diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..d3bd1519a01 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,28 @@ +# Set default behaviour, in case users don't have core.autocrlf set. +# More info: https://help.github.com/articles/dealing-with-line-endings +* text=auto + + +# Explicitly declare text files we want to always be normalized and converted +# to native line endings on checkout. +*.php text eol=lf +*.pl text eol=lf +*.sql text eol=lf +*.htm text eol=lf +*.html text eol=lf +*.js text eol=lf +*.css text eol=lf +*.lang text eol=lf +*.txt text eol=lf +*.md text eol=lf + +# Denote all files that are truly binary and should not be modified. +*.bmp binary +*.ico binary +*.png binary +*.jpg binary +*.odt binary +*.odf binary +*.frm binary +*.MYD binary +*.MYI binary diff --git a/.gitignore b/.gitignore index bc2110ab7ae..b5fd3da5961 100755 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ dolibarr_install.log doxygen_warnings.log /.project .DS_Store +.idea +*.iml +Thumbs.db + diff --git a/.travis.yml b/.travis.yml index c6f3b43c447..26e09482f80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ notifications: email: on_success: never # [always|never|change] default: change - on_failure: always # [always|never|change] default: always + on_failure: change # [always|never|change] default: always services: - memcached # will start memcached @@ -14,8 +14,10 @@ services: # This will tell travis to run phpunit language: php php: +# - "5.2" is not supported because pyrus to install PHP_Codesniffer is not available - "5.3" - "5.4" + - "5.5" env: - DB=mysql @@ -25,8 +27,14 @@ before_script: - echo Start travis - echo Current dir is `pwd` - echo Home dir is `echo ~` - - echo Update composer + - export PHPV=`phpenv version-name` + - echo PHP version $PHPV +# - echo Update composer # - ~/.phpenv/versions/$(phpenv version-name)/bin/composer.phar self-update + - echo Install phpcs then show installed rules + - pyrus install pear/PHP_CodeSniffer + - phpenv rehash + - phpcs -i - echo Create dir $(pwd)/htdocs/documents - sudo mkdir -p $(pwd)/htdocs/documents/admin/temp; - sudo touch $(pwd)/htdocs/documents/dolibarr.log; @@ -36,17 +44,19 @@ before_script: - find $(pwd)/htdocs/documents -type d -exec ls -alt {} \; - echo Edit php.ini file - echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini # - echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "zend_extension_ts = xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - sh -c "if [ '$PHPV' = '5.3' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi" + - sh -c "if [ '$PHPV' = '5.4' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi" + - sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi" + - 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 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" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi" - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi" + - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi" - echo Create config file htdocs/conf/conf.php - echo ' htdocs/conf/conf.php - sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi" @@ -62,7 +72,7 @@ before_script: - echo Show conf.php content - cat htdocs/conf/conf.php - echo Install apache server - - sudo apt-get update > /dev/null + - sudo apt-get update - sudo apt-get install -y --force-yes apache2 libapache2-mod-php5 php5-curl php5-mysql php5-pgsql php5-intl - sudo sed -i -e "s,/var/www,$(pwd)/htdocs,g" /etc/apache2/sites-available/default - echo Show default virtual host @@ -73,13 +83,19 @@ before_script: -# Omitting "script:" will default to phpunit -# use the $DB env variable to determine the phpunit.xml to use -#script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php -#script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php -#script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php script: -# - phpcs -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . + - cd htdocs/install + - date + - php upgrade.php 3.4.0 3.5.0 > upgrade.log + - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log +# - cat upgrade.log +# - cat upgrade2.log + - cd ../.. + - date +# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1 + - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1 + - date +# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php after_script: diff --git a/.tx/config b/.tx/config new file mode 100644 index 00000000000..84e8e9f842f --- /dev/null +++ b/.tx/config @@ -0,0 +1,304 @@ +[main] +host = https://www.transifex.com +lang_map = uz: uz_UZ + +[dolibarr.admin] +file_filter = htdocs/langs//admin.lang +source_file = htdocs/langs/en_US/admin.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.agenda] +file_filter = htdocs/langs//agenda.lang +source_file = htdocs/langs/en_US/agenda.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.banks] +file_filter = htdocs/langs//banks.lang +source_file = htdocs/langs/en_US/banks.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.bills] +file_filter = htdocs/langs//bills.lang +source_file = htdocs/langs/en_US/bills.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.bookmarks] +file_filter = htdocs/langs//bookmarks.lang +source_file = htdocs/langs/en_US/bookmarks.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.boxes] +file_filter = htdocs/langs//boxes.lang +source_file = htdocs/langs/en_US/boxes.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.cashdesk] +file_filter = htdocs/langs//cashdesk.lang +source_file = htdocs/langs/en_US/cashdesk.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.categories] +file_filter = htdocs/langs//categories.lang +source_file = htdocs/langs/en_US/categories.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.commercial] +file_filter = htdocs/langs//commercial.lang +source_file = htdocs/langs/en_US/commercial.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.companies] +file_filter = htdocs/langs//companies.lang +source_file = htdocs/langs/en_US/companies.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.compta] +file_filter = htdocs/langs//compta.lang +source_file = htdocs/langs/en_US/compta.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.contracts] +file_filter = htdocs/langs//contracts.lang +source_file = htdocs/langs/en_US/contracts.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.cron] +file_filter = htdocs/langs//cron.lang +source_file = htdocs/langs/en_US/cron.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.deliveries] +file_filter = htdocs/langs//deliveries.lang +source_file = htdocs/langs/en_US/deliveries.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.dict] +file_filter = htdocs/langs//dict.lang +source_file = htdocs/langs/en_US/dict.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.donations] +file_filter = htdocs/langs//donations.lang +source_file = htdocs/langs/en_US/donations.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.ecm] +file_filter = htdocs/langs//ecm.lang +source_file = htdocs/langs/en_US/ecm.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.errors] +file_filter = htdocs/langs//errors.lang +source_file = htdocs/langs/en_US/errors.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.exports] +file_filter = htdocs/langs//exports.lang +source_file = htdocs/langs/en_US/exports.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.externalsite] +file_filter = htdocs/langs//externalsite.lang +source_file = htdocs/langs/en_US/externalsite.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.ftp] +file_filter = htdocs/langs//ftp.lang +source_file = htdocs/langs/en_US/ftp.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.help] +file_filter = htdocs/langs//help.lang +source_file = htdocs/langs/en_US/help.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.holiday] +file_filter = htdocs/langs//holiday.lang +source_file = htdocs/langs/en_US/holiday.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.install] +file_filter = htdocs/langs//install.lang +source_file = htdocs/langs/en_US/install.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.interventions] +file_filter = htdocs/langs//interventions.lang +source_file = htdocs/langs/en_US/interventions.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.languages] +file_filter = htdocs/langs//languages.lang +source_file = htdocs/langs/en_US/languages.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.ldap] +file_filter = htdocs/langs//ldap.lang +source_file = htdocs/langs/en_US/ldap.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.mailmanspip] +file_filter = htdocs/langs//mailmanspip.lang +source_file = htdocs/langs/en_US/mailmanspip.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.mails] +file_filter = htdocs/langs//mails.lang +source_file = htdocs/langs/en_US/mails.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.main] +file_filter = htdocs/langs//main.lang +source_file = htdocs/langs/en_US/main.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.margins] +file_filter = htdocs/langs//margins.lang +source_file = htdocs/langs/en_US/margins.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.members] +file_filter = htdocs/langs//members.lang +source_file = htdocs/langs/en_US/members.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.opensurvey] +file_filter = htdocs/langs//opensurvey.lang +source_file = htdocs/langs/en_US/opensurvey.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.orders] +file_filter = htdocs/langs//orders.lang +source_file = htdocs/langs/en_US/orders.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.oscommerce] +file_filter = htdocs/langs//oscommerce.lang +source_file = htdocs/langs/en_US/oscommerce.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.other] +file_filter = htdocs/langs//other.lang +source_file = htdocs/langs/en_US/other.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.paybox] +file_filter = htdocs/langs//paybox.lang +source_file = htdocs/langs/en_US/paybox.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.paypal] +file_filter = htdocs/langs//paypal.lang +source_file = htdocs/langs/en_US/paypal.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.products] +file_filter = htdocs/langs//products.lang +source_file = htdocs/langs/en_US/products.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.projects] +file_filter = htdocs/langs//projects.lang +source_file = htdocs/langs/en_US/projects.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.propal] +file_filter = htdocs/langs//propal.lang +source_file = htdocs/langs/en_US/propal.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.sendings] +file_filter = htdocs/langs//sendings.lang +source_file = htdocs/langs/en_US/sendings.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.shop] +file_filter = htdocs/langs//shop.lang +source_file = htdocs/langs/en_US/shop.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.sms] +file_filter = htdocs/langs//sms.lang +source_file = htdocs/langs/en_US/sms.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.stocks] +file_filter = htdocs/langs//stocks.lang +source_file = htdocs/langs/en_US/stocks.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.suppliers] +file_filter = htdocs/langs//suppliers.lang +source_file = htdocs/langs/en_US/suppliers.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.trips] +file_filter = htdocs/langs//trips.lang +source_file = htdocs/langs/en_US/trips.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.users] +file_filter = htdocs/langs//users.lang +source_file = htdocs/langs/en_US/users.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.withdrawals] +file_filter = htdocs/langs//withdrawals.lang +source_file = htdocs/langs/en_US/withdrawals.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.workflow] +file_filter = htdocs/langs//workflow.lang +source_file = htdocs/langs/en_US/workflow.lang +source_lang = en_US +type = MOZILLAPROPERTIES + diff --git a/COPYRIGHT b/COPYRIGHT index a6ae7bf4917..db0cb532478 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -38,7 +38,7 @@ jQuery jqueryFileTree 1.0.1 GPL and MIT Licence Yes JS library for colo jQuery jquerytreeview 1.4.1 MIT Licence Yes JS library for color picker with not defined list of colors jQuery Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15) jQuery Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used) -jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows) +jQuery TableDnD 0.6 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows) jQuery Timepicker 1.1.0 GPL and MIT Licence Yes JS library Timepicker addon for Datepicker jQuery Tiptip 1.3 GPL and MIT Licence Yes JS library for tooltips JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports) diff --git a/ChangeLog b/ChangeLog index 224bb18f864..f716768589a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,329 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.5.5 compared to 3.5.4 ***** +Fix: Holiday module was broken. Initializaion of amount of holidays failed. +Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. +Fix: Fusion PDF button on unpaid invoice is no more displayed +Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click) +Fix: Pb when showing log list of holiday module with some mysql versions. +Fix: Error with bad timezone pushed by some browsers. +Fix: shipping list SQL request was not filtering on shipping element +Fix: debian package provided by dolibarr team must use embedded libraries. +Fix: [ bug #1528 ] Leopard Services numeration module description is not translated. +Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas +Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances +Fix: Update impayees.php +Fix: Fix Link product, In list view and label product + +***** ChangeLog for 3.5.4 compared to 3.5.3 ***** +Fix: Hide title of event when agenda module disabled. +Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender. +Fix: Question about warehouse must not be done when module stock is disabled. +Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented + (missing test at some places). +Fix: Renaming a project with uplaoded files failed. +Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error. +Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin. +Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order. +Fix: The object deliverycompany was not used anymore and output of + details for delivery reports was lost during 3.5. Rewrite code to + restore feature. +Fix: [ bug #1445 ] html fix : missing +Fix: [ bug #1415 ] Intervention document model name and suppliers model names is not shown + properly in module configuration +Fix: [ bug #1416 ] Supplier order does not list document models in the select box of the + supplier order card +Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or + limit date for payment +Fix: Filter on status was not visible when selected from url. +Fix: Filtering on status was last when asking to sort. +Fix: [ bug #1432 ] Trigger SHIPPING_CREATE ignores interception on error. +Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and LINEORDER_INSERT ignore interception on error. +Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler. +Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order. +Fix: [ bug #1454 ] Mention de bas de page erroné +Fix: Do not display dictionnay for non activated module +Fix: Link element from element project pages +Fix: [ bug #1509 ] Expedition admin free text & watermark submit error +Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card +Fix: [ bug #1452 ] variable used but not defined +Fix: If multiprice level is used the VAT on addline is not correct +Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product (on supplier order part) +Fix: [ bug #1462, 1468, 1480, 1483, 1490, 1497] $this instead of $object +Fix: [ bug #1455 ] outstanding amount +Fix: [ bug #1425 ] LINEBILL_SUPPLIER_DELETE failure trigger leads to an endless loop +Fix: [ bug #1460 ] Several supplier order triggers do not show error messages +Fix: [ bug #1461 ] LINEORDER_SUPPLIER_CREATE does not intercept supplier order line insertion +Fix: [ bug #1484 ] BILL_SUPPLIER_PAYED trigger action does not intercept failure under some circumstances +Fix: [ bug #1482 ] Several supplier invoice triggers do not show trigger error messages +Fix: [ bug #1486 ] LINEBILL_SUPPLIER_CREATE and LINEBILL_SUPPLIER_UPDATE triggers do not intercept trigger action +Fix: [ bug #1522 ] Element list into associate object into project are no more filterd by project thirdparty +Fix: [ bug #1526 ] Thumbs of files uploaded with dots in their names do not load correctly +Fix: Import ProfId1 to siren and ProfId2 to siret + +***** ChangeLog for 3.5.3 compared to 3.5.2 ***** +Fix: Error on field accountancy code for export profile of invoices. +Fix: [ bug #1351 ] VIES verification link broken. +Fix: [ bug #1352 ] Removing a shipping does not remove the delivery. +Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template. +Fix: Can disable features with PHPEXCEL (no DLSF compatible). +Fix: Can disable features with CKEDITOR. +Fix: Pb of records not correctly cleaned when module marge is + uninstalled (conflict between 'margin' and 'margins'). +Fix: [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing. +Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents. +Fix: Suppliers invoice mask fails using {tttt} in numbering. +Fix: [ bug #1350 ] pdf template name for typhon was not correctly set when enabling module. +Fix: Navigation on notes for shipments was not working. +Fix: [ bug #1353 ] Email notifications, wrong URL. +Fix: [ bug #1362 ] Note is not saved. +Fix: tr/td balance. +Fix: [ bug #1360 ] note indicator for member tab. +Fix: Nb of notes and doc not visible onto tasks. +Fix: [ bug #1372 ] Margin calculation does not work in proposals. +Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. +Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error. +Fix: TCPDF error file not found in member card generation. +Fix: [ bug #1380 ] Customer invoices are not grouped in company results report. +Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice. +Fix: [ bug #1399 ] [pgsql] Silent warning when setting a propal as "facturée" in propal.php +Fix: When number reach 9999 with default numbering module, next number + will be 10000 instead of 0000 and error. +Fix: element page on project give wrong href link. +Fix: [ bug #1397 ] Filter by supplier orders with status Draft does not filter. +Fix: [ bug #1388 ] Wrong date when invoicing several orders. +Fix: [ bug #1411 ] Unable to set an expedition note if invoices module is not enabled. +Fix: [ bug #1407 ] Rouget pdf overlapped when using tracking number and public notes. +Fix: [ bug #1405 ] Rouget PDF expedition incorrect when two expeditions under the same commande +Fix: [ bug #1434 ] Muscadet supplier order document model linked objects overlap the text + +***** ChangeLog for 3.5.2 compared to 3.5.1 ***** +Fix: Can't add user for a task. +Fix: Autoselect of warehouse if there is only one warehouse. +Fix: Install of odt template for project and tasks. +Fix: [ bug #1318 ] Problem with enter key when adding an existing + product to a customer invoice. +Fix: [ bug #1307 ] Quotes get removed from several inputs. +Fix: [ bug #1317 ] Removing a category does not remove all child categories +Fix: [ bug #1312 ] Call to undefined function _() +Fix: Restore build for obs and launchpad. +Fix: deleting files into backup system tools. +Fix: Dump using php not not include lock on tables that are deleted. +Fix: Fixed a problem with bank accounts sharing across entities. +Fix: fields into group by of sql requests for module margins must be + same than fields into select. +Fix: When select_date is called with '' as preselected date, + automatic user date was not correctly et (We must set a date into PHP + server timezone area) +Fix: First param of select_date must always be forged with a dolibarr + date function and not time(). +Fix: fix can't add line with product in supplier order +Fix: [bug #1309] +Fix: Solve pb of too many embedded tables +Fix: [ bug #1306 ] Fatal error when adding an external calendar +Fix: A fix to manage automatic creation of code for import. +Fix: Try to add code to provide easy way to fix warning on timezone not + defined. +Fix: Several fix into workflow/condition for invoice payments or convert + into discount. +Fix: Option MAIN_PDF_DASH_BETWEEN_LINES was not working when tcpdf was + making a pagebreak higher than 2 pages. +Fix: form to add images should not show link form. +Fix: Correction when adding order line with price as '0'. +Fix: [ bug #1283 ] ROUGET Shipment PDF. +Fix: [ bug #1300 ] +Fix: Miscellaneous problems on task tabs (withproject parameter lost and + download fails). +Fix: Avoid home project page to hung when too many tasks opened. +Fix: bug #1295: Error when creating an agenda extrafield with a number as reference +Fix: Translation of number for pt_PT. +Fix: Error on ajax_constantonoff function. +Fix: [ bug #1323 ] problème pour générer un odt depuis les taches dans projet. +Fix: Can not make withdrawals + +***** ChangeLog for 3.5.1 compared to 3.5.0 ***** +Fix: Do not report trigger errors twice. +Fix: Error when creating event was not reported. +Fix: Bug of import of agenda when using https link +Fix: Field nature not saved correctly +Fix: Substitution of extra field was ko for order +Fix: Bad translation of date format for pt_BR. +Fix: priority field of agenda record is smallint. +Fix: Missing loading of lang in some pages. +Fix: Write note in invoice when using pos module. +Fix: Link to paypal was invalid into email text. +Fix: ref and date of supplier invoice. +Fix: Check on bank account. +Fix: Problem with file upload and download. +Fix: Page load not ending when large number of thirdparies. We + added option MAIN_DISABLE_AJAX_COMBOX to disable javascript + combo feature that is root cause of problem. +Fix: [ bug #1231 ] PDF always generated in interventions +Fix: Be sure there is no duplicate default rib. +Fix: Enable extrafields for customer order, proposal and invoice lines. This feature + was developed for 3.5 but was disabled (hidden) because of a bug not possible to + fix enough quickly for 3.5.0 release. +Fix: user right on Holiday for month report nor working. +Fix: [ bug #1250 ] "Supplier Ref. product" sidebar search box does not work +Fix: Bad space in predefined messages. +Fix: [ bug #1256 ] Signature was not added for email sent from thirdparty page. +Fix: Action event SHIPPING_VALIDATE is not implemented +Fix: The customer code was set to uppercase when using numbering module leopard. We + must keep data safe of any change. +Fix: [ bug #1291 ] Loading actions extrafields fails. +Fix: [ bug #1123 ] Paid deposit invoices are always shown as partially paid when fully paid +Fix: Corrected project contact types translation. +Fix: [ bug #1206 ] PMP price is bad calculated. +Fix: [ bug #520 ] Product statistics and detailed lists are wrong. +Fix: [ bug #1240 ] traduction. +Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation. +Fix: [ bug #1280 ] service with not end of date was tagged as expired. +Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference. +Fix: [ bug #1306 ] Fatal error when adding an external calendar. +New: Added es_CL language +Fix: Margin tabs bad data show +Fix: [ bug #1318 ] Problem with enter key when adding an existing product to a customer invoice. +Fix: [ bug #1410 ] Add customer order line asks for required Unit Price but doesn't interrupt the creation of the line + +***** ChangeLog for 3.5 compared to 3.4.* ***** +For users: +- New: Add hidden option BANK_DISABLE_DIRECT_INPUT. +- New: More options to select status of users into select user list. +- New: [ task #862 ] Add ODT on shipments. +- New: [ task #149 ] Add # of notes and attachments in tabs. +- New: Can edit customer ref at any time. +- New: [ task #877 ] Reorganize menus. +- New: [ task #858 ] Holiday module: note on manual holiday assignation. +- New: [ task #892 ] Add hidden option in thirdparty customer/supplier module to hide non active + companies in select_company method. +- New: [ task #531 ] Add a workload field on tasks. +- New: Add graph of bank account input/output into input-output report page. +- New: Add script export-bank-receipts.php +- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge PDF that + has one payment on a specific bank account.* +- New: [ task #901 ] Add Extrafield on Fiche Inter. +- New: Show process id in all command line scripts. +- New: Module mailman can subscribe/unsubscribe to ML according to categories or type of member. +- New: Add object_hour and object_date_rfc as substitution tag for open document generation. +- New: Add options to send an email when paypal or paybox payment is done. +- New: Clone product/service composition. +- New: Add option ADHERENT_LOGIN_NOT_REQUIRED. +- New: Add a cron module to define scheduled jobs. +- New: Add new graphical boxes (customer and supplier invoices and orders per month). +- New: [ task #286 ] Enhance rounding function of prices to allow round of sum instead of sum of rounding. +- New: Can add an event automatically when a project is create. +- New: Add option MAIN_GENERATE_DOCUMENT_WITH_PICTURE. +- New: Add option excludethirdparties and onlythirdparties into merge pdf scripts. +- New: [ task #925 ] Add ODT document generation for Tasks in project module. +- New: [ task #924 ] Add numbering rule on task. +- New: [ task #165 ] Add import/export of multiprices. +- New: Add Maghreb regions and departments. +- New: A more responsive design for statistic box of home page. +- New: [ task #1005 ] Adapting to Spanish legislation bill numbering +- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode. +- New: [ task #1014 ] Add option to recursively add parent category. +- New: [ task #1016 ] Can define a specific numbering for deposits. +- New: [ task #918 ] Stock replenishment. +- New : Add pdf link into supplier invoice list and supplier order list. +- New : Genrate auto the PDF for supplier invoice. +- New : Add category into filter webservice thirdparty method getListOfThirdParties. +- New : Allow to define margin or mark rate during quoting, ordering, invoicing. +- New : User permissions on margin module. +- New : Add ref supplier into muscadet model/ +- New : Add ability to copy contact address to clipboard. +- New: Can use tag {mm} before {yy} even when there is a reset into numbering masks. +- New: [ task #1060 ] Register fields localtax(1|2)_type into details tables. +- New: [ task #923 ] Localtax support for ODT templates. +- New: [ task #90 ] Barcode search. +- New: Add hidden option MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS. +- New: Can send an email from thirdparty card. +- New: Can cancel holidays that were previously validated. +- New: Can choose contact on event (action com) creation, and filtered by thirdparty. +- New: Add hidden option MAIN_FORCE_DEFAULT_STATE_ID. +- New: Add page to make mass stock movement. +- New: Add field oustanding limit into thirdparty properties. +- New: Can enter a vat payment of zero. +- New: Add path to installed dir of external modules + Name and web of module provider. +- New: Add option to use a specific mask for uploaded filename. +- New: Can attach external links to objects as we can attach files. +- Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). +- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count. +- Fix: [ bug #1022 ] correct margin calculation for credit notes. +- Fix: Better management of using ajax for upload form (to solve problem when enabling ajax jquery multifile upload in some cases). +- Fix: Lost stats filters into year selection. +- Fix: Some config data are shared between suppliers orders and suppliers invoices + +New experimental module: +- New: [ task #157 ] Add a Skype button (adherents / third parties / contacts) + +For translators: +- Qual: Normalized sort order of all languages files with English reference files. +- New: Add language code files for South Africa, France new Caledonia, Vietnam. +- New: Translate string for email to change password. + +For developers: +- New: DolGraph can build graph with three lines. +- New: DolGraph accept a parameter to cache data of graph getNbByMonthWithPrevYear. +- New: Can enable tuning info with option MAIN_SHOW_TUNING_INFO. +- New: Show version of client lib used by mysql drivers. +- New: Add function to get content of an url (using all dolibarr setup like timeout, proxies...) +- New: Upgrade lib of TCPDF to 6.0 +- New: Upgrade jquery flot library to 0.8.1 +- New: Add property "hidden" into module descriptors to allow to hide a module according to + some dynamic conditions. +- New: Add option MAIN_MOTD_SETUPPAGE to add a content onto setup page. Also content for + MAIN_MOTD_SETUPPAGE, MAIN_MOTD_SETUPPAGE, MAIN_HOME now accept "|langfile" into translation + key to use a specific language file. +- New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables. +- Qual: All nowrap properties are now using CSS class nowrap. +- Qual: Move hard coded code of module mailmanspip into trigger. +- New: Into POST forms, if you can add a parameter DOL_AUTOSET_COOKIE with a value that is list name, + separated by a coma, of other POST parameters, Dolibarr will automatically save this parameters + into user cookies. +- New: Add hook addHomeSetup. +- New: Add trigger CATEGORY_LINK and CATEGORY_UNLINK. +- New: A trigger can return an array of error strings instead of one error string. +- New: Add method to use a dictionary as a combo box. +- New: Add update method for web service product. +- Fix also several bugs with old code. + +WARNING: Following change may create regression for some external modules, but was necessary to make +Dolibarr better: + +1) We started to clean hooks code. +If your hook want to modify value of $actions, it's role of your hook to modify it. Dolibarr +hook code will no more decide this for your module. If your action class for hook was returning +a string or an array, instead your module must set $actionclassinstance->results (to return array) +or $actionclassinstance->resprints (to return string) to return same thing. The return value must +be replaced by a "return 0"; +Goal is to fix old compatibility code that does not match hook specifications: + http://wiki.dolibarr.org/index.php/Hooks_system + +2) If you implemented hook printTopRightMenu, check that output does not include '' tags any more. +All content added must be tagged by a '
' with css class="login_block_elem" + +3) Some methods object->addline used a first parameter that was object->id, some not. Of course +this was not a good practice, since object->id is already known, there is no need to provide id as +parameter. All methods addline in this case were modified to remove this parameter. + +4) Method ->classer_facturee() is deprecated. It must be replace with ->classifyBilled(). + +5) Property ->tel on objects is now ->phone + +6) Trigger LINEPROPAL_MODIFY is renamed into LINEPROPAL_UPDATE and + Trigger CONTRACT_LINE_DELETE rnamed into LINECONTRACT_DELETE to match naming rules. + + + +***** ChangeLog for 3.4.3 compared to 3.4.2 ***** +Fix: Bad get of localtaxes into contracts add lines + +***** ChangeLog for 3.4.3 compared to 3.4.2 ***** +Fix: Warning into bank conciliation feature. +Fix: Bad get of localtaxes into contracts add lines. +Fix: Add a limit into list to avoid browser to hang when database is too large. +Fix: [ bug #1212 ] 'jqueryFileTree.php' directory traversal vulnerability ***** ChangeLog for 3.4.3 compared to 3.4.2 ***** Fix: Warning into bank conciliation feature. diff --git a/README-FR b/README-FR index 8b3900ff78c..c89314be22a 100644 --- a/README-FR +++ b/README-FR @@ -123,6 +123,6 @@ Voici un liste de fonctionnalites pas encore gérées par Dolibarr: - Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise). - Dolibarr ne gère en standard qu'une société/institution/association mère (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MultiCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données. - Dolibarr ne contient pas de module de Gestion de la paie. -- Les taches du module de gestion de projets n'ont pas de dépendance entre elle. +- Les tâches du module de gestion de projets n'ont pas de dépendance entre elle. - Dolibarr ne contient pas de Webmail. - Dolibarr ne fait pas le café (pas encore). diff --git a/README.md b/README.md index 6a94371e8dd..574e74da85c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ 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. +![ScreenShot](http://www.dolibarr.org/images/dolibarr_screenshot1_640x480.png) ## LICENSE @@ -12,7 +13,7 @@ Dolibarr is released under the terms of the GNU General Public License as publis ## INSTALL -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, Opensue, Mandriva or Mageia). +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). You can download this at: [Official website] (http://www.dolibarr.org/downloads/) @@ -75,60 +76,63 @@ See ChangeLog file found into package. ### Main modules/features: -- Customers, Prospects or Suppliers directory -- Products and services catalog -- Stock management -- Bank accounts management -- Orders management with PDF export -- Commercial proposals management -- Contracts management -- Invoices management -- Payments management -- Standing orders management -- Shipping management -- 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 +- 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. +- 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. ### Other modules: -- Bookmarks management -- Donations management -- Reporting -- Data export/import tools -- LDAP connectivity -- Third parties or products categories -- ClickToDial phone numbers -- RSS integration +- 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. ### Miscellaneous: - Multi-user, with several permissions levels for each feature. -- Serveral 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 menu and permissions). - Very user friendly and easy to use. -- Optional WYSIWYG forms, optional Ajax forms. -- Several skins. -- Code is highly customizable (a lot of use of modules and submodules). -- Works with Mysql 4.1 or higher, or PostgreSql 8.14 or higher. -- Works with PHP 5.0 or higher. -- An easy to understand and maintain code (PHP with no heavy frameworks). -- A trigger architecture to allow you to make Dolibarr business events run PHP code to update your own information system. -- "NPR VAT Rate" (French particularity for managing VAT in DOM-TOM called "Non Perçue Récupérable"). - +- 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.2.1, MySql 4.1 or PostgreSQL 8.1. +- 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) + ... ## WHAT DOLIBARR CAN'T DO YET (TODO LIST) This is features that Dolibarr does not support completely yet: -- No double party accountancy (only bank management). +- No double party accountancy (only bank and treasury management). - Dolibarr manage one currency at once (mono-currency). -- Dolibarr manage one master company/foundation (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). -- Dolibarr does not contains Payroll module. +- 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). diff --git a/build.xml b/build.xml index be47aadb527..fc267bf196e 100644 --- a/build.xml +++ b/build.xml @@ -3,7 +3,7 @@ - + @@ -46,7 +46,7 @@ --exclude '${basedir}/htdocs/conf' --exclude '${basedir}/htdocs/core/filemanagerdol' --exclude '${basedir}/htdocs/includes' - --exclude '**/PEAR/*,**/NET/*,**/HTTP/*' + --exclude '**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*' --min-tokens 70 --min-lines 20 htdocs @@ -61,7 +61,7 @@ --exclude '${basedir}/htdocs/conf' --exclude '${basedir}/htdocs/core/filemanagerdol' --exclude '${basedir}/htdocs/includes' - --exclude '**/PEAR/*,**/NET/*,**/HTTP/*' + --exclude '**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*' htdocs " /> @@ -78,18 +78,11 @@ "/> - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js b/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js index 8c2b158abbc..d6386c93792 100644 --- a/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js +++ b/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js @@ -1,64 +1,64 @@ -function last(href) -{ - var ret = href.split("/"); - return ret[ret.length-1]; -} - -function StopProcess() -{ -LeftFrame = parent.TOC.document.location.href; -LeftFrame = last(LeftFrame); -if (LeftFrame == "dhtml_search.htm") return 1 -else return 0; -} - - - -function highlightTOC(str) { - - - - - - if (StopProcess()) return; - try { - - str = str || parent.BODY.document.location.href; - uri = last(str); - list = parent.TOC.document.getElementsByTagName("a"); - for(i=0; i]*(?:>|$)/], - [PR_COMMENT, /^<\!--[\s\S]*?(?:-\->|$)/], + [PR_COMMENT, /^<\!--[\s\S]*?(?:-\->|$)/], // Unescaped content in an unknown language ['lang-', /^<\?([\s\S]+?)(?:\?>|$)/], ['lang-', /^<%([\s\S]+?)(?:%>|$)/], diff --git a/build/debian/README.howto b/build/debian/README.howto index 797e653bc27..b34d296d2e4 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -7,21 +7,62 @@ This directory contains files used by makepack-dolibarr.pl script to build a package, ready to be distributed, with format .DEB (for Debian, Ubuntu, ...). + + +##### Prepare linux env to work + # To build a debian package, you need first -# apt-get -i debhelper dpkg-source gpg lintian +# With Ubuntu 12.04 +# apt-get install debhelper dpkg-source gpg lintian git-buildpackage pkg-php-tools schroot sbuild dh-linktree dh-make-php +# With Debian 7 +# apt-get install debhelper dpkg gnupg lintian git-buildpackage pkg-php-tools schroot sbuild dh-linktree dh-make-php -# This is standard command to work on Debian packaging: -# -# gpg --gen-key Generate a GPG key (-> pubring.gpg + secring.gpg) -# +# To generate gpg key for email used into changelog +* Check your existing keys/emails +> gpg --list-key +* Generate a new one, if none exists for email you use as author +> gpg --gen-key Generate a GPG key (-> pubring.gpg + secring.gpg) +Files are saved int .gnupg directory +* Create a file ~/.gpb.conf by +> cat >~/.gbp.conf < reportbug -B debian --email username@domain.tld wnpp @@ -55,3 +99,155 @@ See page http://www.debian.org/devel/wnpp/#l1 for example of ITP requests conten - Once package is uploaded, following URL are available: http://packages.qa.debian.org/package.html http://bugs.debian.org/package + + + +##### Testing a package into unstable env + +Check you have a mysql server available from another interface than localhost +Uncomment line if required and restart mysql +bind-address = 127.0.0.1 + +Create a chroot called "unstable-amd64-sbuild" +> sudo sbuild-createchroot --keyring= unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian + +Pour lister les env chroot +> schroot -l + +Puis pour se connecter et préparer l'environnement +> schroot -c name_of_chroot +> vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok) +> apt-get install links mysql-client + +Pour tester un package +> cp *.deb /srv/chroot/unstable/tmp +> sudo schroot -c name_of_chroot +> dpkg -i dolibarr*.deb +> apt-get install -f + + + + + +##### Create/Maintain TCPDF package + +To update tcpdf package: + +* You can git clone tcpdf +> git clone git.debian.org:/git/collab-maint/tcpdf.git [tcpdf-debian] +or better +> mkdir gitdebian +> cd gitdebian +> gbp-clone git.debian.org:/git/collab-maint/tcpdf.git + +* You can then create a PHP project from Eclipse called tcpdf-debian +from git clone dir and make link to git. + +* If local branch upstream and pristine-tar does not exists, create it +from origin/upstream and origin/pristine. + +* Into root dir, launch: +> debian/get-orig-source.sh + +* Staying into git root directory, run +> git-import-orig -vv ../tcpdf_x.y.z+dfsg.orig.tar.xz + +Note: If there was errors solved manually, you may need to make a git commit + +* Add an entry into debian/changelog +> dch -v x.y.z-1 "My comment" will add entry. +For example: dch -v x.y.z-1 "New upstream release." for a new version + +Warning: Date must have format reported by "date -R" +Warning: Name and email must match value into debian/control file (Entry added here is used by next step). + +* We 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 +Note: Package is built into directory ../build-area + +* If package .deb is ok: +Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit +> git-buildpackage --git-tag-only --git-retag +> git push --all ou git push origin --all +> git push --tags + +* Compilation is then done by a debian developer and sent +> sbuild ... +> dput ... + +* Go into page. You should see new package into unstable. +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 728235 +pending + + + +##### Create/Maintain dolibarr package + +To update dolibarr debian package + +* You can git clone debian git repo +> git clone git.debian.org:/git/collab-maint/dolibarr.git [dolibarr-debian] +or better +> cd ~; mkdir git-debian; cd git-debian +> gbp-clone git.debian.org:/git/collab-maint/dolibarr.git + +* You can then create a PHP project from Eclipse called dolibarr-debian +from git clone dir and make link to git. + +* If local branch upstream and pristine-tar does not exists, create it +from origin/upstream and origin/pristine. + +* If new upstream is available onto sourceforge, launch: +> debian/get-orig-source.sh + +* Staying into git root directory, run +> git-import-orig -vv ../dolibarr-3.3.4.tgz + +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-1 "My comment" will add entry. +For example: dch -v x.y.z-1 "New upstream release." for a new version +Then modify changelog to replace "unstable" with "UNRELEASED". + +Warning: Date must have format reported by "date -R" +Warning: Name and email must match value into debian/control file (Entry added here is used by next step). + +* We 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 +Note: Package is built into directory ../build-area + +* Test package (see dedicated chapter to test it with debian unstable env) + +* If package .deb is ok: +Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit +> git-buildpackage --git-tag-only --git-retag +> git push --all ou git push origin --all +> git push --tags + +* Compilation is then done by a debian developer and sent +> sbuild ... +> dput ... + +* Package arrives into FTPmaster taskboard with status NEW (pending upload). You can view it at: +http://ftp-master.debian.org/new/ + +* Once package is validated, you should see it into area unstable at: +http://packages.qa.debian.org + +* Package will be into release when test will be moved as stable. + + diff --git a/build/debian/apache.conf b/build/debian/apache.conf deleted file mode 100644 index 560a1c5193c..00000000000 --- a/build/debian/apache.conf +++ /dev/null @@ -1,75 +0,0 @@ -# Apache config file for Dolibarr - - -Alias /dolibarr /usr/share/dolibarr/htdocs - - -# You can also use dolibarr as a VirtualHost -# -# ServerName mydolibarrhostname.com -# ServerAdmin root@example.com -# DocumentRoot /usr/share/dolibarr/ -# ErrorLog logs/ldap.example.com-error.log -# CustomLog logs/ldap.example.com-access.log common -# - -# Directory for web pages - - Order deny,allow - Allow from all - DirectoryIndex index.php - Options +FollowSymLinks +Indexes - - ErrorDocument 401 /public/error-401.php - ErrorDocument 404 /public/error-404.php - - - php_flag magic_quotes_gpc Off - php_flag register_globals Off - - - - php_flag magic_quotes_gpc Off - php_flag register_globals Off - - - - # OPTIMIZE: To use cache on static pages (A259200 = 1 month). - # Note that you must also enable the module mod_expires. - #ExpiresActive On - #ExpiresByType image/x-icon A2592000 - #ExpiresByType image/gif A2592000 - #ExpiresByType image/png A2592000 - #ExpiresByType image/jpeg A2592000 - #ExpiresByType text/css A2592000 - #ExpiresByType text/javascript A2592000 - #ExpiresByType application/x-javascript A2592000 - #ExpiresByType application/javascript A2592000 - - - -# Directory for public pages - - AllowOverride All - Order deny,allow - Allow from all - - -# Config files - - AllowOverride All - Order deny,allow - Allow from all - - -# Directory for data files - - AllowOverride All - Order deny,allow - Allow from all - - - AllowOverride All - Order deny,allow - Allow from all - diff --git a/build/debian/apache/.htaccess b/build/debian/apache/.htaccess new file mode 100644 index 00000000000..8ab3fb95cd1 --- /dev/null +++ b/build/debian/apache/.htaccess @@ -0,0 +1,7 @@ += 2.3> +Require all denied + + +Order deny,allow +Deny from all + diff --git a/build/debian/apache/dolibarr.conf b/build/debian/apache/dolibarr.conf new file mode 100644 index 00000000000..ae1d7b46d8e --- /dev/null +++ b/build/debian/apache/dolibarr.conf @@ -0,0 +1,42 @@ +# Apache config file for Dolibarr + +Alias /dolibarr /usr/share/dolibarr/htdocs + + +# You can also use dolibarr as a VirtualHost +# +# ServerName mydolibarrhostname.com +# ServerAdmin root@example.com +# DocumentRoot /usr/share/dolibarr/ +# ErrorLog logs/ldap.example.com-error.log +# CustomLog logs/ldap.example.com-access.log common +# + +# Directory for web pages + + Order deny,allow + Allow from all + + DirectoryIndex index.php + Options +FollowSymLinks +Indexes + + ErrorDocument 401 /dolibarr/public/error-401.php + ErrorDocument 404 /dolibarr/public/error-404.php + + + php_flag magic_quotes_gpc Off + php_flag register_globals Off + + + # OPTIMIZE: To use cache on static pages (A259200 = 1 month). + # Note that you must also enable the module mod_expires. + #ExpiresActive On + #ExpiresByType image/x-icon A2592000 + #ExpiresByType image/gif A2592000 + #ExpiresByType image/png A2592000 + #ExpiresByType image/jpeg A2592000 + #ExpiresByType text/css A2592000 + #ExpiresByType text/javascript A2592000 + #ExpiresByType application/x-javascript A2592000 + #ExpiresByType application/javascript A2592000 + diff --git a/build/debian/changelog b/build/debian/changelog index f3bf1b1d126..aeba0dfa190 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,20 +1,62 @@ -dolibarr (3.4.2) unstable; urgency=low +dolibarr (3.5.5-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Tue, 8 July 2014 12:00:00 +0100 + +dolibarr (3.5.4-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Tue, 1 July 2014 12:00:00 +0100 + +dolibarr (3.5.3-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Fri, 2 May 2014 12:00:00 +0100 + +dolibarr (3.5.2-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Fri, 14 March 2014 12:00:00 +0100 + +dolibarr (3.5.1-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Fri, 7 Feb 2014 12:00:00 +0100 + +dolibarr (3.5.0-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Fri, 31 Jan 2014 12:00:00 +0100 + +dolibarr (3.4.2-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] * Maintenance release. -- Laurent Destailleur (eldy) Mon, 30 Dec 2013 12:00:00 +0100 -dolibarr (3.4.1) unstable; urgency=low +dolibarr (3.4.1-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] * Maintenance release. - -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Mon, 27 Apr 2013 12:00:00 +0100 -dolibarr (3.4.0) unstable; urgency=low +dolibarr (3.4.0-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] - * New upstream release. + * Maintenance release. - -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 \ No newline at end of file diff --git a/build/debian/control b/build/debian/control index ac65f0b9070..f573f64b812 100755 --- a/build/debian/control +++ b/build/debian/control @@ -1,40 +1,47 @@ Source: dolibarr -Maintainer: Laurent Destailleur (eldy) -Uploaders: Laurent Destailleur (eldy) -Standards-Version: 3.9.2 Section: web Priority: optional +Maintainer: Laurent Destailleur (eldy) +# Uploaders: Laurent Destailleur (eldy) # Only if differs from Maintainer +Standards-Version: 3.9.4 Homepage: http://www.dolibarr.org -Build-Depends: debhelper (>= 7), po-debconf, dpatch -Comments: This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version +Build-Depends: debhelper (>= 9), po-debconf +# This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version Package: dolibarr +Architecture: all Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, - php5-mysql | php5-mysqli, - php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, php5-geoip, - libphp-adodb, - libnusoap-php, - libphp-pclzip, - libfpdi-php, libfpdf-tpl-php, php-fpdf, - libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor, - ttf-dejavu-core, + php5-cli, +# Required PHP extensions + php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap, php5-geoip, +# Required PHP libraries + php-pear, php-mail-mime, +# php-tcpdf, libfpdi-php, libfpdf-tpl-php, php-fpdf, +# libphp-adodb, +# libnusoap-php, +# libphp-pclzip, +# Required javascript libraries +# libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor, +# Misc dependencies +# fonts-dejavu-core | ttf-dejavu-core, xdg-utils, mysql-server, ${misc:Depends}, ${perl:Depends} -Recommends: apache2 | lighttpd | httpd, mysql-client +Recommends: mysql-client, apache2 | lighttpd | httpd Suggests: www-browser -Architecture: all -Description: Web based software to manage a small company or foundation +Description: Web based software to manage a company or foundation Dolibarr ERP & CRM is an easy to use open source/free software for small and medium companies, foundations or freelances. It includes different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. + . It's a web software you can install as a standalone program or on any web hosting provider to use it from anywhere with any web browser. . - Dolibarr was designed to be easy to use. Only features you need are - visible, depending on which module were activated. + Dolibarr was designed to be easy to use. Only the features that you need are + visible, depending on which modules were activated. + . Most common used modules are: . Customers, Suppliers or Prospects directory, diff --git a/build/debian/dolibarr.install b/build/debian/dolibarr.install index fcbf0cdb43a..72dff46ed15 100755 --- a/build/debian/dolibarr.install +++ b/build/debian/dolibarr.install @@ -1,12 +1,13 @@ -debian/dolibarr.desktop usr/share/applications -debian/dolibarr.xpm usr/share/pixmaps -README usr/share/doc/dolibarr -doc/install usr/share/doc/dolibarr -doc/user usr/share/doc/dolibarr -doc/index.html usr/share/doc/dolibarr -build/debian/apache.conf etc/dolibarr -build/debian/lighttpd.conf etc/dolibarr -build usr/share/dolibarr -dev usr/share/dolibarr -htdocs usr/share/dolibarr -scripts usr/share/dolibarr +debian/dolibarr.desktop usr/share/applications/ +debian/dolibarr.xpm usr/share/pixmaps/ +debian/apache/.htaccess var/lib/dolibarr/documents/ +debian/apache/dolibarr.conf etc/apache2/conf-available/ +debian/lighttpd/50-dolibarr.conf etc/lighttpd/conf-available/ +debian/install.forced.php.install etc/dolibarr/ +htdocs usr/share/dolibarr/ +scripts usr/share/dolibarr/ +changelog usr/share/doc/dolibarr/ +README usr/share/doc/dolibarr/ +doc/install usr/share/doc/dolibarr/ +doc/user usr/share/doc/dolibarr/ +doc/index.html usr/share/doc/dolibarr/ \ No newline at end of file diff --git a/build/debian/dolibarr.lintian-overrides b/build/debian/dolibarr.lintian-overrides index 019115d037a..7578a575776 100755 --- a/build/debian/dolibarr.lintian-overrides +++ b/build/debian/dolibarr.lintian-overrides @@ -1 +1,7 @@ -# No overrided lintian rules is this version. +# We want a www-data group-writable /var/lib/dolibarr/documents/ +dolibarr: non-standard-dir-perm var/lib/dolibarr/documents/ 2775 != 0755 +# We depend on xdg-utils providing xdg-open and we use that to open an URL +dolibarr: desktop-command-not-in-package usr/share/applications/dolibarr.desktop xdg-open +# We use to include the correct configuration for each apache version +dolibarr: apache2-deprecated-auth-config Order +dolibarr: apache2-deprecated-auth-config Allow \ No newline at end of file diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 92112e29e50..0f99f53203b 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -13,27 +13,52 @@ set -e # # for details, see /usr/share/doc/packaging-manual/ +if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + # Needs to be run outside of functions to have access to parameters + . /usr/share/apache2/apache2-maintscript-helper +fi +setup_empty_conf() { + echo Create empty file $config + mkdir -p /etc/dolibarr + touch /etc/dolibarr/conf.php + chown root:www-data /etc/dolibarr/conf.php + chmod 664 /etc/dolibarr/conf.php +} +is_new_upstream_version() { + # $1 can be empty (not installed) and will result in a true value + # for the check + old_version=$(echo "$1" | sed -e 's/-[^-]*$//' -e 's/^[0-9]*://') + new_version=$(dpkg-query -f '${Version}' -W dolibarr | \ + sed -e 's/-[^-]*$//' -e 's/^[0-9]*://') + test "$old_version" != "$new_version" +} -lighttpd_install() { - if [ ! -f /etc/lighttpd/conf-available/50-dolibarr.conf ] ; then - if which lighty-enable-mod >/dev/null 2>&1 ; then - echo "Add link for Lighttpd config file" - ln -fs /etc/dolibarr/lighttpd.conf /etc/lighttpd/conf-available/50-dolibarr.conf - # We enabled it - lighty-enable-mod dolibarr fastcgi-php - else - echo "Lighttpd not installed, skipping" - fi - fi +enable_install_upgrade_wizard() { + echo Enable install wizard by removing install.lock file if present + rm -f /var/lib/dolibarr/documents/install.lock } apache_install() { webserver=$1 - if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then - echo "Add link for Apache config file" - ln -fs /etc/dolibarr/apache.conf /etc/$webserver/conf.d/dolibarr.conf + if which a2enconf >/dev/null 2>&1 ;then + # a2enconf exists for ubuntu only + a2enconf dolibarr + else + if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then + echo "Add link for Apache config file" + ln -s /etc/$webserver/conf-available/dolibarr.conf /etc/$webserver/conf.d/dolibarr.conf + fi + fi +} + +lighttpd_install() { + if which lighty-enable-mod >/dev/null 2>&1 ; then + echo "Enable lighttpd link for dolibarr config file" + lighty-enable-mod dolibarr fastcgi-php + else + echo "Lighttpd not installed, skipping" fi } @@ -49,24 +74,40 @@ echo Run the dolibarr postinst script # Define vars docdir='/var/lib/dolibarr/documents' -installfileorig="/usr/share/dolibarr/build/debian/install.forced.php.install" +installfileorig="/etc/dolibarr/install.forced.php.install" installconfig="/etc/dolibarr/install.forced.php" config="/etc/dolibarr/conf.php" case "$1" in configure) - - # Remove lock file - rm -f $docdir/install.lock + if [ -z "$2" ]; then + echo First install + #setup_empty_conf + else + echo This is not a first install + fi + # Apache 2 setup + if which a2enmod >/dev/null 2>&1 ;then + a2enmod alias + fi + + apache_install + lighttpd_install + + # Remove lock file + if is_new_upstream_version "$2"; then + enable_install_upgrade_wizard + fi + # Create document directory for uploaded data files mkdir -p $docdir chown -R www-data:www-data $docdir chmod -R 775 $docdir chmod -R g+s $docdir - # Copy install config file (with matching Debian) values into target directory + # Copy install config file (with matching Debian values) into target directory superuserlogin='' superuserpassword='' if [ -f /etc/mysql/debian.cnf ] ; then @@ -87,25 +128,22 @@ case "$1" in if [ ! -s $config ] || ! grep -q "File generated by" $config then # Create an empty conf.php with permission to web server - echo Create empty file $config - touch $config - chmod -R 660 $config - chown -R root:www-data $config + setup_empty_conf else # File already exist. We add params not found. - echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config - grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config - grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config - #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + #echo Add new params to overwrite path to use shared libraries/fonts + #grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config + ##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config + #grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config + ##grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config + ##grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config + #grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config + #grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config + #grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config + #grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config + #grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config fi db_get dolibarr/reconfigure-webserver diff --git a/build/debian/dolibarr.postrm b/build/debian/dolibarr.postrm index 38ebf8399c2..fa16ed582f0 100644 --- a/build/debian/dolibarr.postrm +++ b/build/debian/dolibarr.postrm @@ -177,18 +177,19 @@ case "$1" in passopt="--password='"`echo "$dbadmpass" | sed -e "s/'/'"'"'"'"'"'"'/g"`"'" fi mysqlcmd="mysql $hostopt $passopt -u $dbadmin" - + mysqlcmdnopass="mysql $hostopt -u $dbadmin" + # Now run the drop user if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then echo postrm Database login $dbuser@localhost removed else - error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\"" + error="Unable to run $mysqlcmdnopass -f -e \"DROP USER '$dbuser'@'localhost';\"" echo postrm $error fi if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'%';\"" ; then echo postrm Database login $dbuser@% removed else - error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'%';\"" + error="Unable to run $mysqlcmdnopass -f -e \"DROP USER '$dbuser'@'%';\"" echo postrm $error fi diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install index f5b663b3f4c..a6347863b1d 100755 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -27,20 +27,20 @@ $force_install_lockinstall='444'; // Value to overwrite path to use shared libraries/fonts instead of embedded one. // If we enable/disable libraries declaration during install, we must also check they are -// not removed from package (see in rules file), -// declared into dependencies (see in control file) -$force_dolibarr_lib_TCPDF_PATH=''; -$force_dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf'; -$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; -$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; -$force_dolibarr_lib_GEOIP_PATH=''; -$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; -$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; -$force_dolibarr_lib_PHPEXCEL_PATH=''; -$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; -$force_dolibarr_js_JQUERY='/javascript/jquery'; -$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; -$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; -$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; +// - not removed from package (see rm in rules file), +// - declared into dependencies (see Depends in control file) +//$force_dolibarr_lib_TCPDF_PATH=''; +//$force_dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf'; +//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; +//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; +//$force_dolibarr_lib_GEOIP_PATH=''; +//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; +//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; +//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled' +//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled' +//$force_dolibarr_js_JQUERY='/javascript/jquery'; +//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; +//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; +//$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; ?> \ No newline at end of file diff --git a/build/debian/lighttpd.conf b/build/debian/lighttpd/50-dolibarr.conf old mode 100755 new mode 100644 similarity index 100% rename from build/debian/lighttpd.conf rename to build/debian/lighttpd/50-dolibarr.conf diff --git a/build/debian/patches/00list b/build/debian/patches/00list deleted file mode 100644 index e9740160f5b..00000000000 --- a/build/debian/patches/00list +++ /dev/null @@ -1 +0,0 @@ -install.dpatch \ No newline at end of file diff --git a/build/debian/patches/series b/build/debian/patches/series new file mode 100644 index 00000000000..f67b0d494e7 --- /dev/null +++ b/build/debian/patches/series @@ -0,0 +1 @@ +use-etc-dolibarr-conf.patch diff --git a/build/debian/patches/install.dpatch b/build/debian/patches/use-etc-dolibarr-conf.patch old mode 100755 new mode 100644 similarity index 55% rename from build/debian/patches/install.dpatch rename to build/debian/patches/use-etc-dolibarr-conf.patch index c7c77e25379..f911ad18af0 --- a/build/debian/patches/install.dpatch +++ b/build/debian/patches/use-etc-dolibarr-conf.patch @@ -1,17 +1,17 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## install.patch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Updates htdocs/filefunc.inc.php -## DP: Updates htdocs/install/inc.php -## DP: Updates htdocs/support/inc.php - -@DPATCH@ - - ---- old/htdocs/filefunc.inc.php 2011-09-03 02:32:48.666952000 +0200 -+++ new/htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200 -@@ -63,8 +63,8 @@ +Description: Enable /etc/dolibarr/conf.php so that we use packaged libraries + Update some PHP include files to refer to /etc/dolibarr/conf.php + instead of the in-tree conf/conf.php. + . + /etc/dolibarr/conf.php configures Dolibarr to use packaged libraries + instead of the embedded ones. +Author: Laurent Destailleur +Forwarded: not-needed +Last-Update: 2013-07-29 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/htdocs/filefunc.inc.php ++++ b/htdocs/filefunc.inc.php +@@ -63,8 +63,8 @@ $conffiletoshowshort = "conf.php"; $conffile = "conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems @@ -22,9 +22,9 @@ // Include configuration ---- old/htdocs/install/inc.php 2011-09-03 02:33:26.450952000 +0200 -+++ new/htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200 -@@ -71,8 +71,8 @@ +--- a/htdocs/install/inc.php ++++ b/htdocs/install/inc.php +@@ -73,8 +73,8 @@ $conffiletoshowshort = "conf.php"; $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems @@ -35,9 +35,9 @@ if (! defined('DONOTLOADCONF') && file_exists($conffile)) ---- old/htdocs/support/inc.php 2011-09-03 02:34:39.606952000 +0200 -+++ new/htdocs/support/inc.php 2011-09-03 02:33:59.814952000 +0200 -@@ -69,8 +69,8 @@ +--- a/htdocs/support/inc.php ++++ b/htdocs/support/inc.php +@@ -69,8 +69,8 @@ $conffiletoshowshort = "conf.php"; $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems diff --git a/build/debian/po/fr.po b/build/debian/po/fr.po index d23da598297..0c09e4ae788 100755 --- a/build/debian/po/fr.po +++ b/build/debian/po/fr.po @@ -17,8 +17,8 @@ msgstr "" "Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n" "POT-Creation-Date: 2013-04-23 12:16+0200\n" "PO-Revision-Date: 2011-07-29 22:45+0100\n" -"Last-Translator: Laurent Destailleur \n" -"Language-Team: Laurent Destailleur \n" +"Last-Translator: Laurent Destailleur (eldy) \n" +"Language-Team: Laurent Destailleur (eldy) \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" diff --git a/build/debian/rules b/build/debian/rules index 2ab8af290c1..b61c101f310 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -7,29 +7,11 @@ export DH_OPTIONS=-v #export DH_COMPAT=7 # This is the debhelper compatability version to use, now defined into compat file -# use dpatch -include /usr/share/dpatch/dpatch.make - - -configure: - dh $@ - -build: patch - dh $@ - -build-arch: patch - dh $@ - -build-indep: patch - dh $@ - -binary: - dh $@ - -binary-indep: +%: dh $@ -clean: +override_dh_install: + dh_install # Delete files rm -f .buildpath rm -fr .cache @@ -90,35 +72,45 @@ clean: rm -fr build/rpm rm -fr build/zip - # clean from all embedded libraries (we use package dependencies instead) - rm -fr htdocs/includes/adodbtime - rm -fr htdocs/includes/ckeditor + # clean from all PHP embedded libraries (we use package dependencies instead) +# rm -fr htdocs/includes/adodbtime # rm -fr htdocs/includes/fpdfi - rm -fr htdocs/includes/fonts - rm -fr htdocs/includes/geoip - rm -fr htdocs/includes/nusoap - rm -fr htdocs/includes/odtphp/zip/pclzip - rm -fr htdocs/includes/phpmailer - rm -fr htdocs/includes/jquery/css - rm -fr htdocs/includes/jquery/js - rm -fr htdocs/includes/jquery/plugins/flot - rm -fr htdocs/includes/jquery/plugins/jstree - rm -fr htdocs/includes/jquery/plugins/lightbox +# rm -fr htdocs/includes/geoip +# rm -fr htdocs/includes/nusoap +# rm -fr htdocs/includes/odtphp/zip/pclzip + # clean from all JS-CSS embedded libraries (we use package dependencies instead) +# rm -fr htdocs/includes/ckeditor +# rm -fr htdocs/includes/jquery/js +# rm -fr htdocs/includes/jquery/css +# rm -fr htdocs/includes/jquery/plugins/flot + # clean from all embedded fonts (we use package dependencies instead) +# rm -fr htdocs/includes/fonts + + # clean from useless files rm -fr htdocs/includes/jquery/plugins/multiselect rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33 rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 rm -fr htdocs/includes/tcpdf/fonts/utils - # clean from files to avoid warning of missing dependencies rm -fr htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py - # Licence files are included into copyright file. - rm -fr htdocs/includes/phpexcel/license.txt + # Licence files are already included into copyright file. + rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt + rm -f htdocs/includes/phpexcel/license.txt rm -f htdocs/includes/tcpdf/LICENSE.TXT - dh $@ + # Drop unwanted executable permissions + find debian/dolibarr/usr/share/dolibarr/htdocs -type f -print0 | \ + xargs -0 chmod 644 + # Add missing executable permissions + find debian/dolibarr/usr/share/dolibarr/scripts -type f -name '*.php' -print0 | \ + xargs -0 chmod 755 -binary-arch: - +override_dh_fixperms: + dh_fixperms + # Give rights to the webserver on the upload directory + chown www-data:www-data debian/dolibarr/var/lib/dolibarr/documents + chmod 2775 debian/dolibarr/var/lib/dolibarr/documents + \ No newline at end of file diff --git a/build/debian/source/format b/build/debian/source/format index 9f6742789cd..46ebe026659 100644 --- a/build/debian/source/format +++ b/build/debian/source/format @@ -1 +1 @@ -3.0 (native) \ No newline at end of file +3.0 (quilt) \ No newline at end of file diff --git a/build/doxygen/dolibarr-doxygen-build.pl b/build/doxygen/dolibarr-doxygen-build.pl old mode 100644 new mode 100755 index 65fc027ca32..f8c8c480081 --- a/build/doxygen/dolibarr-doxygen-build.pl +++ b/build/doxygen/dolibarr-doxygen-build.pl @@ -30,8 +30,25 @@ if (! -s $CONFFILE) exit 1; } -print "Running doxygen, please wait...\n"; -$result=`doxygen $OPTIONS $CONFFILE 2>&1`; +$SOURCE="../.."; + +# Get version $MAJOR, $MINOR and $BUILD +$result = open( IN, "< " . $SOURCE . "/htdocs/filefunc.inc.php" ); +if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; } +while () { + if ( $_ =~ /define\('DOL_VERSION','([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; } +} +close IN; +($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3); +if ($MINOR eq '') { die "Error can't detect version into ".$SOURCE . "/htdocs/filefunc.inc.php"; } + + +$version=$MAJOR.".".$MINOR.".".$BUILD; + + +print "Running doxygen for version ".$version.", please wait...\n"; +print "cat $CONFFILE | sed -e 's/x\.y\.z/".$version."/' | doxygen $OPTIONS - 2>&1\n"; +$result=`cat $CONFFILE | sed -e 's/x\.y\.z/$version/' | doxygen $OPTIONS - 2>&1`; print $result; diff --git a/build/doxygen/dolibarr-doxygen-filter.pl b/build/doxygen/dolibarr-doxygen-filter.pl old mode 100644 new mode 100755 diff --git a/build/doxygen/dolibarr-doxygen-getversion.pl b/build/doxygen/dolibarr-doxygen-getversion.pl old mode 100644 new mode 100755 diff --git a/build/doxygen/dolibarr-doxygen.doxyfile b/build/doxygen/dolibarr-doxygen.doxyfile index 880602b2336..912c72b4d69 100644 --- a/build/doxygen/dolibarr-doxygen.doxyfile +++ b/build/doxygen/dolibarr-doxygen.doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 3.4.1 +PROJECT_NUMBER = x.y.z # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/build/doxygen/doxygen_header.html b/build/doxygen/doxygen_header.html index 8d367cccb67..363d408d43c 100755 --- a/build/doxygen/doxygen_header.html +++ b/build/doxygen/doxygen_header.html @@ -35,15 +35,15 @@ File added into doxygen generated documentation
- + + + -
diff --git a/build/doxygen/jenkins_doxygen.doxyfile b/build/doxygen/jenkins_doxygen.doxyfile deleted file mode 100644 index 749b0a10786..00000000000 --- a/build/doxygen/jenkins_doxygen.doxyfile +++ /dev/null @@ -1,1636 +0,0 @@ -# Doxyfile 1.7.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = dolibarr - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 3.3.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = hudson/doxygen - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = YES - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = "." - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST = YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -#FILE_VERSION_FILTER = dolibarr-doxygen-getversion.pl -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = NO - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = doxygen_warnings.log - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = htdocs scripts - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.php *.pl - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = build dev doc documents htdocs/conf/conf.php htdocs/core/filemanagerdol htdocs/includes htdocs/document htdocs/documents htdocs/oscommerce_ws/ws_client_demo htdocs/oscommerce_ws/ws_server scripts/addons scripts/courrier scripts/lolix scripts/energie - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = YES - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = */CVS/* *google* *pibarcode* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = dev/skeletons - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = *.php - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = doc/images - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -# Works on Linux only -#INPUT_FILTER = ../dolibarr-doxygen-filter.pl -#INPUT_FILTER = "perl ../dolibarr-doxygen-filter.pl" -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -# Does not work with 1.7.3 -#HTML_HEADER = doxygen_header.html - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -# Does not work with 1.7.3 -HTML_FOOTER = build/doxygen/doxygen_footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = YES - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.dolibarr.doc - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Dolibarr team - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = YES - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = NO - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = NO - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans.ttf - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = NO - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = YES - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/build/exe/doliwamp/UsedPort.cpp b/build/exe/doliwamp/UsedPort.cpp index 45fb5423b5f..15d2978b3bb 100644 --- a/build/exe/doliwamp/UsedPort.cpp +++ b/build/exe/doliwamp/UsedPort.cpp @@ -10,8 +10,8 @@ //--------------------------------------------------------------------------- // 06/09/09 1.0 Laurent Destailleur Creation //--------------------------------------------------------------------------- -#define PROG "UsedPort" -#define VERSION "1.0" +#define PROG "UsedPort" +#define VERSION "1.0" // If GNU GCC CYGWIN: _WIN32 to defined manually, __GNUC__ is defined, _MSC_VER not defined // If GNU GCC MINGW: _WIN32 automaticaly defined, __GNUC__ is defined, _MSC_VER not defined diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 77a9e1b95c9..5ff4e7770b0 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.4.2 +AppVerName=DoliWamp-3.5.5 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.4.2 +OutputBaseFilename=DoliWamp-3.5.5 ; ----- End of change ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined diff --git a/build/exe/doliwamp/httpd.conf.install b/build/exe/doliwamp/httpd.conf.install index a6bdf850540..d215380aa13 100644 --- a/build/exe/doliwamp/httpd.conf.install +++ b/build/exe/doliwamp/httpd.conf.install @@ -1,762 +1,762 @@ -# -# This is the main Apache HTTP server configuration file. It contains the -# configuration directives that give the server its instructions. -# See for detailed information. -# In particular, see -# -# for a discussion of each configuration directive. -# -# Do NOT simply read the instructions in here without understanding -# what they do. They're here only as hints or reminders. If you are unsure -# consult the online docs. You have been warned. -# -# Configuration and logfile names: If the filenames you specify for many -# of the server's control files begin with "/" (or "drive:/" for Win32), the -# server will use that explicit path. If the filenames do *not* begin -# with "/", the value of ServerRoot is prepended -- so "logs/foo.log" -# with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the -# server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log". -# -# NOTE: Where filenames are specified, you must use forward slashes -# instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). -# If a drive letter is omitted, the drive on which Apache.exe is located -# will be used by default. It is recommended that you always supply -# an explicit drive letter in absolute paths, however, to avoid -# confusion. -# - -# ThreadsPerChild: constant number of worker threads in the server process -# MaxRequestsPerChild: maximum number of requests a server process serves -ThreadsPerChild 250 -MaxRequestsPerChild 0 - -# -# ServerRoot: The top of the directory tree under which the server's -# configuration, error, and log files are kept. -# -# Do not add a slash at the end of the directory path. If you point -# ServerRoot at a non-local disk, be sure to point the LockFile directive -# at a local disk. If you wish to share the same ServerRoot for multiple -# httpd daemons, you will need to change at least LockFile and PidFile. -# -ServerRoot "WAMPROOT/bin/apache/apacheWAMPAPACHEVERSION" - -# -# Listen: Allows you to bind Apache to specific IP addresses and/or -# ports, instead of the default. See also the -# directive. -# -# Change this to Listen on specific IP addresses as shown below to -# prevent Apache from glomming onto all bound IP addresses (0.0.0.0) -# -#Listen 12.34.56.78:80 -Listen WAMPAPACHEPORT - -# -# Dynamic Shared Object (DSO) Support -# -# To be able to use the functionality of a module which was built as a DSO you -# have to place corresponding `LoadModule' lines at this location so the -# directives contained in it are actually available _before_ they are used. -# Statically compiled modules (those listed by `httpd -l') do not need -# to be loaded here. -# -# Example: -# LoadModule foo_module modules/mod_foo.so -# -LoadModule actions_module modules/mod_actions.so -LoadModule alias_module modules/mod_alias.so -LoadModule asis_module modules/mod_asis.so -LoadModule auth_basic_module modules/mod_auth_basic.so -#LoadModule auth_digest_module modules/mod_auth_digest.so -#LoadModule authn_anon_module modules/mod_authn_anon.so -#LoadModule authn_dbm_module modules/mod_authn_dbm.so -LoadModule authn_default_module modules/mod_authn_default.so -LoadModule authn_file_module modules/mod_authn_file.so -#LoadModule authz_dbm_module modules/mod_authz_dbm.so -LoadModule authz_default_module modules/mod_authz_default.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_host_module modules/mod_authz_host.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule autoindex_module modules/mod_autoindex.so -#LoadModule cern_meta_module modules/mod_cern_meta.so -LoadModule cgi_module modules/mod_cgi.so -#LoadModule dav_module modules/mod_dav.so -#LoadModule dav_fs_module modules/mod_dav_fs.so -#LoadModule deflate_module modules/mod_deflate.so -LoadModule dir_module modules/mod_dir.so -LoadModule env_module modules/mod_env.so -LoadModule expires_module modules/mod_expires.so -#LoadModule file_cache_module modules/mod_file_cache.so -#LoadModule headers_module modules/mod_headers.so -LoadModule imagemap_module modules/mod_imagemap.so -LoadModule include_module modules/mod_include.so -#LoadModule info_module modules/mod_info.so -LoadModule isapi_module modules/mod_isapi.so -LoadModule log_config_module modules/mod_log_config.so -LoadModule mime_module modules/mod_mime.so -#LoadModule mime_magic_module modules/mod_mime_magic.so -#LoadModule proxy_module modules/mod_proxy.so -#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so -#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so -#LoadModule proxy_connect_module modules/mod_proxy_connect.so -#LoadModule proxy_http_module modules/mod_proxy_http.so -#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so -LoadModule negotiation_module modules/mod_negotiation.so -LoadModule rewrite_module modules/mod_rewrite.so -LoadModule setenvif_module modules/mod_setenvif.so -#LoadModule speling_module modules/mod_speling.so -LoadModule status_module modules/mod_status.so -#LoadModule unique_id_module modules/mod_unique_id.so -LoadModule userdir_module modules/mod_userdir.so -#LoadModule usertrack_module modules/mod_usertrack.so -LoadModule vhost_alias_module modules/mod_vhost_alias.so -#LoadModule ssl_module modules/mod_ssl.so -LoadModule php5_module "WAMPROOT/bin/php/phpWAMPPHPVERSION/php5apache2_2.dll" - -# -# ExtendedStatus controls whether Apache will generate "full" status -# information (ExtendedStatus On) or just basic information (ExtendedStatus -# Off) when the "server-status" handler is called. The default is Off. -# -ExtendedStatus On - - -SetHandler server-status -Order Deny,Allow -Deny from all -Allow from localhost, 127.0.0.1 - - - -# 'Main' server configuration -# -# The directives in this section set up the values used by the 'main' -# server, which responds to any requests that aren't handled by a -# definition. These values also provide defaults for -# any containers you may define later in the file. -# -# All of these directives may appear inside containers, -# in which case these default settings will be overridden for the -# virtual host being defined. -# - -# -# ServerAdmin: Your address, where problems with the server should be -# e-mailed. This address appears on some server-generated pages, such -# as error documents. e.g. admin@your-domain.com -# -ServerAdmin webmaster@localhost - -# -# ServerName gives the name and port that the server uses to identify itself. -# This can often be determined automatically, but we recommend you specify -# it explicitly to prevent problems during startup. -# -# If your host doesn't have a registered DNS name, enter its IP address here. -# -ServerName localhost - -# -# ServerTokens -# This directive configures what you return as the Server HTTP response -# Header. The default is 'Full' which sends information about the OS-Type -# and compiled in modules. -# Set to one of: Full | OS | Minor | Minimal | Major | Prod -# where Full conveys the most information, and Prod the least. -# -#ServerTokens Prod - -# -# DocumentRoot: The directory out of which you will serve your -# documents. By default, all requests are taken from this directory, but -# symbolic links and aliases may be used to point to other locations. -# -DocumentRoot "WAMPROOT/www/" - - -# -# Timeout: The number of seconds before receives and sends time out. -# -Timeout 300 - -# -# KeepAlive: Whether or not to allow persistent connections (more than -# one request per connection). Set to "Off" to deactivate. -# -KeepAlive On - -# -# MaxKeepAliveRequests: The maximum number of requests to allow -# during a persistent connection. Set to 0 to allow an unlimited amount. -# We recommend you leave this number high, for maximum performance. -# -MaxKeepAliveRequests 500 - -# -# KeepAliveTimeout: Number of seconds to wait for the next request from the -# same client on the same connection. -# -KeepAliveTimeout 30 - - -# -# Each directory to which Apache has access can be configured with respect -# to which services and features are allowed and/or disabled in that -# directory (and its subdirectories). -# -# First, we configure the "default" to be a very restrictive set of -# features. -# - - Options FollowSymLinks - AllowOverride None - Order deny,allow - Deny from all - Satisfy all - - -# -# Note that from this point forward you must specifically allow -# particular features to be enabled - so if something's not working as -# you might expect, make sure that you have specifically enabled it -# below. -# - -# -# This should be changed to whatever you set DocumentRoot to. -# - - - # - # Possible values for the Options directive are "None", "All", - # or any combination of: - # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews - # - # Note that "MultiViews" must be named *explicitly* --- "Options All" - # doesn't give it to you. - # - # The Options directive is both complicated and important. Please see - # http://httpd.apache.org/docs/2.2/mod/core.html#options - # for more information. - # - Options Indexes FollowSymLinks - - # - # AllowOverride controls what directives may be placed in .htaccess files. - # It can be "All", "None", or any combination of the keywords: - # Options FileInfo AuthConfig Limit - # - AllowOverride all - - # - # Controls who can get stuff from this server. - # -# onlineoffline tag - don't remove - Order Deny,Allow - Deny from all - Allow from 127.0.0.1 - - - -# -# DirectoryIndex: sets the file that Apache will serve if a directory -# is requested. -# - - DirectoryIndex index.php index.php3 index.html index.htm - - -# -# The following lines prevent .htaccess and .htpasswd files from being -# viewed by Web clients. -# - - Order allow,deny - Deny from all - - -# -# ErrorLog: The location of the error log file. -# If you do not specify an ErrorLog directive within a -# container, error messages relating to that virtual host will be -# logged here. If you *do* define an error logfile for a -# container, that host's errors will be logged there and not here. -# -ErrorLog "WAMPROOT/logs/apache_error.log" - -# -# LogLevel: Control the number of messages logged to the error_log. -# Possible values include: debug, info, notice, warn, error, crit, -# alert, emerg. -# -LogLevel warn - - - # - # The following directives define some format nicknames for use with - # a CustomLog directive (see below). - # - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined - LogFormat "%h %l %u %t \"%r\" %>s %b" common - - - # You need to enable mod_logio.c to use %I and %O - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio - - - # - # The location and format of the access logfile (Common Logfile Format). - # If you do not define any access logfiles within a - # container, they will be logged here. Contrariwise, if you *do* - # define per- access logfiles, transactions will be - # logged therein and *not* in this file. - # - CustomLog "WAMPROOT/logs/access.log" common - - # - # If you prefer a logfile with access, agent, and referer information - # (Combined Logfile Format) you can use the following directive. - # - #CustomLog logs/access.log combined - - - - # - # Redirect: Allows you to tell clients about documents that used to - # exist in your server's namespace, but do not anymore. The client - # will make a new request for the document at its new location. - # Example: - # Redirect permanent /foo http://localhost/bar - - # - # Alias: Maps web paths into filesystem paths and is used to - # access content that does not live under the DocumentRoot. - # Example: - # Alias /webpath /full/filesystem/path - # - # If you include a trailing / on /webpath then the server will - # require it to be present in the URL. You will also likely - # need to provide a section to allow access to - # the filesystem path. - - # - # ScriptAlias: This controls which directories contain server scripts. - # ScriptAliases are essentially the same as Aliases, except that - # documents in the target directory are treated as applications and - # run by the server when requested rather than as documents sent to the - # client. The same rules about trailing "/" apply to ScriptAlias - # directives as to Alias. - # - ScriptAlias /cgi-bin/ "cgi-bin/" - - - -# -# "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased -# CGI directory exists, if you have that configured. -# - - AllowOverride None - Options None - Order allow,deny - Allow from all - - -# -# Apache parses all CGI scripts for the shebang line by default. -# This comment line, the first line of the script, consists of the symbols -# pound (#) and exclamation (!) followed by the path of the program that -# can execute this specific script. For a perl script, with perl.exe in -# the C:\Program Files\Perl directory, the shebang line should be: - - #!c:/program files/perl/perl - -# Note you _must_not_ indent the actual shebang line, and it must be the -# first line of the file. Of course, CGI processing must be enabled by -# the appropriate ScriptAlias or Options ExecCGI directives for the files -# or directory in question. -# -# However, Apache on Windows allows either the Unix behavior above, or can -# use the Registry to match files by extention. The command to execute -# a file of this type is retrieved from the registry by the same method as -# the Windows Explorer would use to handle double-clicking on a file. -# These script actions can be configured from the Windows Explorer View menu, -# 'Folder Options', and reviewing the 'File Types' tab. Clicking the Edit -# button allows you to modify the Actions, of which Apache 1.3 attempts to -# perform the 'Open' Action, and failing that it will try the shebang line. -# This behavior is subject to change in Apache release 2.0. -# -# Each mechanism has it's own specific security weaknesses, from the means -# to run a program you didn't intend the website owner to invoke, and the -# best method is a matter of great debate. -# -# To enable the this Windows specific behavior (and therefore -disable- the -# equivilant Unix behavior), uncomment the following directive: -# -#ScriptInterpreterSource registry -# -# The directive above can be placed in individual blocks or the -# .htaccess file, with either the 'registry' (Windows behavior) or 'script' -# (Unix behavior) option, and will override this server default option. -# - -# -# DefaultType: the default MIME type the server will use for a document -# if it cannot otherwise determine one, such as from filename extensions. -# If your server contains mostly text or HTML documents, "text/plain" is -# a good value. If most of your content is binary, such as applications -# or images, you may want to use "application/octet-stream" instead to -# keep browsers from trying to display binary files as though they are -# text. -# -DefaultType text/plain - - - # - # TypesConfig points to the file containing the list of mappings from - # filename extension to MIME-type. - # - TypesConfig conf/mime.types - - # - # AddType allows you to add to or override the MIME configuration - # file specified in TypesConfig for specific file types. - # - #AddType application/x-gzip .tgz - # - # AddEncoding allows you to have certain browsers uncompress - # information on the fly. Note: Not all browsers support this. - # - #AddEncoding x-compress .Z - #AddEncoding x-gzip .gz .tgz - # - # If the AddEncoding directives above are commented-out, then you - # probably should define those extensions to indicate media types: - # - AddType application/x-compress .Z - AddType application/x-gzip .gz .tgz - AddType application/x-httpd-php .php - AddType application/x-httpd-php .php3 - - # - # AddHandler allows you to map certain file extensions to "handlers": - # actions unrelated to filetype. These can be either built into the server - # or added with the Action directive (see below) - # - # To use CGI scripts outside of ScriptAliased directories: - # (You will also need to add "ExecCGI" to the "Options" directive.) - # - #AddHandler cgi-script .cgi - - # For type maps (negotiated resources): - #AddHandler type-map var - - # - # Filters allow you to process content before it is sent to the client. - # - # To parse .shtml files for server-side includes (SSI): - # (You will also need to add "Includes" to the "Options" directive.) - # - #AddType text/html .shtml - #AddOutputFilter INCLUDES .shtml - - -# -# The mod_mime_magic module allows the server to use various hints from the -# contents of the file itself to determine its type. The MIMEMagicFile -# directive tells the module where the hint definitions are located. -# -#MIMEMagicFile conf/magic - -# -# Customizable error responses come in three flavors: -# 1) plain text 2) local redirects 3) external redirects -# -# Some examples: -#ErrorDocument 500 "The server made a boo boo." -#ErrorDocument 404 /missing.html -#ErrorDocument 404 "/cgi-bin/missing_handler.pl" -#ErrorDocument 402 http://localhost/subscription_info.html -# - -# -# EnableMMAP and EnableSendfile: On systems that support it, -# memory-mapping or the sendfile syscall is used to deliver -# files. This usually improves server performance, but must -# be turned off when serving from networked-mounted -# filesystems or if support for these functions is otherwise -# broken on your system. -# -#EnableMMAP off -#EnableSendfile off - -# Supplemental configuration -# -# The configuration files in the conf/extra/ directory can be -# included to add extra features or to modify the default configuration of -# the server, or you may simply copy their contents here and change as -# necessary. - -# Server-pool management (MPM specific) -#Include conf/extra/httpd-mpm.conf - -# Multi-language error messages -#Include conf/extra/httpd-multilang-errordoc.conf - -# Fancy directory listings -Include conf/extra/httpd-autoindex.conf - -# Language settings -#Include conf/extra/httpd-languages.conf - -# User home directories -#Include conf/extra/httpd-userdir.conf - -# Real-time info on requests and configuration -#Include conf/extra/httpd-info.conf - -# Virtual hosts -#Include conf/extra/httpd-vhosts.conf - -# Local access to the Apache HTTP Server Manual -#Include conf/extra/httpd-manual.conf - -# Distributed authoring and versioning (WebDAV) -#Include conf/extra/httpd-dav.conf - -# Various default settings -#Include conf/extra/httpd-default.conf - - - -# Secure (SSL/TLS) connections -# -# Note: The following must must be present to support -# starting without SSL on platforms with no /dev/random equivalent -# but a statically compiled-in mod_ssl. -# - - - -SSLRandomSeed startup builtin -SSLRandomSeed connect builtin - -Listen WAMPAPACHEPSSL - -## -## SSL Global Context -## -## All SSL configuration in this context applies both to -## the main server and all SSL-enabled virtual hosts. -## - -# -# Some MIME-types for downloading Certificates and CRLs -# -AddType application/x-x509-ca-cert .crt -AddType application/x-pkcs7-crl .crl - -# Pass Phrase Dialog: -# Configure the pass phrase gathering process. -# The filtering dialog program (`builtin' is a internal -# terminal dialog) has to provide the pass phrase on stdout. -#SSLPassPhraseDialog builtin - -# Inter-Process Session Cache: -# Configure the SSL Session Cache: First the mechanism -# to use and second the expiring timeout (in seconds). -#SSLSessionCache "dbm:C:/Program Files/Apache Software Foundation/Apache2.2/logs/ssl_scache" -#SSLSessionCache "shmcb:C:/Program Files/Apache Software Foundation/Apache2.2/logs/ssl_scache(512000)" -#SSLSessionCacheTimeout 300 - -# Semaphore: -# Configure the path to the mutual exclusion semaphore the -# SSL engine uses internally for inter-process synchronization. -#SSLMutex "file:C:/Program Files/Apache Software Foundation/Apache2.2/logs/ssl_mutex" - -## -## SSL Virtual Host Context -## - - - -# SSL Engine Switch: -# Enable/Disable SSL for this virtual host. -SSLEngine on - -# General setup for the virtual host -DocumentRoot "WAMPROOT/www/" -ServerName localhost -ServerAdmin admin@localhost -ErrorLog "WAMPROOT/logs/apache_error_ssl.log" -TransferLog "WAMPROOT/logs/apache_transfer_ssl.log" -CustomLog "WAMPROOT/logs/apache_access_ssl.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" - -# SSL Cipher Suite: -# List the ciphers that the client is permitted to negotiate. -# See the mod_ssl documentation for a complete list. -#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL - -# Server Certificate: -# Point SSLCertificateFile at a PEM encoded certificate. If -# the certificate is encrypted, then you will be prompted for a -# pass phrase. Note that a kill -HUP will prompt again. Keep -# in mind that if you have both an RSA and a DSA certificate you -# can configure both in parallel (to also allow the use of DSA -# ciphers, etc.) -SSLCertificateFile "WAMPROOT/myserver.crt" - -# Server Private Key: -# If the key is not combined with the certificate, use this -# directive to point at the key file. Keep in mind that if -# you've both a RSA and a DSA private key you can configure -# both in parallel (to also allow the use of DSA ciphers, etc.) -SSLCertificateKeyFile "WAMPROOT/myserver.key" - -# Server Certificate Chain: -# Point SSLCertificateChainFile at a file containing the -# concatenation of PEM encoded CA certificates which form the -# certificate chain for the server certificate. Alternatively -# the referenced file can be the same as SSLCertificateFile -# when the CA certificates are directly appended to the server -# certificate for convinience. -#SSLCertificateChainFile "WAMPROOT/server-ca.crt" - -# Certificate Authority (CA): -# Set the CA certificate verification path where to find CA -# certificates for client authentication or alternatively one -# huge file containing all of them (file must be PEM encoded) -# Note: Inside SSLCACertificatePath you need hash symlinks -# to point to the certificate files. Use the provided -# Makefile to update the hash symlinks after changes. -#SSLCACertificatePath "WAMPROOT/ssl.crt" -#SSLCACertificateFile "WAMPROOT/ca-bundle.crt" - -# Certificate Revocation Lists (CRL): -# Set the CA revocation path where to find CA CRLs for client -# authentication or alternatively one huge file containing all -# of them (file must be PEM encoded) -# Note: Inside SSLCARevocationPath you need hash symlinks -# to point to the certificate files. Use the provided -# Makefile to update the hash symlinks after changes. -#SSLCARevocationPath "WAMPROOT/ssl.crl" -#SSLCARevocationFile "WAMPROOT/ca-bundle.crl" - -# Client Authentication (Type): -# Client certificate verification type and depth. Types are -# none, optional, require and optional_no_ca. Depth is a -# number which specifies how deeply to verify the certificate -# issuer chain before deciding the certificate is not valid. -#SSLVerifyClient require -#SSLVerifyDepth 10 - -# Access Control: -# With SSLRequire you can do per-directory access control based -# on arbitrary complex boolean expressions containing server -# variable checks and other lookup directives. The syntax is a -# mixture between C and Perl. See the mod_ssl documentation -# for more details. -# -#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ -# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \ -# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \ -# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \ -# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \ -# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/ -# - -# SSL Engine Options: -# Set various options for the SSL engine. -# o FakeBasicAuth: -# Translate the client X.509 into a Basic Authorisation. This means that -# the standard Auth/DBMAuth methods can be used for access control. The -# user name is the `one line' version of the client's X.509 certificate. -# Note that no password is obtained from the user. Every entry in the user -# file needs this password: `xxj31ZMTZzkVA'. -# o ExportCertData: -# This exports two additional environment variables: SSL_CLIENT_CERT and -# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the -# server (always existing) and the client (only existing when client -# authentication is used). This can be used to import the certificates -# into CGI scripts. -# o StdEnvVars: -# This exports the standard SSL/TLS related `SSL_*' environment variables. -# Per default this exportation is switched off for performance reasons, -# because the extraction step is an expensive operation and is usually -# useless for serving static content. So one usually enables the -# exportation for CGI and SSI requests only. -# o StrictRequire: -# This denies access when "SSLRequireSSL" or "SSLRequire" applied even -# under a "Satisfy any" situation, i.e. when it applies access is denied -# and no other module can change it. -# o OptRenegotiate: -# This enables optimized SSL connection renegotiation handling when SSL -# directives are used in per-directory context. -#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire -# -# SSLOptions +StdEnvVars -# -# -# SSLOptions +StdEnvVars -# - -# SSL Protocol Adjustments: -# The safe and default but still SSL/TLS standard compliant shutdown -# approach is that mod_ssl sends the close notify alert but doesn't wait for -# the close notify alert from client. When you need a different shutdown -# approach you can use one of the following variables: -# o ssl-unclean-shutdown: -# This forces an unclean shutdown when the connection is closed, i.e. no -# SSL close notify alert is send or allowed to received. This violates -# the SSL/TLS standard but is needed for some brain-dead browsers. Use -# this when you receive I/O errors because of the standard approach where -# mod_ssl sends the close notify alert. -# o ssl-accurate-shutdown: -# This forces an accurate shutdown when the connection is closed, i.e. a -# SSL close notify alert is send and mod_ssl waits for the close notify -# alert of the client. This is 100% SSL/TLS standard compliant, but in -# practice often causes hanging connections with brain-dead browsers. Use -# this only for browsers where you know that their SSL implementation -# works correctly. -# Notice: Most problems of broken clients are also related to the HTTP -# keep-alive facility, so you usually additionally want to disable -# keep-alive for those clients, too. Use variable "nokeepalive" for this. -# Similarly, one has to force some clients to use HTTP/1.0 to workaround -# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and -# "force-response-1.0" for this. -#BrowserMatch ".*MSIE.*" \ -# nokeepalive ssl-unclean-shutdown \ -# downgrade-1.0 force-response-1.0 - - - - - - - -# OPTIMIZE: To use gzip compression (for already compressed files). -# Note that constant MAIN_OPTIMIZE_SPEED must have a value with bit 0 set. -#AddType text/javascript .jgz -#AddEncoding gzip .jgz - -# OPTIMIZE: To use gzip compression (on the fly). -# Note that you must also enable the module mod_deflate. -# You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set. -#TODO - -# OPTIMIZE: To use cache on static pages (A259200 = 1 month). -# Note that you must also enable the module mod_expires. -#ExpiresActive On -#ExpiresByType image/x-icon A2592000 -#ExpiresByType image/gif A2592000 -#ExpiresByType image/png A2592000 -#ExpiresByType image/jpeg A2592000 -#ExpiresByType text/css A2592000 -#ExpiresByType text/javascript A2592000 -#ExpiresByType application/x-javascript A2592000 -#ExpiresByType application/javascript A2592000 - - -# Declare alias for Dolibarr, PHPMyAdmin and other softwares -Include "WAMPROOT/alias/*.conf" +# +# This is the main Apache HTTP server configuration file. It contains the +# configuration directives that give the server its instructions. +# See for detailed information. +# In particular, see +# +# for a discussion of each configuration directive. +# +# Do NOT simply read the instructions in here without understanding +# what they do. They're here only as hints or reminders. If you are unsure +# consult the online docs. You have been warned. +# +# Configuration and logfile names: If the filenames you specify for many +# of the server's control files begin with "/" (or "drive:/" for Win32), the +# server will use that explicit path. If the filenames do *not* begin +# with "/", the value of ServerRoot is prepended -- so "logs/foo.log" +# with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the +# server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log". +# +# NOTE: Where filenames are specified, you must use forward slashes +# instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). +# If a drive letter is omitted, the drive on which Apache.exe is located +# will be used by default. It is recommended that you always supply +# an explicit drive letter in absolute paths, however, to avoid +# confusion. +# + +# ThreadsPerChild: constant number of worker threads in the server process +# MaxRequestsPerChild: maximum number of requests a server process serves +ThreadsPerChild 250 +MaxRequestsPerChild 0 + +# +# ServerRoot: The top of the directory tree under which the server's +# configuration, error, and log files are kept. +# +# Do not add a slash at the end of the directory path. If you point +# ServerRoot at a non-local disk, be sure to point the LockFile directive +# at a local disk. If you wish to share the same ServerRoot for multiple +# httpd daemons, you will need to change at least LockFile and PidFile. +# +ServerRoot "WAMPROOT/bin/apache/apacheWAMPAPACHEVERSION" + +# +# Listen: Allows you to bind Apache to specific IP addresses and/or +# ports, instead of the default. See also the +# directive. +# +# Change this to Listen on specific IP addresses as shown below to +# prevent Apache from glomming onto all bound IP addresses (0.0.0.0) +# +#Listen 12.34.56.78:80 +Listen WAMPAPACHEPORT + +# +# Dynamic Shared Object (DSO) Support +# +# To be able to use the functionality of a module which was built as a DSO you +# have to place corresponding `LoadModule' lines at this location so the +# directives contained in it are actually available _before_ they are used. +# Statically compiled modules (those listed by `httpd -l') do not need +# to be loaded here. +# +# Example: +# LoadModule foo_module modules/mod_foo.so +# +LoadModule actions_module modules/mod_actions.so +LoadModule alias_module modules/mod_alias.so +LoadModule asis_module modules/mod_asis.so +LoadModule auth_basic_module modules/mod_auth_basic.so +#LoadModule auth_digest_module modules/mod_auth_digest.so +#LoadModule authn_anon_module modules/mod_authn_anon.so +#LoadModule authn_dbm_module modules/mod_authn_dbm.so +LoadModule authn_default_module modules/mod_authn_default.so +LoadModule authn_file_module modules/mod_authn_file.so +#LoadModule authz_dbm_module modules/mod_authz_dbm.so +LoadModule authz_default_module modules/mod_authz_default.so +LoadModule authz_groupfile_module modules/mod_authz_groupfile.so +LoadModule authz_host_module modules/mod_authz_host.so +LoadModule authz_user_module modules/mod_authz_user.so +LoadModule autoindex_module modules/mod_autoindex.so +#LoadModule cern_meta_module modules/mod_cern_meta.so +LoadModule cgi_module modules/mod_cgi.so +#LoadModule dav_module modules/mod_dav.so +#LoadModule dav_fs_module modules/mod_dav_fs.so +#LoadModule deflate_module modules/mod_deflate.so +LoadModule dir_module modules/mod_dir.so +LoadModule env_module modules/mod_env.so +LoadModule expires_module modules/mod_expires.so +#LoadModule file_cache_module modules/mod_file_cache.so +#LoadModule headers_module modules/mod_headers.so +LoadModule imagemap_module modules/mod_imagemap.so +LoadModule include_module modules/mod_include.so +#LoadModule info_module modules/mod_info.so +LoadModule isapi_module modules/mod_isapi.so +LoadModule log_config_module modules/mod_log_config.so +LoadModule mime_module modules/mod_mime.so +#LoadModule mime_magic_module modules/mod_mime_magic.so +#LoadModule proxy_module modules/mod_proxy.so +#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so +#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so +#LoadModule proxy_connect_module modules/mod_proxy_connect.so +#LoadModule proxy_http_module modules/mod_proxy_http.so +#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so +LoadModule negotiation_module modules/mod_negotiation.so +LoadModule rewrite_module modules/mod_rewrite.so +LoadModule setenvif_module modules/mod_setenvif.so +#LoadModule speling_module modules/mod_speling.so +LoadModule status_module modules/mod_status.so +#LoadModule unique_id_module modules/mod_unique_id.so +LoadModule userdir_module modules/mod_userdir.so +#LoadModule usertrack_module modules/mod_usertrack.so +LoadModule vhost_alias_module modules/mod_vhost_alias.so +#LoadModule ssl_module modules/mod_ssl.so +LoadModule php5_module "WAMPROOT/bin/php/phpWAMPPHPVERSION/php5apache2_2.dll" + +# +# ExtendedStatus controls whether Apache will generate "full" status +# information (ExtendedStatus On) or just basic information (ExtendedStatus +# Off) when the "server-status" handler is called. The default is Off. +# +ExtendedStatus On + + +SetHandler server-status +Order Deny,Allow +Deny from all +Allow from localhost, 127.0.0.1 + + + +# 'Main' server configuration +# +# The directives in this section set up the values used by the 'main' +# server, which responds to any requests that aren't handled by a +# definition. These values also provide defaults for +# any containers you may define later in the file. +# +# All of these directives may appear inside containers, +# in which case these default settings will be overridden for the +# virtual host being defined. +# + +# +# ServerAdmin: Your address, where problems with the server should be +# e-mailed. This address appears on some server-generated pages, such +# as error documents. e.g. admin@your-domain.com +# +ServerAdmin webmaster@localhost + +# +# ServerName gives the name and port that the server uses to identify itself. +# This can often be determined automatically, but we recommend you specify +# it explicitly to prevent problems during startup. +# +# If your host doesn't have a registered DNS name, enter its IP address here. +# +ServerName localhost + +# +# ServerTokens +# This directive configures what you return as the Server HTTP response +# Header. The default is 'Full' which sends information about the OS-Type +# and compiled in modules. +# Set to one of: Full | OS | Minor | Minimal | Major | Prod +# where Full conveys the most information, and Prod the least. +# +#ServerTokens Prod + +# +# DocumentRoot: The directory out of which you will serve your +# documents. By default, all requests are taken from this directory, but +# symbolic links and aliases may be used to point to other locations. +# +DocumentRoot "WAMPROOT/www/" + + +# +# Timeout: The number of seconds before receives and sends time out. +# +Timeout 300 + +# +# KeepAlive: Whether or not to allow persistent connections (more than +# one request per connection). Set to "Off" to deactivate. +# +KeepAlive On + +# +# MaxKeepAliveRequests: The maximum number of requests to allow +# during a persistent connection. Set to 0 to allow an unlimited amount. +# We recommend you leave this number high, for maximum performance. +# +MaxKeepAliveRequests 500 + +# +# KeepAliveTimeout: Number of seconds to wait for the next request from the +# same client on the same connection. +# +KeepAliveTimeout 30 + + +# +# Each directory to which Apache has access can be configured with respect +# to which services and features are allowed and/or disabled in that +# directory (and its subdirectories). +# +# First, we configure the "default" to be a very restrictive set of +# features. +# + + Options FollowSymLinks + AllowOverride None + Order deny,allow + Deny from all + Satisfy all + + +# +# Note that from this point forward you must specifically allow +# particular features to be enabled - so if something's not working as +# you might expect, make sure that you have specifically enabled it +# below. +# + +# +# This should be changed to whatever you set DocumentRoot to. +# + + + # + # Possible values for the Options directive are "None", "All", + # or any combination of: + # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews + # + # Note that "MultiViews" must be named *explicitly* --- "Options All" + # doesn't give it to you. + # + # The Options directive is both complicated and important. Please see + # http://httpd.apache.org/docs/2.2/mod/core.html#options + # for more information. + # + Options Indexes FollowSymLinks + + # + # AllowOverride controls what directives may be placed in .htaccess files. + # It can be "All", "None", or any combination of the keywords: + # Options FileInfo AuthConfig Limit + # + AllowOverride all + + # + # Controls who can get stuff from this server. + # +# onlineoffline tag - don't remove + Order Deny,Allow + Deny from all + Allow from 127.0.0.1 + + + +# +# DirectoryIndex: sets the file that Apache will serve if a directory +# is requested. +# + + DirectoryIndex index.php index.php3 index.html index.htm + + +# +# The following lines prevent .htaccess and .htpasswd files from being +# viewed by Web clients. +# + + Order allow,deny + Deny from all + + +# +# ErrorLog: The location of the error log file. +# If you do not specify an ErrorLog directive within a +# container, error messages relating to that virtual host will be +# logged here. If you *do* define an error logfile for a +# container, that host's errors will be logged there and not here. +# +ErrorLog "WAMPROOT/logs/apache_error.log" + +# +# LogLevel: Control the number of messages logged to the error_log. +# Possible values include: debug, info, notice, warn, error, crit, +# alert, emerg. +# +LogLevel warn + + + # + # The following directives define some format nicknames for use with + # a CustomLog directive (see below). + # + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined + LogFormat "%h %l %u %t \"%r\" %>s %b" common + + + # You need to enable mod_logio.c to use %I and %O + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio + + + # + # The location and format of the access logfile (Common Logfile Format). + # If you do not define any access logfiles within a + # container, they will be logged here. Contrariwise, if you *do* + # define per- access logfiles, transactions will be + # logged therein and *not* in this file. + # + CustomLog "WAMPROOT/logs/access.log" common + + # + # If you prefer a logfile with access, agent, and referer information + # (Combined Logfile Format) you can use the following directive. + # + #CustomLog logs/access.log combined + + + + # + # Redirect: Allows you to tell clients about documents that used to + # exist in your server's namespace, but do not anymore. The client + # will make a new request for the document at its new location. + # Example: + # Redirect permanent /foo http://localhost/bar + + # + # Alias: Maps web paths into filesystem paths and is used to + # access content that does not live under the DocumentRoot. + # Example: + # Alias /webpath /full/filesystem/path + # + # If you include a trailing / on /webpath then the server will + # require it to be present in the URL. You will also likely + # need to provide a section to allow access to + # the filesystem path. + + # + # ScriptAlias: This controls which directories contain server scripts. + # ScriptAliases are essentially the same as Aliases, except that + # documents in the target directory are treated as applications and + # run by the server when requested rather than as documents sent to the + # client. The same rules about trailing "/" apply to ScriptAlias + # directives as to Alias. + # + ScriptAlias /cgi-bin/ "cgi-bin/" + + + +# +# "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased +# CGI directory exists, if you have that configured. +# + + AllowOverride None + Options None + Order allow,deny + Allow from all + + +# +# Apache parses all CGI scripts for the shebang line by default. +# This comment line, the first line of the script, consists of the symbols +# pound (#) and exclamation (!) followed by the path of the program that +# can execute this specific script. For a perl script, with perl.exe in +# the C:\Program Files\Perl directory, the shebang line should be: + + #!c:/program files/perl/perl + +# Note you _must_not_ indent the actual shebang line, and it must be the +# first line of the file. Of course, CGI processing must be enabled by +# the appropriate ScriptAlias or Options ExecCGI directives for the files +# or directory in question. +# +# However, Apache on Windows allows either the Unix behavior above, or can +# use the Registry to match files by extention. The command to execute +# a file of this type is retrieved from the registry by the same method as +# the Windows Explorer would use to handle double-clicking on a file. +# These script actions can be configured from the Windows Explorer View menu, +# 'Folder Options', and reviewing the 'File Types' tab. Clicking the Edit +# button allows you to modify the Actions, of which Apache 1.3 attempts to +# perform the 'Open' Action, and failing that it will try the shebang line. +# This behavior is subject to change in Apache release 2.0. +# +# Each mechanism has it's own specific security weaknesses, from the means +# to run a program you didn't intend the website owner to invoke, and the +# best method is a matter of great debate. +# +# To enable the this Windows specific behavior (and therefore -disable- the +# equivilant Unix behavior), uncomment the following directive: +# +#ScriptInterpreterSource registry +# +# The directive above can be placed in individual blocks or the +# .htaccess file, with either the 'registry' (Windows behavior) or 'script' +# (Unix behavior) option, and will override this server default option. +# + +# +# DefaultType: the default MIME type the server will use for a document +# if it cannot otherwise determine one, such as from filename extensions. +# If your server contains mostly text or HTML documents, "text/plain" is +# a good value. If most of your content is binary, such as applications +# or images, you may want to use "application/octet-stream" instead to +# keep browsers from trying to display binary files as though they are +# text. +# +DefaultType text/plain + + + # + # TypesConfig points to the file containing the list of mappings from + # filename extension to MIME-type. + # + TypesConfig conf/mime.types + + # + # AddType allows you to add to or override the MIME configuration + # file specified in TypesConfig for specific file types. + # + #AddType application/x-gzip .tgz + # + # AddEncoding allows you to have certain browsers uncompress + # information on the fly. Note: Not all browsers support this. + # + #AddEncoding x-compress .Z + #AddEncoding x-gzip .gz .tgz + # + # If the AddEncoding directives above are commented-out, then you + # probably should define those extensions to indicate media types: + # + AddType application/x-compress .Z + AddType application/x-gzip .gz .tgz + AddType application/x-httpd-php .php + AddType application/x-httpd-php .php3 + + # + # AddHandler allows you to map certain file extensions to "handlers": + # actions unrelated to filetype. These can be either built into the server + # or added with the Action directive (see below) + # + # To use CGI scripts outside of ScriptAliased directories: + # (You will also need to add "ExecCGI" to the "Options" directive.) + # + #AddHandler cgi-script .cgi + + # For type maps (negotiated resources): + #AddHandler type-map var + + # + # Filters allow you to process content before it is sent to the client. + # + # To parse .shtml files for server-side includes (SSI): + # (You will also need to add "Includes" to the "Options" directive.) + # + #AddType text/html .shtml + #AddOutputFilter INCLUDES .shtml + + +# +# The mod_mime_magic module allows the server to use various hints from the +# contents of the file itself to determine its type. The MIMEMagicFile +# directive tells the module where the hint definitions are located. +# +#MIMEMagicFile conf/magic + +# +# Customizable error responses come in three flavors: +# 1) plain text 2) local redirects 3) external redirects +# +# Some examples: +#ErrorDocument 500 "The server made a boo boo." +#ErrorDocument 404 /missing.html +#ErrorDocument 404 "/cgi-bin/missing_handler.pl" +#ErrorDocument 402 http://localhost/subscription_info.html +# + +# +# EnableMMAP and EnableSendfile: On systems that support it, +# memory-mapping or the sendfile syscall is used to deliver +# files. This usually improves server performance, but must +# be turned off when serving from networked-mounted +# filesystems or if support for these functions is otherwise +# broken on your system. +# +#EnableMMAP off +#EnableSendfile off + +# Supplemental configuration +# +# The configuration files in the conf/extra/ directory can be +# included to add extra features or to modify the default configuration of +# the server, or you may simply copy their contents here and change as +# necessary. + +# Server-pool management (MPM specific) +#Include conf/extra/httpd-mpm.conf + +# Multi-language error messages +#Include conf/extra/httpd-multilang-errordoc.conf + +# Fancy directory listings +Include conf/extra/httpd-autoindex.conf + +# Language settings +#Include conf/extra/httpd-languages.conf + +# User home directories +#Include conf/extra/httpd-userdir.conf + +# Real-time info on requests and configuration +#Include conf/extra/httpd-info.conf + +# Virtual hosts +#Include conf/extra/httpd-vhosts.conf + +# Local access to the Apache HTTP Server Manual +#Include conf/extra/httpd-manual.conf + +# Distributed authoring and versioning (WebDAV) +#Include conf/extra/httpd-dav.conf + +# Various default settings +#Include conf/extra/httpd-default.conf + + + +# Secure (SSL/TLS) connections +# +# Note: The following must must be present to support +# starting without SSL on platforms with no /dev/random equivalent +# but a statically compiled-in mod_ssl. +# + + + +SSLRandomSeed startup builtin +SSLRandomSeed connect builtin + +Listen WAMPAPACHEPSSL + +## +## SSL Global Context +## +## All SSL configuration in this context applies both to +## the main server and all SSL-enabled virtual hosts. +## + +# +# Some MIME-types for downloading Certificates and CRLs +# +AddType application/x-x509-ca-cert .crt +AddType application/x-pkcs7-crl .crl + +# Pass Phrase Dialog: +# Configure the pass phrase gathering process. +# The filtering dialog program (`builtin' is a internal +# terminal dialog) has to provide the pass phrase on stdout. +#SSLPassPhraseDialog builtin + +# Inter-Process Session Cache: +# Configure the SSL Session Cache: First the mechanism +# to use and second the expiring timeout (in seconds). +#SSLSessionCache "dbm:C:/Program Files/Apache Software Foundation/Apache2.2/logs/ssl_scache" +#SSLSessionCache "shmcb:C:/Program Files/Apache Software Foundation/Apache2.2/logs/ssl_scache(512000)" +#SSLSessionCacheTimeout 300 + +# Semaphore: +# Configure the path to the mutual exclusion semaphore the +# SSL engine uses internally for inter-process synchronization. +#SSLMutex "file:C:/Program Files/Apache Software Foundation/Apache2.2/logs/ssl_mutex" + +## +## SSL Virtual Host Context +## + + + +# SSL Engine Switch: +# Enable/Disable SSL for this virtual host. +SSLEngine on + +# General setup for the virtual host +DocumentRoot "WAMPROOT/www/" +ServerName localhost +ServerAdmin admin@localhost +ErrorLog "WAMPROOT/logs/apache_error_ssl.log" +TransferLog "WAMPROOT/logs/apache_transfer_ssl.log" +CustomLog "WAMPROOT/logs/apache_access_ssl.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" + +# SSL Cipher Suite: +# List the ciphers that the client is permitted to negotiate. +# See the mod_ssl documentation for a complete list. +#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL + +# Server Certificate: +# Point SSLCertificateFile at a PEM encoded certificate. If +# the certificate is encrypted, then you will be prompted for a +# pass phrase. Note that a kill -HUP will prompt again. Keep +# in mind that if you have both an RSA and a DSA certificate you +# can configure both in parallel (to also allow the use of DSA +# ciphers, etc.) +SSLCertificateFile "WAMPROOT/myserver.crt" + +# Server Private Key: +# If the key is not combined with the certificate, use this +# directive to point at the key file. Keep in mind that if +# you've both a RSA and a DSA private key you can configure +# both in parallel (to also allow the use of DSA ciphers, etc.) +SSLCertificateKeyFile "WAMPROOT/myserver.key" + +# Server Certificate Chain: +# Point SSLCertificateChainFile at a file containing the +# concatenation of PEM encoded CA certificates which form the +# certificate chain for the server certificate. Alternatively +# the referenced file can be the same as SSLCertificateFile +# when the CA certificates are directly appended to the server +# certificate for convinience. +#SSLCertificateChainFile "WAMPROOT/server-ca.crt" + +# Certificate Authority (CA): +# Set the CA certificate verification path where to find CA +# certificates for client authentication or alternatively one +# huge file containing all of them (file must be PEM encoded) +# Note: Inside SSLCACertificatePath you need hash symlinks +# to point to the certificate files. Use the provided +# Makefile to update the hash symlinks after changes. +#SSLCACertificatePath "WAMPROOT/ssl.crt" +#SSLCACertificateFile "WAMPROOT/ca-bundle.crt" + +# Certificate Revocation Lists (CRL): +# Set the CA revocation path where to find CA CRLs for client +# authentication or alternatively one huge file containing all +# of them (file must be PEM encoded) +# Note: Inside SSLCARevocationPath you need hash symlinks +# to point to the certificate files. Use the provided +# Makefile to update the hash symlinks after changes. +#SSLCARevocationPath "WAMPROOT/ssl.crl" +#SSLCARevocationFile "WAMPROOT/ca-bundle.crl" + +# Client Authentication (Type): +# Client certificate verification type and depth. Types are +# none, optional, require and optional_no_ca. Depth is a +# number which specifies how deeply to verify the certificate +# issuer chain before deciding the certificate is not valid. +#SSLVerifyClient require +#SSLVerifyDepth 10 + +# Access Control: +# With SSLRequire you can do per-directory access control based +# on arbitrary complex boolean expressions containing server +# variable checks and other lookup directives. The syntax is a +# mixture between C and Perl. See the mod_ssl documentation +# for more details. +# +#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ +# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \ +# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \ +# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \ +# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \ +# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/ +# + +# SSL Engine Options: +# Set various options for the SSL engine. +# o FakeBasicAuth: +# Translate the client X.509 into a Basic Authorisation. This means that +# the standard Auth/DBMAuth methods can be used for access control. The +# user name is the `one line' version of the client's X.509 certificate. +# Note that no password is obtained from the user. Every entry in the user +# file needs this password: `xxj31ZMTZzkVA'. +# o ExportCertData: +# This exports two additional environment variables: SSL_CLIENT_CERT and +# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the +# server (always existing) and the client (only existing when client +# authentication is used). This can be used to import the certificates +# into CGI scripts. +# o StdEnvVars: +# This exports the standard SSL/TLS related `SSL_*' environment variables. +# Per default this exportation is switched off for performance reasons, +# because the extraction step is an expensive operation and is usually +# useless for serving static content. So one usually enables the +# exportation for CGI and SSI requests only. +# o StrictRequire: +# This denies access when "SSLRequireSSL" or "SSLRequire" applied even +# under a "Satisfy any" situation, i.e. when it applies access is denied +# and no other module can change it. +# o OptRenegotiate: +# This enables optimized SSL connection renegotiation handling when SSL +# directives are used in per-directory context. +#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire +# +# SSLOptions +StdEnvVars +# +# +# SSLOptions +StdEnvVars +# + +# SSL Protocol Adjustments: +# The safe and default but still SSL/TLS standard compliant shutdown +# approach is that mod_ssl sends the close notify alert but doesn't wait for +# the close notify alert from client. When you need a different shutdown +# approach you can use one of the following variables: +# o ssl-unclean-shutdown: +# This forces an unclean shutdown when the connection is closed, i.e. no +# SSL close notify alert is send or allowed to received. This violates +# the SSL/TLS standard but is needed for some brain-dead browsers. Use +# this when you receive I/O errors because of the standard approach where +# mod_ssl sends the close notify alert. +# o ssl-accurate-shutdown: +# This forces an accurate shutdown when the connection is closed, i.e. a +# SSL close notify alert is send and mod_ssl waits for the close notify +# alert of the client. This is 100% SSL/TLS standard compliant, but in +# practice often causes hanging connections with brain-dead browsers. Use +# this only for browsers where you know that their SSL implementation +# works correctly. +# Notice: Most problems of broken clients are also related to the HTTP +# keep-alive facility, so you usually additionally want to disable +# keep-alive for those clients, too. Use variable "nokeepalive" for this. +# Similarly, one has to force some clients to use HTTP/1.0 to workaround +# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and +# "force-response-1.0" for this. +#BrowserMatch ".*MSIE.*" \ +# nokeepalive ssl-unclean-shutdown \ +# downgrade-1.0 force-response-1.0 + + + + + + + +# OPTIMIZE: To use gzip compression (for already compressed files). +# Note that constant MAIN_OPTIMIZE_SPEED must have a value with bit 0 set. +#AddType text/javascript .jgz +#AddEncoding gzip .jgz + +# OPTIMIZE: To use gzip compression (on the fly). +# Note that you must also enable the module mod_deflate. +# You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set. +#TODO + +# OPTIMIZE: To use cache on static pages (A259200 = 1 month). +# Note that you must also enable the module mod_expires. +#ExpiresActive On +#ExpiresByType image/x-icon A2592000 +#ExpiresByType image/gif A2592000 +#ExpiresByType image/png A2592000 +#ExpiresByType image/jpeg A2592000 +#ExpiresByType text/css A2592000 +#ExpiresByType text/javascript A2592000 +#ExpiresByType application/x-javascript A2592000 +#ExpiresByType application/javascript A2592000 + + +# Declare alias for Dolibarr, PHPMyAdmin and other softwares +Include "WAMPROOT/alias/*.conf" diff --git a/build/exe/doliwamp/php.ini.install b/build/exe/doliwamp/php.ini.install index 5b1c898eea1..46e4dc685b7 100644 --- a/build/exe/doliwamp/php.ini.install +++ b/build/exe/doliwamp/php.ini.install @@ -603,7 +603,7 @@ upload_max_filesize = 2M ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -allow_url_fopen = Off +allow_url_fopen = On ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. allow_url_include = Off diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 5cff1442a89..55de5abffb4 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -349,8 +349,9 @@ if ($nboftargetok) { mkdir "$BUILDROOT/$PROJECT"; print "Copy $SOURCE into $BUILDROOT/$PROJECT\n"; $ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`; - #print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n"; - #$ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`; + + print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n"; + $ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`; } print "Clean $BUILDROOT\n"; $ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`; @@ -441,8 +442,8 @@ if ($nboftargetok) { $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/_source`; # Keep this removal in case we embed libraries - $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/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 -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; @@ -504,15 +505,17 @@ if ($nboftargetok) { $cmd="cp -pr \"$BUILDROOT/$PROJECT/\" \"$BUILDROOT/$FILENAMETGZ\""; $ret=`$cmd`; - $ret=`rm -fr $BUILDROOT/$PROJECT/build/exe`; - + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`; + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages + print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n"; - $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" $FILENAMETGZ"; + $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ"; + print "$cmd\n"; $ret=`$cmd`; # Move to final dir - print "Move $FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n"; - $ret=`mv "$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`; + print "Move $BUILDROOT/$FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n"; + $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`; next; } @@ -531,6 +534,9 @@ if ($nboftargetok) { $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEXZ\""; $ret=`$cmd`; + $ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`; + $ret=`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages + print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n"; print "Go to directory $BUILDROOT\n"; @@ -562,6 +568,9 @@ if ($nboftargetok) { $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEZIP\""; $ret=`$cmd`; + $ret=`rm -fr $BUILDROOT/$FILENAMEZIP/build/exe`; + $ret=`rm -fr $BUILDROOT/$FILENAMEZIP/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages + print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n"; print "Go to directory $BUILDROOT\n"; @@ -687,8 +696,8 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\""; $ret=`$cmd`; - #$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/debian/apache/.htaccess\" \"$BUILDROOT/$PROJECT.tmp/build/debian/apache/.htaccess\""; - #$ret=`$cmd`; + $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/debian/apache/.htaccess\" \"$BUILDROOT/$PROJECT.tmp/build/debian/apache/.htaccess\""; + $ret=`$cmd`; print "Remove other files\n"; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`; @@ -748,9 +757,9 @@ if ($nboftargetok) { $ret=`cp -fr "$SOURCE/build/debian/patches" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -fr "$SOURCE/build/debian/po" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -fr "$SOURCE/build/debian/source" "$BUILDROOT/$PROJECT.tmp/debian"`; - #$ret=`cp -fr "$SOURCE/build/debian/apache" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; - #$ret=`cp -f "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; - #$ret=`cp -fr "$SOURCE/build/debian/lighttpd" "$BUILDROOT/$PROJECT.tmp/debian/lighttpd"`; + $ret=`cp -fr "$SOURCE/build/debian/apache" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; + $ret=`cp -f "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; + $ret=`cp -fr "$SOURCE/build/debian/lighttpd" "$BUILDROOT/$PROJECT.tmp/debian/lighttpd"`; # Add files also required to build binary package $ret=`cp -f "$SOURCE/build/debian/dolibarr.config" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/dolibarr.postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; @@ -948,12 +957,15 @@ if ($nboftargetok) { "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', "$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM' ); + use POSIX qw/strftime/; foreach my $file (sort keys %filestoscan) { $found=0; my $filesize = -s $file; + my $filedate = (stat $file)[9]; print $file." ".($filesize?"(found)":"(not found)"); print ($filesize?" - ".$filesize:""); + print ($filedate?" - ".strftime("%Y-%m-%d %H:%M:%S",localtime($filedate)):""); print "\n"; } diff --git a/build/makepack-dolibarrmodule.pl b/build/makepack-dolibarrmodule.pl index a4b51e9bf8f..62002fd063b 100755 --- a/build/makepack-dolibarrmodule.pl +++ b/build/makepack-dolibarrmodule.pl @@ -2,13 +2,15 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarrmodule.pl # \brief Package builder (tgz, zip, rpm, deb, exe) -# \author (c)2005-2006 Laurent Destailleur +# \author (c)2005-2014 Laurent Destailleur #---------------------------------------------------------------------------- use Cwd; +$OWNER="ldestailleur"; +$GROUP="ldestailleur"; -@LISTETARGET=("TGZ"); # Possible packages +@LISTETARGET=("ZIP"); # Possible packages %REQUIREMENTTARGET=( # Tool requirement for each package "TGZ"=>"tar", "ZIP"=>"7z" @@ -18,8 +20,8 @@ use Cwd; use vars qw/ $REVISION $VERSION /; -$REVISION='1.20'; -$VERSION="1.0 (build $REVISION)"; +$REVISION='1.0'; +$VERSION="3.5 (build $REVISION)"; @@ -35,9 +37,9 @@ if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS=' elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; } elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; } if (! $OS) { - print "makepack-dolbarrmodule.pl was not able to detect your OS.\n"; + print "$PROG.$Extension was not able to detect your OS.\n"; print "Can't continue.\n"; - print "makepack-dolibarrmodule.pl aborted.\n"; + print "$PROG.$Extension aborted.\n"; sleep 2; exit 1; } @@ -57,7 +59,7 @@ if ($OS =~ /windows/) { if (! $TEMP || ! -d $TEMP) { print "Error: A temporary directory can not be find.\n"; print "Check that TEMP or TMP environment variable is set correctly.\n"; - print "makepack-dolibarrmodule.pl aborted.\n"; + print "$PROG.$Extension aborted.\n"; sleep 2; exit 2; } @@ -86,18 +88,6 @@ print "Source directory: $SOURCE\n"; print "Target directory: $NEWDESTI\n"; -# Ask and set version $MAJOR, $MINOR and $BUILD -print "Enter value for version: "; -$PROJVERSION=; -chomp($PROJVERSION); -($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3); -if ($MINOR eq '') -{ - print "Enter value for minor version: "; - $MINOR=; - chomp($MINOR); -} - # Ask module print "Enter name for your module (mymodule, mywonderfulmondule, ... or 'all') : "; $PROJECTINPUT=; @@ -128,6 +118,8 @@ else # Loop on each projects foreach my $PROJECT (@PROJECTLIST) { + $PROJECTLC=lc($PROJECT); + if (! -f "makepack-".$PROJECT.".conf") { print "Error: can't open conf file makepack-".$PROJECT.".conf\n"; @@ -139,9 +131,28 @@ foreach my $PROJECT (@PROJECTLIST) { exit 2; } - $FILENAME="$PROJECT"; - $FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":""); - $FILENAMEZIP="module_$PROJECT-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":""); + # Get version $MAJOR, $MINOR and $BUILD + print "Version detected for module ".$PROJECT.": "; + $result=open(IN,"<".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php"); + if (! $result) { die "Error: Can't open descriptor file ".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php for reading.\n"; } + while() + { + if ($_ =~ /this->version\s*=\s*'([\d\.]+)'/) { $PROJVERSION=$1; break; } + } + close IN; + print $PROJVERSION."\n"; + + ($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3); + if ($MINOR eq '') + { + print "Enter value for minor version for module ".$PROJECT.": "; + $MINOR=; + chomp($MINOR); + } + + $FILENAME="$PROJECTLC"; + $FILENAMETGZ="module_$PROJECTLC-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":""); + $FILENAMEZIP="module_$PROJECTLC-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":""); if (-d "/usr/src/redhat") { # redhat $RPMDIR="/usr/src/redhat"; @@ -228,54 +239,66 @@ foreach my $PROJECT (@PROJECTLIST) { $ret=`rm -fr "$BUILDROOT"`; mkdir "$BUILDROOT"; - mkdir "$BUILDROOT/$PROJECT"; + mkdir "$BUILDROOT/$PROJECTLC"; $result=open(IN,") { - if ($_ =~ /^#/) { next; } # Do not process comments + $entry=$_; + + if ($entry =~ /^#/) { next; } # Do not process comments - $_ =~ s/\n//; - $_ =~ /^(.*)\/[^\/]+/; - print "Create directory $BUILDROOT/$PROJECT/$1\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT/$1"`; - if ($_ !~ /version\-/) + $entry =~ s/\n//; + + if ($entry =~ /^!(.*)$/) # Exclude so remove file/dir { - print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECT/$_\n"; - $ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECT/$_"`; + print "Remove $BUILDROOT/$PROJECTLC/$1\n"; + $ret=`rm -fr "$BUILDROOT/$PROJECTLC/"$1`; + if ($? != 0) { die "Failed to delete a file to exclude declared into makepack-".$PROJECT.".conf file (Fails on line ".$entry.")\n"; } + next; } + + $entry =~ /^(.*)\/[^\/]+/; + print "Create directory $BUILDROOT/$PROJECTLC/$1\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECTLC/$1"`; + if ($entry !~ /version\-/) + { + print "Copy $SOURCE/$entry into $BUILDROOT/$PROJECTLC/$entry\n"; + $ret=`cp -pr "$SOURCE/$entry" "$BUILDROOT/$PROJECTLC/$entry"`; + if ($? != 0) { die "Failed to make copy of a file declared into makepack-".$PROJECT.".conf file (Fails on line ".$entry.")\n"; } + } + } close IN; @timearray=localtime(time()); $fulldate=($timearray[5]+1900).'-'.($timearray[4]+1).'-'.$timearray[3].' '.$timearray[2].':'.$timearray[1]; - open(VF,">$BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt"); + open(VF,">$BUILDROOT/$PROJECTLC/build/version-".$PROJECTLC.".txt"); - print "Create version file $BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt with date ".$fulldate."\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT/build"`; + print "Create version file $BUILDROOT/$PROJECTLC/build/version-".$PROJECTLC.".txt with date ".$fulldate."\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECTLC/build"`; print VF "Version: ".$MAJOR.".".$MINOR.($BUILD ne ''?".$BUILD":"")."\n"; print VF "Build : ".$fulldate."\n"; close VF; } print "Clean $BUILDROOT\n"; - $ret=`rm -fr $BUILDROOT/$PROJECT/.cache`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.project`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.settings`; - $ret=`rm -fr $BUILDROOT/$PROJECT/index.php`; - $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`; - $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; - $ret=`rm -fr $BUILDROOT/$PROJECT/document`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom2`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/bureau2crea`; - $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 -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/.cache`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/.project`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/.settings`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/index.php`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/build/html`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/documents`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/document`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.mysql`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.old`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.postgres`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf*sav*`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom2`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/test`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/Thumbs.db $BUILDROOT/$PROJECTLC/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/*/Thumbs.db`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/CVS* $BUILDROOT/$PROJECTLC/*/CVS* $BUILDROOT/$PROJECTLC/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/*/CVS*`; } # Build package for each target @@ -313,9 +336,9 @@ foreach my $PROJECT (@PROJECTLIST) { unlink "$NEWDESTI/$FILENAMEZIP.zip"; print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n"; - print "Go to directory $BUILDROOT/$PROJECT\n"; + print "Go to directory $BUILDROOT/$PROJECTLC\n"; $olddir=getcwd(); - chdir("$BUILDROOT/$PROJECT"); + chdir("$BUILDROOT/$PROJECTLC"); $cmd= "7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip *"; print $cmd."\n"; $ret= `$cmd`; @@ -323,6 +346,7 @@ foreach my $PROJECT (@PROJECTLIST) { print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n"; $ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`; + $ret=`chown $OWNER.$GROUP "$NEWDESTI/$FILENAMEZIP.zip"`; next; } diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 5a130227945..7ab0da72138 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -10,18 +10,17 @@ beta version of Dolibarr, step by step. - Check all files are commited. - Update version/info in /ChangeLog - Update version number with x.y.z-w in htdocs/filefunc.inc.php -- Update version number with x.y.z-w in build/makepack-dolibarr.pl - Update version number with x.y.z-w in build/debian/changelog - Update version number with x.y.z-w in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z-w in build/rpm/*.spec -- Update version number with x.y.z in build/doxygen/dolibarr-doxygen.doxyfile -- Update version number with x.y.z in build/perl/virtualmin/dolibarr.pl +- Update version number with x.y in build/doxygen/dolibarr-doxygen.doxyfile - Commit all changes. - Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags - Create a branch (x.y). - Run makepack-dolibarr.pl to generate all packages. -- Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files). +- Move build files into www.dolibarr.org web site + (/home/dolibarr/wwwroot/files/lastbuild). - Post a news on dolibarr.org/dolibarr.fr - Send mail on mailings-list @@ -34,21 +33,20 @@ complete release of Dolibarr, step by step. - Check all files are commited. - Update version/info in ChangeLog - Update version number with x.y.z in htdocs/filefunc.inc.php -- Update version number with x.y.z in build/makepack-dolibarr.pl - Update version number with x.y.z in build/debian/changelog - Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z in build/rpm/*.spec -- Update PAD files. - Commit all changes. - Add a Tag (x.y.z) - Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl - Check content of built packages. -- Move build files (tgz+exe+deb+rpm...), ChangeLog and PAD files - into www.dolibarr.org web site (/home/dolibarr/wwwroot/files). -- Edit symbolic links in directory "/home/dolibarr/wwwroot/files" on server to - point to new files (used by PAD descriptor). -- Upload files dolibarr.*.tgz and doliwamp.*.exe on sourceforge. +- Move build files into www.dolibarr.org web site + (/home/dolibarr/wwwroot/files/stable). +- Run makepack-dolibarr.pl again with option to publish files on + sourceforge. +- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx" + on server to point to new files (used by some web sites). - Send mail on mailings-list - Send news on OpenSource web sites (if major beta or release) diff --git a/build/obs/README b/build/obs/README index 8b3ea336dc1..5f8f0014d8a 100644 --- a/build/obs/README +++ b/build/obs/README @@ -23,13 +23,23 @@ To submit a snapshot for building, we should have a service file with content www.dolibarr.org http - /files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm + /files/stable/package_rpm_generic/dolibarr-x.y.z-3.src.rpm -How to have such a service ? -Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm +How to have such a service file created automatically ? +Click on "Add file", then select mode "Upload From: Remote URL" +Enter the Remote URL that should looks like this: http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-3.src.rpm Then add into advanded - attributes -OBS:Screenshots http://www.dolibarr.org/images/phocagallery/dolibarr_screenshot1.png -OBS:QualityCategory Testing \ No newline at end of file +OBS:Screenshots http://www.dolibarr.org/images/dolibarr_screenshot1.png +OBS:QualityCategory Testing + + +# Move project into official directory +- Enter a bug to ask to be a maintener of a category or to add a new one. +For example: https://bugzilla.novell.com/show_bug.cgi?id=848083 to be a maintener of category +https://build.opensuse.org/project/show/Application:ERP +- Once done, go into project, category, subproject and enter a subproject for your application. +Fo example: Dolibarr +- Then go onto project into your home and ask a publish to the category/you project your created. diff --git a/build/pad/DoliWamp.pml b/build/pad/DoliWamp.pml index dcd0c444792..9209bdbe061 100644 --- a/build/pad/DoliWamp.pml +++ b/build/pad/DoliWamp.pml @@ -4,10 +4,10 @@ DoliWamp - 3.3.0 - 08 - 10 - 2012 + 3.5.0 + 01 + 01 + 2014 diff --git a/build/pad/Dolibarr developpers.cml b/build/pad/Dolibarr developpers.cml index 06be3b4770f..55eae1473f9 100644 --- a/build/pad/Dolibarr developpers.cml +++ b/build/pad/Dolibarr developpers.cml @@ -1,31 +1,31 @@ - - - PADGen 3.1.1.47 - - Dolibarr team - 11 rue raymond Queneau - - Rueil Malmaison - - 92500 - FRANCE - http://www.dolibarr.org - - Dolibarr team - Dolibarr team - dolibarr-dev@nongnu.org - Dolibarr team - Dolibarr team - dolibarr-dev@nongnu.org - - - dolibarr-dev@nongnu.org - dolibarr-dev@nongnu.org - dolibarr-dev@nongnu.org - - - - - - - + + + PADGen 3.1.1.47 + + Dolibarr team + 11 rue raymond Queneau + + Rueil Malmaison + + 92500 + FRANCE + http://www.dolibarr.org + + Dolibarr team + Dolibarr team + dolibarr-dev@nongnu.org + Dolibarr team + Dolibarr team + dolibarr-dev@nongnu.org + + + dolibarr-dev@nongnu.org + dolibarr-dev@nongnu.org + dolibarr-dev@nongnu.org + + + + + + + diff --git a/build/pad/Dolibarr.pml b/build/pad/Dolibarr.pml index ae62df0dfe3..6dafb6b0d7d 100644 --- a/build/pad/Dolibarr.pml +++ b/build/pad/Dolibarr.pml @@ -4,10 +4,10 @@ Dolibarr - 3.3.0 - 08 - 10 - 2012 + 3.5.0 + 01 + 01 + 2014 diff --git a/build/pad/NLTechno.cml b/build/pad/NLTechno.cml index 459e4bc9bef..7c039a2de43 100644 --- a/build/pad/NLTechno.cml +++ b/build/pad/NLTechno.cml @@ -1,31 +1,31 @@ - - - PADGen 3.1.1.47 - - NLTechno - 11 Rue raymond Queneau - - Rueil Malmaison - - 92500 - FRANCE - http://www.nltechno.com - - NLTechno - NLTechno - dolibarr@nltechno.com - NLTechno - NLTechno - dolibarr@nltechno.com - - - dolibarr@nltechno.com - dolibarr@nltechno.com - dolibarr@nltechno.com - - - - - - - + + + PADGen 3.1.1.47 + + NLTechno + 11 Rue raymond Queneau + + Rueil Malmaison + + 92500 + FRANCE + http://www.nltechno.com + + NLTechno + NLTechno + dolibarr@nltechno.com + NLTechno + NLTechno + dolibarr@nltechno.com + + + dolibarr@nltechno.com + dolibarr@nltechno.com + dolibarr@nltechno.com + + + + + + + diff --git a/build/pad/pad_dolibarr.xml b/build/pad/pad_dolibarr.xml index 37f4d4abd6f..0f09644cb9a 100644 --- a/build/pad/pad_dolibarr.xml +++ b/build/pad/pad_dolibarr.xml @@ -34,7 +34,7 @@ Dolibarr - 3.4 + 3.5 01 01 2014 diff --git a/build/pad/pad_doliwamp.xml b/build/pad/pad_doliwamp.xml index cd3d2facf5e..0da0b189113 100644 --- a/build/pad/pad_doliwamp.xml +++ b/build/pad/pad_doliwamp.xml @@ -17,15 +17,15 @@ NLTechno NLTechno - dolibarr@nltechno.com + contact@nltechno.com NLTechno NLTechno - dolibarr@nltechno.com + contact@nltechno.com - dolibarr@nltechno.com - dolibarr@nltechno.com - dolibarr@nltechno.com + support@nltechno.com + support@nltechno.com + support@nltechno.com @@ -34,7 +34,7 @@ DoliWamp - 3.4 + 3.5 01 01 2014 diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index c0884a5cd13..dceb3c20898 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); +return ( "3.5.3", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); } sub script_dolibarr_category diff --git a/build/rpm/README b/build/rpm/README index ffdb6d24a53..99f871e882a 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -19,8 +19,8 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...). # # On Fedora # rpm -i --test dolibarr-...rpm To list dependencies of RPM -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum -v install dolibarr-...rpm To install package and dependencies +# yum -v erase dolibarr To remove package # chcon -R -h -t httpd_sys_script_rw_t /file To add temporary context rw for httpd on /file # semanage fcontext -a -t httpd_sys_script_rw_t "/dir/(.*)?" To add persistent context rw for httpd on /dir (this add file_contexts.local) # restorecon -R -v /file Restore values into files (cancel chcon, validate semanage) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index c1c70d0acea..92b097801b4 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -103,6 +103,7 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz %{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name} %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts @@ -117,9 +118,9 @@ do lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`; echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang if [ "$lang1" = "$lang2" ] ; then - echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" else - echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" fi done >>%{name}.lang @@ -238,20 +239,20 @@ echo Create document directory $docdir export config=%{_sysconfdir}/dolibarr/conf.php if [ -s $config ] && grep -q "File generated by" $config then - # File already exist. We add params not found. - echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config - grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config - grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config - #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + # File already exist. We add params not found. + echo Add new params to overwrite path to use shared libraries/fonts + grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config + grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config + grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config + #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config fi # Create config for SE Linux @@ -264,13 +265,13 @@ restorecon -R -v /var/lib/dolibarr # Create a config link dolibarr.conf if [ ! -L $apachelink ]; then - apachelinkdir=`dirname $apachelink` - if [ -d $apachelinkdir ]; then - echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink - ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink - else - echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed - fi + apachelinkdir=`dirname $apachelink` + if [ -d $apachelinkdir ]; then + echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink + ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink + else + echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed + fi fi echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr @@ -302,33 +303,48 @@ echo if [ "x$1" = "x0" ] ; then - # Remove - echo "Removed package" + # Remove + echo "Removed package" - # Define vars - export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - - # Remove apache link - if [ -L $apachelink ] ; - then - echo "Delete apache config link for Dolibarr ($apachelink)" - %{__rm} -f $apachelink - status=purge - fi - - # Restart web servers if required - if [ "x$status" = "xpurge" ] ; - then - # Restart web server - echo Restart web server - /sbin/service httpd restart - fi + # Define vars + export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + + # Remove apache link + if [ -L $apachelink ] ; + then + echo "Delete apache config link for Dolibarr ($apachelink)" + %{__rm} -f $apachelink + status=purge + fi + + # Restart web servers if required + if [ "x$status" = "xpurge" ] ; + then + # Restart web server + echo Restart web server + /sbin/service httpd restart + fi else - # Upgrade - echo "No remove ation done (this is an upgrade)" + # Upgrade + echo "No remove action done (this is an upgrade)" 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 -* Mon Dec 30 2013 Laurent Destailleur 3.4.2-0.3 +* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 +- Upstream release + +* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 +- Upstream release + +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + +* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index ba5daf1aad0..b2b7e745b34 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -166,6 +166,7 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz %{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name} %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap @@ -190,9 +191,9 @@ do lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`; echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang if [ "$lang1" = "$lang2" ] ; then - echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" else - echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" fi done >>%{name}.lang @@ -305,6 +306,11 @@ done >>%{name}.lang %post echo Run post script of packager dolibarr_generic.spec +echo Detected constant fedora=0%{?fedora} +echo Detected constant rhel_version=0%{?rhel_version} +echo Detected constant centos_version=0%{?centos_version} +echo Detected constant mdkversion=0%{?mdkversion} +echo Detected constant suse_version=0%{?suse_version} # Define vars export docdir="/var/lib/dolibarr/documents" @@ -323,28 +329,28 @@ export installconfig="%{_sysconfdir}/dolibarr/install.forced.php" # Detect OS os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; + export os='fedora-redhat'; + export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; + export os='opensuse'; + export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; + export os='mageia-mandriva'; + export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; + export os='ubuntu-debian'; + export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; fi echo OS detected: $os %endif @@ -363,16 +369,16 @@ echo Create document directory $docdir # Create install.forced.php into Dolibarr install directory if [ "x$os" = "xubuntu-debian" ] then - superuserlogin='' - superuserpassword='' - if [ -f %{_sysconfdir}/mysql/debian.cnf ] ; then - # Load superuser login and pass - superuserlogin=$(/bin/grep --max-count=1 "user" %{_sysconfdir}/mysql/debian.cnf | /bin/sed -e 's/^user[ =]*//g') - superuserpassword=$(/bin/grep --max-count=1 "password" %{_sysconfdir}/mysql/debian.cnf | /bin/sed -e 's/^password[ =]*//g') - fi - echo Mysql superuser found to use is $superuserlogin - %{__cat} /usr/share/dolibarr/build/rpm/install.forced.php.generic | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $installconfig - %{__chmod} -R 660 $installconfig + superuserlogin='' + superuserpassword='' + if [ -f %{_sysconfdir}/mysql/debian.cnf ] ; then + # Load superuser login and pass + superuserlogin=$(/bin/grep --max-count=1 "user" %{_sysconfdir}/mysql/debian.cnf | /bin/sed -e 's/^user[ =]*//g') + superuserpassword=$(/bin/grep --max-count=1 "password" %{_sysconfdir}/mysql/debian.cnf | /bin/sed -e 's/^password[ =]*//g') + fi + echo Mysql superuser found to use is $superuserlogin + %{__cat} /usr/share/dolibarr/build/rpm/install.forced.php.generic | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $installconfig + %{__chmod} -R 660 $installconfig fi %endif @@ -383,29 +389,29 @@ fi export config=%{_sysconfdir}/dolibarr/conf.php if [ -s $config ] && grep -q "File generated by" $config then - # File already exist. We add params not found. - echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config - grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config - grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config - #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config + # File already exist. We add params not found. + echo Add new params to overwrite path to use shared libraries/fonts + grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config + grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config + grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config + #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config %else %if 0%{?mdkversion} - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config %else %if 0%{?suse_version} - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config %else - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config %endif %endif %endif @@ -418,12 +424,12 @@ if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then %endif %if 0%{?mdkversion} || 0%{?suse_version} %else - echo Add SE Linux permissions for dolibarr - # semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local - semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)" - semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)" - restorecon -R -v /etc/dolibarr - restorecon -R -v /var/lib/dolibarr + echo Add SE Linux permissions for dolibarr + # semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local + semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)" + semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)" + restorecon -R -v /etc/dolibarr + restorecon -R -v /var/lib/dolibarr %endif %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version} %else @@ -432,13 +438,13 @@ fi # Create a config link dolibarr.conf if [ ! -L $apachelink ]; then - apachelinkdir=`dirname $apachelink` - if [ -d $apachelinkdir ]; then - echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink - ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink - else - echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed - fi + apachelinkdir=`dirname $apachelink` + if [ -d $apachelinkdir ]; then + echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink + ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink + else + echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed + fi fi echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr @@ -451,30 +457,33 @@ echo Restart web server /sbin/service httpd restart %else if [ -f %{_sysconfdir}/init.d/httpd ]; then - %{_sysconfdir}/init.d/httpd restart + %{_sysconfdir}/init.d/httpd restart fi if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart + %{_sysconfdir}/init.d/apache2 restart fi %endif # Restart mysql server echo Restart mysql server %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} - /sbin/service mysqld restart + /sbin/service mysqld restart %else %if 0%{?suse_version} if [ -f /etc/init.d/mysqld ]; then - /etc/init.d/mysqld restart -else - /sbin/service mysql restart + /sbin/service mysqld restart + #/etc/init.d/mysqld restart +fi +if [ -f /etc/init.d/mysql ]; then + /sbin/service mysql restart + #/etc/init.d/mysql restart fi %else if [ -f /etc/init.d/mysqld ]; then - /etc/init.d/mysqld restart + /etc/init.d/mysqld restart fi if [ -f /etc/init.d/mysql ]; then - /etc/init.d/mysql restart + /etc/init.d/mysql restart fi %endif %endif @@ -497,66 +506,81 @@ echo if [ "x$1" = "x0" ] ; then - # Remove - echo "Removed package" + # Remove + echo "Removed package" - # Define vars - os='unknown'; - %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} - export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - %else - %if 0%{?suse_version} - export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - %else - if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - fi - if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - fi - if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - fi - if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - fi - %endif - %endif - - # Remove apache link - if [ -L $apachelink ] ; - then - echo "Delete apache config link for Dolibarr ($apachelink)" - %{__rm} -f $apachelink - status=purge - fi - - # Restart web servers if required - if [ "x$status" = "xpurge" ] ; - then - # Restart web server - echo Restart web server - %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} - /sbin/service httpd restart - %else - if [ -f %{_sysconfdir}/init.d/httpd ]; then - %{_sysconfdir}/init.d/httpd restart - fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi - %endif - fi + # Define vars + os='unknown'; + %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} + export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + %else + %if 0%{?suse_version} + export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + %else + if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora-redhat'; + export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + fi + if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then + export os='opensuse'; + export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + fi + if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + fi + if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then + export os='ubuntu-debian'; + export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + fi + %endif + %endif + + # Remove apache link + if [ -L $apachelink ] ; + then + echo "Delete apache config link for Dolibarr ($apachelink)" + %{__rm} -f $apachelink + status=purge + fi + + # Restart web servers if required + if [ "x$status" = "xpurge" ] ; + then + # Restart web server + echo Restart web server + %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} + /sbin/service httpd restart + %else + if [ -f %{_sysconfdir}/init.d/httpd ]; then + %{_sysconfdir}/init.d/httpd restart + fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi + %endif + fi else - # Upgrade - echo "No remove ation done (this is an upgrade)" + # Upgrade + echo "No remove action done (this is an upgrade)" 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 -* Mon Dec 30 2013 Laurent Destailleur 3.4.2-0.3 +* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 +- Upstream release + +* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 +- Upstream release + +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + +* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 0c68270166e..658601980f7 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -102,6 +102,7 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz %{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name} %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts # Lang @@ -114,9 +115,9 @@ do lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`; echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang if [ "$lang1" = "$lang2" ] ; then - echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" else - echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" fi done >>%{name}.lang @@ -235,31 +236,31 @@ echo Create document directory $docdir export config=%{_sysconfdir}/dolibarr/conf.php if [ -s $config ] && grep -q "File generated by" $config then - # File already exist. We add params not found. - echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config - grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config - grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config - #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + # File already exist. We add params not found. + echo Add new params to overwrite path to use shared libraries/fonts + grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config + grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config + grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config + #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config fi # Create a config link dolibarr.conf if [ ! -L $apachelink ]; then - apachelinkdir=`dirname $apachelink` - if [ -d $apachelinkdir ]; then - echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink - ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink - else - echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed - fi + apachelinkdir=`dirname $apachelink` + if [ -d $apachelinkdir ]; then + echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink + ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink + else + echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed + fi fi echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr @@ -269,19 +270,19 @@ echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr # Restart web server echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then - %{_sysconfdir}/init.d/httpd restart + %{_sysconfdir}/init.d/httpd restart fi if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart + %{_sysconfdir}/init.d/apache2 restart fi # Restart mysql echo Restart mysql if [ -f /etc/init.d/mysqld ]; then - /etc/init.d/mysqld restart + /etc/init.d/mysqld restart fi if [ -f /etc/init.d/mysql ]; then - /etc/init.d/mysql restart + /etc/init.d/mysql restart fi # Show result @@ -301,39 +302,54 @@ echo if [ "x$1" = "x0" ] ; then - # Remove - echo "Removed package" + # Remove + echo "Removed package" - # Define vars - export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - - # Remove apache link - if [ -L $apachelink ] ; - then - echo "Delete apache config link for Dolibarr ($apachelink)" - %{__rm} -f $apachelink - status=purge - fi - - # Restart web servers if required - if [ "x$status" = "xpurge" ] ; - then - # Restart web server - echo Restart web server - if [ -f %{_sysconfdir}/init.d/httpd ]; then - %{_sysconfdir}/init.d/httpd restart - fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi - fi + # Define vars + export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + + # Remove apache link + if [ -L $apachelink ] ; + then + echo "Delete apache config link for Dolibarr ($apachelink)" + %{__rm} -f $apachelink + status=purge + fi + + # Restart web servers if required + if [ "x$status" = "xpurge" ] ; + then + # Restart web server + echo Restart web server + if [ -f %{_sysconfdir}/init.d/httpd ]; then + %{_sysconfdir}/init.d/httpd restart + fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi + fi else - # Upgrade - echo "No remove ation done (this is an upgrade)" + # Upgrade + echo "No remove action done (this is an upgrade)" 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 -* Mon Dec 30 2013 Laurent Destailleur 3.4.2-0.3 +* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 +- Upstream release + +* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 +- Upstream release + +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + +* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 2f4cf7cf411..d11630c3bb9 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -103,6 +103,7 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz %{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name} %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts # Lang @@ -115,9 +116,9 @@ do lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`; echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang if [ "$lang1" = "$lang2" ] ; then - echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" else - echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" + echo "%lang(${lang}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" fi done >>%{name}.lang @@ -246,31 +247,31 @@ echo Create document directory $docdir export config=%{_sysconfdir}/dolibarr/conf.php if [ -s $config ] && grep -q "File generated by" $config then - # File already exist. We add params not found. - echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config - grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config - grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config - #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config - #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config - grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config - grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config + # File already exist. We add params not found. + echo Add new params to overwrite path to use shared libraries/fonts + grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config + grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config + grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config + #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "" >> $config + #grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "" >> $config + grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config + grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config fi # Create a config link dolibarr.conf if [ ! -L $apachelink ]; then - apachelinkdir=`dirname $apachelink` - if [ -d $apachelinkdir ]; then - echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink - ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink - else - echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed - fi + apachelinkdir=`dirname $apachelink` + if [ -d $apachelinkdir ]; then + echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink + ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink + else + echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed + fi fi echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr @@ -280,18 +281,19 @@ echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr # Restart web server echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then - %{_sysconfdir}/init.d/httpd restart + %{_sysconfdir}/init.d/httpd restart fi if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart + %{_sysconfdir}/init.d/apache2 restart fi # Restart mysql echo Restart mysql if [ -f /etc/init.d/mysqld ]; then - /etc/init.d/mysqld restart -else - /sbin/service mysql restart + /sbin/service mysqld restart +fi +if [ -f /etc/init.d/mysql ]; then + /sbin/service mysql restart fi # Show result @@ -311,39 +313,54 @@ echo if [ "x$1" = "x0" ] ; then - # Remove - echo "Removed package" - - # Define vars - export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - - # Remove apache link - if [ -L $apachelink ] ; - then - echo "Delete apache config link for Dolibarr ($apachelink)" - %{__rm} -f $apachelink - status=purge - fi - - # Restart web servers if required - if [ "x$status" = "xpurge" ] ; - then - # Restart web server - echo Restart web server - if [ -f %{_sysconfdir}/init.d/httpd ]; then - %{_sysconfdir}/init.d/httpd restart - fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi - fi + # Remove + echo "Removed package" + + # Define vars + export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + + # Remove apache link + if [ -L $apachelink ] ; + then + echo "Delete apache config link for Dolibarr ($apachelink)" + %{__rm} -f $apachelink + status=purge + fi + + # Restart web servers if required + if [ "x$status" = "xpurge" ] ; + then + # Restart web server + echo Restart web server + if [ -f %{_sysconfdir}/init.d/httpd ]; then + %{_sysconfdir}/init.d/httpd restart + fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi + fi else - # Upgrade - echo "No remove ation done (this is an upgrade)" + # Upgrade + echo "No remove action done (this is an upgrade)" 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 -* Mon Dec 30 2013 Laurent Destailleur 3.4.2-0.3 +* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 +- Upstream release + +* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 +- Upstream release + +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + +* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/build/sitemap/README b/build/sitemap/README new file mode 100644 index 00000000000..b98b5cc48d8 --- /dev/null +++ b/build/sitemap/README @@ -0,0 +1,6 @@ +# Format of sitemap file is available at +# http://www.sitemaps.org/protocol.html + +# To build a sitemap from urllist-bing.txt, run +# google-sitemapgen --config=config-bing.xml --testing + diff --git a/build/sitemap/config-bing.xml b/build/sitemap/config-bing.xml new file mode 100644 index 00000000000..c08d8bb7a5d --- /dev/null +++ b/build/sitemap/config-bing.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/sitemap/urllist-wiki.txt b/build/sitemap/urllist-wiki.txt new file mode 100644 index 00000000000..ae13bb96d87 --- /dev/null +++ b/build/sitemap/urllist-wiki.txt @@ -0,0 +1 @@ +http://wiki.dolibarr.org/ diff --git a/build/tgz/tar_exclude.txt b/build/tgz/tar_exclude.txt index 3f3ff2e27fb..c590ca2154f 100644 --- a/build/tgz/tar_exclude.txt +++ b/build/tgz/tar_exclude.txt @@ -1,3 +1,6 @@ +*~ +.#* +Thumbs.db build/exe build/html dev/dbmodel @@ -7,58 +10,10 @@ dev/initdata dev/iso-normes dev/licence dev/load -dev/skeletons/*socpeople* -dev/spec -dev/test -dev/uml -dev/xdebug -doc/dev/dolibarr-phpdoc -doc/dev/barcode -doc/dev/compta -doc/dev/dbmodel -doc/dev/normes -doc/dev/html -doc/dev/iso-normes -doc/flyer -doc/font -doc/rollup -doc/tshirts -doc/wiki -document -documents htdocs/conf/conf.php htdocs/conf/conf.php.mysql htdocs/conf/conf.php.old htdocs/conf/conf.php.postgres -htdocs/avoir -htdocs/custom -htdocs/custom2 -htdocs/customleave -htdocs/customgoogle -htdocs/document -htdocs/documents -htdocs/includes/fckeditor/_samples -htdocs/includes/fckeditor/_testcases -htdocs/includes/nusoap/samples -htdocs/includes/tcpdf/fonts/utils -htdocs/includes/tcpdf/fonts/free*.ctg.z -htdocs/includes/tcpdf/fonts/free*.z -mssql -test -CVS -*~ -.#* -.buildpath -.cache -.cvsignore -.gitignore -.externalToolBuilders -.htaccess -.settings -.project -.travis.yml -Thumbs.db -data_dev.sql doli*.tar.gz doli*.tgz doli*.exe @@ -66,5 +21,4 @@ doli*.rpm doli*.deb doli*.zip cvschangelogbuilder_dolibarr* -doxygen_warnings.log -dolibarr_install.log \ No newline at end of file +dolibarr_install.log diff --git a/build/zip/zip_exclude.txt b/build/zip/zip_exclude.txt index 99f8337efcc..88bd22826ff 100644 --- a/build/zip/zip_exclude.txt +++ b/build/zip/zip_exclude.txt @@ -1,65 +1,19 @@ -*/build +*~ +*.#* +Thumbs.db +*/build/exe +*/build/html */dev/dbmodel/* */dev/fpdf/* */dev/initdemo/* +*/dev/initdata/* */dev/iso-normes/* */dev/licence/* */dev/load/* -*/dev/test/* -*/dev/uml/* -*/dev/xdebug/* -*/doc/dev/dolibarr-phpdoc/* -*/doc/dev/barcode/* -*/doc/dev/compta/* -*/doc/dev/dbmodel/* -*/doc/dev/normes/* -*/doc/dev/html/* -*/doc/dev/iso-normes/* -*/doc/flyer/* -*/doc/font/* -*/doc/rollup/* -*/doc/tshirt/* -*/doc/wiki/* -*/document/* -*/documents/* -*/htdocs/avoir/* */htdocs/conf/conf.php */htdocs/conf/conf.php.mysql */htdocs/conf/conf.php.old */htdocs/conf/conf.php.postgres -*/htdocs/custom/* -*/htdocs/custom2/* -*/htdocs/document/* -*/htdocs/documents/* -*/htdocs/includes/ckeditor/_source -*/htdocs/includes/ckeditor/*_source.js -*/htdocs/includes/fckeditor/_samples/* -*/htdocs/includes/fckeditor/_testcases/* -*/htdocs/includes/nusoap/samples/* -*/htdocs/includes/phplot5/doc/* -*/htdocs/includes/phplot5/examples/* -*/htdocs/includes/scriptaculous/test/* -*/htdocs/includes/treemenu/docs/* -*/htdocs/includes/treemenu/images/* -*/htdocs/includes/treemenu/imagesAlt/* -*/htdocs/includes/treemenu/imagesAlt2/* -*/htdocs/includes/tcpdf/fonts/utils/* -*/htdocs/includes/tcpdf/fonts/free*.ctg.z -*/htdocs/includes/tcpdf/fonts/free*.z -*/test -*/CVS/* -*~ -*.#* -*.buildpath* -*.cache* -*.cvsignore* -*.gitignore* -*.htaccess* -*.settings* -*.project* -*.travis.yml* -Thumbs.db -data_dev.sql dolibarr*.tar.gz dolibarr*.tgz dolibarr*.exe @@ -67,5 +21,4 @@ dolibarr*.rpm dolibarr*.deb dolibarr*.zip cvschangelogbuilder_dolibarr* -doxygen_warnings.log -dolibarr_install.log \ No newline at end of file +dolibarr_install.log diff --git a/dev/codesniffer/jenkins_ruleset.xml b/dev/codesniffer/jenkins_ruleset.xml deleted file mode 100755 index f414b6270af..00000000000 --- a/dev/codesniffer/jenkins_ruleset.xml +++ /dev/null @@ -1,247 +0,0 @@ - - - - Dolibarr coding standard. - - - - - - - 0 - - - 0 - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - 0 - - - - - 0 - - - - 5 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - 0 - - - - - - - 0 - - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index c24b994e1e9..24cc4b46e7b 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -5,7 +5,11 @@ - + + 0 + + + 0 @@ -211,10 +215,14 @@ 0 + + 0 + + 0 - + 0 diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 68383139ac6..2bf2e1a5c99 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -25,18 +25,19 @@ Replace call to serialize_val with no bugged value TCPDF: ------ -* To be compatible with FPDF, replace line -public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign='T', $fitcell=false) { -by -public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=false, $maxh=0, $valign='T', $fitcell=false) { - -* Removed all fonts except dejavu* (used by greek, arab, persan, romanian, turkish), freemono* (russian), stsongstdlight* (chinese), helvetica* (all other) and useless directories (fonts/utils, docs, cache, images) - -* Replace in tcpdf_config.php -define ('K_PATH_CACHE', K_PATH_MAIN.'cache/'); -with -define ('K_PATH_CACHE', DOL_DATA_ROOT.'/admin/temp/'); -dol_mkdir(K_PATH_CACHE); +* Removed all fonts except + dejavusans* (used by greek, arab, persan, romanian, turkish), + freemono* (russian), + cid*+msungstdlight+stsongstdlight+uni2cid* (chinese), + helvetica* (all other languages), + zapfdingbats.php (for special chars like form checkboxes) +* Removed useless directories (examples, tools) +* Fix + // initialize subsetchars + $subsetchars = array(); +into + // initialize subsetchars + $subsetchars = array_fill(0, 256, true); JSGANTT: diff --git a/dev/findutf8bomincludes.sh b/dev/findutf8bomincludes.sh deleted file mode 100755 index 4a9458654d2..00000000000 --- a/dev/findutf8bomincludes.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# Checks if files contains UTF-8 BOM -# in dolibarr includes tree excluding -# git repository -# -# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr -grep -rlI \ ---exclude-dir='.git' \ -$'\xEF\xBB\xBF' htdocs/includes diff --git a/dev/fixdosfiles.sh b/dev/fixdosfiles.sh index 256babb60eb..721df266961 100755 --- a/dev/fixdosfiles.sh +++ b/dev/fixdosfiles.sh @@ -16,13 +16,13 @@ fi # To detec if [ "x$1" = "xlist" ] then - find . \( -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF + find . \( -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 fi # To convert if [ "x$1" = "xfix" ] then - for fic in `find . \( -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF | awk -F':' '{ print $1 }' ` + for fic in `find . \( -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 | awk -F':' '{ print $1 }' ` do echo "Fix file $fic" dos2unix $fic diff --git a/dev/fixnotabfiles.sh b/dev/fixnotabfiles.sh new file mode 100755 index 00000000000..3e5d28966c9 --- /dev/null +++ b/dev/fixnotabfiles.sh @@ -0,0 +1,26 @@ +#!/bin/sh +#------------------------------------------------------ +# Script to find files that are not Unix encoded +# +# Laurent Destailleur - eldy@users.sourceforge.net +#------------------------------------------------------ +# Usage: fixnotabfiles.sh [list|fix] +#------------------------------------------------------ + +# Syntax +if [ "x$1" != "xlist" -a "x$1" != "xfix" ] +then + echo "Usage: fixnotabfiles.sh [list|fix]" +fi + +# To detec +if [ "x$1" = "xlist" ] +then + find build \( -iname "*.sh" -o -iname "*.spec" \) -exec grep -l -P '\t' {} \; +fi + +# To convert +if [ "x$1" = "xfix" ] +then + echo Feature not implemented. Please fix files manually. +fi diff --git a/dev/fixperms.sh b/dev/fixperms.sh old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-commande.php b/dev/initdata/generate-commande.php old mode 100644 new mode 100755 index 4794d9f949f..7057550e3d7 --- a/dev/initdata/generate-commande.php +++ b/dev/initdata/generate-commande.php @@ -186,7 +186,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) $prodid = rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$com->addline($com->id, $product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type); + $result=$com->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type); if ($result < 0) { dol_print_error($db,$propal->error); diff --git a/dev/initdata/generate-facture.php b/dev/initdata/generate-facture.php old mode 100644 new mode 100755 index 7761817dc28..5de15dce3a1 --- a/dev/initdata/generate-facture.php +++ b/dev/initdata/generate-facture.php @@ -112,8 +112,12 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) $prodid = rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$facture->addline($facture->id,$product->description,$product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); - $xnbp++; + $result=$facture->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); + if ($result < 0) + { + dol_print_error($db,$propal->error); + } + $xnbp++; } print " OK with ref ".$facture->ref."\n";; diff --git a/dev/initdata/generate-produit.php b/dev/initdata/generate-produit.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-propale.php b/dev/initdata/generate-propale.php old mode 100644 new mode 100755 index 5ee18ee6073..6d9db265b37 --- a/dev/initdata/generate-propale.php +++ b/dev/initdata/generate-propale.php @@ -143,7 +143,9 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) while ($xnbp < $nbp) { $prodid = rand(1, $num_prods); - $result=$propal->addline($propal->id, 'Description '.$xnbp, '100', rand(1,5), '19.6', 0, 0, $prodids[$prodid], 0); + $product=new Product($db); + $result=$product->fetch($prodids[$prodid]); + $result=$propal->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0); if ($result < 0) { dol_print_error($db,$propal->error); diff --git a/dev/initdata/generate-societe.php b/dev/initdata/generate-societe.php old mode 100644 new mode 100755 index 9072709c738..2642750eb8a --- a/dev/initdata/generate-societe.php +++ b/dev/initdata/generate-societe.php @@ -99,8 +99,8 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++) $soc->country_id=1; $soc->country_code='FR'; // Un client sur 3 a une remise de 5% - $user_remise=rand(1,3); if ($user_remise==3) $soc->remise_client=5; - print "> client=".$soc->client.", fournisseur=".$soc->fournisseur.", remise=".$soc->remise_client."\n"; + $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'; $socid = $soc->create(); diff --git a/dev/initdata/mysqldump_dolibarr_3.5.0.sql b/dev/initdata/mysqldump_dolibarr_3.5.0.sql new file mode 100644 index 00000000000..62eabd2da79 --- /dev/null +++ b/dev/initdata/mysqldump_dolibarr_3.5.0.sql @@ -0,0 +1,7175 @@ +-- MySQL dump 10.13 Distrib 5.5.35, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: dolibarr35 +-- ------------------------------------------------------ +-- Server version 5.5.35-0ubuntu0.12.04.2 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `llx_accounting_system` +-- + +DROP TABLE IF EXISTS `llx_accounting_system`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accounting_system` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `pcg_version` varchar(12) NOT NULL, + `fk_pays` int(11) NOT NULL, + `label` varchar(128) NOT NULL, + `active` smallint(6) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_accounting_system_pcg_version` (`pcg_version`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accounting_system` +-- + +LOCK TABLES `llx_accounting_system` WRITE; +/*!40000 ALTER TABLE `llx_accounting_system` DISABLE KEYS */; +INSERT INTO `llx_accounting_system` VALUES (1,'PCG99-ABREGE',1,'The simple accountancy french plan',1),(2,'PCG99-BASE',1,'The base accountancy french plan',1); +/*!40000 ALTER TABLE `llx_accounting_system` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accountingaccount` +-- + +DROP TABLE IF EXISTS `llx_accountingaccount`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accountingaccount` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_pcg_version` varchar(12) NOT NULL, + `pcg_type` varchar(20) NOT NULL, + `pcg_subtype` varchar(20) NOT NULL, + `account_number` varchar(20) NOT NULL, + `account_parent` varchar(20) DEFAULT NULL, + `label` varchar(128) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + KEY `idx_accountingaccount_fk_pcg_version` (`fk_pcg_version`), + CONSTRAINT `fk_accountingaccount_fk_pcg_version` FOREIGN KEY (`fk_pcg_version`) REFERENCES `llx_accounting_system` (`pcg_version`) +) ENGINE=InnoDB AUTO_INCREMENT=439 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accountingaccount` +-- + +LOCK TABLES `llx_accountingaccount` WRITE; +/*!40000 ALTER TABLE `llx_accountingaccount` DISABLE KEYS */; +INSERT INTO `llx_accountingaccount` VALUES (1,'PCG99-ABREGE','CAPIT','CAPITAL','101','1','Capital',1),(2,'PCG99-ABREGE','CAPIT','XXXXXX','105','1','Ecarts de réévaluation',1),(3,'PCG99-ABREGE','CAPIT','XXXXXX','1061','1','Réserve légale',1),(4,'PCG99-ABREGE','CAPIT','XXXXXX','1063','1','Réserves statutaires ou contractuelles',1),(5,'PCG99-ABREGE','CAPIT','XXXXXX','1064','1','Réserves réglementées',1),(6,'PCG99-ABREGE','CAPIT','XXXXXX','1068','1','Autres réserves',1),(7,'PCG99-ABREGE','CAPIT','XXXXXX','108','1','Compte de l\'exploitant',1),(8,'PCG99-ABREGE','CAPIT','XXXXXX','12','1','Résultat de l\'exercice',1),(9,'PCG99-ABREGE','CAPIT','XXXXXX','145','1','Amortissements dérogatoires',1),(10,'PCG99-ABREGE','CAPIT','XXXXXX','146','1','Provision spéciale de réévaluation',1),(11,'PCG99-ABREGE','CAPIT','XXXXXX','147','1','Plus-values réinvesties',1),(12,'PCG99-ABREGE','CAPIT','XXXXXX','148','1','Autres provisions réglementées',1),(13,'PCG99-ABREGE','CAPIT','XXXXXX','15','1','Provisions pour risques et charges',1),(14,'PCG99-ABREGE','CAPIT','XXXXXX','16','1','Emprunts et dettes assimilees',1),(15,'PCG99-ABREGE','IMMO','XXXXXX','20','2','Immobilisations incorporelles',1),(16,'PCG99-ABREGE','IMMO','XXXXXX','201','20','Frais d\'établissement',1),(17,'PCG99-ABREGE','IMMO','XXXXXX','206','20','Droit au bail',1),(18,'PCG99-ABREGE','IMMO','XXXXXX','207','20','Fonds commercial',1),(19,'PCG99-ABREGE','IMMO','XXXXXX','208','20','Autres immobilisations incorporelles',1),(20,'PCG99-ABREGE','IMMO','XXXXXX','21','2','Immobilisations corporelles',1),(21,'PCG99-ABREGE','IMMO','XXXXXX','23','2','Immobilisations en cours',1),(22,'PCG99-ABREGE','IMMO','XXXXXX','27','2','Autres immobilisations financieres',1),(23,'PCG99-ABREGE','IMMO','XXXXXX','280','2','Amortissements des immobilisations incorporelles',1),(24,'PCG99-ABREGE','IMMO','XXXXXX','281','2','Amortissements des immobilisations corporelles',1),(25,'PCG99-ABREGE','IMMO','XXXXXX','290','2','Provisions pour dépréciation des immobilisations incorporelles',1),(26,'PCG99-ABREGE','IMMO','XXXXXX','291','2','Provisions pour dépréciation des immobilisations corporelles',1),(27,'PCG99-ABREGE','IMMO','XXXXXX','297','2','Provisions pour dépréciation des autres immobilisations financières',1),(28,'PCG99-ABREGE','STOCK','XXXXXX','31','3','Matieres premières',1),(29,'PCG99-ABREGE','STOCK','XXXXXX','32','3','Autres approvisionnements',1),(30,'PCG99-ABREGE','STOCK','XXXXXX','33','3','En-cours de production de biens',1),(31,'PCG99-ABREGE','STOCK','XXXXXX','34','3','En-cours de production de services',1),(32,'PCG99-ABREGE','STOCK','XXXXXX','35','3','Stocks de produits',1),(33,'PCG99-ABREGE','STOCK','XXXXXX','37','3','Stocks de marchandises',1),(34,'PCG99-ABREGE','STOCK','XXXXXX','391','3','Provisions pour dépréciation des matières premières',1),(35,'PCG99-ABREGE','STOCK','XXXXXX','392','3','Provisions pour dépréciation des autres approvisionnements',1),(36,'PCG99-ABREGE','STOCK','XXXXXX','393','3','Provisions pour dépréciation des en-cours de production de biens',1),(37,'PCG99-ABREGE','STOCK','XXXXXX','394','3','Provisions pour dépréciation des en-cours de production de services',1),(38,'PCG99-ABREGE','STOCK','XXXXXX','395','3','Provisions pour dépréciation des stocks de produits',1),(39,'PCG99-ABREGE','STOCK','XXXXXX','397','3','Provisions pour dépréciation des stocks de marchandises',1),(40,'PCG99-ABREGE','TIERS','SUPPLIER','400','4','Fournisseurs et Comptes rattachés',1),(41,'PCG99-ABREGE','TIERS','XXXXXX','409','4','Fournisseurs débiteurs',1),(42,'PCG99-ABREGE','TIERS','CUSTOMER','410','4','Clients et Comptes rattachés',1),(43,'PCG99-ABREGE','TIERS','XXXXXX','419','4','Clients créditeurs',1),(44,'PCG99-ABREGE','TIERS','XXXXXX','421','4','Personnel',1),(45,'PCG99-ABREGE','TIERS','XXXXXX','428','4','Personnel',1),(46,'PCG99-ABREGE','TIERS','XXXXXX','43','4','Sécurité sociale et autres organismes sociaux',1),(47,'PCG99-ABREGE','TIERS','XXXXXX','444','4','Etat - impôts sur bénéfice',1),(48,'PCG99-ABREGE','TIERS','XXXXXX','445','4','Etat - Taxes sur chiffre affaires',1),(49,'PCG99-ABREGE','TIERS','XXXXXX','447','4','Autres impôts, taxes et versements assimilés',1),(50,'PCG99-ABREGE','TIERS','XXXXXX','45','4','Groupe et associes',1),(51,'PCG99-ABREGE','TIERS','XXXXXX','455','45','Associés',1),(52,'PCG99-ABREGE','TIERS','XXXXXX','46','4','Débiteurs divers et créditeurs divers',1),(53,'PCG99-ABREGE','TIERS','XXXXXX','47','4','Comptes transitoires ou d\'attente',1),(54,'PCG99-ABREGE','TIERS','XXXXXX','481','4','Charges à répartir sur plusieurs exercices',1),(55,'PCG99-ABREGE','TIERS','XXXXXX','486','4','Charges constatées d\'avance',1),(56,'PCG99-ABREGE','TIERS','XXXXXX','487','4','Produits constatés d\'avance',1),(57,'PCG99-ABREGE','TIERS','XXXXXX','491','4','Provisions pour dépréciation des comptes de clients',1),(58,'PCG99-ABREGE','TIERS','XXXXXX','496','4','Provisions pour dépréciation des comptes de débiteurs divers',1),(59,'PCG99-ABREGE','FINAN','XXXXXX','50','5','Valeurs mobilières de placement',1),(60,'PCG99-ABREGE','FINAN','BANK','51','5','Banques, établissements financiers et assimilés',1),(61,'PCG99-ABREGE','FINAN','CASH','53','5','Caisse',1),(62,'PCG99-ABREGE','FINAN','XXXXXX','54','5','Régies d\'avance et accréditifs',1),(63,'PCG99-ABREGE','FINAN','XXXXXX','58','5','Virements internes',1),(64,'PCG99-ABREGE','FINAN','XXXXXX','590','5','Provisions pour dépréciation des valeurs mobilières de placement',1),(65,'PCG99-ABREGE','CHARGE','PRODUCT','60','6','Achats',1),(66,'PCG99-ABREGE','CHARGE','XXXXXX','603','60','Variations des stocks',1),(67,'PCG99-ABREGE','CHARGE','SERVICE','61','6','Services extérieurs',1),(68,'PCG99-ABREGE','CHARGE','XXXXXX','62','6','Autres services extérieurs',1),(69,'PCG99-ABREGE','CHARGE','XXXXXX','63','6','Impôts, taxes et versements assimiles',1),(70,'PCG99-ABREGE','CHARGE','XXXXXX','641','6','Rémunérations du personnel',1),(71,'PCG99-ABREGE','CHARGE','XXXXXX','644','6','Rémunération du travail de l\'exploitant',1),(72,'PCG99-ABREGE','CHARGE','SOCIAL','645','6','Charges de sécurité sociale et de prévoyance',1),(73,'PCG99-ABREGE','CHARGE','XXXXXX','646','6','Cotisations sociales personnelles de l\'exploitant',1),(74,'PCG99-ABREGE','CHARGE','XXXXXX','65','6','Autres charges de gestion courante',1),(75,'PCG99-ABREGE','CHARGE','XXXXXX','66','6','Charges financières',1),(76,'PCG99-ABREGE','CHARGE','XXXXXX','67','6','Charges exceptionnelles',1),(77,'PCG99-ABREGE','CHARGE','XXXXXX','681','6','Dotations aux amortissements et aux provisions',1),(78,'PCG99-ABREGE','CHARGE','XXXXXX','686','6','Dotations aux amortissements et aux provisions',1),(79,'PCG99-ABREGE','CHARGE','XXXXXX','687','6','Dotations aux amortissements et aux provisions',1),(80,'PCG99-ABREGE','CHARGE','XXXXXX','691','6','Participation des salariés aux résultats',1),(81,'PCG99-ABREGE','CHARGE','XXXXXX','695','6','Impôts sur les bénéfices',1),(82,'PCG99-ABREGE','CHARGE','XXXXXX','697','6','Imposition forfaitaire annuelle des sociétés',1),(83,'PCG99-ABREGE','CHARGE','XXXXXX','699','6','Produits',1),(84,'PCG99-ABREGE','PROD','PRODUCT','701','7','Ventes de produits finis',1),(85,'PCG99-ABREGE','PROD','SERVICE','706','7','Prestations de services',1),(86,'PCG99-ABREGE','PROD','PRODUCT','707','7','Ventes de marchandises',1),(87,'PCG99-ABREGE','PROD','PRODUCT','708','7','Produits des activités annexes',1),(88,'PCG99-ABREGE','PROD','XXXXXX','709','7','Rabais, remises et ristournes accordés par l\'entreprise',1),(89,'PCG99-ABREGE','PROD','XXXXXX','713','7','Variation des stocks',1),(90,'PCG99-ABREGE','PROD','XXXXXX','72','7','Production immobilisée',1),(91,'PCG99-ABREGE','PROD','XXXXXX','73','7','Produits nets partiels sur opérations à long terme',1),(92,'PCG99-ABREGE','PROD','XXXXXX','74','7','Subventions d\'exploitation',1),(93,'PCG99-ABREGE','PROD','XXXXXX','75','7','Autres produits de gestion courante',1),(94,'PCG99-ABREGE','PROD','XXXXXX','753','75','Jetons de présence et rémunérations d\'administrateurs, gérants,...',1),(95,'PCG99-ABREGE','PROD','XXXXXX','754','75','Ristournes perçues des coopératives',1),(96,'PCG99-ABREGE','PROD','XXXXXX','755','75','Quotes-parts de résultat sur opérations faites en commun',1),(97,'PCG99-ABREGE','PROD','XXXXXX','76','7','Produits financiers',1),(98,'PCG99-ABREGE','PROD','XXXXXX','77','7','Produits exceptionnels',1),(99,'PCG99-ABREGE','PROD','XXXXXX','781','7','Reprises sur amortissements et provisions',1),(100,'PCG99-ABREGE','PROD','XXXXXX','786','7','Reprises sur provisions pour risques',1),(101,'PCG99-ABREGE','PROD','XXXXXX','787','7','Reprises sur provisions',1),(102,'PCG99-ABREGE','PROD','XXXXXX','79','7','Transferts de charges',1),(103,'PCG99-BASE','CAPIT','XXXXXX','10','1','Capital et réserves',1),(104,'PCG99-BASE','CAPIT','CAPITAL','101','10','Capital',1),(105,'PCG99-BASE','CAPIT','XXXXXX','104','10','Primes liées au capital social',1),(106,'PCG99-BASE','CAPIT','XXXXXX','105','10','Ecarts de réévaluation',1),(107,'PCG99-BASE','CAPIT','XXXXXX','106','10','Réserves',1),(108,'PCG99-BASE','CAPIT','XXXXXX','107','10','Ecart d\'equivalence',1),(109,'PCG99-BASE','CAPIT','XXXXXX','108','10','Compte de l\'exploitant',1),(110,'PCG99-BASE','CAPIT','XXXXXX','109','10','Actionnaires : capital souscrit - non appelé',1),(111,'PCG99-BASE','CAPIT','XXXXXX','11','1','Report à nouveau (solde créditeur ou débiteur)',1),(112,'PCG99-BASE','CAPIT','XXXXXX','110','11','Report à nouveau (solde créditeur)',1),(113,'PCG99-BASE','CAPIT','XXXXXX','119','11','Report à nouveau (solde débiteur)',1),(114,'PCG99-BASE','CAPIT','XXXXXX','12','1','Résultat de l\'exercice (bénéfice ou perte)',1),(115,'PCG99-BASE','CAPIT','XXXXXX','120','12','Résultat de l\'exercice (bénéfice)',1),(116,'PCG99-BASE','CAPIT','XXXXXX','129','12','Résultat de l\'exercice (perte)',1),(117,'PCG99-BASE','CAPIT','XXXXXX','13','1','Subventions d\'investissement',1),(118,'PCG99-BASE','CAPIT','XXXXXX','131','13','Subventions d\'équipement',1),(119,'PCG99-BASE','CAPIT','XXXXXX','138','13','Autres subventions d\'investissement',1),(120,'PCG99-BASE','CAPIT','XXXXXX','139','13','Subventions d\'investissement inscrites au compte de résultat',1),(121,'PCG99-BASE','CAPIT','XXXXXX','14','1','Provisions réglementées',1),(122,'PCG99-BASE','CAPIT','XXXXXX','142','14','Provisions réglementées relatives aux immobilisations',1),(123,'PCG99-BASE','CAPIT','XXXXXX','143','14','Provisions réglementées relatives aux stocks',1),(124,'PCG99-BASE','CAPIT','XXXXXX','144','14','Provisions réglementées relatives aux autres éléments de l\'actif',1),(125,'PCG99-BASE','CAPIT','XXXXXX','145','14','Amortissements dérogatoires',1),(126,'PCG99-BASE','CAPIT','XXXXXX','146','14','Provision spéciale de réévaluation',1),(127,'PCG99-BASE','CAPIT','XXXXXX','147','14','Plus-values réinvesties',1),(128,'PCG99-BASE','CAPIT','XXXXXX','148','14','Autres provisions réglementées',1),(129,'PCG99-BASE','CAPIT','XXXXXX','15','1','Provisions pour risques et charges',1),(130,'PCG99-BASE','CAPIT','XXXXXX','151','15','Provisions pour risques',1),(131,'PCG99-BASE','CAPIT','XXXXXX','153','15','Provisions pour pensions et obligations similaires',1),(132,'PCG99-BASE','CAPIT','XXXXXX','154','15','Provisions pour restructurations',1),(133,'PCG99-BASE','CAPIT','XXXXXX','155','15','Provisions pour impôts',1),(134,'PCG99-BASE','CAPIT','XXXXXX','156','15','Provisions pour renouvellement des immobilisations (entreprises concessionnaires)',1),(135,'PCG99-BASE','CAPIT','XXXXXX','157','15','Provisions pour charges à répartir sur plusieurs exercices',1),(136,'PCG99-BASE','CAPIT','XXXXXX','158','15','Autres provisions pour charges',1),(137,'PCG99-BASE','CAPIT','XXXXXX','16','1','Emprunts et dettes assimilees',1),(138,'PCG99-BASE','CAPIT','XXXXXX','161','16','Emprunts obligataires convertibles',1),(139,'PCG99-BASE','CAPIT','XXXXXX','163','16','Autres emprunts obligataires',1),(140,'PCG99-BASE','CAPIT','XXXXXX','164','16','Emprunts auprès des établissements de crédit',1),(141,'PCG99-BASE','CAPIT','XXXXXX','165','16','Dépôts et cautionnements reçus',1),(142,'PCG99-BASE','CAPIT','XXXXXX','166','16','Participation des salariés aux résultats',1),(143,'PCG99-BASE','CAPIT','XXXXXX','167','16','Emprunts et dettes assortis de conditions particulières',1),(144,'PCG99-BASE','CAPIT','XXXXXX','168','16','Autres emprunts et dettes assimilées',1),(145,'PCG99-BASE','CAPIT','XXXXXX','169','16','Primes de remboursement des obligations',1),(146,'PCG99-BASE','CAPIT','XXXXXX','17','1','Dettes rattachées à des participations',1),(147,'PCG99-BASE','CAPIT','XXXXXX','171','17','Dettes rattachées à des participations (groupe)',1),(148,'PCG99-BASE','CAPIT','XXXXXX','174','17','Dettes rattachées à des participations (hors groupe)',1),(149,'PCG99-BASE','CAPIT','XXXXXX','178','17','Dettes rattachées à des sociétés en participation',1),(150,'PCG99-BASE','CAPIT','XXXXXX','18','1','Comptes de liaison des établissements et sociétés en participation',1),(151,'PCG99-BASE','CAPIT','XXXXXX','181','18','Comptes de liaison des établissements',1),(152,'PCG99-BASE','CAPIT','XXXXXX','186','18','Biens et prestations de services échangés entre établissements (charges)',1),(153,'PCG99-BASE','CAPIT','XXXXXX','187','18','Biens et prestations de services échangés entre établissements (produits)',1),(154,'PCG99-BASE','CAPIT','XXXXXX','188','18','Comptes de liaison des sociétés en participation',1),(155,'PCG99-BASE','IMMO','XXXXXX','20','2','Immobilisations incorporelles',1),(156,'PCG99-BASE','IMMO','XXXXXX','201','20','Frais d\'établissement',1),(157,'PCG99-BASE','IMMO','XXXXXX','203','20','Frais de recherche et de développement',1),(158,'PCG99-BASE','IMMO','XXXXXX','205','20','Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',1),(159,'PCG99-BASE','IMMO','XXXXXX','206','20','Droit au bail',1),(160,'PCG99-BASE','IMMO','XXXXXX','207','20','Fonds commercial',1),(161,'PCG99-BASE','IMMO','XXXXXX','208','20','Autres immobilisations incorporelles',1),(162,'PCG99-BASE','IMMO','XXXXXX','21','2','Immobilisations corporelles',1),(163,'PCG99-BASE','IMMO','XXXXXX','211','21','Terrains',1),(164,'PCG99-BASE','IMMO','XXXXXX','212','21','Agencements et aménagements de terrains',1),(165,'PCG99-BASE','IMMO','XXXXXX','213','21','Constructions',1),(166,'PCG99-BASE','IMMO','XXXXXX','214','21','Constructions sur sol d\'autrui',1),(167,'PCG99-BASE','IMMO','XXXXXX','215','21','Installations techniques, matériels et outillage industriels',1),(168,'PCG99-BASE','IMMO','XXXXXX','218','21','Autres immobilisations corporelles',1),(169,'PCG99-BASE','IMMO','XXXXXX','22','2','Immobilisations mises en concession',1),(170,'PCG99-BASE','IMMO','XXXXXX','23','2','Immobilisations en cours',1),(171,'PCG99-BASE','IMMO','XXXXXX','231','23','Immobilisations corporelles en cours',1),(172,'PCG99-BASE','IMMO','XXXXXX','232','23','Immobilisations incorporelles en cours',1),(173,'PCG99-BASE','IMMO','XXXXXX','237','23','Avances et acomptes versés sur immobilisations incorporelles',1),(174,'PCG99-BASE','IMMO','XXXXXX','238','23','Avances et acomptes versés sur commandes d\'immobilisations corporelles',1),(175,'PCG99-BASE','IMMO','XXXXXX','25','2','Parts dans des entreprises liées et créances sur des entreprises liées',1),(176,'PCG99-BASE','IMMO','XXXXXX','26','2','Participations et créances rattachées à des participations',1),(177,'PCG99-BASE','IMMO','XXXXXX','261','26','Titres de participation',1),(178,'PCG99-BASE','IMMO','XXXXXX','266','26','Autres formes de participation',1),(179,'PCG99-BASE','IMMO','XXXXXX','267','26','Créances rattachées à des participations',1),(180,'PCG99-BASE','IMMO','XXXXXX','268','26','Créances rattachées à des sociétés en participation',1),(181,'PCG99-BASE','IMMO','XXXXXX','269','26','Versements restant à effectuer sur titres de participation non libérés',1),(182,'PCG99-BASE','IMMO','XXXXXX','27','2','Autres immobilisations financieres',1),(183,'PCG99-BASE','IMMO','XXXXXX','271','27','Titres immobilisés autres que les titres immobilisés de l\'activité de portefeuille (droit de propriété)',1),(184,'PCG99-BASE','IMMO','XXXXXX','272','27','Titres immobilisés (droit de créance)',1),(185,'PCG99-BASE','IMMO','XXXXXX','273','27','Titres immobilisés de l\'activité de portefeuille',1),(186,'PCG99-BASE','IMMO','XXXXXX','274','27','Prêts',1),(187,'PCG99-BASE','IMMO','XXXXXX','275','27','Dépôts et cautionnements versés',1),(188,'PCG99-BASE','IMMO','XXXXXX','276','27','Autres créances immobilisées',1),(189,'PCG99-BASE','IMMO','XXXXXX','277','27','(Actions propres ou parts propres)',1),(190,'PCG99-BASE','IMMO','XXXXXX','279','27','Versements restant à effectuer sur titres immobilisés non libérés',1),(191,'PCG99-BASE','IMMO','XXXXXX','28','2','Amortissements des immobilisations',1),(192,'PCG99-BASE','IMMO','XXXXXX','280','28','Amortissements des immobilisations incorporelles',1),(193,'PCG99-BASE','IMMO','XXXXXX','281','28','Amortissements des immobilisations corporelles',1),(194,'PCG99-BASE','IMMO','XXXXXX','282','28','Amortissements des immobilisations mises en concession',1),(195,'PCG99-BASE','IMMO','XXXXXX','29','2','Dépréciations des immobilisations',1),(196,'PCG99-BASE','IMMO','XXXXXX','290','29','Dépréciations des immobilisations incorporelles',1),(197,'PCG99-BASE','IMMO','XXXXXX','291','29','Dépréciations des immobilisations corporelles',1),(198,'PCG99-BASE','IMMO','XXXXXX','292','29','Dépréciations des immobilisations mises en concession',1),(199,'PCG99-BASE','IMMO','XXXXXX','293','29','Dépréciations des immobilisations en cours',1),(200,'PCG99-BASE','IMMO','XXXXXX','296','29','Provisions pour dépréciation des participations et créances rattachées à des participations',1),(201,'PCG99-BASE','IMMO','XXXXXX','297','29','Provisions pour dépréciation des autres immobilisations financières',1),(202,'PCG99-BASE','STOCK','XXXXXX','31','3','Matières premières (et fournitures)',1),(203,'PCG99-BASE','STOCK','XXXXXX','311','31','Matières (ou groupe) A',1),(204,'PCG99-BASE','STOCK','XXXXXX','312','31','Matières (ou groupe) B',1),(205,'PCG99-BASE','STOCK','XXXXXX','317','31','Fournitures A, B, C,',1),(206,'PCG99-BASE','STOCK','XXXXXX','32','3','Autres approvisionnements',1),(207,'PCG99-BASE','STOCK','XXXXXX','321','32','Matières consommables',1),(208,'PCG99-BASE','STOCK','XXXXXX','322','32','Fournitures consommables',1),(209,'PCG99-BASE','STOCK','XXXXXX','326','32','Emballages',1),(210,'PCG99-BASE','STOCK','XXXXXX','33','3','En-cours de production de biens',1),(211,'PCG99-BASE','STOCK','XXXXXX','331','33','Produits en cours',1),(212,'PCG99-BASE','STOCK','XXXXXX','335','33','Travaux en cours',1),(213,'PCG99-BASE','STOCK','XXXXXX','34','3','En-cours de production de services',1),(214,'PCG99-BASE','STOCK','XXXXXX','341','34','Etudes en cours',1),(215,'PCG99-BASE','STOCK','XXXXXX','345','34','Prestations de services en cours',1),(216,'PCG99-BASE','STOCK','XXXXXX','35','3','Stocks de produits',1),(217,'PCG99-BASE','STOCK','XXXXXX','351','35','Produits intermédiaires',1),(218,'PCG99-BASE','STOCK','XXXXXX','355','35','Produits finis',1),(219,'PCG99-BASE','STOCK','XXXXXX','358','35','Produits résiduels (ou matières de récupération)',1),(220,'PCG99-BASE','STOCK','XXXXXX','37','3','Stocks de marchandises',1),(221,'PCG99-BASE','STOCK','XXXXXX','371','37','Marchandises (ou groupe) A',1),(222,'PCG99-BASE','STOCK','XXXXXX','372','37','Marchandises (ou groupe) B',1),(223,'PCG99-BASE','STOCK','XXXXXX','39','3','Provisions pour dépréciation des stocks et en-cours',1),(224,'PCG99-BASE','STOCK','XXXXXX','391','39','Provisions pour dépréciation des matières premières',1),(225,'PCG99-BASE','STOCK','XXXXXX','392','39','Provisions pour dépréciation des autres approvisionnements',1),(226,'PCG99-BASE','STOCK','XXXXXX','393','39','Provisions pour dépréciation des en-cours de production de biens',1),(227,'PCG99-BASE','STOCK','XXXXXX','394','39','Provisions pour dépréciation des en-cours de production de services',1),(228,'PCG99-BASE','STOCK','XXXXXX','395','39','Provisions pour dépréciation des stocks de produits',1),(229,'PCG99-BASE','STOCK','XXXXXX','397','39','Provisions pour dépréciation des stocks de marchandises',1),(230,'PCG99-BASE','TIERS','XXXXXX','40','4','Fournisseurs et Comptes rattachés',1),(231,'PCG99-BASE','TIERS','XXXXXX','400','40','Fournisseurs et Comptes rattachés',1),(232,'PCG99-BASE','TIERS','SUPPLIER','401','40','Fournisseurs',1),(233,'PCG99-BASE','TIERS','XXXXXX','403','40','Fournisseurs - Effets à payer',1),(234,'PCG99-BASE','TIERS','XXXXXX','404','40','Fournisseurs d\'immobilisations',1),(235,'PCG99-BASE','TIERS','XXXXXX','405','40','Fournisseurs d\'immobilisations - Effets à payer',1),(236,'PCG99-BASE','TIERS','XXXXXX','408','40','Fournisseurs - Factures non parvenues',1),(237,'PCG99-BASE','TIERS','XXXXXX','409','40','Fournisseurs débiteurs',1),(238,'PCG99-BASE','TIERS','XXXXXX','41','4','Clients et comptes rattachés',1),(239,'PCG99-BASE','TIERS','XXXXXX','410','41','Clients et Comptes rattachés',1),(240,'PCG99-BASE','TIERS','CUSTOMER','411','41','Clients',1),(241,'PCG99-BASE','TIERS','XXXXXX','413','41','Clients - Effets à recevoir',1),(242,'PCG99-BASE','TIERS','XXXXXX','416','41','Clients douteux ou litigieux',1),(243,'PCG99-BASE','TIERS','XXXXXX','418','41','Clients - Produits non encore facturés',1),(244,'PCG99-BASE','TIERS','XXXXXX','419','41','Clients créditeurs',1),(245,'PCG99-BASE','TIERS','XXXXXX','42','4','Personnel et comptes rattachés',1),(246,'PCG99-BASE','TIERS','XXXXXX','421','42','Personnel - Rémunérations dues',1),(247,'PCG99-BASE','TIERS','XXXXXX','422','42','Comités d\'entreprises, d\'établissement, ...',1),(248,'PCG99-BASE','TIERS','XXXXXX','424','42','Participation des salariés aux résultats',1),(249,'PCG99-BASE','TIERS','XXXXXX','425','42','Personnel - Avances et acomptes',1),(250,'PCG99-BASE','TIERS','XXXXXX','426','42','Personnel - Dépôts',1),(251,'PCG99-BASE','TIERS','XXXXXX','427','42','Personnel - Oppositions',1),(252,'PCG99-BASE','TIERS','XXXXXX','428','42','Personnel - Charges à payer et produits à recevoir',1),(253,'PCG99-BASE','TIERS','XXXXXX','43','4','Sécurité sociale et autres organismes sociaux',1),(254,'PCG99-BASE','TIERS','XXXXXX','431','43','Sécurité sociale',1),(255,'PCG99-BASE','TIERS','XXXXXX','437','43','Autres organismes sociaux',1),(256,'PCG99-BASE','TIERS','XXXXXX','438','43','Organismes sociaux - Charges à payer et produits à recevoir',1),(257,'PCG99-BASE','TIERS','XXXXXX','44','4','État et autres collectivités publiques',1),(258,'PCG99-BASE','TIERS','XXXXXX','441','44','État - Subventions à recevoir',1),(259,'PCG99-BASE','TIERS','XXXXXX','442','44','Etat - Impôts et taxes recouvrables sur des tiers',1),(260,'PCG99-BASE','TIERS','XXXXXX','443','44','Opérations particulières avec l\'Etat, les collectivités publiques, les organismes internationaux',1),(261,'PCG99-BASE','TIERS','XXXXXX','444','44','Etat - Impôts sur les bénéfices',1),(262,'PCG99-BASE','TIERS','XXXXXX','445','44','Etat - Taxes sur le chiffre d\'affaires',1),(263,'PCG99-BASE','TIERS','XXXXXX','446','44','Obligations cautionnées',1),(264,'PCG99-BASE','TIERS','XXXXXX','447','44','Autres impôts, taxes et versements assimilés',1),(265,'PCG99-BASE','TIERS','XXXXXX','448','44','Etat - Charges à payer et produits à recevoir',1),(266,'PCG99-BASE','TIERS','XXXXXX','449','44','Quotas d\'émission à restituer à l\'Etat',1),(267,'PCG99-BASE','TIERS','XXXXXX','45','4','Groupe et associes',1),(268,'PCG99-BASE','TIERS','XXXXXX','451','45','Groupe',1),(269,'PCG99-BASE','TIERS','XXXXXX','455','45','Associés - Comptes courants',1),(270,'PCG99-BASE','TIERS','XXXXXX','456','45','Associés - Opérations sur le capital',1),(271,'PCG99-BASE','TIERS','XXXXXX','457','45','Associés - Dividendes à payer',1),(272,'PCG99-BASE','TIERS','XXXXXX','458','45','Associés - Opérations faites en commun et en G.I.E.',1),(273,'PCG99-BASE','TIERS','XXXXXX','46','4','Débiteurs divers et créditeurs divers',1),(274,'PCG99-BASE','TIERS','XXXXXX','462','46','Créances sur cessions d\'immobilisations',1),(275,'PCG99-BASE','TIERS','XXXXXX','464','46','Dettes sur acquisitions de valeurs mobilières de placement',1),(276,'PCG99-BASE','TIERS','XXXXXX','465','46','Créances sur cessions de valeurs mobilières de placement',1),(277,'PCG99-BASE','TIERS','XXXXXX','467','46','Autres comptes débiteurs ou créditeurs',1),(278,'PCG99-BASE','TIERS','XXXXXX','468','46','Divers - Charges à payer et produits à recevoir',1),(279,'PCG99-BASE','TIERS','XXXXXX','47','4','Comptes transitoires ou d\'attente',1),(280,'PCG99-BASE','TIERS','XXXXXX','471','47','Comptes d\'attente',1),(281,'PCG99-BASE','TIERS','XXXXXX','476','47','Différence de conversion - Actif',1),(282,'PCG99-BASE','TIERS','XXXXXX','477','47','Différences de conversion - Passif',1),(283,'PCG99-BASE','TIERS','XXXXXX','478','47','Autres comptes transitoires',1),(284,'PCG99-BASE','TIERS','XXXXXX','48','4','Comptes de régularisation',1),(285,'PCG99-BASE','TIERS','XXXXXX','481','48','Charges à répartir sur plusieurs exercices',1),(286,'PCG99-BASE','TIERS','XXXXXX','486','48','Charges constatées d\'avance',1),(287,'PCG99-BASE','TIERS','XXXXXX','487','48','Produits constatés d\'avance',1),(288,'PCG99-BASE','TIERS','XXXXXX','488','48','Comptes de répartition périodique des charges et des produits',1),(289,'PCG99-BASE','TIERS','XXXXXX','489','48','Quotas d\'émission alloués par l\'Etat',1),(290,'PCG99-BASE','TIERS','XXXXXX','49','4','Provisions pour dépréciation des comptes de tiers',1),(291,'PCG99-BASE','TIERS','XXXXXX','491','49','Provisions pour dépréciation des comptes de clients',1),(292,'PCG99-BASE','TIERS','XXXXXX','495','49','Provisions pour dépréciation des comptes du groupe et des associés',1),(293,'PCG99-BASE','TIERS','XXXXXX','496','49','Provisions pour dépréciation des comptes de débiteurs divers',1),(294,'PCG99-BASE','FINAN','XXXXXX','50','5','Valeurs mobilières de placement',1),(295,'PCG99-BASE','FINAN','XXXXXX','501','50','Parts dans des entreprises liées',1),(296,'PCG99-BASE','FINAN','XXXXXX','502','50','Actions propres',1),(297,'PCG99-BASE','FINAN','XXXXXX','503','50','Actions',1),(298,'PCG99-BASE','FINAN','XXXXXX','504','50','Autres titres conférant un droit de propriété',1),(299,'PCG99-BASE','FINAN','XXXXXX','505','50','Obligations et bons émis par la société et rachetés par elle',1),(300,'PCG99-BASE','FINAN','XXXXXX','506','50','Obligations',1),(301,'PCG99-BASE','FINAN','XXXXXX','507','50','Bons du Trésor et bons de caisse à court terme',1),(302,'PCG99-BASE','FINAN','XXXXXX','508','50','Autres valeurs mobilières de placement et autres créances assimilées',1),(303,'PCG99-BASE','FINAN','XXXXXX','509','50','Versements restant à effectuer sur valeurs mobilières de placement non libérées',1),(304,'PCG99-BASE','FINAN','XXXXXX','51','5','Banques, établissements financiers et assimilés',1),(305,'PCG99-BASE','FINAN','XXXXXX','511','51','Valeurs à l\'encaissement',1),(306,'PCG99-BASE','FINAN','BANK','512','51','Banques',1),(307,'PCG99-BASE','FINAN','XXXXXX','514','51','Chèques postaux',1),(308,'PCG99-BASE','FINAN','XXXXXX','515','51','\"Caisses\" du Trésor et des établissements publics',1),(309,'PCG99-BASE','FINAN','XXXXXX','516','51','Sociétés de bourse',1),(310,'PCG99-BASE','FINAN','XXXXXX','517','51','Autres organismes financiers',1),(311,'PCG99-BASE','FINAN','XXXXXX','518','51','Intérêts courus',1),(312,'PCG99-BASE','FINAN','XXXXXX','519','51','Concours bancaires courants',1),(313,'PCG99-BASE','FINAN','XXXXXX','52','5','Instruments de trésorerie',1),(314,'PCG99-BASE','FINAN','CASH','53','5','Caisse',1),(315,'PCG99-BASE','FINAN','XXXXXX','531','53','Caisse siège social',1),(316,'PCG99-BASE','FINAN','XXXXXX','532','53','Caisse succursale (ou usine) A',1),(317,'PCG99-BASE','FINAN','XXXXXX','533','53','Caisse succursale (ou usine) B',1),(318,'PCG99-BASE','FINAN','XXXXXX','54','5','Régies d\'avance et accréditifs',1),(319,'PCG99-BASE','FINAN','XXXXXX','58','5','Virements internes',1),(320,'PCG99-BASE','FINAN','XXXXXX','59','5','Provisions pour dépréciation des comptes financiers',1),(321,'PCG99-BASE','FINAN','XXXXXX','590','59','Provisions pour dépréciation des valeurs mobilières de placement',1),(322,'PCG99-BASE','CHARGE','PRODUCT','60','6','Achats',1),(323,'PCG99-BASE','CHARGE','XXXXXX','601','60','Achats stockés - Matières premières (et fournitures)',1),(324,'PCG99-BASE','CHARGE','XXXXXX','602','60','Achats stockés - Autres approvisionnements',1),(325,'PCG99-BASE','CHARGE','XXXXXX','603','60','Variations des stocks (approvisionnements et marchandises)',1),(326,'PCG99-BASE','CHARGE','XXXXXX','604','60','Achats stockés - Matières premières (et fournitures)',1),(327,'PCG99-BASE','CHARGE','XXXXXX','605','60','Achats de matériel, équipements et travaux',1),(328,'PCG99-BASE','CHARGE','XXXXXX','606','60','Achats non stockés de matière et fournitures',1),(329,'PCG99-BASE','CHARGE','XXXXXX','607','60','Achats de marchandises',1),(330,'PCG99-BASE','CHARGE','XXXXXX','608','60','(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)',1),(331,'PCG99-BASE','CHARGE','XXXXXX','609','60','Rabais, remises et ristournes obtenus sur achats',1),(332,'PCG99-BASE','CHARGE','SERVICE','61','6','Services extérieurs',1),(333,'PCG99-BASE','CHARGE','XXXXXX','611','61','Sous-traitance générale',1),(334,'PCG99-BASE','CHARGE','XXXXXX','612','61','Redevances de crédit-bail',1),(335,'PCG99-BASE','CHARGE','XXXXXX','613','61','Locations',1),(336,'PCG99-BASE','CHARGE','XXXXXX','614','61','Charges locatives et de copropriété',1),(337,'PCG99-BASE','CHARGE','XXXXXX','615','61','Entretien et réparations',1),(338,'PCG99-BASE','CHARGE','XXXXXX','616','61','Primes d\'assurances',1),(339,'PCG99-BASE','CHARGE','XXXXXX','617','61','Etudes et recherches',1),(340,'PCG99-BASE','CHARGE','XXXXXX','618','61','Divers',1),(341,'PCG99-BASE','CHARGE','XXXXXX','619','61','Rabais, remises et ristournes obtenus sur services extérieurs',1),(342,'PCG99-BASE','CHARGE','XXXXXX','62','6','Autres services extérieurs',1),(343,'PCG99-BASE','CHARGE','XXXXXX','621','62','Personnel extérieur à l\'entreprise',1),(344,'PCG99-BASE','CHARGE','XXXXXX','622','62','Rémunérations d\'intermédiaires et honoraires',1),(345,'PCG99-BASE','CHARGE','XXXXXX','623','62','Publicité, publications, relations publiques',1),(346,'PCG99-BASE','CHARGE','XXXXXX','624','62','Transports de biens et transports collectifs du personnel',1),(347,'PCG99-BASE','CHARGE','XXXXXX','625','62','Déplacements, missions et réceptions',1),(348,'PCG99-BASE','CHARGE','XXXXXX','626','62','Frais postaux et de télécommunications',1),(349,'PCG99-BASE','CHARGE','XXXXXX','627','62','Services bancaires et assimilés',1),(350,'PCG99-BASE','CHARGE','XXXXXX','628','62','Divers',1),(351,'PCG99-BASE','CHARGE','XXXXXX','629','62','Rabais, remises et ristournes obtenus sur autres services extérieurs',1),(352,'PCG99-BASE','CHARGE','XXXXXX','63','6','Impôts, taxes et versements assimilés',1),(353,'PCG99-BASE','CHARGE','XXXXXX','631','63','Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)',1),(354,'PCG99-BASE','CHARGE','XXXXXX','633','63','Impôts, taxes et versements assimilés sur rémunérations (autres organismes)',1),(355,'PCG99-BASE','CHARGE','XXXXXX','635','63','Autres impôts, taxes et versements assimilés (administrations des impôts)',1),(356,'PCG99-BASE','CHARGE','XXXXXX','637','63','Autres impôts, taxes et versements assimilés (autres organismes)',1),(357,'PCG99-BASE','CHARGE','XXXXXX','64','6','Charges de personnel',1),(358,'PCG99-BASE','CHARGE','XXXXXX','641','64','Rémunérations du personnel',1),(359,'PCG99-BASE','CHARGE','XXXXXX','644','64','Rémunération du travail de l\'exploitant',1),(360,'PCG99-BASE','CHARGE','SOCIAL','645','64','Charges de sécurité sociale et de prévoyance',1),(361,'PCG99-BASE','CHARGE','XXXXXX','646','64','Cotisations sociales personnelles de l\'exploitant',1),(362,'PCG99-BASE','CHARGE','XXXXXX','647','64','Autres charges sociales',1),(363,'PCG99-BASE','CHARGE','XXXXXX','648','64','Autres charges de personnel',1),(364,'PCG99-BASE','CHARGE','XXXXXX','65','6','Autres charges de gestion courante',1),(365,'PCG99-BASE','CHARGE','XXXXXX','651','65','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',1),(366,'PCG99-BASE','CHARGE','XXXXXX','653','65','Jetons de présence',1),(367,'PCG99-BASE','CHARGE','XXXXXX','654','65','Pertes sur créances irrécouvrables',1),(368,'PCG99-BASE','CHARGE','XXXXXX','655','65','Quote-part de résultat sur opérations faites en commun',1),(369,'PCG99-BASE','CHARGE','XXXXXX','658','65','Charges diverses de gestion courante',1),(370,'PCG99-BASE','CHARGE','XXXXXX','66','6','Charges financières',1),(371,'PCG99-BASE','CHARGE','XXXXXX','661','66','Charges d\'intérêts',1),(372,'PCG99-BASE','CHARGE','XXXXXX','664','66','Pertes sur créances liées à des participations',1),(373,'PCG99-BASE','CHARGE','XXXXXX','665','66','Escomptes accordés',1),(374,'PCG99-BASE','CHARGE','XXXXXX','666','66','Pertes de change',1),(375,'PCG99-BASE','CHARGE','XXXXXX','667','66','Charges nettes sur cessions de valeurs mobilières de placement',1),(376,'PCG99-BASE','CHARGE','XXXXXX','668','66','Autres charges financières',1),(377,'PCG99-BASE','CHARGE','XXXXXX','67','6','Charges exceptionnelles',1),(378,'PCG99-BASE','CHARGE','XXXXXX','671','67','Charges exceptionnelles sur opérations de gestion',1),(379,'PCG99-BASE','CHARGE','XXXXXX','672','67','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les charges sur exercices antérieurs)',1),(380,'PCG99-BASE','CHARGE','XXXXXX','675','67','Valeurs comptables des éléments d\'actif cédés',1),(381,'PCG99-BASE','CHARGE','XXXXXX','678','67','Autres charges exceptionnelles',1),(382,'PCG99-BASE','CHARGE','XXXXXX','68','6','Dotations aux amortissements et aux provisions',1),(383,'PCG99-BASE','CHARGE','XXXXXX','681','68','Dotations aux amortissements et aux provisions - Charges d\'exploitation',1),(384,'PCG99-BASE','CHARGE','XXXXXX','686','68','Dotations aux amortissements et aux provisions - Charges financières',1),(385,'PCG99-BASE','CHARGE','XXXXXX','687','68','Dotations aux amortissements et aux provisions - Charges exceptionnelles',1),(386,'PCG99-BASE','CHARGE','XXXXXX','69','6','Participation des salariés - impôts sur les bénéfices et assimiles',1),(387,'PCG99-BASE','CHARGE','XXXXXX','691','69','Participation des salariés aux résultats',1),(388,'PCG99-BASE','CHARGE','XXXXXX','695','69','Impôts sur les bénéfices',1),(389,'PCG99-BASE','CHARGE','XXXXXX','696','69','Suppléments d\'impôt sur les sociétés liés aux distributions',1),(390,'PCG99-BASE','CHARGE','XXXXXX','697','69','Imposition forfaitaire annuelle des sociétés',1),(391,'PCG99-BASE','CHARGE','XXXXXX','698','69','Intégration fiscale',1),(392,'PCG99-BASE','CHARGE','XXXXXX','699','69','Produits - Reports en arrière des déficits',1),(393,'PCG99-BASE','PROD','XXXXXX','70','7','Ventes de produits fabriqués, prestations de services, marchandises',1),(394,'PCG99-BASE','PROD','PRODUCT','701','70','Ventes de produits finis',1),(395,'PCG99-BASE','PROD','XXXXXX','702','70','Ventes de produits intermédiaires',1),(396,'PCG99-BASE','PROD','XXXXXX','703','70','Ventes de produits résiduels',1),(397,'PCG99-BASE','PROD','XXXXXX','704','70','Travaux',1),(398,'PCG99-BASE','PROD','XXXXXX','705','70','Etudes',1),(399,'PCG99-BASE','PROD','SERVICE','706','70','Prestations de services',1),(400,'PCG99-BASE','PROD','PRODUCT','707','70','Ventes de marchandises',1),(401,'PCG99-BASE','PROD','PRODUCT','708','70','Produits des activités annexes',1),(402,'PCG99-BASE','PROD','XXXXXX','709','70','Rabais, remises et ristournes accordés par l\'entreprise',1),(403,'PCG99-BASE','PROD','XXXXXX','71','7','Production stockée (ou déstockage)',1),(404,'PCG99-BASE','PROD','XXXXXX','713','71','Variation des stocks (en-cours de production, produits)',1),(405,'PCG99-BASE','PROD','XXXXXX','72','7','Production immobilisée',1),(406,'PCG99-BASE','PROD','XXXXXX','721','72','Immobilisations incorporelles',1),(407,'PCG99-BASE','PROD','XXXXXX','722','72','Immobilisations corporelles',1),(408,'PCG99-BASE','PROD','XXXXXX','74','7','Subventions d\'exploitation',1),(409,'PCG99-BASE','PROD','XXXXXX','75','7','Autres produits de gestion courante',1),(410,'PCG99-BASE','PROD','XXXXXX','751','75','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',1),(411,'PCG99-BASE','PROD','XXXXXX','752','75','Revenus des immeubles non affectés à des activités professionnelles',1),(412,'PCG99-BASE','PROD','XXXXXX','753','75','Jetons de présence et rémunérations d\'administrateurs, gérants,...',1),(413,'PCG99-BASE','PROD','XXXXXX','754','75','Ristournes perçues des coopératives (provenant des excédents)',1),(414,'PCG99-BASE','PROD','XXXXXX','755','75','Quotes-parts de résultat sur opérations faites en commun',1),(415,'PCG99-BASE','PROD','XXXXXX','758','75','Produits divers de gestion courante',1),(416,'PCG99-BASE','PROD','XXXXXX','76','7','Produits financiers',1),(417,'PCG99-BASE','PROD','XXXXXX','761','76','Produits de participations',1),(418,'PCG99-BASE','PROD','XXXXXX','762','76','Produits des autres immobilisations financières',1),(419,'PCG99-BASE','PROD','XXXXXX','763','76','Revenus des autres créances',1),(420,'PCG99-BASE','PROD','XXXXXX','764','76','Revenus des valeurs mobilières de placement',1),(421,'PCG99-BASE','PROD','XXXXXX','765','76','Escomptes obtenus',1),(422,'PCG99-BASE','PROD','XXXXXX','766','76','Gains de change',1),(423,'PCG99-BASE','PROD','XXXXXX','767','76','Produits nets sur cessions de valeurs mobilières de placement',1),(424,'PCG99-BASE','PROD','XXXXXX','768','76','Autres produits financiers',1),(425,'PCG99-BASE','PROD','XXXXXX','77','7','Produits exceptionnels',1),(426,'PCG99-BASE','PROD','XXXXXX','771','77','Produits exceptionnels sur opérations de gestion',1),(427,'PCG99-BASE','PROD','XXXXXX','772','77','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les produits sur exercices antérieurs)',1),(428,'PCG99-BASE','PROD','XXXXXX','775','77','Produits des cessions d\'éléments d\'actif',1),(429,'PCG99-BASE','PROD','XXXXXX','777','77','Quote-part des subventions d\'investissement virée au résultat de l\'exercice',1),(430,'PCG99-BASE','PROD','XXXXXX','778','77','Autres produits exceptionnels',1),(431,'PCG99-BASE','PROD','XXXXXX','78','7','Reprises sur amortissements et provisions',1),(432,'PCG99-BASE','PROD','XXXXXX','781','78','Reprises sur amortissements et provisions (à inscrire dans les produits d\'exploitation)',1),(433,'PCG99-BASE','PROD','XXXXXX','786','78','Reprises sur provisions pour risques (à inscrire dans les produits financiers)',1),(434,'PCG99-BASE','PROD','XXXXXX','787','78','Reprises sur provisions (à inscrire dans les produits exceptionnels)',1),(435,'PCG99-BASE','PROD','XXXXXX','79','7','Transferts de charges',1),(436,'PCG99-BASE','PROD','XXXXXX','791','79','Transferts de charges d\'exploitation ',1),(437,'PCG99-BASE','PROD','XXXXXX','796','79','Transferts de charges financières',1),(438,'PCG99-BASE','PROD','XXXXXX','797','79','Transferts de charges exceptionnelles',1); +/*!40000 ALTER TABLE `llx_accountingaccount` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accountingdebcred` +-- + +DROP TABLE IF EXISTS `llx_accountingdebcred`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accountingdebcred` ( + `fk_transaction` int(11) NOT NULL, + `fk_account` int(11) NOT NULL, + `amount` double NOT NULL, + `direction` varchar(1) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accountingdebcred` +-- + +LOCK TABLES `llx_accountingdebcred` WRITE; +/*!40000 ALTER TABLE `llx_accountingdebcred` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_accountingdebcred` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accountingtransaction` +-- + +DROP TABLE IF EXISTS `llx_accountingtransaction`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accountingtransaction` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(128) NOT NULL, + `datec` date NOT NULL, + `fk_author` varchar(20) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_facture` int(11) DEFAULT NULL, + `fk_facture_fourn` int(11) DEFAULT NULL, + `fk_paiement` int(11) DEFAULT NULL, + `fk_paiement_fourn` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accountingtransaction` +-- + +LOCK TABLES `llx_accountingtransaction` WRITE; +/*!40000 ALTER TABLE `llx_accountingtransaction` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_accountingtransaction` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm` +-- + +DROP TABLE IF EXISTS `llx_actioncomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ref_ext` varchar(128) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datep` datetime DEFAULT NULL, + `datep2` datetime DEFAULT NULL, + `datea` datetime DEFAULT NULL, + `datea2` datetime DEFAULT NULL, + `fk_action` int(11) DEFAULT NULL, + `code` varchar(32) DEFAULT NULL, + `label` varchar(128) NOT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `fk_project` int(11) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_parent` int(11) NOT NULL DEFAULT '0', + `fk_user_action` int(11) DEFAULT NULL, + `transparency` int(11) DEFAULT NULL, + `fk_user_done` int(11) DEFAULT NULL, + `priority` smallint(6) DEFAULT NULL, + `fulldayevent` smallint(6) NOT NULL DEFAULT '0', + `punctual` smallint(6) NOT NULL DEFAULT '1', + `percent` smallint(6) NOT NULL DEFAULT '0', + `location` varchar(128) DEFAULT NULL, + `durationp` double DEFAULT NULL, + `durationa` double DEFAULT NULL, + `note` text, + `fk_element` int(11) DEFAULT NULL, + `elementtype` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx_actioncomm_datea` (`datea`), + KEY `idx_actioncomm_fk_soc` (`fk_soc`), + KEY `idx_actioncomm_fk_contact` (`fk_contact`) +) ENGINE=InnoDB AUTO_INCREMENT=320 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm` +-- + +LOCK TABLES `llx_actioncomm` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm` DISABLE KEYS */; +INSERT INTO `llx_actioncomm` VALUES (1,NULL,1,'2010-07-08 14:21:44','2010-07-08 14:21:44',NULL,NULL,50,NULL,'Company AAA and Co added into Dolibarr','2010-07-08 14:21:44','2010-07-08 12:21:44',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company AAA and Co added into Dolibarr\nAuthor: admin',NULL,NULL),(2,NULL,1,'2010-07-08 14:23:48','2010-07-08 14:23:48',NULL,NULL,50,NULL,'Company Belin SARL added into Dolibarr','2010-07-08 14:23:48','2010-07-08 12:23:48',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Belin SARL added into Dolibarr\nAuthor: admin',NULL,NULL),(3,NULL,1,'2010-07-08 22:42:12','2010-07-08 22:42:12',NULL,NULL,50,NULL,'Company Spanish Comp added into Dolibarr','2010-07-08 22:42:12','2010-07-08 20:42:12',1,NULL,NULL,3,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Spanish Comp added into Dolibarr\nAuthor: admin',NULL,NULL),(4,NULL,1,'2010-07-08 22:48:18','2010-07-08 22:48:18',NULL,NULL,50,NULL,'Company Prospector Vaalen added into Dolibarr','2010-07-08 22:48:18','2010-07-08 20:48:18',1,NULL,NULL,4,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Prospector Vaalen added into Dolibarr\nAuthor: admin',NULL,NULL),(5,NULL,1,'2010-07-08 23:22:57','2010-07-08 23:22:57',NULL,NULL,50,NULL,'Company NoCountry Co added into Dolibarr','2010-07-08 23:22:57','2010-07-08 21:22:57',1,NULL,NULL,5,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company NoCountry Co added into Dolibarr\nAuthor: admin',NULL,NULL),(6,NULL,1,'2010-07-09 00:15:09','2010-07-09 00:15:09',NULL,NULL,50,NULL,'Company Swiss customer added into Dolibarr','2010-07-09 00:15:09','2010-07-08 22:15:09',1,NULL,NULL,6,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Swiss customer added into Dolibarr\nAuthor: admin',NULL,NULL),(7,NULL,1,'2010-07-09 01:24:26','2010-07-09 01:24:26',NULL,NULL,50,NULL,'Company Generic customer added into Dolibarr','2010-07-09 01:24:26','2010-07-08 23:24:26',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Generic customer added into Dolibarr\nAuthor: admin',NULL,NULL),(8,NULL,1,'2010-07-10 14:54:27','2010-07-10 14:54:27',NULL,NULL,50,NULL,'Société Client salon ajoutée dans Dolibarr','2010-07-10 14:54:27','2010-07-10 12:54:27',1,NULL,NULL,8,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(9,NULL,1,'2010-07-10 14:54:44','2010-07-10 14:54:44',NULL,NULL,50,NULL,'Société Client salon invidivdu ajoutée dans Doliba','2010-07-10 14:54:44','2010-07-10 12:54:44',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon invidivdu ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(10,NULL,1,'2010-07-10 14:56:10','2010-07-10 14:56:10',NULL,NULL,50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:56:10','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice'),(11,NULL,1,'2010-07-10 14:58:53','2010-07-10 14:58:53',NULL,NULL,50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:58:53','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice'),(12,NULL,1,'2010-07-10 15:00:55','2010-07-10 15:00:55',NULL,NULL,50,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr','2010-07-10 15:00:55','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr\nAuteur: admin',1,'invoice'),(13,NULL,1,'2010-07-10 15:13:08','2010-07-10 15:13:08',NULL,NULL,50,NULL,'Société Smith Vick ajoutée dans Dolibarr','2010-07-10 15:13:08','2010-07-10 13:13:08',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Smith Vick ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(14,NULL,1,'2010-07-10 15:21:00','2010-07-10 16:21:00',NULL,NULL,5,NULL,'RDV avec mon chef','2010-07-10 15:21:48','2010-07-10 13:21:48',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'',3600,NULL,'',NULL,NULL),(15,NULL,1,'2010-07-10 18:18:16','2010-07-10 18:18:16',NULL,NULL,50,NULL,'Contrat CONTRAT1 validé dans Dolibarr','2010-07-10 18:18:16','2010-07-10 16:18:16',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Contrat CONTRAT1 validé dans Dolibarr\nAuteur: admin',NULL,NULL),(16,NULL,1,'2010-07-10 18:35:57','2010-07-10 18:35:57',NULL,NULL,50,NULL,'Société Mon client ajoutée dans Dolibarr','2010-07-10 18:35:57','2010-07-10 16:35:57',1,NULL,NULL,11,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Mon client ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(17,NULL,1,'2010-07-11 16:18:08','2010-07-11 16:18:08',NULL,NULL,50,NULL,'Société Dupont Alain ajoutée dans Dolibarr','2010-07-11 16:18:08','2010-07-11 14:18:08',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Dupont Alain ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(18,NULL,1,'2010-07-11 17:11:00','2010-07-11 17:17:00',NULL,NULL,5,NULL,'Rendez-vous','2010-07-11 17:11:22','2010-07-11 15:11:22',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'gfgdfgdf',360,NULL,'',NULL,NULL),(19,NULL,1,'2010-07-11 17:13:20','2010-07-11 17:13:20',NULL,NULL,50,NULL,'Société Vendeur de chips ajoutée dans Dolibarr','2010-07-11 17:13:20','2010-07-11 15:13:20',1,NULL,NULL,13,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Vendeur de chips ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(20,NULL,1,'2010-07-11 17:15:42','2010-07-11 17:15:42',NULL,NULL,50,NULL,'Commande CF1007-0001 validée','2010-07-11 17:15:42','2010-07-11 15:15:42',1,NULL,NULL,13,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0001 validée\nAuteur: admin',NULL,NULL),(21,NULL,1,'2010-07-11 18:47:33','2010-07-11 18:47:33',NULL,NULL,50,NULL,'Commande CF1007-0002 validée','2010-07-11 18:47:33','2010-07-11 16:47:33',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0002 validée\nAuteur: admin',NULL,NULL),(22,NULL,1,'2010-07-18 11:36:18','2010-07-18 11:36:18',NULL,NULL,50,NULL,'Proposition PR1007-0003 validée','2010-07-18 11:36:18','2011-07-18 17:29:22',1,NULL,NULL,4,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Proposition PR1007-0003 validée\nAuteur: admin',3,'propal'),(23,NULL,1,'2011-07-18 20:49:58','2011-07-18 20:49:58',NULL,NULL,50,NULL,'Invoice FA1007-0002 validated in Dolibarr','2011-07-18 20:49:58','2011-07-18 18:49:58',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 validated in Dolibarr\nAuthor: admin',2,'invoice'),(24,NULL,1,'2011-07-28 01:37:00',NULL,NULL,NULL,1,NULL,'Phone call','2011-07-28 01:37:48','2011-07-27 23:37:48',1,NULL,NULL,NULL,2,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL),(25,NULL,1,'2011-08-01 02:31:24','2011-08-01 02:31:24',NULL,NULL,50,NULL,'Company mmm added into Dolibarr','2011-08-01 02:31:24','2011-08-01 00:31:24',1,NULL,NULL,15,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company mmm added into Dolibarr\nAuthor: admin',15,'societe'),(26,NULL,1,'2011-08-01 02:31:43','2011-08-01 02:31:43',NULL,NULL,50,NULL,'Company ppp added into Dolibarr','2011-08-01 02:31:43','2011-08-01 00:31:43',1,NULL,NULL,16,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ppp added into Dolibarr\nAuthor: admin',16,'societe'),(27,NULL,1,'2011-08-01 02:41:26','2011-08-01 02:41:26',NULL,NULL,50,NULL,'Company aaa added into Dolibarr','2011-08-01 02:41:26','2011-08-01 00:41:26',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company aaa added into Dolibarr\nAuthor: admin',17,'societe'),(28,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',NULL,NULL,50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2011-08-01 01:34:11',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 validated in Dolibarr\nAuthor: admin',5,'invoice'),(29,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',NULL,NULL,50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2011-08-01 01:34:11',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 changed to paid in Dolibarr\nAuthor: admin',5,'invoice'),(30,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',NULL,NULL,50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2011-08-06 18:33:54',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 validated in Dolibarr\nAuthor: admin',6,'invoice'),(31,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',NULL,NULL,50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2011-08-06 18:33:54',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 changed to paid in Dolibarr\nAuthor: admin',6,'invoice'),(38,NULL,1,'2011-08-08 02:41:55','2011-08-08 02:41:55',NULL,NULL,50,NULL,'Invoice FA1108-0005 validated in Dolibarr','2011-08-08 02:41:55','2011-08-08 00:41:55',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 validated in Dolibarr\nAuthor: admin',8,'invoice'),(40,NULL,1,'2011-08-08 02:53:40','2011-08-08 02:53:40',NULL,NULL,50,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr','2011-08-08 02:53:40','2011-08-08 00:53:40',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr\nAuthor: admin',8,'invoice'),(41,NULL,1,'2011-08-08 02:54:05','2011-08-08 02:54:05',NULL,NULL,50,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr','2011-08-08 02:54:05','2011-08-08 00:54:05',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr\nAuthor: admin',2,'invoice'),(42,NULL,1,'2011-08-08 02:55:04','2011-08-08 02:55:04',NULL,NULL,50,NULL,'Invoice FA1107-0006 validated in Dolibarr','2011-08-08 02:55:04','2011-08-08 00:55:04',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 validated in Dolibarr\nAuthor: admin',3,'invoice'),(43,NULL,1,'2011-08-08 02:55:26','2011-08-08 02:55:26',NULL,NULL,50,NULL,'Invoice FA1108-0007 validated in Dolibarr','2011-08-08 02:55:26','2011-08-08 00:55:26',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0007 validated in Dolibarr\nAuthor: admin',9,'invoice'),(44,NULL,1,'2011-08-08 02:55:58','2011-08-08 02:55:58',NULL,NULL,50,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr','2011-08-08 02:55:58','2011-08-08 00:55:58',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr\nAuthor: admin',3,'invoice'),(45,NULL,1,'2011-08-08 03:04:22','2011-08-08 03:04:22',NULL,NULL,50,NULL,'Order CO1108-0001 validated','2011-08-08 03:04:22','2011-08-08 01:04:22',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1108-0001 validated\nAuthor: admin',5,'order'),(46,NULL,1,'2011-08-08 13:59:09','2011-08-08 13:59:09',NULL,NULL,50,NULL,'Order CO1107-0002 validated','2011-08-08 13:59:10','2011-08-08 11:59:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1107-0002 validated\nAuthor: admin',1,'order'),(47,NULL,1,'2011-08-08 14:24:18','2011-08-08 14:24:18',NULL,NULL,50,NULL,'Proposal PR1007-0001 validated','2011-08-08 14:24:18','2011-08-08 12:24:18',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1007-0001 validated\nAuthor: admin',1,'propal'),(48,NULL,1,'2011-08-08 14:24:24','2011-08-08 14:24:24',NULL,NULL,50,NULL,'Proposal PR1108-0004 validated','2011-08-08 14:24:24','2011-08-08 12:24:24',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1108-0004 validated\nAuthor: admin',4,'propal'),(49,NULL,1,'2011-08-08 15:04:37','2011-08-08 15:04:37',NULL,NULL,50,NULL,'Order CF1108-0003 validated','2011-08-08 15:04:37','2011-08-08 13:04:37',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CF1108-0003 validated\nAuthor: admin',6,'order_supplier'),(50,NULL,1,'2012-12-08 17:56:47','2012-12-08 17:56:47',NULL,NULL,40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:56:47','2012-12-08 16:56:47',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice'),(51,NULL,1,'2012-12-08 17:57:11','2012-12-08 17:57:11',NULL,NULL,40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:57:11','2012-12-08 16:57:11',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice'),(52,NULL,1,'2012-12-08 17:58:27','2012-12-08 17:58:27',NULL,NULL,40,NULL,'Facture FA1212-0008 validée dans Dolibarr','2012-12-08 17:58:27','2012-12-08 16:58:27',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0008 validée dans Dolibarr\nAuteur: admin',11,'invoice'),(53,NULL,1,'2012-12-08 18:20:49','2012-12-08 18:20:49',NULL,NULL,40,NULL,'Facture AV1212-0002 validée dans Dolibarr','2012-12-08 18:20:49','2012-12-08 17:20:49',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 validée dans Dolibarr\nAuteur: admin',12,'invoice'),(54,NULL,1,'2012-12-09 18:35:07','2012-12-09 18:35:07',NULL,NULL,40,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr','2012-12-09 18:35:07','2012-12-09 17:35:07',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr\nAuteur: admin',12,'invoice'),(55,NULL,1,'2012-12-09 20:14:42','2012-12-09 20:14:42',NULL,NULL,40,NULL,'Société doe john ajoutée dans Dolibarr','2012-12-09 20:14:42','2012-12-09 19:14:42',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Société doe john ajoutée dans Dolibarr\nAuteur: admin',18,'societe'),(56,NULL,1,'2012-12-12 18:54:19','2012-12-12 18:54:19',NULL,NULL,40,NULL,'Facture FA1212-0009 validée dans Dolibarr','2012-12-12 18:54:19','2012-12-12 17:54:19',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0009 validée dans Dolibarr\nAuteur: admin',55,'invoice'),(121,NULL,1,'2012-12-06 10:00:00',NULL,NULL,NULL,50,NULL,'aaab','2012-12-21 17:48:08','2012-12-21 16:54:07',3,1,NULL,NULL,NULL,0,3,NULL,NULL,1,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL),(122,NULL,1,'2012-12-21 18:09:52','2012-12-21 18:09:52',NULL,NULL,40,NULL,'Facture client FA1007-0001 envoyée par EMail','2012-12-21 18:09:52','2012-12-21 17:09:52',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Mail envoyé par Firstname SuperAdminName à laurent@destailleur.fr.\nSujet du mail: Envoi facture FA1007-0001\nCorps du mail:\nVeuillez trouver ci-joint la facture FA1007-0001\r\n\r\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\r\n\r\nhttp://localhost/dolibarrnew/public/paypal/newpayment.php?source=invoice&ref=FA1007-0001&securekey=50c82fab36bb3b6aa83e2a50691803b2\r\n\r\nCordialement',1,'invoice'),(123,NULL,1,'2013-01-06 13:13:57','2013-01-06 13:13:57',NULL,NULL,40,NULL,'Facture 16 validée dans Dolibarr','2013-01-06 13:13:57','2013-01-06 12:13:57',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture 16 validée dans Dolibarr\nAuteur: admin',16,'invoice_supplier'),(124,NULL,1,'2013-01-12 12:23:05','2013-01-12 12:23:05',NULL,NULL,40,NULL,'Patient aaa ajouté','2013-01-12 12:23:05','2013-01-12 11:23:05',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient aaa ajouté\nAuteur: admin',19,'societe'),(125,NULL,1,'2013-01-12 12:52:20','2013-01-12 12:52:20',NULL,NULL,40,NULL,'Patient pppoo ajouté','2013-01-12 12:52:20','2013-01-12 11:52:20',1,NULL,NULL,20,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pppoo ajouté\nAuteur: admin',20,'societe'),(127,NULL,1,'2013-01-19 18:22:48','2013-01-19 18:22:48',NULL,NULL,40,NULL,'Facture FS1301-0001 validée dans Dolibarr','2013-01-19 18:22:48','2013-01-19 17:22:48',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0001 validée dans Dolibarr\nAuteur: admin',148,'invoice'),(128,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',NULL,NULL,40,NULL,'Facture FA6801-0010 validée dans Dolibarr','2013-01-19 18:31:10','2013-01-19 17:31:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 validée dans Dolibarr\nAuteur: admin',150,'invoice'),(129,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',NULL,NULL,40,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr','2013-01-19 18:31:10','2013-01-19 17:31:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr\nAuteur: admin',150,'invoice'),(130,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',NULL,NULL,40,NULL,'Facture FS1301-0002 validée dans Dolibarr','2013-01-19 18:31:58','2013-01-19 17:31:58',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 validée dans Dolibarr\nAuteur: admin',151,'invoice'),(131,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',NULL,NULL,40,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr','2013-01-19 18:31:58','2013-01-19 17:31:58',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr\nAuteur: admin',151,'invoice'),(132,NULL,1,'2013-01-23 15:07:54','2013-01-23 15:07:54',NULL,NULL,50,NULL,'Consultation 24 saisie (aaa)','2013-01-23 15:07:54','2013-01-23 14:07:54',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Consultation 24 saisie (aaa)\nAuteur: admin',24,'cabinetmed_cons'),(133,NULL,1,'2013-01-23 16:56:58','2013-01-23 16:56:58',NULL,NULL,40,NULL,'Patient pa ajouté','2013-01-23 16:56:58','2013-01-23 15:56:58',1,NULL,NULL,21,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pa ajouté\nAuteur: admin',21,'societe'),(134,NULL,1,'2013-01-23 17:34:00',NULL,NULL,NULL,50,NULL,'bbcv','2013-01-23 17:35:21','2013-01-23 16:35:21',1,NULL,1,2,NULL,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL),(135,NULL,1,'2013-02-12 15:54:00','2013-02-12 15:54:00',NULL,NULL,40,NULL,'Facture FA1212-0011 validée dans Dolibarr','2013-02-12 15:54:37','2013-02-20 20:11:54',1,1,NULL,7,NULL,0,NULL,NULL,1,0,0,1,50,NULL,NULL,NULL,'Facture FA1212-0011 validée dans Dolibarr
\r\nAuteur: admin',13,'invoice'),(136,NULL,1,'2013-02-12 17:06:51','2013-02-12 17:06:51',NULL,NULL,40,NULL,'Commande CO1107-0003 validée','2013-02-12 17:06:51','2013-02-12 16:06:51',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0003 validée\nAuteur: admin',2,'order'),(137,NULL,1,'2013-02-17 16:22:10','2013-02-17 16:22:10',NULL,NULL,40,NULL,'Proposition PR1302-0009 validée','2013-02-17 16:22:10','2013-02-17 15:22:10',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0009 validée\nAuteur: admin',9,'propal'),(138,NULL,1,'2013-02-17 16:27:00','2013-02-17 16:27:00',NULL,NULL,40,NULL,'Facture FA1302-0012 validée dans Dolibarr','2013-02-17 16:27:00','2013-02-17 15:27:00',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1302-0012 validée dans Dolibarr\nAuteur: admin',152,'invoice'),(139,NULL,1,'2013-02-17 16:27:29','2013-02-17 16:27:29',NULL,NULL,40,NULL,'Proposition PR1302-0010 validée','2013-02-17 16:27:29','2013-02-17 15:27:29',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0010 validée\nAuteur: admin',11,'propal'),(140,NULL,1,'2013-02-17 18:27:56','2013-02-17 18:27:56',NULL,NULL,40,NULL,'Commande CO1107-0004 validée','2013-02-17 18:27:56','2013-02-17 17:27:56',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0004 validée\nAuteur: admin',3,'order'),(141,NULL,1,'2013-02-17 18:38:14','2013-02-17 18:38:14',NULL,NULL,40,NULL,'Commande CO1302-0005 validée','2013-02-17 18:38:14','2013-02-17 17:38:14',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1302-0005 validée\nAuteur: admin',7,'order'),(142,NULL,1,'2013-02-26 22:57:50','2013-02-26 22:57:50',NULL,NULL,40,NULL,'Company pppp added into Dolibarr','2013-02-26 22:57:50','2013-02-26 21:57:50',1,NULL,NULL,22,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company pppp added into Dolibarr\nAuthor: admin',22,'societe'),(143,NULL,1,'2013-02-26 22:58:13','2013-02-26 22:58:13',NULL,NULL,40,NULL,'Company ttttt added into Dolibarr','2013-02-26 22:58:13','2013-02-26 21:58:13',1,NULL,NULL,23,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ttttt added into Dolibarr\nAuthor: admin',23,'societe'),(144,NULL,1,'2013-02-27 10:00:00','2013-02-27 19:20:00',NULL,NULL,5,NULL,'Rendez-vous','2013-02-27 19:20:53','2013-02-27 18:20:53',1,NULL,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,'',33600,NULL,'',NULL,NULL),(145,NULL,1,'2013-02-27 19:28:00',NULL,NULL,NULL,2,NULL,'fdsfsd','2013-02-27 19:28:48','2013-02-27 18:29:53',1,1,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL),(146,NULL,1,'2013-03-06 10:05:07','2013-03-06 10:05:07',NULL,NULL,40,NULL,'Contrat (PROV3) validé dans Dolibarr','2013-03-06 10:05:07','2013-03-06 09:05:07',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Contrat (PROV3) validé dans Dolibarr\nAuteur: admin',3,'contract'),(147,NULL,1,'2013-03-06 16:43:37','2013-03-06 16:43:37',NULL,NULL,40,NULL,'Facture FA1307-0013 validée dans Dolibarr','2013-03-06 16:43:37','2013-03-06 15:43:37',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée dans Dolibarr\nAuteur: admin',158,'invoice'),(148,NULL,1,'2013-03-06 16:44:12','2013-03-06 16:44:12',NULL,NULL,40,NULL,'Facture FA1407-0014 validée dans Dolibarr','2013-03-06 16:44:12','2013-03-06 15:44:12',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1407-0014 validée dans Dolibarr\nAuteur: admin',159,'invoice'),(149,NULL,1,'2013-03-06 16:47:48','2013-03-06 16:47:48',NULL,NULL,40,NULL,'Facture FA1507-0015 validée dans Dolibarr','2013-03-06 16:47:48','2013-03-06 15:47:48',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1507-0015 validée dans Dolibarr\nAuteur: admin',160,'invoice'),(150,NULL,1,'2013-03-06 16:48:16','2013-03-06 16:48:16',NULL,NULL,40,NULL,'Facture FA1607-0016 validée dans Dolibarr','2013-03-06 16:48:16','2013-03-06 15:48:16',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1607-0016 validée dans Dolibarr\nAuteur: admin',161,'invoice'),(151,NULL,1,'2013-03-06 17:13:59','2013-03-06 17:13:59',NULL,NULL,40,NULL,'Société smith smith ajoutée dans Dolibarr','2013-03-06 17:13:59','2013-03-06 16:13:59',1,NULL,NULL,24,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Société smith smith ajoutée dans Dolibarr\nAuteur: admin',24,'societe'),(152,NULL,1,'2013-03-08 10:02:22','2013-03-08 10:02:22',NULL,NULL,40,NULL,'Proposition (PROV12) validée dans Dolibarr','2013-03-08 10:02:22','2013-03-08 09:02:22',1,NULL,NULL,23,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition (PROV12) validée dans Dolibarr\nAuteur: admin',12,'propal'),(203,NULL,1,'2013-03-09 19:39:27','2013-03-09 19:39:27',NULL,NULL,40,'AC_ORDER_SUPPLIER_VALIDATE','Commande CF1303-0004 validée','2013-03-09 19:39:27','2013-03-09 18:39:27',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CF1303-0004 validée\nAuteur: admin',13,'order_supplier'),(204,NULL,1,'2013-03-10 15:47:37','2013-03-10 15:47:37',NULL,NULL,40,'AC_COMPANY_CREATE','Patient créé','2013-03-10 15:47:37','2013-03-10 14:47:37',1,NULL,NULL,25,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuteur: admin',25,'societe'),(205,NULL,1,'2013-03-10 15:57:32','2013-03-10 15:57:32',NULL,NULL,40,'AC_COMPANY_CREATE','Tiers créé','2013-03-10 15:57:32','2013-03-10 14:57:32',1,NULL,NULL,26,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Tiers créé\nAuteur: admin',26,'societe'),(206,NULL,1,'2013-03-10 15:58:28','2013-03-10 15:58:28',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0017 validée','2013-03-10 15:58:28','2013-03-10 14:58:28',1,NULL,NULL,26,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0017 validée\nAuteur: admin',208,'invoice'),(207,NULL,1,'2013-03-19 09:38:10','2013-03-19 09:38:10',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0018 validée','2013-03-19 09:38:10','2013-03-19 08:38:10',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0018 validée\nAuteur: admin',209,'invoice'),(208,NULL,1,'2013-03-20 14:30:11','2013-03-20 14:30:11',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1107-0019 validée','2013-03-20 14:30:11','2013-03-20 13:30:11',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1107-0019 validée\nAuteur: admin',210,'invoice'),(209,NULL,1,'2013-03-22 09:40:25','2013-03-22 09:40:25',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-22 09:40:25','2013-03-22 08:40:25',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice'),(210,NULL,1,'2013-03-23 17:16:25','2013-03-23 17:16:25',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-23 17:16:25','2013-03-23 16:16:25',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice'),(211,NULL,1,'2013-03-23 18:08:27','2013-03-23 18:08:27',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1307-0013 validée','2013-03-23 18:08:27','2013-03-23 17:08:27',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée\nAuteur: admin',158,'invoice'),(212,NULL,1,'2013-03-24 15:54:00','2013-03-24 15:54:00',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1212-0021 validée','2013-03-24 15:54:00','2013-03-24 14:54:00',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0021 validée\nAuteur: admin',32,'invoice'),(213,NULL,1,'2013-11-07 01:02:39','2013-11-07 01:02:39',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:02:39','2013-11-07 00:02:39',1,NULL,NULL,27,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',27,'societe'),(214,NULL,1,'2013-11-07 01:05:22','2013-11-07 01:05:22',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:05:22','2013-11-07 00:05:22',1,NULL,NULL,28,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',28,'societe'),(215,NULL,1,'2013-11-07 01:07:07','2013-11-07 01:07:07',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:07','2013-11-07 00:07:07',1,NULL,NULL,29,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',29,'societe'),(216,NULL,1,'2013-11-07 01:07:58','2013-11-07 01:07:58',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:58','2013-11-07 00:07:58',1,NULL,NULL,30,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',30,'societe'),(217,NULL,1,'2013-11-07 01:10:09','2013-11-07 01:10:09',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:10:09','2013-11-07 00:10:09',1,NULL,NULL,31,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',31,'societe'),(218,NULL,1,'2013-11-07 01:15:57','2013-11-07 01:15:57',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:15:57','2013-11-07 00:15:57',1,NULL,NULL,32,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',32,'societe'),(219,NULL,1,'2013-11-07 01:16:51','2013-11-07 01:16:51',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:16:51','2013-11-07 00:16:51',1,NULL,NULL,33,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',33,'societe'); +/*!40000 ALTER TABLE `llx_actioncomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm_extrafields` +-- + +DROP TABLE IF EXISTS `llx_actioncomm_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_actioncomm_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm_extrafields` +-- + +LOCK TABLES `llx_actioncomm_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_actioncomm_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm_resources` +-- + +DROP TABLE IF EXISTS `llx_actioncomm_resources`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm_resources` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_actioncomm` int(11) NOT NULL, + `element_type` varchar(50) NOT NULL, + `fk_element` int(11) NOT NULL, + `answer_status` varchar(50) DEFAULT NULL, + `mandatory` smallint(6) DEFAULT NULL, + `transparent` smallint(6) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_actioncomm_resources_idx1` (`fk_actioncomm`,`element_type`,`fk_element`), + KEY `idx_actioncomm_resources_fk_element` (`fk_element`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm_resources` +-- + +LOCK TABLES `llx_actioncomm_resources` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm_resources` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_actioncomm_resources` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent` +-- + +DROP TABLE IF EXISTS `llx_adherent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `civilite` varchar(6) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `login` varchar(50) DEFAULT NULL, + `pass` varchar(50) DEFAULT NULL, + `fk_adherent_type` int(11) NOT NULL, + `morphy` varchar(3) NOT NULL, + `societe` varchar(50) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `address` text, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `state_id` varchar(50) DEFAULT NULL, + `country` varchar(50) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `phone` varchar(30) DEFAULT NULL, + `phone_perso` varchar(30) DEFAULT NULL, + `phone_mobile` varchar(30) DEFAULT NULL, + `birth` date DEFAULT NULL, + `photo` varchar(255) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `public` smallint(6) NOT NULL DEFAULT '0', + `datefin` datetime DEFAULT NULL, + `note` text, + `datevalid` datetime DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_adherent_login` (`login`,`entity`), + UNIQUE KEY `uk_adherent_fk_soc` (`fk_soc`), + KEY `idx_adherent_fk_adherent_type` (`fk_adherent_type`), + CONSTRAINT `adherent_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_adherent_adherent_type` FOREIGN KEY (`fk_adherent_type`) REFERENCES `llx_adherent_type` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent` +-- + +LOCK TABLES `llx_adherent` WRITE; +/*!40000 ALTER TABLE `llx_adherent` DISABLE KEYS */; +INSERT INTO `llx_adherent` VALUES (1,1,NULL,NULL,'Smith','Vick','vsmith','vsx1n8tf',2,'phy',NULL,10,NULL,NULL,NULL,NULL,'102','vsmith@email.com',NULL,NULL,NULL,NULL,'1960-07-07',NULL,1,0,'2012-07-09 00:00:00',NULL,'2010-07-10 15:12:56','2010-07-08 23:50:00','2013-03-20 13:30:11',1,1,1,NULL,NULL),(2,1,NULL,NULL,'Dupont','Alain','adupont','adupont',2,'phy',NULL,12,NULL,NULL,NULL,NULL,'1','toto@aa.com',NULL,NULL,NULL,NULL,'1972-07-08',NULL,1,1,'2017-07-17 00:00:00',NULL,'2010-07-10 15:03:32','2010-07-10 15:03:09','2013-03-06 15:48:16',1,1,1,NULL,NULL),(3,1,NULL,NULL,'john','doe','john','8bs6gty5',2,'phy',NULL,18,NULL,NULL,NULL,NULL,'1','johndoe@email.com',NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,'2011-07-18 21:28:00','2011-07-18 21:10:09','2012-12-09 19:14:42',1,1,1,NULL,NULL),(4,1,NULL,NULL,'smith','smith','Smith','s6hjp10f',2,'phy',NULL,24,NULL,NULL,NULL,NULL,'11','smith@email.com',NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,'2011-07-18 21:27:52','2011-07-18 21:27:44','2013-03-06 16:13:59',1,1,1,NULL,NULL); +/*!40000 ALTER TABLE `llx_adherent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_extrafields` +-- + +DROP TABLE IF EXISTS `llx_adherent_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `zzz` varchar(125) DEFAULT NULL, + `aaa` varchar(255) DEFAULT NULL, + `sssss` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_adherent_options` (`fk_object`), + KEY `idx_adherent_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_extrafields` +-- + +LOCK TABLES `llx_adherent_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_adherent_extrafields` DISABLE KEYS */; +INSERT INTO `llx_adherent_extrafields` VALUES (2,'2011-06-19 12:03:23',12,'aaa',NULL,NULL,NULL),(3,'2011-06-19 14:19:32',13,NULL,NULL,NULL,NULL),(8,'2011-06-19 18:08:09',7,'zzz',NULL,NULL,NULL),(34,'2011-06-22 10:06:51',14,'moo',NULL,NULL,NULL),(37,'2011-06-22 10:43:55',16,'z',NULL,NULL,NULL),(40,'2011-06-22 10:55:37',17,NULL,NULL,NULL,NULL),(41,'2011-06-22 10:56:07',18,'l',NULL,NULL,NULL),(43,'2011-06-23 07:40:56',19,NULL,NULL,NULL,NULL),(44,'2011-06-26 18:13:20',20,'gdfgdf',NULL,NULL,NULL),(46,'2011-06-26 19:29:23',22,'gdfgdf',NULL,NULL,NULL),(47,'2011-07-03 16:17:56',23,NULL,NULL,NULL,NULL),(48,'2011-07-03 16:21:05',24,NULL,NULL,NULL,NULL),(49,'2011-07-03 16:30:54',25,NULL,NULL,NULL,NULL),(50,'2011-07-03 16:48:13',26,NULL,NULL,NULL,NULL),(51,'2011-07-03 16:51:36',27,NULL,NULL,NULL,NULL),(52,'2011-07-03 16:53:37',28,NULL,NULL,NULL,NULL),(53,'2011-07-03 16:54:24',29,NULL,NULL,NULL,NULL),(54,'2011-07-05 08:21:35',30,NULL,NULL,NULL,NULL),(55,'2011-07-05 08:26:15',31,NULL,NULL,NULL,NULL),(59,'2011-07-13 11:18:55',46,NULL,NULL,NULL,NULL),(61,'2011-07-13 11:50:36',47,NULL,NULL,NULL,NULL),(62,'2011-07-18 19:10:09',3,NULL,NULL,NULL,NULL),(63,'2011-07-18 19:27:44',4,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_adherent_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_type` +-- + +DROP TABLE IF EXISTS `llx_adherent_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_type` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `statut` smallint(6) NOT NULL DEFAULT '0', + `libelle` varchar(50) NOT NULL, + `cotisation` varchar(3) NOT NULL DEFAULT 'yes', + `vote` varchar(3) NOT NULL DEFAULT 'yes', + `note` text, + `mail_valid` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_adherent_type_libelle` (`libelle`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_type` +-- + +LOCK TABLES `llx_adherent_type` WRITE; +/*!40000 ALTER TABLE `llx_adherent_type` DISABLE KEYS */; +INSERT INTO `llx_adherent_type` VALUES (1,1,'2010-07-08 21:41:55',1,'Board members','1','1','','
'),(2,1,'2010-07-08 21:41:43',1,'Standard members','1','0','','
'); +/*!40000 ALTER TABLE `llx_adherent_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_type_extrafields` +-- + +DROP TABLE IF EXISTS `llx_adherent_type_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_type_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_adherent_type_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_type_extrafields` +-- + +LOCK TABLES `llx_adherent_type_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_adherent_type_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_adherent_type_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_advanced_extrafields` +-- + +DROP TABLE IF EXISTS `llx_advanced_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_advanced_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `entity` int(11) NOT NULL DEFAULT '1', + `elementtype` varchar(64) NOT NULL, + `name` varchar(64) NOT NULL, + `label` varchar(64) NOT NULL, + `format` varchar(8) NOT NULL, + `fieldsize` int(11) DEFAULT NULL, + `maxlength` int(11) DEFAULT NULL, + `options` varchar(255) DEFAULT NULL, + `rang` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_advanced_extrafields_name` (`elementtype`,`entity`,`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_advanced_extrafields` +-- + +LOCK TABLES `llx_advanced_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_advanced_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_advanced_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_advanced_extrafields_options` +-- + +DROP TABLE IF EXISTS `llx_advanced_extrafields_options`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_advanced_extrafields_options` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_extrafields` int(11) NOT NULL, + `value` varchar(255) NOT NULL, + `rang` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_advanced_extrafields_options_fk_advanced_extrafields` (`fk_extrafields`), + CONSTRAINT `fk_advanced_extrafields_options_fk_advanced_extrafields` FOREIGN KEY (`fk_extrafields`) REFERENCES `llx_advanced_extrafields` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_advanced_extrafields_options` +-- + +LOCK TABLES `llx_advanced_extrafields_options` WRITE; +/*!40000 ALTER TABLE `llx_advanced_extrafields_options` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_advanced_extrafields_options` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_advanced_extrafields_values` +-- + +DROP TABLE IF EXISTS `llx_advanced_extrafields_values`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_advanced_extrafields_values` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `datem` datetime DEFAULT NULL, + `fk_element` int(11) NOT NULL, + `fk_extrafields` int(11) NOT NULL, + `value` varchar(255) DEFAULT NULL, + `fk_user_create` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_advanced_extrafields_values_fk_advanced_extrafields` (`fk_extrafields`,`entity`), + CONSTRAINT `fk_advanced_extrafields_values_fk_advanced_extrafields` FOREIGN KEY (`fk_extrafields`) REFERENCES `llx_advanced_extrafields` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_advanced_extrafields_values` +-- + +LOCK TABLES `llx_advanced_extrafields_values` WRITE; +/*!40000 ALTER TABLE `llx_advanced_extrafields_values` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_advanced_extrafields_values` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank` +-- + +DROP TABLE IF EXISTS `llx_bank`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datev` date DEFAULT NULL, + `dateo` date DEFAULT NULL, + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `label` varchar(255) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_rappro` int(11) DEFAULT NULL, + `fk_type` varchar(6) DEFAULT NULL, + `num_releve` varchar(50) DEFAULT NULL, + `num_chq` varchar(50) DEFAULT NULL, + `rappro` tinyint(4) DEFAULT '0', + `note` text, + `fk_bordereau` int(11) DEFAULT '0', + `banque` varchar(255) DEFAULT NULL, + `emetteur` varchar(255) DEFAULT NULL, + `author` varchar(40) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_bank_datev` (`datev`), + KEY `idx_bank_dateo` (`dateo`), + KEY `idx_bank_fk_account` (`fk_account`), + KEY `idx_bank_rappro` (`rappro`) +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank` +-- + +LOCK TABLES `llx_bank` WRITE; +/*!40000 ALTER TABLE `llx_bank` DISABLE KEYS */; +INSERT INTO `llx_bank` VALUES (1,'2010-07-08 23:56:14','2013-03-07 21:28:51','2010-07-08','2010-07-08',2000.00000000,'(Initial balance)',1,NULL,1,'SOLD','201210',NULL,1,NULL,0,NULL,NULL,NULL),(2,'2010-07-09 00:00:24','0000-00-00 00:00:00','2010-07-09','2010-07-09',500.00000000,'(Initial balance)',2,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(3,'2010-07-10 13:33:42','0000-00-00 00:00:00','2010-07-10','2010-07-10',0.00000000,'(Solde initial)',3,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(4,'2010-07-10 14:59:41','0000-00-00 00:00:00','2010-07-10','2010-07-10',0.02000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,'Client salon invidivdu',NULL),(5,'2011-07-18 20:50:24','0000-00-00 00:00:00','2011-07-08','2011-07-08',20.00000000,'(CustomerInvoicePayment)',1,1,NULL,'CB','201107',NULL,1,NULL,0,NULL,NULL,NULL),(6,'2011-07-18 20:50:47','0000-00-00 00:00:00','2011-07-08','2011-07-08',10.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(8,'2011-08-01 03:34:11','2013-03-07 21:28:51','2011-08-01','2011-08-01',5.63000000,'(CustomerInvoicePayment)',1,1,1,'CB','201210',NULL,1,NULL,0,NULL,NULL,NULL),(12,'2011-08-05 23:11:37','2013-03-07 21:33:57','2011-08-05','2011-08-05',-10.00000000,'(SocialContributionPayment)',1,1,1,'VIR','201210',NULL,1,NULL,0,NULL,NULL,NULL),(13,'2011-08-06 20:33:54','0000-00-00 00:00:00','2011-08-06','2011-08-06',5.98000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(14,'2011-08-08 02:53:40','0000-00-00 00:00:00','2011-08-08','2011-08-08',26.10000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(15,'2011-08-08 02:55:58','2013-03-07 21:39:20','2011-08-08','2011-08-08',26.96000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201211',NULL,1,NULL,0,NULL,NULL,NULL),(16,'2012-12-09 15:28:44','2012-12-09 14:28:44','2012-12-09','2012-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(17,'2012-12-09 15:28:53','2012-12-09 14:33:07','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(18,'2012-12-09 17:35:55','2012-12-09 16:35:55','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(19,'2012-12-09 17:37:02','2012-12-09 16:37:02','2012-12-09','2012-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(20,'2012-12-09 18:35:07','2012-12-09 17:35:07','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(21,'2012-12-12 18:54:33','2013-03-07 21:28:51','2012-12-12','2012-12-12',1.00000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201210',NULL,1,NULL,0,NULL,NULL,NULL),(22,'2013-03-06 16:48:16','2013-03-06 15:48:16','2013-03-06','2013-03-06',20.00000000,'(SubscriptionPayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(23,'2013-03-20 14:30:11','2013-03-20 13:30:11','2013-03-20','2013-03-20',10.00000000,'(SubscriptionPayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_bank` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_account` +-- + +DROP TABLE IF EXISTS `llx_bank_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_account` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(12) NOT NULL, + `label` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `bank` varchar(60) DEFAULT NULL, + `code_banque` varchar(8) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(11) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `country_iban` varchar(2) DEFAULT NULL, + `cle_iban` varchar(2) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `state_id` varchar(50) DEFAULT NULL, + `fk_pays` int(11) NOT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` text, + `courant` smallint(6) NOT NULL DEFAULT '0', + `clos` smallint(6) NOT NULL DEFAULT '0', + `rappro` smallint(6) DEFAULT '1', + `url` varchar(128) DEFAULT NULL, + `account_number` varchar(8) DEFAULT NULL, + `currency_code` varchar(3) NOT NULL, + `min_allowed` int(11) DEFAULT '0', + `min_desired` int(11) DEFAULT '0', + `comment` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bank_account_label` (`label`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_account` +-- + +LOCK TABLES `llx_bank_account` WRITE; +/*!40000 ALTER TABLE `llx_bank_account` DISABLE KEYS */; +INSERT INTO `llx_bank_account` VALUES (1,'2010-07-08 23:56:14','2013-03-24 14:53:09','SWIBAC','Swiss bank account',1,'gdfgdf','','','gdfgdfgdfg','','','',NULL,NULL,'gd fgdf g\r\ngdfgdfgdf\r\ngfdgdfgdf',NULL,169,'gdfgdfgd','dfgdfgd\r\ngdfgdfgdf\r\ngdfgdfg',1,0,1,NULL,'','EUR',1500,1500,''),(2,'2010-07-09 00:00:24','2013-03-24 14:50:40','SWIBAC2','Swiss bank account 2',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,169,NULL,NULL,1,1,1,NULL,'','EUR',200,400,''),(3,'2010-07-10 13:33:42','2010-07-10 11:33:42','ACCOUNTCASH','Account for cash',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'3',1,NULL,NULL,2,0,1,NULL,'','EUR',0,0,'
'); +/*!40000 ALTER TABLE `llx_bank_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_categ` +-- + +DROP TABLE IF EXISTS `llx_bank_categ`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_categ` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_categ` +-- + +LOCK TABLES `llx_bank_categ` WRITE; +/*!40000 ALTER TABLE `llx_bank_categ` DISABLE KEYS */; +INSERT INTO `llx_bank_categ` VALUES (1,'Bank category one',1),(2,'Bank category two',1); +/*!40000 ALTER TABLE `llx_bank_categ` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_class` +-- + +DROP TABLE IF EXISTS `llx_bank_class`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_class` ( + `lineid` int(11) NOT NULL, + `fk_categ` int(11) NOT NULL, + UNIQUE KEY `uk_bank_class_lineid` (`lineid`,`fk_categ`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_class` +-- + +LOCK TABLES `llx_bank_class` WRITE; +/*!40000 ALTER TABLE `llx_bank_class` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_bank_class` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_url` +-- + +DROP TABLE IF EXISTS `llx_bank_url`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_url` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_bank` int(11) DEFAULT NULL, + `url_id` int(11) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `type` varchar(20) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bank_url` (`fk_bank`,`type`) +) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_url` +-- + +LOCK TABLES `llx_bank_url` WRITE; +/*!40000 ALTER TABLE `llx_bank_url` DISABLE KEYS */; +INSERT INTO `llx_bank_url` VALUES (1,4,1,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(2,4,9,'/dolibarrnew/compta/fiche.php?socid=','Client salon invidivdu','company'),(3,5,2,'/compta/paiement/fiche.php?id=','(paiement)','payment'),(4,5,2,'/comm/fiche.php?socid=','Belin SARL','company'),(5,6,3,'/compta/paiement/fiche.php?id=','(paiement)','payment'),(6,6,2,'/comm/fiche.php?socid=','Belin SARL','company'),(9,8,5,'/compta/paiement/fiche.php?id=','(paiement)','payment'),(10,8,7,'/comm/fiche.php?socid=','Generic customer','company'),(17,12,4,'/compta/payment_sc/fiche.php?id=','(paiement)','payment_sc'),(18,12,4,'/compta/charges.php?id=','Assurance Chomage (fff)','sc'),(19,13,6,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(20,13,7,'/dolibarrnew/comm/fiche.php?socid=','Generic customer','company'),(21,14,8,'/compta/paiement/fiche.php?id=','(paiement)','payment'),(22,14,2,'/comm/fiche.php?socid=','Belin SARL','company'),(23,15,9,'/compta/paiement/fiche.php?id=','(paiement)','payment'),(24,15,10,'/comm/fiche.php?socid=','Smith Vick','company'),(25,16,17,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(26,16,10,'/dolibarrnew/comm/fiche.php?socid=','Smith Vick','company'),(27,17,18,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(28,17,10,'/dolibarrnew/comm/fiche.php?socid=','Smith Vick','company'),(29,18,19,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(30,18,10,'/dolibarrnew/comm/fiche.php?socid=','Smith Vick','company'),(31,19,20,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(32,19,10,'/dolibarrnew/comm/fiche.php?socid=','Smith Vick','company'),(33,20,21,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(34,20,10,'/dolibarrnew/comm/fiche.php?socid=','Smith Vick','company'),(35,21,23,'/compta/paiement/fiche.php?id=','(paiement)','payment'),(36,21,1,'/comm/fiche.php?socid=','ABC and Co','company'),(37,22,24,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(38,22,12,'/dolibarrnew/comm/fiche.php?socid=','Dupont Alain','company'),(39,23,25,'/dolibarrnew/compta/paiement/fiche.php?id=','(paiement)','payment'),(40,23,10,'/dolibarrnew/comm/fiche.php?socid=','Smith Vick','company'); +/*!40000 ALTER TABLE `llx_bank_url` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bookkeeping` +-- + +DROP TABLE IF EXISTS `llx_bookkeeping`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bookkeeping` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `doc_date` date NOT NULL, + `doc_type` varchar(30) NOT NULL, + `doc_ref` varchar(30) NOT NULL, + `fk_doc` int(11) NOT NULL, + `fk_docdet` int(11) NOT NULL, + `code_tiers` varchar(24) DEFAULT NULL, + `numero_compte` varchar(50) DEFAULT NULL, + `label_compte` varchar(128) NOT NULL, + `debit` double NOT NULL, + `credit` double NOT NULL, + `montant` double NOT NULL, + `sens` varchar(1) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + `code_journal` varchar(10) DEFAULT NULL, + `piece_num` int(11) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bookkeeping` +-- + +LOCK TABLES `llx_bookkeeping` WRITE; +/*!40000 ALTER TABLE `llx_bookkeeping` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_bookkeeping` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bookmark` +-- + +DROP TABLE IF EXISTS `llx_bookmark`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bookmark` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `dateb` datetime DEFAULT NULL, + `url` varchar(128) NOT NULL, + `target` varchar(16) DEFAULT NULL, + `title` varchar(64) DEFAULT NULL, + `favicon` varchar(24) DEFAULT NULL, + `position` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bookmark_url` (`fk_user`,`url`), + UNIQUE KEY `uk_bookmark_title` (`fk_user`,`title`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bookmark` +-- + +LOCK TABLES `llx_bookmark` WRITE; +/*!40000 ALTER TABLE `llx_bookmark` DISABLE KEYS */; +INSERT INTO `llx_bookmark` VALUES (1,NULL,0,'2010-07-09 01:29:03','http://wiki.dolibarr.org','1','Online documentation','none',1),(2,NULL,0,'2010-07-09 01:30:15','http://www.dolibarr.org','1','Official portal','none',2),(3,NULL,0,'2010-07-09 01:30:53','http://www.dolistore.com','1','DoliStore','none',10),(4,NULL,0,'2010-07-09 01:31:35','http://asso.dolibarr.org/index.php/Main_Page','1','The foundation','none',0); +/*!40000 ALTER TABLE `llx_bookmark` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bordereau_cheque` +-- + +DROP TABLE IF EXISTS `llx_bordereau_cheque`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bordereau_cheque` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime NOT NULL, + `date_bordereau` date DEFAULT NULL, + `number` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `amount` double(24,8) NOT NULL, + `nbcheque` smallint(6) NOT NULL, + `fk_bank_account` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `note` text, + `statut` smallint(6) NOT NULL DEFAULT '0', + `ref_ext` varchar(255) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bordereau_cheque` (`number`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bordereau_cheque` +-- + +LOCK TABLES `llx_bordereau_cheque` WRITE; +/*!40000 ALTER TABLE `llx_bordereau_cheque` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_bordereau_cheque` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_boxes` +-- + +DROP TABLE IF EXISTS `llx_boxes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_boxes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `box_id` int(11) NOT NULL, + `position` smallint(6) NOT NULL, + `box_order` varchar(3) NOT NULL, + `fk_user` int(11) NOT NULL DEFAULT '0', + `maxline` int(11) DEFAULT NULL, + `params` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_boxes` (`entity`,`box_id`,`position`,`fk_user`), + KEY `idx_boxes_boxid` (`box_id`), + KEY `idx_boxes_fk_user` (`fk_user`), + CONSTRAINT `fk_boxes_box_id` FOREIGN KEY (`box_id`) REFERENCES `llx_boxes_def` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=594 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_boxes` +-- + +LOCK TABLES `llx_boxes` WRITE; +/*!40000 ALTER TABLE `llx_boxes` DISABLE KEYS */; +INSERT INTO `llx_boxes` VALUES (12,1,20,0,'A09',0,NULL,NULL),(73,1,21,0,'B16',0,NULL,NULL),(153,1,288,0,'A21',0,NULL,NULL),(154,1,289,0,'A07',0,NULL,NULL),(155,1,290,0,'A17',0,NULL,NULL),(160,1,295,0,'A13',0,NULL,NULL),(161,1,296,0,'A15',0,NULL,NULL),(162,1,297,0,'B12',0,NULL,NULL),(163,1,298,0,'B20',0,NULL,NULL),(164,1,299,0,'B10',0,NULL,NULL),(177,1,309,0,'B18',0,NULL,NULL),(240,1,316,0,'A05',0,NULL,NULL),(241,1,317,0,'B04',0,NULL,NULL),(253,2,323,0,'0',0,NULL,NULL),(304,2,324,0,'0',0,NULL,NULL),(305,2,325,0,'0',0,NULL,NULL),(306,2,326,0,'0',0,NULL,NULL),(307,2,327,0,'0',0,NULL,NULL),(308,2,328,0,'0',0,NULL,NULL),(309,2,329,0,'0',0,NULL,NULL),(310,2,330,0,'0',0,NULL,NULL),(311,2,331,0,'0',0,NULL,NULL),(312,2,332,0,'0',0,NULL,NULL),(313,2,333,0,'0',0,NULL,NULL),(372,1,334,0,'0',0,NULL,NULL),(373,1,335,0,'0',0,NULL,NULL),(374,1,336,0,'0',0,NULL,NULL),(439,1,337,0,'0',0,NULL,NULL),(440,1,338,0,'0',0,NULL,NULL),(441,1,339,0,'0',0,NULL,NULL),(442,1,340,0,'0',0,NULL,NULL),(521,1,339,0,'A01',1,NULL,NULL),(522,1,317,0,'A02',1,NULL,NULL),(523,1,299,0,'A03',1,NULL,NULL),(524,1,289,0,'A04',1,NULL,NULL),(525,1,340,0,'B01',1,NULL,NULL),(526,1,298,0,'B02',1,NULL,NULL),(527,1,295,0,'B03',1,NULL,NULL),(528,1,290,0,'B04',1,NULL,NULL),(529,1,297,0,'B05',1,NULL,NULL),(530,1,20,0,'B06',1,NULL,NULL),(531,1,341,0,'0',0,NULL,NULL),(532,1,342,0,'0',0,NULL,NULL),(533,1,343,0,'0',0,NULL,NULL),(534,1,344,0,'0',0,NULL,NULL),(535,1,345,0,'0',0,NULL,NULL); +/*!40000 ALTER TABLE `llx_boxes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_boxes_def` +-- + +DROP TABLE IF EXISTS `llx_boxes_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_boxes_def` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `file` varchar(200) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `note` varchar(130) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_boxes_def` (`file`,`entity`,`note`) +) ENGINE=InnoDB AUTO_INCREMENT=405 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_boxes_def` +-- + +LOCK TABLES `llx_boxes_def` WRITE; +/*!40000 ALTER TABLE `llx_boxes_def` DISABLE KEYS */; +INSERT INTO `llx_boxes_def` VALUES (20,'box_actions.php',1,'2010-07-08 11:29:29',NULL),(21,'box_bookmarks.php',1,'2010-07-08 11:30:03',NULL),(188,'box_services_vendus.php',1,'2011-08-05 20:40:27',NULL),(288,'box_clients.php',1,'2012-12-21 17:08:59',NULL),(289,'box_prospect.php',1,'2012-12-21 17:08:59',NULL),(290,'box_contacts.php',1,'2012-12-21 17:08:59',NULL),(295,'box_propales.php',1,'2013-01-02 20:33:16',NULL),(296,'box_contracts.php',1,'2013-01-02 20:33:17',NULL),(297,'box_services_expired.php',1,'2013-01-02 20:33:17',NULL),(298,'box_services_contracts.php',1,'2013-01-02 20:33:17',NULL),(299,'box_commandes.php',1,'2013-01-02 20:33:19',NULL),(309,'box_activity.php',1,'2013-01-16 15:37:16','(WarningUsingThisBoxSlowDown)'),(316,'box_produits.php',1,'2013-01-19 17:16:10',NULL),(317,'box_produits_alerte_stock.php',1,'2013-01-19 17:16:10',NULL),(323,'box_actions.php',2,'2013-03-13 15:29:19',NULL),(324,'box_clients.php',2,'2013-03-13 20:21:35',NULL),(325,'box_prospect.php',2,'2013-03-13 20:21:35',NULL),(326,'box_contacts.php',2,'2013-03-13 20:21:35',NULL),(327,'box_activity.php',2,'2013-03-13 20:21:35','(WarningUsingThisBoxSlowDown)'),(328,'box_propales.php',2,'2013-03-13 20:32:38',NULL),(329,'box_comptes.php',2,'2013-03-13 20:33:09',NULL),(330,'box_factures_imp.php',2,'2013-03-13 20:33:09',NULL),(331,'box_factures.php',2,'2013-03-13 20:33:09',NULL),(332,'box_produits.php',2,'2013-03-13 20:33:09',NULL),(333,'box_produits_alerte_stock.php',2,'2013-03-13 20:33:09',NULL),(334,'box_factures_imp.php',1,'2013-03-20 20:04:28',NULL),(335,'box_factures.php',1,'2013-03-20 20:04:28',NULL),(336,'box_comptes.php',1,'2013-03-20 20:04:28',NULL),(337,'box_fournisseurs.php',1,'2013-03-22 09:24:29',NULL),(338,'box_factures_fourn_imp.php',1,'2013-03-22 09:24:29',NULL),(339,'box_factures_fourn.php',1,'2013-03-22 09:24:29',NULL),(340,'box_supplier_orders.php',1,'2013-03-22 09:24:29',NULL),(341,'box_graph_product_distribution.php',1,'2013-11-06 23:35:12',NULL),(342,'box_graph_orders_permonth.php',1,'2013-11-06 23:35:12',NULL),(343,'box_graph_invoices_permonth.php',1,'2013-11-06 23:35:12',NULL),(344,'box_graph_invoices_supplier_permonth.php',1,'2013-11-06 23:35:12',NULL),(345,'box_graph_orders_supplier_permonth.php',1,'2013-11-06 23:35:12',NULL),(346,'box_googlemaps@google',1,'2013-11-07 00:01:39',NULL); +/*!40000 ALTER TABLE `llx_boxes_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_action_trigger` +-- + +DROP TABLE IF EXISTS `llx_c_action_trigger`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_action_trigger` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(32) NOT NULL, + `label` varchar(128) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `elementtype` varchar(16) NOT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_action_trigger_code` (`code`), + KEY `idx_action_trigger_rang` (`rang`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_action_trigger` +-- + +LOCK TABLES `llx_c_action_trigger` WRITE; +/*!40000 ALTER TABLE `llx_c_action_trigger` DISABLE KEYS */; +INSERT INTO `llx_c_action_trigger` VALUES (1,'FICHINTER_VALIDATE','Validation fiche intervention','Executed when a intervention is validated','ficheinter',18),(2,'BILL_VALIDATE','Validation facture client','Executed when a customer invoice is approved','facture',6),(3,'ORDER_SUPPLIER_APPROVE','Approbation commande fournisseur','Executed when a supplier order is approved','order_supplier',11),(4,'ORDER_SUPPLIER_REFUSE','Refus commande fournisseur','Executed when a supplier order is refused','order_supplier',12),(5,'ORDER_VALIDATE','Validation commande client','Executed when a customer order is validated','commande',4),(6,'PROPAL_VALIDATE','Validation proposition client','Executed when a commercial proposal is validated','propal',2),(9,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1),(10,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1),(11,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',17),(12,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3),(13,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5),(14,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7),(15,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8),(16,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9),(17,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',10),(18,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',13),(19,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',14),(20,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',15),(21,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',16),(22,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',19),(23,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',20),(24,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',21),(25,'MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',22),(26,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',23),(27,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',24),(28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10),(29,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',29),(30,'PROJECT_CREATE','Project creation','Executed when a project is created','project',30); +/*!40000 ALTER TABLE `llx_c_action_trigger` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_actioncomm` +-- + +DROP TABLE IF EXISTS `llx_c_actioncomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_actioncomm` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `type` varchar(10) NOT NULL DEFAULT 'system', + `libelle` varchar(48) NOT NULL, + `module` varchar(16) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `todo` tinyint(4) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_actioncomm` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_actioncomm` +-- + +LOCK TABLES `llx_c_actioncomm` WRITE; +/*!40000 ALTER TABLE `llx_c_actioncomm` DISABLE KEYS */; +INSERT INTO `llx_c_actioncomm` VALUES (1,'AC_TEL','system','Phone call',NULL,1,NULL,2),(2,'AC_FAX','system','Send Fax',NULL,1,NULL,3),(3,'AC_PROP','systemauto','Send commercial proposal by email','propal',0,NULL,10),(4,'AC_EMAIL','system','Send Email',NULL,1,NULL,4),(5,'AC_RDV','system','Rendez-vous',NULL,1,NULL,1),(8,'AC_COM','systemauto','Send customer order by email','order',0,NULL,8),(9,'AC_FAC','systemauto','Send customer invoice by email','invoice',0,NULL,6),(10,'AC_SHIP','systemauto','Send shipping by email','shipping',0,NULL,11),(30,'AC_SUP_ORD','systemauto','Send supplier order by email','order_supplier',0,NULL,9),(31,'AC_SUP_INV','systemauto','Send supplier invoice by email','invoice_supplier',0,NULL,7),(40,'AC_OTH_AUTO','systemauto','Other (automatically inserted events)',NULL,1,NULL,20),(50,'AC_OTH','system','Other (manually inserted events)',NULL,1,NULL,5),(100700,'AC_CABMED','module','Send document by email','cabinetmed',0,NULL,100); +/*!40000 ALTER TABLE `llx_c_actioncomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_availability` +-- + +DROP TABLE IF EXISTS `llx_c_availability`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_availability` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) NOT NULL, + `label` varchar(60) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_availability` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_availability` +-- + +LOCK TABLES `llx_c_availability` WRITE; +/*!40000 ALTER TABLE `llx_c_availability` DISABLE KEYS */; +INSERT INTO `llx_c_availability` VALUES (1,'AV_NOW','Immediate',1),(2,'AV_1W','1 week',1),(3,'AV_2W','2 weeks',1),(4,'AV_3W','3 weeks',1); +/*!40000 ALTER TABLE `llx_c_availability` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_barcode_type` +-- + +DROP TABLE IF EXISTS `llx_c_barcode_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_barcode_type` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `libelle` varchar(50) NOT NULL, + `coder` varchar(16) NOT NULL, + `example` varchar(16) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_barcode_type` (`code`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_barcode_type` +-- + +LOCK TABLES `llx_c_barcode_type` WRITE; +/*!40000 ALTER TABLE `llx_c_barcode_type` DISABLE KEYS */; +INSERT INTO `llx_c_barcode_type` VALUES (1,'EAN8',1,'EAN8','0','1234567'),(2,'EAN13',1,'EAN13','0','123456789012'),(3,'UPC',1,'UPC','0','123456789012'),(4,'ISBN',1,'ISBN','0','123456789'),(5,'C39',1,'Code 39','0','1234567890'),(6,'C128',1,'Code 128','0','ABCD1234567890'); +/*!40000 ALTER TABLE `llx_c_barcode_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_chargesociales` +-- + +DROP TABLE IF EXISTS `llx_c_chargesociales`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_chargesociales` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `libelle` varchar(80) DEFAULT NULL, + `deductible` smallint(6) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + `code` varchar(12) NOT NULL, + `fk_pays` int(11) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `accountancy_code` varchar(24) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=231 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_chargesociales` +-- + +LOCK TABLES `llx_c_chargesociales` WRITE; +/*!40000 ALTER TABLE `llx_c_chargesociales` DISABLE KEYS */; +INSERT INTO `llx_c_chargesociales` VALUES (1,'Allocations familiales',1,1,'TAXFAM',1,NULL,NULL),(2,'CSG Deductible',1,1,'TAXCSGD',1,NULL,NULL),(3,'CSG/CRDS NON Deductible',0,1,'TAXCSGND',1,NULL,NULL),(10,'Taxe apprentissage',0,1,'TAXAPP',1,NULL,NULL),(11,'Taxe professionnelle',0,1,'TAXPRO',1,NULL,NULL),(12,'Cotisation foncière des entreprises',0,1,'TAXCFE',1,NULL,NULL),(13,'Cotisation sur la valeur ajoutée des entreprises',0,1,'TAXCVAE',1,NULL,NULL),(20,'Impots locaux/fonciers',0,1,'TAXFON',1,NULL,NULL),(25,'Impots revenus',0,1,'TAXREV',1,NULL,NULL),(30,'Assurance Sante',0,1,'TAXSECU',1,NULL,NULL),(40,'Mutuelle',0,1,'TAXMUT',1,NULL,NULL),(50,'Assurance vieillesse',0,1,'TAXRET',1,NULL,NULL),(60,'Assurance Chomage',0,1,'TAXCHOM',1,NULL,NULL),(201,'ONSS',1,1,'TAXBEONSS',2,NULL,NULL),(210,'Precompte professionnel',1,1,'TAXBEPREPRO',2,NULL,NULL),(220,'Prime d\'existence',1,1,'TAXBEPRIEXI',2,NULL,NULL),(230,'Precompte immobilier',1,1,'TAXBEPREIMMO',2,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_chargesociales` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_civilite` +-- + +DROP TABLE IF EXISTS `llx_c_civilite`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_civilite` ( + `rowid` int(11) NOT NULL, + `code` varchar(6) NOT NULL, + `civilite` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_civilite` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_civilite` +-- + +LOCK TABLES `llx_c_civilite` WRITE; +/*!40000 ALTER TABLE `llx_c_civilite` DISABLE KEYS */; +INSERT INTO `llx_c_civilite` VALUES (1,'MME','Madame',1,NULL),(3,'MR','Monsieur',1,NULL),(5,'MLE','Mademoiselle',1,NULL),(7,'MTRE','Maître',1,NULL),(8,'DR','Docteur',1,NULL); +/*!40000 ALTER TABLE `llx_c_civilite` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_currencies` +-- + +DROP TABLE IF EXISTS `llx_c_currencies`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_currencies` ( + `code_iso` varchar(3) NOT NULL, + `label` varchar(64) NOT NULL, + `unicode` varchar(32) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_currencies` +-- + +LOCK TABLES `llx_c_currencies` WRITE; +/*!40000 ALTER TABLE `llx_c_currencies` DISABLE KEYS */; +INSERT INTO `llx_c_currencies` VALUES ('AED','United Arab Emirates Dirham',NULL,1),('AFN','Afghanistan Afghani','[1547]',1),('ALL','Albania Leklll','[76,101,107]',1),('ANG','Netherlands Antilles Guilder','[402]',1),('ARP','Pesos argentins',NULL,0),('ARS','Argentino Peso','[36]',1),('ATS','Shiliing autrichiens',NULL,0),('AUD','Australia Dollar','[36]',1),('AWG','Aruba Guilder','[402]',1),('AZN','Azerbaijan New Manat','[1084,1072,1085]',1),('BAM','Bosnia and Herzegovina Convertible Marka','[75,77]',1),('BBD','Barbados Dollar','[36]',1),('BEF','Francs belges',NULL,0),('BGN','Bulgaria Lev','[1083,1074]',1),('BMD','Bermuda Dollar','[36]',1),('BND','Brunei Darussalam Dollar','[36]',1),('BOB','Bolivia Boliviano','[36,98]',1),('BRL','Brazil Real','[82,36]',1),('BSD','Bahamas Dollar','[36]',1),('BWP','Botswana Pula','[80]',1),('BYR','Belarus Ruble','[112,46]',1),('BZD','Belize Dollar','[66,90,36]',1),('CAD','Canada Dollar','[36]',1),('CHF','Switzerland Franc','[67,72,70]',1),('CLP','Chile Peso','[36]',1),('CNY','China Yuan Renminbi','[165]',1),('COP','Colombia Peso','[36]',1),('CRC','Costa Rica Colon','[8353]',1),('CUP','Cuba Peso','[8369]',1),('CZK','Czech Republic Koruna','[75,269]',1),('DEM','Deutsch mark',NULL,0),('DKK','Denmark Krone','[107,114]',1),('DOP','Dominican Republic Peso','[82,68,36]',1),('DZD','Algeria Dinar',NULL,1),('EEK','Estonia Kroon','[107,114]',1),('EGP','Egypt Pound','[163]',1),('ESP','Pesete',NULL,0),('EUR','Euro Member Countries','[8364]',1),('FIM','Mark finlandais',NULL,0),('FJD','Fiji Dollar','[36]',1),('FKP','Falkland Islands (Malvinas) Pound','[163]',1),('FRF','Francs francais',NULL,0),('GBP','United Kingdom Pound','[163]',1),('GGP','Guernsey Pound','[163]',1),('GHC','Ghana Cedis','[162]',1),('GIP','Gibraltar Pound','[163]',1),('GRD','Drachme (grece)',NULL,0),('GTQ','Guatemala Quetzal','[81]',1),('GYD','Guyana Dollar','[36]',1),('hhh','ddd','[]',1),('HKD','Hong Kong Dollar','[36]',1),('HNL','Honduras Lempira','[76]',1),('HRK','Croatia Kuna','[107,110]',1),('HUF','Hungary Forint','[70,116]',1),('IDR','Indonesia Rupiah','[82,112]',1),('IEP','Livres irlandaises',NULL,0),('ILS','Israel Shekel','[8362]',1),('IMP','Isle of Man Pound','[163]',1),('INR','India Rupee',NULL,1),('IRR','Iran Rial','[65020]',1),('ISK','Iceland Krona','[107,114]',1),('ITL','Lires',NULL,0),('JEP','Jersey Pound','[163]',1),('JMD','Jamaica Dollar','[74,36]',1),('JPY','Japan Yen','[165]',1),('KGS','Kyrgyzstan Som','[1083,1074]',1),('KHR','Cambodia Riel','[6107]',1),('KPW','Korea (North) Won','[8361]',1),('KRW','Korea (South) Won','[8361]',1),('KYD','Cayman Islands Dollar','[36]',1),('KZT','Kazakhstan Tenge','[1083,1074]',1),('LAK','Laos Kip','[8365]',1),('LBP','Lebanon Pound','[163]',1),('LKR','Sri Lanka Rupee','[8360]',1),('LRD','Liberia Dollar','[36]',1),('LTL','Lithuania Litas','[76,116]',1),('LUF','Francs luxembourgeois',NULL,0),('LVL','Latvia Lat','[76,115]',1),('MAD','Morocco Dirham',NULL,1),('MKD','Macedonia Denar','[1076,1077,1085]',1),('MNT','Mongolia Tughrik','[8366]',1),('MRO','Mauritania Ouguiya',NULL,1),('MUR','Mauritius Rupee','[8360]',1),('MXN','Mexico Peso','[36]',1),('MXP','Pesos Mexicans',NULL,0),('MYR','Malaysia Ringgit','[82,77]',1),('MZN','Mozambique Metical','[77,84]',1),('NAD','Namibia Dollar','[36]',1),('NGN','Nigeria Naira','[8358]',1),('NIO','Nicaragua Cordoba','[67,36]',1),('NLG','Florins',NULL,0),('NOK','Norway Krone','[107,114]',1),('NPR','Nepal Rupee','[8360]',1),('NZD','New Zealand Dollar','[36]',1),('OMR','Oman Rial','[65020]',1),('PAB','Panama Balboa','[66,47,46]',1),('PEN','Peru Nuevo Sol','[83,47,46]',1),('PHP','Philippines Peso','[8369]',1),('PKR','Pakistan Rupee','[8360]',1),('PLN','Poland Zloty','[122,322]',1),('PTE','Escudos',NULL,0),('PYG','Paraguay Guarani','[71,115]',1),('QAR','Qatar Riyal','[65020]',1),('RON','Romania New Leu','[108,101,105]',1),('RSD','Serbia Dinar','[1044,1080,1085,46]',1),('RUB','Russia Ruble','[1088,1091,1073]',1),('SAR','Saudi Arabia Riyal','[65020]',1),('SBD','Solomon Islands Dollar','[36]',1),('SCR','Seychelles Rupee','[8360]',1),('SEK','Sweden Krona','[107,114]',1),('SGD','Singapore Dollar','[36]',1),('SHP','Saint Helena Pound','[163]',1),('SKK','Couronnes slovaques',NULL,0),('SOS','Somalia Shilling','[83]',1),('SRD','Suriname Dollar','[36]',1),('SUR','Rouble',NULL,0),('SVC','El Salvador Colon','[36]',1),('SYP','Syria Pound','[163]',1),('THB','Thailand Baht','[3647]',1),('TND','Tunisia Dinar',NULL,1),('TRL','Turkey Lira','[84,76]',1),('TRY','Turkey Lira','[8356]',1),('TTD','Trinidad and Tobago Dollar','[84,84,36]',1),('TVD','Tuvalu Dollar','[36]',1),('TWD','Taiwan New Dollar','[78,84,36]',1),('UAH','Ukraine Hryvna','[8372]',1),('USD','United States Dollar','[36]',1),('UYU','Uruguay Peso','[36,85]',1),('UZS','Uzbekistan Som','[1083,1074]',1),('VEF','Venezuela Bolivar Fuerte','[66,115]',1),('VND','Viet Nam Dong','[8363]',1),('XAF','Communaute Financiere Africaine (BEAC) CFA Franc',NULL,1),('XCD','East Caribbean Dollar','[36]',1),('XEU','Ecus',NULL,0),('XOF','Communaute Financiere Africaine (BCEAO) Franc',NULL,1),('YER','Yemen Rial','[65020]',1),('ZAR','South Africa Rand','[82]',1),('ZWD','Zimbabwe Dollar','[90,36]',1); +/*!40000 ALTER TABLE `llx_c_currencies` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_departements` +-- + +DROP TABLE IF EXISTS `llx_c_departements`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_departements` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code_departement` varchar(6) NOT NULL, + `fk_region` int(11) DEFAULT NULL, + `cheflieu` varchar(50) DEFAULT NULL, + `tncc` int(11) DEFAULT NULL, + `ncc` varchar(50) DEFAULT NULL, + `nom` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_departements` (`code_departement`,`fk_region`), + KEY `idx_departements_fk_region` (`fk_region`) +) ENGINE=InnoDB AUTO_INCREMENT=2052 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_departements` +-- + +LOCK TABLES `llx_c_departements` WRITE; +/*!40000 ALTER TABLE `llx_c_departements` DISABLE KEYS */; +INSERT INTO `llx_c_departements` VALUES (1,'0',0,'0',0,'-','-',1),(2,'01',82,'01053',5,'AIN','Ain',1),(3,'02',22,'02408',5,'AISNE','Aisne',1),(4,'03',83,'03190',5,'ALLIER','Allier',1),(5,'04',93,'04070',4,'ALPES-DE-HAUTE-PROVENCE','Alpes-de-Haute-Provence',1),(6,'05',93,'05061',4,'HAUTES-ALPES','Hautes-Alpes',1),(7,'06',93,'06088',4,'ALPES-MARITIMES','Alpes-Maritimes',1),(8,'07',82,'07186',5,'ARDECHE','Ardèche',1),(9,'08',21,'08105',4,'ARDENNES','Ardennes',1),(10,'09',73,'09122',5,'ARIEGE','Ariège',1),(11,'10',21,'10387',5,'AUBE','Aube',1),(12,'11',91,'11069',5,'AUDE','Aude',1),(13,'12',73,'12202',5,'AVEYRON','Aveyron',1),(14,'13',93,'13055',4,'BOUCHES-DU-RHONE','Bouches-du-Rhône',1),(15,'14',25,'14118',2,'CALVADOS','Calvados',1),(16,'15',83,'15014',2,'CANTAL','Cantal',1),(17,'16',54,'16015',3,'CHARENTE','Charente',1),(18,'17',54,'17300',3,'CHARENTE-MARITIME','Charente-Maritime',1),(19,'18',24,'18033',2,'CHER','Cher',1),(20,'19',74,'19272',3,'CORREZE','Corrèze',1),(21,'2A',94,'2A004',3,'CORSE-DU-SUD','Corse-du-Sud',1),(22,'2B',94,'2B033',3,'HAUTE-CORSE','Haute-Corse',1),(23,'21',26,'21231',3,'COTE-D\'OR','Côte-d\'Or',1),(24,'22',53,'22278',4,'COTES-D\'ARMOR','Côtes-d\'Armor',1),(25,'23',74,'23096',3,'CREUSE','Creuse',1),(26,'24',72,'24322',3,'DORDOGNE','Dordogne',1),(27,'25',43,'25056',2,'DOUBS','Doubs',1),(28,'26',82,'26362',3,'DROME','Drôme',1),(29,'27',23,'27229',5,'EURE','Eure',1),(30,'28',24,'28085',1,'EURE-ET-LOIR','Eure-et-Loir',1),(31,'29',53,'29232',2,'FINISTERE','Finistère',1),(32,'30',91,'30189',2,'GARD','Gard',1),(33,'31',73,'31555',3,'HAUTE-GARONNE','Haute-Garonne',1),(34,'32',73,'32013',2,'GERS','Gers',1),(35,'33',72,'33063',3,'GIRONDE','Gironde',1),(36,'34',91,'34172',5,'HERAULT','Hérault',1),(37,'35',53,'35238',1,'ILLE-ET-VILAINE','Ille-et-Vilaine',1),(38,'36',24,'36044',5,'INDRE','Indre',1),(39,'37',24,'37261',1,'INDRE-ET-LOIRE','Indre-et-Loire',1),(40,'38',82,'38185',5,'ISERE','Isère',1),(41,'39',43,'39300',2,'JURA','Jura',1),(42,'40',72,'40192',4,'LANDES','Landes',1),(43,'41',24,'41018',0,'LOIR-ET-CHER','Loir-et-Cher',1),(44,'42',82,'42218',3,'LOIRE','Loire',1),(45,'43',83,'43157',3,'HAUTE-LOIRE','Haute-Loire',1),(46,'44',52,'44109',3,'LOIRE-ATLANTIQUE','Loire-Atlantique',1),(47,'45',24,'45234',2,'LOIRET','Loiret',1),(48,'46',73,'46042',2,'LOT','Lot',1),(49,'47',72,'47001',0,'LOT-ET-GARONNE','Lot-et-Garonne',1),(50,'48',91,'48095',3,'LOZERE','Lozère',1),(51,'49',52,'49007',0,'MAINE-ET-LOIRE','Maine-et-Loire',1),(52,'50',25,'50502',3,'MANCHE','Manche',1),(53,'51',21,'51108',3,'MARNE','Marne',1),(54,'52',21,'52121',3,'HAUTE-MARNE','Haute-Marne',1),(55,'53',52,'53130',3,'MAYENNE','Mayenne',1),(56,'54',41,'54395',0,'MEURTHE-ET-MOSELLE','Meurthe-et-Moselle',1),(57,'55',41,'55029',3,'MEUSE','Meuse',1),(58,'56',53,'56260',2,'MORBIHAN','Morbihan',1),(59,'57',41,'57463',3,'MOSELLE','Moselle',1),(60,'58',26,'58194',3,'NIEVRE','Nièvre',1),(61,'59',31,'59350',2,'NORD','Nord',1),(62,'60',22,'60057',5,'OISE','Oise',1),(63,'61',25,'61001',5,'ORNE','Orne',1),(64,'62',31,'62041',2,'PAS-DE-CALAIS','Pas-de-Calais',1),(65,'63',83,'63113',2,'PUY-DE-DOME','Puy-de-Dôme',1),(66,'64',72,'64445',4,'PYRENEES-ATLANTIQUES','Pyrénées-Atlantiques',1),(67,'65',73,'65440',4,'HAUTES-PYRENEES','Hautes-Pyrénées',1),(68,'66',91,'66136',4,'PYRENEES-ORIENTALES','Pyrénées-Orientales',1),(69,'67',42,'67482',2,'BAS-RHIN','Bas-Rhin',1),(70,'68',42,'68066',2,'HAUT-RHIN','Haut-Rhin',1),(71,'69',82,'69123',2,'RHONE','Rhône',1),(72,'70',43,'70550',3,'HAUTE-SAONE','Haute-Saône',1),(73,'71',26,'71270',0,'SAONE-ET-LOIRE','Saône-et-Loire',1),(74,'72',52,'72181',3,'SARTHE','Sarthe',1),(75,'73',82,'73065',3,'SAVOIE','Savoie',1),(76,'74',82,'74010',3,'HAUTE-SAVOIE','Haute-Savoie',1),(77,'75',11,'75056',0,'PARIS','Paris',1),(78,'76',23,'76540',3,'SEINE-MARITIME','Seine-Maritime',1),(79,'77',11,'77288',0,'SEINE-ET-MARNE','Seine-et-Marne',1),(80,'78',11,'78646',4,'YVELINES','Yvelines',1),(81,'79',54,'79191',4,'DEUX-SEVRES','Deux-Sèvres',1),(82,'80',22,'80021',3,'SOMME','Somme',1),(83,'81',73,'81004',2,'TARN','Tarn',1),(84,'82',73,'82121',0,'TARN-ET-GARONNE','Tarn-et-Garonne',1),(85,'83',93,'83137',2,'VAR','Var',1),(86,'84',93,'84007',0,'VAUCLUSE','Vaucluse',1),(87,'85',52,'85191',3,'VENDEE','Vendée',1),(88,'86',54,'86194',3,'VIENNE','Vienne',1),(89,'87',74,'87085',3,'HAUTE-VIENNE','Haute-Vienne',1),(90,'88',41,'88160',4,'VOSGES','Vosges',1),(91,'89',26,'89024',5,'YONNE','Yonne',1),(92,'90',43,'90010',0,'TERRITOIRE DE BELFORT','Territoire de Belfort',1),(93,'91',11,'91228',5,'ESSONNE','Essonne',1),(94,'92',11,'92050',4,'HAUTS-DE-SEINE','Hauts-de-Seine',1),(95,'93',11,'93008',3,'SEINE-SAINT-DENIS','Seine-Saint-Denis',1),(96,'94',11,'94028',2,'VAL-DE-MARNE','Val-de-Marne',1),(97,'95',11,'95500',2,'VAL-D\'OISE','Val-d\'Oise',1),(98,'971',1,'97105',3,'GUADELOUPE','Guadeloupe',1),(99,'972',2,'97209',3,'MARTINIQUE','Martinique',1),(100,'973',3,'97302',3,'GUYANE','Guyane',1),(101,'974',4,'97411',3,'REUNION','Réunion',1),(102,'01',201,'',1,'ANVERS','Anvers',1),(103,'02',203,'',3,'BRUXELLES-CAPITALE','Bruxelles-Capitale',1),(104,'03',202,'',2,'BRABANT-WALLON','Brabant-Wallon',1),(105,'04',201,'',1,'BRABANT-FLAMAND','Brabant-Flamand',1),(106,'05',201,'',1,'FLANDRE-OCCIDENTALE','Flandre-Occidentale',1),(107,'06',201,'',1,'FLANDRE-ORIENTALE','Flandre-Orientale',1),(108,'07',202,'',2,'HAINAUT','Hainaut',1),(109,'08',201,'',2,'LIEGE','Liège',1),(110,'09',202,'',1,'LIMBOURG','Limbourg',1),(111,'10',202,'',2,'LUXEMBOURG','Luxembourg',1),(112,'11',201,'',2,'NAMUR','Namur',1),(113,'NSW',2801,'',1,'','New South Wales',1),(114,'VIC',2801,'',1,'','Victoria',1),(115,'QLD',2801,'',1,'','Queensland',1),(116,'SA',2801,'',1,'','South Australia',1),(117,'ACT',2801,'',1,'','Australia Capital Territory',1),(118,'TAS',2801,'',1,'','Tasmania',1),(119,'WA',2801,'',1,'','Western Australia',1),(120,'NT',2801,'',1,'','Northern Territory',1),(121,'01',419,'',19,'ALAVA','Álava',1),(122,'02',404,'',4,'ALBACETE','Albacete',1),(123,'03',411,'',11,'ALICANTE','Alicante',1),(124,'04',401,'',1,'ALMERIA','Almería',1),(125,'05',403,'',3,'AVILA','Avila',1),(126,'06',412,'',12,'BADAJOZ','Badajoz',1),(127,'07',414,'',14,'ISLAS BALEARES','Islas Baleares',1),(128,'08',406,'',6,'BARCELONA','Barcelona',1),(129,'09',403,'',8,'BURGOS','Burgos',1),(130,'10',412,'',12,'CACERES','Cáceres',1),(131,'11',401,'',1,'CADIz','Cádiz',1),(132,'12',411,'',11,'CASTELLON','Castellón',1),(133,'13',404,'',4,'CIUDAD REAL','Ciudad Real',1),(134,'14',401,'',1,'CORDOBA','Córdoba',1),(135,'15',413,'',13,'LA CORUÑA','La Coruña',1),(136,'16',404,'',4,'CUENCA','Cuenca',1),(137,'17',406,'',6,'GERONA','Gerona',1),(138,'18',401,'',1,'GRANADA','Granada',1),(139,'19',404,'',4,'GUADALAJARA','Guadalajara',1),(140,'20',419,'',19,'GUIPUZCOA','Guipúzcoa',1),(141,'21',401,'',1,'HUELVA','Huelva',1),(142,'22',402,'',2,'HUESCA','Huesca',1),(143,'23',401,'',1,'JAEN','Jaén',1),(144,'24',403,'',3,'LEON','León',1),(145,'25',406,'',6,'LERIDA','Lérida',1),(146,'26',415,'',15,'LA RIOJA','La Rioja',1),(147,'27',413,'',13,'LUGO','Lugo',1),(148,'28',416,'',16,'MADRID','Madrid',1),(149,'29',401,'',1,'MALAGA','Málaga',1),(150,'30',417,'',17,'MURCIA','Murcia',1),(151,'31',408,'',8,'NAVARRA','Navarra',1),(152,'32',413,'',13,'ORENSE','Orense',1),(153,'33',418,'',18,'ASTURIAS','Asturias',1),(154,'34',403,'',3,'PALENCIA','Palencia',1),(155,'35',405,'',5,'LAS PALMAS','Las Palmas',1),(156,'36',413,'',13,'PONTEVEDRA','Pontevedra',1),(157,'37',403,'',3,'SALAMANCA','Salamanca',1),(158,'38',405,'',5,'STA. CRUZ DE TENERIFE','Sta. Cruz de Tenerife',1),(159,'39',410,'',10,'CANTABRIA','Cantabria',1),(160,'40',403,'',3,'SEGOVIA','Segovia',1),(161,'41',401,'',1,'SEVILLA','Sevilla',1),(162,'42',403,'',3,'SORIA','Soria',1),(163,'43',406,'',6,'TARRAGONA','Tarragona',1),(164,'44',402,'',2,'TERUEL','Teruel',1),(165,'45',404,'',5,'TOLEDO','Toledo',1),(166,'46',411,'',11,'VALENCIA','Valencia',1),(167,'47',403,'',3,'VALLADOLID','Valladolid',1),(168,'48',419,'',19,'VIZCAYA','Vizcaya',1),(169,'49',403,'',3,'ZAMORA','Zamora',1),(170,'50',402,'',1,'ZARAGOZA','Zaragoza',1),(171,'51',407,'',7,'CEUTA','Ceuta',1),(172,'52',409,'',9,'MELILLA','Melilla',1),(173,'53',420,'',20,'OTROS','Otros',1),(174,'AG',601,NULL,NULL,'ARGOVIE','Argovie',1),(175,'AI',601,NULL,NULL,'APPENZELL RHODES INTERIEURES','Appenzell Rhodes intérieures',1),(176,'AR',601,NULL,NULL,'APPENZELL RHODES EXTERIEURES','Appenzell Rhodes extérieures',1),(177,'BE',601,NULL,NULL,'BERNE','Berne',1),(178,'BL',601,NULL,NULL,'BALE CAMPAGNE','Bâle Campagne',1),(179,'BS',601,NULL,NULL,'BALE VILLE','Bâle Ville',1),(180,'FR',601,NULL,NULL,'FRIBOURG','Fribourg',1),(181,'GE',601,NULL,NULL,'GENEVE','Genève',1),(182,'GL',601,NULL,NULL,'GLARIS','Glaris',1),(183,'GR',601,NULL,NULL,'GRISONS','Grisons',1),(184,'JU',601,NULL,NULL,'JURA','Jura',1),(185,'LU',601,NULL,NULL,'LUCERNE','Lucerne',1),(186,'NE',601,NULL,NULL,'NEUCHATEL','Neuchâtel',1),(187,'NW',601,NULL,NULL,'NIDWALD','Nidwald',1),(188,'OW',601,NULL,NULL,'OBWALD','Obwald',1),(189,'SG',601,NULL,NULL,'SAINT-GALL','Saint-Gall',1),(190,'SH',601,NULL,NULL,'SCHAFFHOUSE','Schaffhouse',1),(191,'SO',601,NULL,NULL,'SOLEURE','Soleure',1),(192,'SZ',601,NULL,NULL,'SCHWYZ','Schwyz',1),(193,'TG',601,NULL,NULL,'THURGOVIE','Thurgovie',1),(194,'TI',601,NULL,NULL,'TESSIN','Tessin',1),(195,'UR',601,NULL,NULL,'URI','Uri',1),(196,'VD',601,NULL,NULL,'VAUD','Vaud',1),(197,'VS',601,NULL,NULL,'VALAIS','Valais',1),(198,'ZG',601,NULL,NULL,'ZUG','Zug',1),(199,'ZH',601,NULL,NULL,'ZURICH','Zürich',1),(200,'AL',1101,'',0,'ALABAMA','Alabama',1),(201,'AK',1101,'',0,'ALASKA','Alaska',1),(202,'AZ',1101,'',0,'ARIZONA','Arizona',1),(203,'AR',1101,'',0,'ARKANSAS','Arkansas',1),(204,'CA',1101,'',0,'CALIFORNIA','California',1),(205,'CO',1101,'',0,'COLORADO','Colorado',1),(206,'CT',1101,'',0,'CONNECTICUT','Connecticut',1),(207,'DE',1101,'',0,'DELAWARE','Delaware',1),(208,'FL',1101,'',0,'FLORIDA','Florida',1),(209,'GA',1101,'',0,'GEORGIA','Georgia',1),(210,'HI',1101,'',0,'HAWAII','Hawaii',1),(211,'ID',1101,'',0,'IDAHO','Idaho',1),(212,'IL',1101,'',0,'ILLINOIS','Illinois',1),(213,'IN',1101,'',0,'INDIANA','Indiana',1),(214,'IA',1101,'',0,'IOWA','Iowa',1),(215,'KS',1101,'',0,'KANSAS','Kansas',1),(216,'KY',1101,'',0,'KENTUCKY','Kentucky',1),(217,'LA',1101,'',0,'LOUISIANA','Louisiana',1),(218,'ME',1101,'',0,'MAINE','Maine',1),(219,'MD',1101,'',0,'MARYLAND','Maryland',1),(220,'MA',1101,'',0,'MASSACHUSSETTS','Massachusetts',1),(221,'MI',1101,'',0,'MICHIGAN','Michigan',1),(222,'MN',1101,'',0,'MINNESOTA','Minnesota',1),(223,'MS',1101,'',0,'MISSISSIPPI','Mississippi',1),(224,'MO',1101,'',0,'MISSOURI','Missouri',1),(225,'MT',1101,'',0,'MONTANA','Montana',1),(226,'NE',1101,'',0,'NEBRASKA','Nebraska',1),(227,'NV',1101,'',0,'NEVADA','Nevada',1),(228,'NH',1101,'',0,'NEW HAMPSHIRE','New Hampshire',1),(229,'NJ',1101,'',0,'NEW JERSEY','New Jersey',1),(230,'NM',1101,'',0,'NEW MEXICO','New Mexico',1),(231,'NY',1101,'',0,'NEW YORK','New York',1),(232,'NC',1101,'',0,'NORTH CAROLINA','North Carolina',1),(233,'ND',1101,'',0,'NORTH DAKOTA','North Dakota',1),(234,'OH',1101,'',0,'OHIO','Ohio',1),(235,'OK',1101,'',0,'OKLAHOMA','Oklahoma',1),(236,'OR',1101,'',0,'OREGON','Oregon',1),(237,'PA',1101,'',0,'PENNSYLVANIA','Pennsylvania',1),(238,'RI',1101,'',0,'RHODE ISLAND','Rhode Island',1),(239,'SC',1101,'',0,'SOUTH CAROLINA','South Carolina',1),(240,'SD',1101,'',0,'SOUTH DAKOTA','South Dakota',1),(241,'TN',1101,'',0,'TENNESSEE','Tennessee',1),(242,'TX',1101,'',0,'TEXAS','Texas',1),(243,'UT',1101,'',0,'UTAH','Utah',1),(244,'VT',1101,'',0,'VERMONT','Vermont',1),(245,'VA',1101,'',0,'VIRGINIA','Virginia',1),(246,'WA',1101,'',0,'WASHINGTON','Washington',1),(247,'WV',1101,'',0,'WEST VIRGINIA','West Virginia',1),(248,'WI',1101,'',0,'WISCONSIN','Wisconsin',1),(249,'WY',1101,'',0,'WYOMING','Wyoming',1),(250,'SS',8601,NULL,NULL,NULL,'San Salvador',1),(251,'SA',8603,NULL,NULL,NULL,'Santa Ana',1),(252,'AH',8603,NULL,NULL,NULL,'Ahuachapan',1),(253,'SO',8603,NULL,NULL,NULL,'Sonsonate',1),(254,'US',8602,NULL,NULL,NULL,'Usulutan',1),(255,'SM',8602,NULL,NULL,NULL,'San Miguel',1),(256,'MO',8602,NULL,NULL,NULL,'Morazan',1),(257,'LU',8602,NULL,NULL,NULL,'La Union',1),(258,'LL',8601,NULL,NULL,NULL,'La Libertad',1),(259,'CH',8601,NULL,NULL,NULL,'Chalatenango',1),(260,'CA',8601,NULL,NULL,NULL,'Cabañas',1),(261,'LP',8601,NULL,NULL,NULL,'La Paz',1),(262,'SV',8601,NULL,NULL,NULL,'San Vicente',1),(263,'CU',8601,NULL,NULL,NULL,'Cuscatlan',1),(264,'2301',2301,'',0,'CATAMARCA','Catamarca',1),(265,'2302',2301,'',0,'JUJUY','Jujuy',1),(266,'2303',2301,'',0,'TUCAMAN','Tucamán',1),(267,'2304',2301,'',0,'SANTIAGO DEL ESTERO','Santiago del Estero',1),(268,'2305',2301,'',0,'SALTA','Salta',1),(269,'2306',2302,'',0,'CHACO','Chaco',1),(270,'2307',2302,'',0,'CORRIENTES','Corrientes',1),(271,'2308',2302,'',0,'ENTRE RIOS','Entre Ríos',1),(272,'2309',2302,'',0,'FORMOSA MISIONES','Formosa Misiones',1),(273,'2310',2302,'',0,'SANTA FE','Santa Fe',1),(274,'2311',2303,'',0,'LA RIOJA','La Rioja',1),(275,'2312',2303,'',0,'MENDOZA','Mendoza',1),(276,'2313',2303,'',0,'SAN JUAN','San Juan',1),(277,'2314',2303,'',0,'SAN LUIS','San Luis',1),(278,'2315',2304,'',0,'CORDOBA','Córdoba',1),(279,'2316',2304,'',0,'BUENOS AIRES','Buenos Aires',1),(280,'2317',2304,'',0,'CABA','Caba',1),(281,'2318',2305,'',0,'LA PAMPA','La Pampa',1),(282,'2319',2305,'',0,'NEUQUEN','Neuquén',1),(283,'2320',2305,'',0,'RIO NEGRO','Río Negro',1),(284,'2321',2305,'',0,'CHUBUT','Chubut',1),(285,'2322',2305,'',0,'SANTA CRUZ','Santa Cruz',1),(286,'2323',2305,'',0,'TIERRA DEL FUEGO','Tierra del Fuego',1),(287,'2324',2305,'',0,'ISLAS MALVINAS','Islas Malvinas',1),(288,'2325',2305,'',0,'ANTARTIDA','Antártida',1),(289,'AN',11701,NULL,0,'AN','Andaman & Nicobar',1),(290,'AP',11701,NULL,0,'AP','Andhra Pradesh',1),(291,'AR',11701,NULL,0,'AR','Arunachal Pradesh',1),(292,'AS',11701,NULL,0,'AS','Assam',1),(293,'BR',11701,NULL,0,'BR','Bihar',1),(294,'CG',11701,NULL,0,'CG','Chattisgarh',1),(295,'CH',11701,NULL,0,'CH','Chandigarh',1),(296,'DD',11701,NULL,0,'DD','Daman & Diu',1),(297,'DL',11701,NULL,0,'DL','Delhi',1),(298,'DN',11701,NULL,0,'DN','Dadra and Nagar Haveli',1),(299,'GA',11701,NULL,0,'GA','Goa',1),(300,'GJ',11701,NULL,0,'GJ','Gujarat',1),(301,'HP',11701,NULL,0,'HP','Himachal Pradesh',1),(302,'HR',11701,NULL,0,'HR','Haryana',1),(303,'JH',11701,NULL,0,'JH','Jharkhand',1),(304,'JK',11701,NULL,0,'JK','Jammu & Kashmir',1),(305,'KA',11701,NULL,0,'KA','Karnataka',1),(306,'KL',11701,NULL,0,'KL','Kerala',1),(307,'LD',11701,NULL,0,'LD','Lakshadweep',1),(308,'MH',11701,NULL,0,'MH','Maharashtra',1),(309,'ML',11701,NULL,0,'ML','Meghalaya',1),(310,'MN',11701,NULL,0,'MN','Manipur',1),(311,'MP',11701,NULL,0,'MP','Madhya Pradesh',1),(312,'MZ',11701,NULL,0,'MZ','Mizoram',1),(313,'NL',11701,NULL,0,'NL','Nagaland',1),(314,'OR',11701,NULL,0,'OR','Orissa',1),(315,'PB',11701,NULL,0,'PB','Punjab',1),(316,'PY',11701,NULL,0,'PY','Puducherry',1),(317,'RJ',11701,NULL,0,'RJ','Rajasthan',1),(318,'SK',11701,NULL,0,'SK','Sikkim',1),(319,'TN',11701,NULL,0,'TN','Tamil Nadu',1),(320,'TR',11701,NULL,0,'TR','Tripura',1),(321,'UL',11701,NULL,0,'UL','Uttarakhand',1),(322,'UP',11701,NULL,0,'UP','Uttar Pradesh',1),(323,'WB',11701,NULL,0,'WB','West Bengal',1),(374,'151',6715,'',0,'151','Arica',1),(375,'152',6715,'',0,'152','Parinacota',1),(376,'011',6701,'',0,'011','Iquique',1),(377,'014',6701,'',0,'014','Tamarugal',1),(378,'021',6702,'',0,'021','Antofagasa',1),(379,'022',6702,'',0,'022','El Loa',1),(380,'023',6702,'',0,'023','Tocopilla',1),(381,'031',6703,'',0,'031','Copiapó',1),(382,'032',6703,'',0,'032','Chañaral',1),(383,'033',6703,'',0,'033','Huasco',1),(384,'041',6704,'',0,'041','Elqui',1),(385,'042',6704,'',0,'042','Choapa',1),(386,'043',6704,'',0,'043','Limarí',1),(387,'051',6705,'',0,'051','Valparaíso',1),(388,'052',6705,'',0,'052','Isla de Pascua',1),(389,'053',6705,'',0,'053','Los Andes',1),(390,'054',6705,'',0,'054','Petorca',1),(391,'055',6705,'',0,'055','Quillota',1),(392,'056',6705,'',0,'056','San Antonio',1),(393,'057',6705,'',0,'057','San Felipe de Aconcagua',1),(394,'058',6705,'',0,'058','Marga Marga',1),(395,'061',6706,'',0,'061','Cachapoal',1),(396,'062',6706,'',0,'062','Cardenal Caro',1),(397,'063',6706,'',0,'063','Colchagua',1),(398,'071',6707,'',0,'071','Talca',1),(399,'072',6707,'',0,'072','Cauquenes',1),(400,'073',6707,'',0,'073','Curicó',1),(401,'074',6707,'',0,'074','Linares',1),(402,'081',6708,'',0,'081','Concepción',1),(403,'082',6708,'',0,'082','Arauco',1),(404,'083',6708,'',0,'083','Biobío',1),(405,'084',6708,'',0,'084','Ñuble',1),(406,'091',6709,'',0,'091','Cautín',1),(407,'092',6709,'',0,'092','Malleco',1),(408,'141',6714,'',0,'141','Valdivia',1),(409,'142',6714,'',0,'142','Ranco',1),(410,'101',6710,'',0,'101','Llanquihue',1),(411,'102',6710,'',0,'102','Chiloé',1),(412,'103',6710,'',0,'103','Osorno',1),(413,'104',6710,'',0,'104','Palena',1),(414,'111',6711,'',0,'111','Coihaique',1),(415,'112',6711,'',0,'112','Aisén',1),(416,'113',6711,'',0,'113','Capitán Prat',1),(417,'114',6711,'',0,'114','General Carrera',1),(418,'121',6712,'',0,'121','Magallanes',1),(419,'122',6712,'',0,'122','Antártica Chilena',1),(420,'123',6712,'',0,'123','Tierra del Fuego',1),(421,'124',6712,'',0,'124','Última Esperanza',1),(422,'131',6713,'',0,'131','Santiago',1),(423,'132',6713,'',0,'132','Cordillera',1),(424,'133',6713,'',0,'133','Chacabuco',1),(425,'134',6713,'',0,'134','Maipo',1),(426,'135',6713,'',0,'135','Melipilla',1),(427,'136',6713,'',0,'136','Talagante',1),(428,'DIF',15401,'',0,'DIF','Distrito Federal',1),(429,'AGS',15401,'',0,'AGS','Aguascalientes',1),(430,'BCN',15401,'',0,'BCN','Baja California Norte',1),(431,'BCS',15401,'',0,'BCS','Baja California Sur',1),(432,'CAM',15401,'',0,'CAM','Campeche',1),(433,'CHP',15401,'',0,'CHP','Chiapas',1),(434,'CHI',15401,'',0,'CHI','Chihuahua',1),(435,'COA',15401,'',0,'COA','Coahuila',1),(436,'COL',15401,'',0,'COL','Colima',1),(437,'DUR',15401,'',0,'DUR','Durango',1),(438,'GTO',15401,'',0,'GTO','Guanajuato',1),(439,'GRO',15401,'',0,'GRO','Guerrero',1),(440,'HGO',15401,'',0,'HGO','Hidalgo',1),(441,'JAL',15401,'',0,'JAL','Jalisco',1),(442,'MEX',15401,'',0,'MEX','México',1),(443,'MIC',15401,'',0,'MIC','Michoacán de Ocampo',1),(444,'MOR',15401,'',0,'MOR','Morelos',1),(445,'NAY',15401,'',0,'NAY','Nayarit',1),(446,'NLE',15401,'',0,'NLE','Nuevo León',1),(447,'OAX',15401,'',0,'OAX','Oaxaca',1),(448,'PUE',15401,'',0,'PUE','Puebla',1),(449,'QRO',15401,'',0,'QRO','Querétaro',1),(451,'ROO',15401,'',0,'ROO','Quintana Roo',1),(452,'SLP',15401,'',0,'SLP','San Luis Potosí',1),(453,'SIN',15401,'',0,'SIN','Sinaloa',1),(454,'SON',15401,'',0,'SON','Sonora',1),(455,'TAB',15401,'',0,'TAB','Tabasco',1),(456,'TAM',15401,'',0,'TAM','Tamaulipas',1),(457,'TLX',15401,'',0,'TLX','Tlaxcala',1),(458,'VER',15401,'',0,'VER','Veracruz',1),(459,'YUC',15401,'',0,'YUC','Yucatán',1),(460,'ZAC',15401,'',0,'ZAC','Zacatecas',1),(461,'ANT',7001,'',0,'ANT','Antioquia',1),(462,'BOL',7001,'',0,'BOL','Bolívar',1),(463,'BOY',7001,'',0,'BOY','Boyacá',1),(464,'CAL',7001,'',0,'CAL','Caldas',1),(465,'CAU',7001,'',0,'CAU','Cauca',1),(466,'CUN',7001,'',0,'CUN','Cundinamarca',1),(467,'HUI',7001,'',0,'HUI','Huila',1),(468,'LAG',7001,'',0,'LAG','La Guajira',1),(469,'MET',7001,'',0,'MET','Meta',1),(470,'NAR',7001,'',0,'NAR','Nariño',1),(471,'NDS',7001,'',0,'NDS','Norte de Santander',1),(472,'SAN',7001,'',0,'SAN','Santander',1),(473,'SUC',7001,'',0,'SUC','Sucre',1),(474,'TOL',7001,'',0,'TOL','Tolima',1),(475,'VAC',7001,'',0,'VAC','Valle del Cauca',1),(476,'RIS',7001,'',0,'RIS','Risalda',1),(477,'ATL',7001,'',0,'ATL','Atlántico',1),(478,'COR',7001,'',0,'COR','Córdoba',1),(479,'SAP',7001,'',0,'SAP','San Andrés, Providencia y Santa Catalina',1),(480,'ARA',7001,'',0,'ARA','Arauca',1),(481,'CAS',7001,'',0,'CAS','Casanare',1),(482,'AMA',7001,'',0,'AMA','Amazonas',1),(483,'CAQ',7001,'',0,'CAQ','Caquetá',1),(484,'CHO',7001,'',0,'CHO','Chocó',1),(485,'GUA',7001,'',0,'GUA','Guainía',1),(486,'GUV',7001,'',0,'GUV','Guaviare',1),(487,'PUT',7001,'',0,'PUT','Putumayo',1),(488,'QUI',7001,'',0,'QUI','Quindío',1),(489,'VAU',7001,'',0,'VAU','Vaupés',1),(490,'BOG',7001,'',0,'BOG','Bogotá',1),(491,'VID',7001,'',0,'VID','Vichada',1),(492,'CES',7001,'',0,'CES','Cesar',1),(493,'MAG',7001,'',0,'MAG','Magdalena',1),(494,'AT',11401,'',0,'AT','Atlántida',1),(495,'CH',11401,'',0,'CH','Choluteca',1),(496,'CL',11401,'',0,'CL','Colón',1),(497,'CM',11401,'',0,'CM','Comayagua',1),(498,'CO',11401,'',0,'CO','Copán',1),(499,'CR',11401,'',0,'CR','Cortés',1),(500,'EP',11401,'',0,'EP','El Paraíso',1),(501,'FM',11401,'',0,'FM','Francisco Morazán',1),(502,'GD',11401,'',0,'GD','Gracias a Dios',1),(503,'IN',11401,'',0,'IN','Intibucá',1),(504,'IB',11401,'',0,'IB','Islas de la Bahía',1),(505,'LP',11401,'',0,'LP','La Paz',1),(506,'LM',11401,'',0,'LM','Lempira',1),(507,'OC',11401,'',0,'OC','Ocotepeque',1),(508,'OL',11401,'',0,'OL','Olancho',1),(509,'SB',11401,'',0,'SB','Santa Bárbara',1),(510,'VL',11401,'',0,'VL','Valle',1),(511,'YO',11401,'',0,'YO','Yoro',1),(512,'DC',11401,'',0,'DC','Distrito Central',1),(652,'CC',4601,'Oistins',0,'CC','Christ Church',1),(655,'SA',4601,'Greenland',0,'SA','Saint Andrew',1),(656,'SG',4601,'Bulkeley',0,'SG','Saint George',1),(657,'JA',4601,'Holetown',0,'JA','Saint James',1),(658,'SJ',4601,'Four Roads',0,'SJ','Saint John',1),(659,'SB',4601,'Bathsheba',0,'SB','Saint Joseph',1),(660,'SL',4601,'Crab Hill',0,'SL','Saint Lucy',1),(661,'SM',4601,'Bridgetown',0,'SM','Saint Michael',1),(662,'SP',4601,'Speightstown',0,'SP','Saint Peter',1),(663,'SC',4601,'Crane',0,'SC','Saint Philip',1),(664,'ST',4601,'Hillaby',0,'ST','Saint Thomas',1),(777,'AG',315,NULL,NULL,NULL,'AGRIGENTO',1),(778,'AL',312,NULL,NULL,NULL,'ALESSANDRIA',1),(779,'AN',310,NULL,NULL,NULL,'ANCONA',1),(780,'AO',319,NULL,NULL,NULL,'AOSTA',1),(781,'AR',316,NULL,NULL,NULL,'AREZZO',1),(782,'AP',310,NULL,NULL,NULL,'ASCOLI PICENO',1),(783,'AT',312,NULL,NULL,NULL,'ASTI',1),(784,'AV',304,NULL,NULL,NULL,'AVELLINO',1),(785,'BA',313,NULL,NULL,NULL,'BARI',1),(786,'BT',313,NULL,NULL,NULL,'BARLETTA-ANDRIA-TRANI',1),(787,'BL',320,NULL,NULL,NULL,'BELLUNO',1),(788,'BN',304,NULL,NULL,NULL,'BENEVENTO',1),(789,'BG',309,NULL,NULL,NULL,'BERGAMO',1),(790,'BI',312,NULL,NULL,NULL,'BIELLA',1),(791,'BO',305,NULL,NULL,NULL,'BOLOGNA',1),(792,'BZ',317,NULL,NULL,NULL,'BOLZANO',1),(793,'BS',309,NULL,NULL,NULL,'BRESCIA',1),(794,'BR',313,NULL,NULL,NULL,'BRINDISI',1),(795,'CA',314,NULL,NULL,NULL,'CAGLIARI',1),(796,'CL',315,NULL,NULL,NULL,'CALTANISSETTA',1),(797,'CB',311,NULL,NULL,NULL,'CAMPOBASSO',1),(798,'CI',314,NULL,NULL,NULL,'CARBONIA-IGLESIAS',1),(799,'CE',304,NULL,NULL,NULL,'CASERTA',1),(800,'CT',315,NULL,NULL,NULL,'CATANIA',1),(801,'CZ',303,NULL,NULL,NULL,'CATANZARO',1),(802,'CH',301,NULL,NULL,NULL,'CHIETI',1),(803,'CO',309,NULL,NULL,NULL,'COMO',1),(804,'CS',303,NULL,NULL,NULL,'COSENZA',1),(805,'CR',309,NULL,NULL,NULL,'CREMONA',1),(806,'KR',303,NULL,NULL,NULL,'CROTONE',1),(807,'CN',312,NULL,NULL,NULL,'CUNEO',1),(808,'EN',315,NULL,NULL,NULL,'ENNA',1),(809,'FM',310,NULL,NULL,NULL,'FERMO',1),(810,'FE',305,NULL,NULL,NULL,'FERRARA',1),(811,'FI',316,NULL,NULL,NULL,'FIRENZE',1),(812,'FG',313,NULL,NULL,NULL,'FOGGIA',1),(813,'FC',305,NULL,NULL,NULL,'FORLI-CESENA',1),(814,'FR',307,NULL,NULL,NULL,'FROSINONE',1),(815,'GE',308,NULL,NULL,NULL,'GENOVA',1),(816,'GO',306,NULL,NULL,NULL,'GORIZIA',1),(817,'GR',316,NULL,NULL,NULL,'GROSSETO',1),(818,'IM',308,NULL,NULL,NULL,'IMPERIA',1),(819,'IS',311,NULL,NULL,NULL,'ISERNIA',1),(820,'SP',308,NULL,NULL,NULL,'LA SPEZIA',1),(821,'AQ',301,NULL,NULL,NULL,'L AQUILA',1),(822,'LT',307,NULL,NULL,NULL,'LATINA',1),(823,'LE',313,NULL,NULL,NULL,'LECCE',1),(824,'LC',309,NULL,NULL,NULL,'LECCO',1),(825,'LI',314,NULL,NULL,NULL,'LIVORNO',1),(826,'LO',309,NULL,NULL,NULL,'LODI',1),(827,'LU',316,NULL,NULL,NULL,'LUCCA',1),(828,'MC',310,NULL,NULL,NULL,'MACERATA',1),(829,'MN',309,NULL,NULL,NULL,'MANTOVA',1),(830,'MS',316,NULL,NULL,NULL,'MASSA-CARRARA',1),(831,'MT',302,NULL,NULL,NULL,'MATERA',1),(832,'VS',314,NULL,NULL,NULL,'MEDIO CAMPIDANO',1),(833,'ME',315,NULL,NULL,NULL,'MESSINA',1),(834,'MI',309,NULL,NULL,NULL,'MILANO',1),(835,'MB',309,NULL,NULL,NULL,'MONZA e BRIANZA',1),(836,'MO',305,NULL,NULL,NULL,'MODENA',1),(837,'NA',304,NULL,NULL,NULL,'NAPOLI',1),(838,'NO',312,NULL,NULL,NULL,'NOVARA',1),(839,'NU',314,NULL,NULL,NULL,'NUORO',1),(840,'OG',314,NULL,NULL,NULL,'OGLIASTRA',1),(841,'OT',314,NULL,NULL,NULL,'OLBIA-TEMPIO',1),(842,'OR',314,NULL,NULL,NULL,'ORISTANO',1),(843,'PD',320,NULL,NULL,NULL,'PADOVA',1),(844,'PA',315,NULL,NULL,NULL,'PALERMO',1),(845,'PR',305,NULL,NULL,NULL,'PARMA',1),(846,'PV',309,NULL,NULL,NULL,'PAVIA',1),(847,'PG',318,NULL,NULL,NULL,'PERUGIA',1),(848,'PU',310,NULL,NULL,NULL,'PESARO e URBINO',1),(849,'PE',301,NULL,NULL,NULL,'PESCARA',1),(850,'PC',305,NULL,NULL,NULL,'PIACENZA',1),(851,'PI',316,NULL,NULL,NULL,'PISA',1),(852,'PT',316,NULL,NULL,NULL,'PISTOIA',1),(853,'PN',306,NULL,NULL,NULL,'PORDENONE',1),(854,'PZ',302,NULL,NULL,NULL,'POTENZA',1),(855,'PO',316,NULL,NULL,NULL,'PRATO',1),(856,'RG',315,NULL,NULL,NULL,'RAGUSA',1),(857,'RA',305,NULL,NULL,NULL,'RAVENNA',1),(858,'RC',303,NULL,NULL,NULL,'REGGIO CALABRIA',1),(859,'RE',305,NULL,NULL,NULL,'REGGIO NELL EMILIA',1),(860,'RI',307,NULL,NULL,NULL,'RIETI',1),(861,'RN',305,NULL,NULL,NULL,'RIMINI',1),(862,'RM',307,NULL,NULL,NULL,'ROMA',1),(863,'RO',320,NULL,NULL,NULL,'ROVIGO',1),(864,'SA',304,NULL,NULL,NULL,'SALERNO',1),(865,'SS',314,NULL,NULL,NULL,'SASSARI',1),(866,'SV',308,NULL,NULL,NULL,'SAVONA',1),(867,'SI',316,NULL,NULL,NULL,'SIENA',1),(868,'SR',315,NULL,NULL,NULL,'SIRACUSA',1),(869,'SO',309,NULL,NULL,NULL,'SONDRIO',1),(870,'TA',313,NULL,NULL,NULL,'TARANTO',1),(871,'TE',301,NULL,NULL,NULL,'TERAMO',1),(872,'TR',318,NULL,NULL,NULL,'TERNI',1),(873,'TO',312,NULL,NULL,NULL,'TORINO',1),(874,'TP',315,NULL,NULL,NULL,'TRAPANI',1),(875,'TN',317,NULL,NULL,NULL,'TRENTO',1),(876,'TV',320,NULL,NULL,NULL,'TREVISO',1),(877,'TS',306,NULL,NULL,NULL,'TRIESTE',1),(878,'UD',306,NULL,NULL,NULL,'UDINE',1),(879,'VA',309,NULL,NULL,NULL,'VARESE',1),(880,'VE',320,NULL,NULL,NULL,'VENEZIA',1),(881,'VB',312,NULL,NULL,NULL,'VERBANO-CUSIO-OSSOLA',1),(882,'VC',312,NULL,NULL,NULL,'VERCELLI',1),(883,'VR',320,NULL,NULL,NULL,'VERONA',1),(884,'VV',303,NULL,NULL,NULL,'VIBO VALENTIA',1),(885,'VI',320,NULL,NULL,NULL,'VICENZA',1),(886,'VT',307,NULL,NULL,NULL,'VITERBO',1),(1036,'VE-L',23201,'',0,'VE-L','Mérida',1),(1037,'VE-T',23201,'',0,'VE-T','Trujillo',1),(1038,'VE-E',23201,'',0,'VE-E','Barinas',1),(1039,'VE-M',23202,'',0,'VE-M','Miranda',1),(1040,'VE-W',23202,'',0,'VE-W','Vargas',1),(1041,'VE-A',23202,'',0,'VE-A','Distrito Capital',1),(1042,'VE-D',23203,'',0,'VE-D','Aragua',1),(1043,'VE-G',23203,'',0,'VE-G','Carabobo',1),(1044,'VE-I',23204,'',0,'VE-I','Falcón',1),(1045,'VE-K',23204,'',0,'VE-K','Lara',1),(1046,'VE-U',23204,'',0,'VE-U','Yaracuy',1),(1047,'VE-F',23205,'',0,'VE-F','Bolívar',1),(1048,'VE-X',23205,'',0,'VE-X','Amazonas',1),(1049,'VE-Y',23205,'',0,'VE-Y','Delta Amacuro',1),(1050,'VE-O',23206,'',0,'VE-O','Nueva Esparta',1),(1051,'VE-Z',23206,'',0,'VE-Z','Dependencias Federales',1),(1052,'VE-C',23207,'',0,'VE-C','Apure',1),(1053,'VE-J',23207,'',0,'VE-J','Guárico',1),(1054,'VE-H',23207,'',0,'VE-H','Cojedes',1),(1055,'VE-P',23207,'',0,'VE-P','Portuguesa',1),(1056,'VE-B',23208,'',0,'VE-B','Anzoátegui',1),(1057,'VE-N',23208,'',0,'VE-N','Monagas',1),(1058,'VE-R',23208,'',0,'VE-R','Sucre',1),(1059,'VE-V',23209,'',0,'VE-V','Zulia',1),(1060,'VE-S',23209,'',0,'VE-S','Táchira',1),(1061,'66',10201,NULL,NULL,NULL,'?????',1),(1062,'00',10205,NULL,NULL,NULL,'?????',1),(1063,'01',10205,NULL,NULL,NULL,'?????',1),(1064,'02',10205,NULL,NULL,NULL,'?????',1),(1065,'03',10205,NULL,NULL,NULL,'??????',1),(1066,'04',10205,NULL,NULL,NULL,'?????',1),(1067,'05',10205,NULL,NULL,NULL,'??????',1),(1068,'06',10203,NULL,NULL,NULL,'??????',1),(1069,'07',10203,NULL,NULL,NULL,'???????????',1),(1070,'08',10203,NULL,NULL,NULL,'??????',1),(1071,'09',10203,NULL,NULL,NULL,'?????',1),(1072,'10',10203,NULL,NULL,NULL,'??????',1),(1073,'11',10203,NULL,NULL,NULL,'??????',1),(1074,'12',10203,NULL,NULL,NULL,'?????????',1),(1075,'13',10206,NULL,NULL,NULL,'????',1),(1076,'14',10206,NULL,NULL,NULL,'?????????',1),(1077,'15',10206,NULL,NULL,NULL,'????????',1),(1078,'16',10206,NULL,NULL,NULL,'???????',1),(1079,'17',10213,NULL,NULL,NULL,'???????',1),(1080,'18',10213,NULL,NULL,NULL,'????????',1),(1081,'19',10213,NULL,NULL,NULL,'??????',1),(1082,'20',10213,NULL,NULL,NULL,'???????',1),(1083,'21',10212,NULL,NULL,NULL,'????????',1),(1084,'22',10212,NULL,NULL,NULL,'??????',1),(1085,'23',10212,NULL,NULL,NULL,'????????',1),(1086,'24',10212,NULL,NULL,NULL,'???????',1),(1087,'25',10212,NULL,NULL,NULL,'????????',1),(1088,'26',10212,NULL,NULL,NULL,'???????',1),(1089,'27',10202,NULL,NULL,NULL,'??????',1),(1090,'28',10202,NULL,NULL,NULL,'?????????',1),(1091,'29',10202,NULL,NULL,NULL,'????????',1),(1092,'30',10202,NULL,NULL,NULL,'??????',1),(1093,'31',10209,NULL,NULL,NULL,'????????',1),(1094,'32',10209,NULL,NULL,NULL,'???????',1),(1095,'33',10209,NULL,NULL,NULL,'????????',1),(1096,'34',10209,NULL,NULL,NULL,'???????',1),(1097,'35',10209,NULL,NULL,NULL,'????????',1),(1098,'36',10211,NULL,NULL,NULL,'???????????????',1),(1099,'37',10211,NULL,NULL,NULL,'?????',1),(1100,'38',10211,NULL,NULL,NULL,'?????',1),(1101,'39',10207,NULL,NULL,NULL,'????????',1),(1102,'40',10207,NULL,NULL,NULL,'???????',1),(1103,'41',10207,NULL,NULL,NULL,'??????????',1),(1104,'42',10207,NULL,NULL,NULL,'?????',1),(1105,'43',10207,NULL,NULL,NULL,'???????',1),(1106,'44',10208,NULL,NULL,NULL,'??????',1),(1107,'45',10208,NULL,NULL,NULL,'??????',1),(1108,'46',10208,NULL,NULL,NULL,'??????',1),(1109,'47',10208,NULL,NULL,NULL,'?????',1),(1110,'48',10208,NULL,NULL,NULL,'????',1),(1111,'49',10210,NULL,NULL,NULL,'??????',1),(1112,'50',10210,NULL,NULL,NULL,'????',1),(1113,'51',10210,NULL,NULL,NULL,'????????',1),(1114,'52',10210,NULL,NULL,NULL,'????????',1),(1115,'53',10210,NULL,NULL,NULL,'???-??????',1),(1116,'54',10210,NULL,NULL,NULL,'??',1),(1117,'55',10210,NULL,NULL,NULL,'?????',1),(1118,'56',10210,NULL,NULL,NULL,'???????',1),(1119,'57',10210,NULL,NULL,NULL,'?????',1),(1120,'58',10210,NULL,NULL,NULL,'?????',1),(1121,'59',10210,NULL,NULL,NULL,'?????',1),(1122,'60',10210,NULL,NULL,NULL,'?????',1),(1123,'61',10210,NULL,NULL,NULL,'?????',1),(1124,'62',10204,NULL,NULL,NULL,'????????',1),(1125,'63',10204,NULL,NULL,NULL,'??????',1),(1126,'64',10204,NULL,NULL,NULL,'???????',1),(1127,'65',10204,NULL,NULL,NULL,'?????',1),(1128,'AL01',1301,'',0,'','Wilaya d\'Adrar',1),(1129,'AL02',1301,'',0,'','Wilaya de Chlef',1),(1130,'AL03',1301,'',0,'','Wilaya de Laghouat',1),(1131,'AL04',1301,'',0,'','Wilaya d\'Oum El Bouaghi',1),(1132,'AL05',1301,'',0,'','Wilaya de Batna',1),(1133,'AL06',1301,'',0,'','Wilaya de Béjaïa',1),(1134,'AL07',1301,'',0,'','Wilaya de Biskra',1),(1135,'AL08',1301,'',0,'','Wilaya de Béchar',1),(1136,'AL09',1301,'',0,'','Wilaya de Blida',1),(1137,'AL11',1301,'',0,'','Wilaya de Bouira',1),(1138,'AL12',1301,'',0,'','Wilaya de Tamanrasset',1),(1139,'AL13',1301,'',0,'','Wilaya de Tébessa',1),(1140,'AL14',1301,'',0,'','Wilaya de Tlemcen',1),(1141,'AL15',1301,'',0,'','Wilaya de Tiaret',1),(1142,'AL16',1301,'',0,'','Wilaya de Tizi Ouzou',1),(1143,'AL17',1301,'',0,'','Wilaya d\'Alger',1),(1144,'AL18',1301,'',0,'','Wilaya de Djelfa',1),(1145,'AL19',1301,'',0,'','Wilaya de Jijel',1),(1146,'AL20',1301,'',0,'','Wilaya de Sétif ',1),(1147,'AL21',1301,'',0,'','Wilaya de Saïda',1),(1148,'AL22',1301,'',0,'','Wilaya de Skikda',1),(1149,'AL23',1301,'',0,'','Wilaya de Sidi Bel Abbès',1),(1150,'AL24',1301,'',0,'','Wilaya d\'Annaba',1),(1151,'AL25',1301,'',0,'','Wilaya de Guelma',1),(1152,'AL26',1301,'',0,'','Wilaya de Constantine',1),(1153,'AL27',1301,'',0,'','Wilaya de Médéa',1),(1154,'AL28',1301,'',0,'','Wilaya de Mostaganem',1),(1155,'AL29',1301,'',0,'','Wilaya de M\'Sila',1),(1156,'AL30',1301,'',0,'','Wilaya de Mascara',1),(1157,'AL31',1301,'',0,'','Wilaya d\'Ouargla',1),(1158,'AL32',1301,'',0,'','Wilaya d\'Oran',1),(1159,'AL33',1301,'',0,'','Wilaya d\'El Bayadh',1),(1160,'AL34',1301,'',0,'','Wilaya d\'Illizi',1),(1161,'AL35',1301,'',0,'','Wilaya de Bordj Bou Arreridj',1),(1162,'AL36',1301,'',0,'','Wilaya de Boumerdès',1),(1163,'AL37',1301,'',0,'','Wilaya d\'El Tarf',1),(1164,'AL38',1301,'',0,'','Wilaya de Tindouf',1),(1165,'AL39',1301,'',0,'','Wilaya de Tissemsilt',1),(1166,'AL40',1301,'',0,'','Wilaya d\'El Oued',1),(1167,'AL41',1301,'',0,'','Wilaya de Khenchela',1),(1168,'AL42',1301,'',0,'','Wilaya de Souk Ahras',1),(1169,'AL43',1301,'',0,'','Wilaya de Tipaza',1),(1170,'AL44',1301,'',0,'','Wilaya de Mila',1),(1171,'AL45',1301,'',0,'','Wilaya d\'Aïn Defla',1),(1172,'AL46',1301,'',0,'','Wilaya de Naâma',1),(1173,'AL47',1301,'',0,'','Wilaya d\'Aïn Témouchent',1),(1174,'AL48',1301,'',0,'','Wilaya de Ghardaia',1),(1175,'AL49',1301,'',0,'','Wilaya de Relizane',1),(1176,'MA',1209,'',0,'','Province de Benslimane',1),(1177,'MA1',1209,'',0,'','Province de Berrechid',1),(1178,'MA2',1209,'',0,'','Province de Khouribga',1),(1179,'MA3',1209,'',0,'','Province de Settat',1),(1180,'MA4',1210,'',0,'','Province d\'El Jadida',1),(1181,'MA5',1210,'',0,'','Province de Safi',1),(1182,'MA6',1210,'',0,'','Province de Sidi Bennour',1),(1183,'MA7',1210,'',0,'','Province de Youssoufia',1),(1184,'MA6B',1205,'',0,'','Préfecture de Fès',1),(1185,'MA7B',1205,'',0,'','Province de Boulemane',1),(1186,'MA8',1205,'',0,'','Province de Moulay Yacoub',1),(1187,'MA9',1205,'',0,'','Province de Sefrou',1),(1188,'MA8A',1202,'',0,'','Province de Kénitra',1),(1189,'MA9A',1202,'',0,'','Province de Sidi Kacem',1),(1190,'MA10',1202,'',0,'','Province de Sidi Slimane',1),(1191,'MA11',1208,'',0,'','Préfecture de Casablanca',1),(1192,'MA12',1208,'',0,'','Préfecture de Mohammédia',1),(1193,'MA13',1208,'',0,'','Province de Médiouna',1),(1194,'MA14',1208,'',0,'','Province de Nouaceur',1),(1195,'MA15',1214,'',0,'','Province d\'Assa-Zag',1),(1196,'MA16',1214,'',0,'','Province d\'Es-Semara',1),(1197,'MA17A',1214,'',0,'','Province de Guelmim',1),(1198,'MA18',1214,'',0,'','Province de Tata',1),(1199,'MA19',1214,'',0,'','Province de Tan-Tan',1),(1200,'MA15',1215,'',0,'','Province de Boujdour',1),(1201,'MA16',1215,'',0,'','Province de Lâayoune',1),(1202,'MA17',1215,'',0,'','Province de Tarfaya',1),(1203,'MA18',1211,'',0,'','Préfecture de Marrakech',1),(1204,'MA19',1211,'',0,'','Province d\'Al Haouz',1),(1205,'MA20',1211,'',0,'','Province de Chichaoua',1),(1206,'MA21',1211,'',0,'','Province d\'El Kelâa des Sraghna',1),(1207,'MA22',1211,'',0,'','Province d\'Essaouira',1),(1208,'MA23',1211,'',0,'','Province de Rehamna',1),(1209,'MA24',1206,'',0,'','Préfecture de Meknès',1),(1210,'MA25',1206,'',0,'','Province d’El Hajeb',1),(1211,'MA26',1206,'',0,'','Province d\'Errachidia',1),(1212,'MA27',1206,'',0,'','Province d’Ifrane',1),(1213,'MA28',1206,'',0,'','Province de Khénifra',1),(1214,'MA29',1206,'',0,'','Province de Midelt',1),(1215,'MA30',1204,'',0,'','Préfecture d\'Oujda-Angad',1),(1216,'MA31',1204,'',0,'','Province de Berkane',1),(1217,'MA32',1204,'',0,'','Province de Driouch',1),(1218,'MA33',1204,'',0,'','Province de Figuig',1),(1219,'MA34',1204,'',0,'','Province de Jerada',1),(1220,'MA35',1204,'',0,'','Province de Nadorgg',1),(1221,'MA36',1204,'',0,'','Province de Taourirt',1),(1222,'MA37',1216,'',0,'','Province d\'Aousserd',1),(1223,'MA38',1216,'',0,'','Province d\'Oued Ed-Dahab',1),(1224,'MA39',1207,'',0,'','Préfecture de Rabat',1),(1225,'MA40',1207,'',0,'','Préfecture de Skhirat-Témara',1),(1226,'MA41',1207,'',0,'','Préfecture de Salé',1),(1227,'MA42',1207,'',0,'','Province de Khémisset',1),(1228,'MA43',1213,'',0,'','Préfecture d\'Agadir Ida-Outanane',1),(1229,'MA44',1213,'',0,'','Préfecture d\'Inezgane-Aït Melloul',1),(1230,'MA45',1213,'',0,'','Province de Chtouka-Aït Baha',1),(1231,'MA46',1213,'',0,'','Province d\'Ouarzazate',1),(1232,'MA47',1213,'',0,'','Province de Sidi Ifni',1),(1233,'MA48',1213,'',0,'','Province de Taroudant',1),(1234,'MA49',1213,'',0,'','Province de Tinghir',1),(1235,'MA50',1213,'',0,'','Province de Tiznit',1),(1236,'MA51',1213,'',0,'','Province de Zagora',1),(1237,'MA52',1212,'',0,'','Province d\'Azilal',1),(1238,'MA53',1212,'',0,'','Province de Beni Mellal',1),(1239,'MA54',1212,'',0,'','Province de Fquih Ben Salah',1),(1240,'MA55',1201,'',0,'','Préfecture de M\'diq-Fnideq',1),(1241,'MA56',1201,'',0,'','Préfecture de Tanger-Asilah',1),(1242,'MA57',1201,'',0,'','Province de Chefchaouen',1),(1243,'MA58',1201,'',0,'','Province de Fahs-Anjra',1),(1244,'MA59',1201,'',0,'','Province de Larache',1),(1245,'MA60',1201,'',0,'','Province d\'Ouezzane',1),(1246,'MA61',1201,'',0,'','Province de Tétouan',1),(1247,'MA62',1203,'',0,'','Province de Guercif',1),(1248,'MA63',1203,'',0,'','Province d\'Al Hoceïma',1),(1249,'MA64',1203,'',0,'','Province de Taounate',1),(1250,'MA65',1203,'',0,'','Province de Taza',1),(1251,'MA6A',1205,'',0,'','Préfecture de Fès',1),(1252,'MA7A',1205,'',0,'','Province de Boulemane',1),(1253,'MA15A',1214,'',0,'','Province d\'Assa-Zag',1),(1254,'MA16A',1214,'',0,'','Province d\'Es-Semara',1),(1255,'MA18A',1211,'',0,'','Préfecture de Marrakech',1),(1256,'MA19A',1214,'',0,'','Province de Tan-Tan',1),(1257,'MA19B',1214,'',0,'','Province de Tan-Tan',1),(1258,'TN01',1001,'',0,'','Ariana',1),(1259,'TN02',1001,'',0,'','Béja',1),(1260,'TN03',1001,'',0,'','Ben Arous',1),(1261,'TN04',1001,'',0,'','Bizerte',1),(1262,'TN05',1001,'',0,'','Gabès',1),(1263,'TN06',1001,'',0,'','Gafsa',1),(1264,'TN07',1001,'',0,'','Jendouba',1),(1265,'TN08',1001,'',0,'','Kairouan',1),(1266,'TN09',1001,'',0,'','Kasserine',1),(1267,'TN10',1001,'',0,'','Kébili',1),(1268,'TN11',1001,'',0,'','La Manouba',1),(1269,'TN12',1001,'',0,'','Le Kef',1),(1270,'TN13',1001,'',0,'','Mahdia',1),(1271,'TN14',1001,'',0,'','Médenine',1),(1272,'TN15',1001,'',0,'','Monastir',1),(1273,'TN16',1001,'',0,'','Nabeul',1),(1274,'TN17',1001,'',0,'','Sfax',1),(1275,'TN18',1001,'',0,'','Sidi Bouzid',1),(1276,'TN19',1001,'',0,'','Siliana',1),(1277,'TN20',1001,'',0,'','Sousse',1),(1278,'TN21',1001,'',0,'','Tataouine',1),(1279,'TN22',1001,'',0,'','Tozeur',1),(1280,'TN23',1001,'',0,'','Tunis',1),(1281,'TN24',1001,'',0,'','Zaghouan',1); +/*!40000 ALTER TABLE `llx_c_departements` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_ecotaxe` +-- + +DROP TABLE IF EXISTS `llx_c_ecotaxe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_ecotaxe` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(64) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `organization` varchar(255) DEFAULT NULL, + `fk_pays` int(11) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_ecotaxe` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_ecotaxe` +-- + +LOCK TABLES `llx_c_ecotaxe` WRITE; +/*!40000 ALTER TABLE `llx_c_ecotaxe` DISABLE KEYS */; +INSERT INTO `llx_c_ecotaxe` VALUES (1,'ER-A-A','Materiels electriques < 0,2kg',0.01000000,'ERP',1,1),(2,'ER-A-B','Materiels electriques >= 0,2 kg et < 0,5 kg',0.03000000,'ERP',1,1),(3,'ER-A-C','Materiels electriques >= 0,5 kg et < 1 kg',0.04000000,'ERP',1,1),(4,'ER-A-D','Materiels electriques >= 1 kg et < 2 kg',0.13000000,'ERP',1,1),(5,'ER-A-E','Materiels electriques >= 2 kg et < 4kg',0.21000000,'ERP',1,1),(6,'ER-A-F','Materiels electriques >= 4 kg et < 8 kg',0.42000000,'ERP',1,1),(7,'ER-A-G','Materiels electriques >= 8 kg et < 15 kg',0.84000000,'ERP',1,1),(8,'ER-A-H','Materiels electriques >= 15 kg et < 20 kg',1.25000000,'ERP',1,1),(9,'ER-A-I','Materiels electriques >= 20 kg et < 30 kg',1.88000000,'ERP',1,1),(10,'ER-A-J','Materiels electriques >= 30 kg',3.34000000,'ERP',1,1),(11,'ER-M-1','TV, Moniteurs < 9kg',0.84000000,'ERP',1,1),(12,'ER-M-2','TV, Moniteurs >= 9kg et < 15kg',1.67000000,'ERP',1,1),(13,'ER-M-3','TV, Moniteurs >= 15kg et < 30kg',3.34000000,'ERP',1,1),(14,'ER-M-4','TV, Moniteurs >= 30 kg',6.69000000,'ERP',1,1),(15,'EC-A-A','Materiels electriques 0,2 kg max',0.00840000,'Ecologic',1,1),(16,'EC-A-B','Materiels electriques 0,21 kg min - 0,50 kg max',0.02500000,'Ecologic',1,1),(17,'EC-A-C','Materiels electriques 0,51 kg min - 1 kg max',0.04000000,'Ecologic',1,1),(18,'EC-A-D','Materiels electriques 1,01 kg min - 2,5 kg max',0.13000000,'Ecologic',1,1),(19,'EC-A-E','Materiels electriques 2,51 kg min - 4 kg max',0.21000000,'Ecologic',1,1),(20,'EC-A-F','Materiels electriques 4,01 kg min - 8 kg max',0.42000000,'Ecologic',1,1),(21,'EC-A-G','Materiels electriques 8,01 kg min - 12 kg max',0.63000000,'Ecologic',1,1),(22,'EC-A-H','Materiels electriques 12,01 kg min - 20 kg max',1.05000000,'Ecologic',1,1),(23,'EC-A-I','Materiels electriques 20,01 kg min',1.88000000,'Ecologic',1,1),(24,'EC-M-1','TV, Moniteurs 9 kg max',0.84000000,'Ecologic',1,1),(25,'EC-M-2','TV, Moniteurs 9,01 kg min - 18 kg max',1.67000000,'Ecologic',1,1),(26,'EC-M-3','TV, Moniteurs 18,01 kg min - 36 kg max',3.34000000,'Ecologic',1,1),(27,'EC-M-4','TV, Moniteurs 36,01 kg min',6.69000000,'Ecologic',1,1),(28,'ES-M-1','TV, Moniteurs <= 20 pouces',0.84000000,'Eco-systemes',1,1),(29,'ES-M-2','TV, Moniteurs > 20 pouces et <= 32 pouces',3.34000000,'Eco-systemes',1,1),(30,'ES-M-3','TV, Moniteurs > 32 pouces et autres grands ecrans',6.69000000,'Eco-systemes',1,1),(31,'ES-A-A','Ordinateur fixe, Audio home systems (HIFI), elements hifi separes',0.84000000,'Eco-systemes',1,1),(32,'ES-A-B','Ordinateur portable, CD-RCR, VCR, lecteurs et enregistreurs DVD, instruments de musique et caisses de resonance, haut parleurs...',0.25000000,'Eco-systemes',1,1),(33,'ES-A-C','Imprimante, photocopieur, telecopieur',0.42000000,'Eco-systemes',1,1),(34,'ES-A-D','Accessoires, clavier, souris, PDA, imprimante photo, appareil photo, gps, telephone, repondeur, telephone sans fil, modem, telecommande, casque, camescope, baladeur mp3, radio portable, radio K7 et CD portable, radio reveil',0.08400000,'Eco-systemes',1,1),(35,'ES-A-E','GSM',0.00840000,'Eco-systemes',1,1),(36,'ES-A-F','Jouets et equipements de loisirs et de sports < 0,5 kg',0.04200000,'Eco-systemes',1,1),(37,'ES-A-G','Jouets et equipements de loisirs et de sports > 0,5 kg',0.17000000,'Eco-systemes',1,1),(38,'ES-A-H','Jouets et equipements de loisirs et de sports > 10 kg',1.25000000,'Eco-systemes',1,1); +/*!40000 ALTER TABLE `llx_c_ecotaxe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_effectif` +-- + +DROP TABLE IF EXISTS `llx_c_effectif`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_effectif` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_effectif` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_effectif` +-- + +LOCK TABLES `llx_c_effectif` WRITE; +/*!40000 ALTER TABLE `llx_c_effectif` DISABLE KEYS */; +INSERT INTO `llx_c_effectif` VALUES (0,'EF0','-',1,NULL),(1,'EF1-5','1 - 5',1,NULL),(2,'EF6-10','6 - 10',1,NULL),(3,'EF11-50','11 - 50',1,NULL),(4,'EF51-100','51 - 100',1,NULL),(5,'EF100-500','100 - 500',1,NULL),(6,'EF500-','> 500',1,NULL); +/*!40000 ALTER TABLE `llx_c_effectif` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_field_list` +-- + +DROP TABLE IF EXISTS `llx_c_field_list`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_field_list` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `element` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `name` varchar(32) NOT NULL, + `alias` varchar(32) NOT NULL, + `title` varchar(32) NOT NULL, + `align` varchar(6) DEFAULT 'left', + `sort` tinyint(4) NOT NULL DEFAULT '1', + `search` tinyint(4) NOT NULL DEFAULT '0', + `enabled` varchar(255) DEFAULT '1', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_field_list` +-- + +LOCK TABLES `llx_c_field_list` WRITE; +/*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */; +INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8); +/*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_forme_juridique` +-- + +DROP TABLE IF EXISTS `llx_c_forme_juridique`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_forme_juridique` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` int(11) NOT NULL, + `fk_pays` int(11) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `isvatexempted` tinyint(4) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_forme_juridique` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=100008 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_forme_juridique` +-- + +LOCK TABLES `llx_c_forme_juridique` WRITE; +/*!40000 ALTER TABLE `llx_c_forme_juridique` DISABLE KEYS */; +INSERT INTO `llx_c_forme_juridique` VALUES (399,0,0,'-',0,1,NULL),(400,2301,23,'Monotributista',0,1,NULL),(401,2302,23,'Sociedad Civil',0,1,NULL),(402,2303,23,'Sociedades Comerciales',0,1,NULL),(403,2304,23,'Sociedades de Hecho',0,1,NULL),(404,2305,23,'Sociedades Irregulares',0,1,NULL),(405,2306,23,'Sociedad Colectiva',0,1,NULL),(406,2307,23,'Sociedad en Comandita Simple',0,1,NULL),(407,2308,23,'Sociedad de Capital e Industria',0,1,NULL),(408,2309,23,'Sociedad Accidental o en participación',0,1,NULL),(409,2310,23,'Sociedad de Responsabilidad Limitada',0,1,NULL),(410,2311,23,'Sociedad Anónima',0,1,NULL),(411,2312,23,'Sociedad Anónima con Participación Estatal Mayoritaria',0,1,NULL),(412,2313,23,'Sociedad en Comandita por Acciones (arts. 315 a 324, LSC)',0,1,NULL),(413,11,1,'Artisan Commerçant (EI)',0,1,NULL),(414,12,1,'Commerçant (EI)',0,1,NULL),(415,13,1,'Artisan (EI)',0,1,NULL),(416,14,1,'Officier public ou ministériel',0,1,NULL),(417,15,1,'Profession libérale (EI)',0,1,NULL),(418,16,1,'Exploitant agricole',0,1,NULL),(419,17,1,'Agent commercial',0,1,NULL),(420,18,1,'Associé Gérant de société',0,1,NULL),(421,19,1,'Personne physique',0,1,NULL),(422,21,1,'Indivision',0,1,NULL),(423,22,1,'Société créée de fait',0,1,NULL),(424,23,1,'Société en participation',0,1,NULL),(425,27,1,'Paroisse hors zone concordataire',0,1,NULL),(426,29,1,'Groupement de droit privé non doté de la personnalité morale',0,1,NULL),(427,31,1,'Personne morale de droit étranger, immatriculée au RCS',0,1,NULL),(428,32,1,'Personne morale de droit étranger, non immatriculée au RCS',0,1,NULL),(429,35,1,'Régime auto-entrepreneur',0,1,NULL),(430,41,1,'Établissement public ou régie à caractère industriel ou commercial',0,1,NULL),(431,51,1,'Société coopérative commerciale particulière',0,1,NULL),(432,52,1,'Société en nom collectif',0,1,NULL),(433,53,1,'Société en commandite',0,1,NULL),(434,54,1,'Société à responsabilité limitée (SARL)',0,1,NULL),(435,55,1,'Société anonyme à conseil d administration',0,1,NULL),(436,56,1,'Société anonyme à directoire',0,1,NULL),(437,57,1,'Société par actions simplifiée',0,1,NULL),(438,58,1,'Entreprise Unipersonnelle à Responsabilité Limitée (EURL)',0,1,NULL),(439,61,1,'Caisse d\'épargne et de prévoyance',0,1,NULL),(440,62,1,'Groupement d\'intérêt économique (GIE)',0,1,NULL),(441,63,1,'Société coopérative agricole',0,1,NULL),(442,64,1,'Société non commerciale d assurances',0,1,NULL),(443,65,1,'Société civile',0,1,NULL),(444,69,1,'Personnes de droit privé inscrites au RCS',0,1,NULL),(445,71,1,'Administration de l état',0,1,NULL),(446,72,1,'Collectivité territoriale',0,1,NULL),(447,73,1,'Établissement public administratif',0,1,NULL),(448,74,1,'Personne morale de droit public administratif',0,1,NULL),(449,81,1,'Organisme gérant régime de protection social à adhésion obligatoire',0,1,NULL),(450,82,1,'Organisme mutualiste',0,1,NULL),(451,83,1,'Comité d entreprise',0,1,NULL),(452,84,1,'Organisme professionnel',0,1,NULL),(453,85,1,'Organisme de retraite à adhésion non obligatoire',0,1,NULL),(454,91,1,'Syndicat de propriétaires',0,1,NULL),(455,92,1,'Association loi 1901 ou assimilé',0,1,NULL),(456,93,1,'Fondation',0,1,NULL),(457,99,1,'Personne morale de droit privé',0,1,NULL),(458,200,2,'Indépendant',0,1,NULL),(459,201,2,'SPRL - Société à responsabilité limitée',0,1,NULL),(460,202,2,'SA - Société Anonyme',0,1,NULL),(461,203,2,'SCRL - Société coopérative à responsabilité limitée',0,1,NULL),(462,204,2,'ASBL - Association sans but Lucratif',0,1,NULL),(463,205,2,'SCRI - Société coopérative à responsabilité illimitée',0,1,NULL),(464,206,2,'SCS - Société en commandite simple',0,1,NULL),(465,207,2,'SCA - Société en commandite par action',0,1,NULL),(466,208,2,'SNC - Société en nom collectif',0,1,NULL),(467,209,2,'GIE - Groupement d intérêt économique',0,1,NULL),(468,210,2,'GEIE - Groupement européen d intérêt économique',0,1,NULL),(469,500,5,'Limited liability corporation (GmbH)',0,1,NULL),(470,501,5,'Stock corporation (AG)',0,1,NULL),(471,502,5,'Partnerships general or limited (GmbH & CO. KG)',0,1,NULL),(472,503,5,'Sole proprietor / Private business',0,1,NULL),(473,301,3,'Società semplice',0,1,NULL),(474,302,3,'Società in nome collettivo s.n.c.',0,1,NULL),(475,303,3,'Società in accomandita semplice s.a.s.',0,1,NULL),(476,304,3,'Società per azioni s.p.a.',0,1,NULL),(477,305,3,'Società a responsabilità limitata s.r.l.',0,1,NULL),(478,306,3,'Società in accomandita per azioni s.a.p.a.',0,1,NULL),(479,307,3,'Società cooperativa',0,1,NULL),(480,308,3,'Società consortile',0,1,NULL),(481,309,3,'Società europea',0,1,NULL),(482,310,3,'Società cooperativa europea',0,1,NULL),(483,311,3,'Società unipersonale',0,1,NULL),(484,312,3,'Società di professionisti',0,1,NULL),(485,313,3,'Società di fatto',0,1,NULL),(486,314,3,'Società occulta',0,1,NULL),(487,315,3,'Società apparente',0,1,NULL),(488,316,3,'Impresa individuale ',0,1,NULL),(489,317,3,'Impresa coniugale',0,1,NULL),(490,318,3,'Impresa familiare',0,1,NULL),(491,600,6,'Raison Individuelle',0,1,NULL),(492,601,6,'Société Simple',0,1,NULL),(493,602,6,'Société en nom collectif',0,1,NULL),(494,603,6,'Société en commandite',0,1,NULL),(495,604,6,'Société anonyme (SA)',0,1,NULL),(496,605,6,'Société en commandite par actions',0,1,NULL),(497,606,6,'Société à responsabilité limitée (SARL)',0,1,NULL),(498,607,6,'Société coopérative',0,1,NULL),(499,608,6,'Association',0,1,NULL),(500,609,6,'Fondation',0,1,NULL),(501,700,7,'Sole Trader',0,1,NULL),(502,701,7,'Partnership',0,1,NULL),(503,702,7,'Private Limited Company by shares (LTD)',0,1,NULL),(504,703,7,'Public Limited Company',0,1,NULL),(505,704,7,'Workers Cooperative',0,1,NULL),(506,705,7,'Limited Liability Partnership',0,1,NULL),(507,706,7,'Franchise',0,1,NULL),(508,1000,10,'Société à responsabilité limitée (SARL)',0,1,NULL),(509,1001,10,'Société en Nom Collectif (SNC)',0,1,NULL),(510,1002,10,'Société en Commandite Simple (SCS)',0,1,NULL),(511,1003,10,'société en participation',0,1,NULL),(512,1004,10,'Société Anonyme (SA)',0,1,NULL),(513,1005,10,'Société Unipersonnelle à Responsabilité Limitée (SUARL)',0,1,NULL),(514,1006,10,'Groupement d\'intérêt économique (GEI)',0,1,NULL),(515,1007,10,'Groupe de sociétés',0,1,NULL),(516,401,4,'Empresario Individual',0,1,NULL),(517,402,4,'Comunidad de Bienes',0,1,NULL),(518,403,4,'Sociedad Civil',0,1,NULL),(519,404,4,'Sociedad Colectiva',0,1,NULL),(520,405,4,'Sociedad Limitada',0,1,NULL),(521,406,4,'Sociedad Anónima',0,1,NULL),(522,407,4,'Sociedad Comandataria por Acciones',0,1,NULL),(523,408,4,'Sociedad Comandataria Simple',0,1,NULL),(524,409,4,'Sociedad Laboral',0,1,NULL),(525,410,4,'Sociedad Cooperativa',0,1,NULL),(526,411,4,'Sociedad de Garantía Recíproca',0,1,NULL),(527,412,4,'Entidad de Capital-Riesgo',0,1,NULL),(528,413,4,'Agrupación de Interés Económico',0,1,NULL),(529,414,4,'Sociedad de Inversión Mobiliaria',0,1,NULL),(530,415,4,'Agrupación sin Ánimo de Lucro',0,1,NULL),(531,15201,152,'Mauritius Private Company Limited By Shares',0,1,NULL),(532,15202,152,'Mauritius Company Limited By Guarantee',0,1,NULL),(533,15203,152,'Mauritius Public Company Limited By Shares',0,1,NULL),(534,15204,152,'Mauritius Foreign Company',0,1,NULL),(535,15205,152,'Mauritius GBC1 (Offshore Company)',0,1,NULL),(536,15206,152,'Mauritius GBC2 (International Company)',0,1,NULL),(537,15207,152,'Mauritius General Partnership',0,1,NULL),(538,15208,152,'Mauritius Limited Partnership',0,1,NULL),(539,15209,152,'Mauritius Sole Proprietorship',0,1,NULL),(540,15210,152,'Mauritius Trusts',0,1,NULL),(541,15401,154,'Sociedad en nombre colectivo',0,1,NULL),(542,15402,154,'Sociedad en comandita simple',0,1,NULL),(543,15403,154,'Sociedad de responsabilidad limitada',0,1,NULL),(544,15404,154,'Sociedad anónima',0,1,NULL),(545,15405,154,'Sociedad en comandita por acciones',0,1,NULL),(546,15406,154,'Sociedad cooperativa',0,1,NULL),(100001,100001,1,'Etudiant',0,0,'cabinetmed'),(100002,100002,1,'Retraité',0,0,'cabinetmed'),(100003,100003,1,'Artisan',0,0,'cabinetmed'),(100004,100004,1,'Femme de ménage',0,0,'cabinetmed'),(100005,100005,1,'Professeur',0,0,'cabinetmed'),(100006,100006,1,'Profession libérale',0,0,'cabinetmed'),(100007,100007,1,'Informaticien',0,0,'cabinetmed'); +/*!40000 ALTER TABLE `llx_c_forme_juridique` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_input_method` +-- + +DROP TABLE IF EXISTS `llx_c_input_method`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_input_method` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) DEFAULT NULL, + `libelle` varchar(60) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_methode_commande_fournisseur` (`code`), + UNIQUE KEY `uk_c_input_method` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_input_method` +-- + +LOCK TABLES `llx_c_input_method` WRITE; +/*!40000 ALTER TABLE `llx_c_input_method` DISABLE KEYS */; +INSERT INTO `llx_c_input_method` VALUES (1,'OrderByMail','Courrier',1,NULL),(2,'OrderByFax','Fax',1,NULL),(3,'OrderByEMail','EMail',1,NULL),(4,'OrderByPhone','Téléphone',1,NULL),(5,'OrderByWWW','En ligne',1,NULL); +/*!40000 ALTER TABLE `llx_c_input_method` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_input_reason` +-- + +DROP TABLE IF EXISTS `llx_c_input_reason`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_input_reason` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) NOT NULL, + `label` varchar(60) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_input_reason` (`code`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_input_reason` +-- + +LOCK TABLES `llx_c_input_reason` WRITE; +/*!40000 ALTER TABLE `llx_c_input_reason` DISABLE KEYS */; +INSERT INTO `llx_c_input_reason` VALUES (1,'SRC_INTE','Web site',1,NULL),(2,'SRC_CAMP_MAIL','Mailing campaign',1,NULL),(3,'SRC_CAMP_PHO','Phone campaign',1,NULL),(4,'SRC_CAMP_FAX','Fax campaign',1,NULL),(5,'SRC_COMM','Commercial contact',1,NULL),(6,'SRC_SHOP','Shop contact',1,NULL),(7,'SRC_CAMP_EMAIL','EMailing campaign',1,NULL),(8,'SRC_WOM','Word of mouth',1,NULL),(9,'SRC_PARTNER','Partner',1,NULL),(10,'SRC_EMPLOYEE','Employee',1,NULL),(11,'SRC_SPONSORING','Sponsoring',1,NULL); +/*!40000 ALTER TABLE `llx_c_input_reason` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_methode_commande_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_c_methode_commande_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_methode_commande_fournisseur` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) DEFAULT NULL, + `libelle` varchar(60) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_methode_commande_fournisseur` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_methode_commande_fournisseur` +-- + +LOCK TABLES `llx_c_methode_commande_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_c_methode_commande_fournisseur` VALUES (1,'OrderByMail','Courrier',1),(2,'OrderByFax','Fax',1),(3,'OrderByEMail','EMail',1),(4,'OrderByPhone','Téléphone',1),(5,'OrderByWWW','En ligne',1); +/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_paiement` +-- + +DROP TABLE IF EXISTS `llx_c_paiement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_paiement` ( + `id` int(11) NOT NULL, + `code` varchar(6) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `type` smallint(6) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_paiement` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_paiement` +-- + +LOCK TABLES `llx_c_paiement` WRITE; +/*!40000 ALTER TABLE `llx_c_paiement` DISABLE KEYS */; +INSERT INTO `llx_c_paiement` VALUES (0,'','-',3,1,NULL),(1,'TIP','TIP',2,1,NULL),(2,'VIR','Virement',2,1,NULL),(3,'PRE','Prélèvement',2,1,NULL),(4,'LIQ','Espèces',2,1,NULL),(6,'CB','Carte Bancaire',2,1,NULL),(7,'CHQ','Chèque',2,1,NULL),(50,'VAD','Paiement en ligne',2,0,NULL),(51,'TRA','Traite',2,0,NULL),(52,'LCR','LCR',2,0,NULL),(53,'FAC','Factor',2,0,NULL),(54,'PRO','Proforma',2,0,NULL); +/*!40000 ALTER TABLE `llx_c_paiement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_paper_format` +-- + +DROP TABLE IF EXISTS `llx_c_paper_format`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_paper_format` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `label` varchar(50) NOT NULL, + `width` float(6,2) DEFAULT '0.00', + `height` float(6,2) DEFAULT '0.00', + `unit` varchar(5) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_paper_format` +-- + +LOCK TABLES `llx_c_paper_format` WRITE; +/*!40000 ALTER TABLE `llx_c_paper_format` DISABLE KEYS */; +INSERT INTO `llx_c_paper_format` VALUES (1,'EU4A0','Format 4A0',1682.00,2378.00,'mm',1,NULL),(2,'EU2A0','Format 2A0',1189.00,1682.00,'mm',1,NULL),(3,'EUA0','Format A0',840.00,1189.00,'mm',1,NULL),(4,'EUA1','Format A1',594.00,840.00,'mm',1,NULL),(5,'EUA2','Format A2',420.00,594.00,'mm',1,NULL),(6,'EUA3','Format A3',297.00,420.00,'mm',1,NULL),(7,'EUA4','Format A4',210.00,297.00,'mm',1,NULL),(8,'EUA5','Format A5',148.00,210.00,'mm',1,NULL),(9,'EUA6','Format A6',105.00,148.00,'mm',1,NULL),(100,'USLetter','Format Letter (A)',216.00,279.00,'mm',1,NULL),(105,'USLegal','Format Legal',216.00,356.00,'mm',1,NULL),(110,'USExecutive','Format Executive',190.00,254.00,'mm',1,NULL),(115,'USLedger','Format Ledger/Tabloid (B)',279.00,432.00,'mm',1,NULL),(200,'CAP1','Format Canadian P1',560.00,860.00,'mm',1,NULL),(205,'CAP2','Format Canadian P2',430.00,560.00,'mm',1,NULL),(210,'CAP3','Format Canadian P3',280.00,430.00,'mm',1,NULL),(215,'CAP4','Format Canadian P4',215.00,280.00,'mm',1,NULL),(220,'CAP5','Format Canadian P5',140.00,215.00,'mm',1,NULL),(225,'CAP6','Format Canadian P6',107.00,140.00,'mm',1,NULL); +/*!40000 ALTER TABLE `llx_c_paper_format` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_payment_term` +-- + +DROP TABLE IF EXISTS `llx_c_payment_term`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_payment_term` ( + `rowid` int(11) NOT NULL, + `code` varchar(16) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `active` tinyint(4) DEFAULT '1', + `libelle` varchar(255) DEFAULT NULL, + `libelle_facture` text, + `fdm` tinyint(4) DEFAULT NULL, + `nbjour` smallint(6) DEFAULT NULL, + `decalage` smallint(6) DEFAULT NULL, + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_payment_term` +-- + +LOCK TABLES `llx_c_payment_term` WRITE; +/*!40000 ALTER TABLE `llx_c_payment_term` DISABLE KEYS */; +INSERT INTO `llx_c_payment_term` VALUES (1,'RECEP',1,1,'A réception','Réception de facture',0,0,NULL,NULL),(2,'30D',2,1,'30 jours','Réglement à 30 jours',0,30,NULL,NULL),(3,'30DENDMONTH',3,1,'30 jours fin de mois','Réglement à 30 jours fin de mois',1,30,NULL,NULL),(4,'60D',4,1,'60 jours','Réglement à 60 jours',0,60,NULL,NULL),(5,'60DENDMONTH',5,1,'60 jours fin de mois','Réglement à 60 jours fin de mois',1,60,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_payment_term` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_pays` +-- + +DROP TABLE IF EXISTS `llx_c_pays`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_pays` ( + `rowid` int(11) NOT NULL, + `code` varchar(2) NOT NULL, + `code_iso` varchar(3) DEFAULT NULL, + `libelle` varchar(50) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_c_pays_code` (`code`), + UNIQUE KEY `idx_c_pays_libelle` (`libelle`), + UNIQUE KEY `idx_c_pays_code_iso` (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_pays` +-- + +LOCK TABLES `llx_c_pays` WRITE; +/*!40000 ALTER TABLE `llx_c_pays` DISABLE KEYS */; +INSERT INTO `llx_c_pays` VALUES (0,'',NULL,'-',1),(1,'FR',NULL,'France',1),(2,'BE',NULL,'Belgium',1),(3,'IT',NULL,'Italy',1),(4,'ES',NULL,'Spain',1),(5,'DE',NULL,'Germany',1),(6,'CH',NULL,'Suisse',1),(7,'GB',NULL,'United Kingdow',1),(8,'IE',NULL,'Irland',1),(9,'CN',NULL,'China',1),(10,'TN',NULL,'Tunisie',1),(11,'US',NULL,'United States',1),(12,'MA',NULL,'Maroc',1),(13,'DZ',NULL,'Algérie',1),(14,'CA',NULL,'Canada',1),(15,'TG',NULL,'Togo',1),(16,'GA',NULL,'Gabon',1),(17,'NL',NULL,'Nerderland',1),(18,'HU',NULL,'Hongrie',1),(19,'RU',NULL,'Russia',1),(20,'SE',NULL,'Sweden',1),(21,'CI',NULL,'Côte d\'Ivoire',1),(22,'SN',NULL,'Sénégal',1),(23,'AR',NULL,'Argentine',1),(24,'CM',NULL,'Cameroun',1),(25,'PT',NULL,'Portugal',1),(26,'SA',NULL,'Arabie Saoudite',1),(27,'MC',NULL,'Monaco',1),(28,'AU',NULL,'Australia',1),(29,'SG',NULL,'Singapour',1),(30,'AF',NULL,'Afghanistan',1),(31,'AX',NULL,'Iles Aland',1),(32,'AL',NULL,'Albanie',1),(33,'AS',NULL,'Samoa américaines',1),(34,'AD',NULL,'Andorre',1),(35,'AO',NULL,'Angola',1),(36,'AI',NULL,'Anguilla',1),(37,'AQ',NULL,'Antarctique',1),(38,'AG',NULL,'Antigua-et-Barbuda',1),(39,'AM',NULL,'Arménie',1),(40,'AW',NULL,'Aruba',1),(41,'AT',NULL,'Autriche',1),(42,'AZ',NULL,'Azerbaïdjan',1),(43,'BS',NULL,'Bahamas',1),(44,'BH',NULL,'Bahreïn',1),(45,'BD',NULL,'Bangladesh',1),(46,'BB',NULL,'Barbade',1),(47,'BY',NULL,'Biélorussie',1),(48,'BZ',NULL,'Belize',1),(49,'BJ',NULL,'Bénin',1),(50,'BM',NULL,'Bermudes',1),(51,'BT',NULL,'Bhoutan',1),(52,'BO',NULL,'Bolivie',1),(53,'BA',NULL,'Bosnie-Herzégovine',1),(54,'BW',NULL,'Botswana',1),(55,'BV',NULL,'Ile Bouvet',1),(56,'BR',NULL,'Brésil',1),(57,'IO',NULL,'Territoire britannique de l\'Océan Indien',1),(58,'BN',NULL,'Brunei',1),(59,'BG',NULL,'Bulgarie',1),(60,'BF',NULL,'Burkina Faso',1),(61,'BI',NULL,'Burundi',1),(62,'KH',NULL,'Cambodge',1),(63,'CV',NULL,'Cap-Vert',1),(64,'KY',NULL,'Iles Cayman',1),(65,'CF',NULL,'République centrafricaine',1),(66,'TD',NULL,'Tchad',1),(67,'CL',NULL,'Chili',1),(68,'CX',NULL,'Ile Christmas',1),(69,'CC',NULL,'Iles des Cocos (Keeling)',1),(70,'CO',NULL,'Colombie',1),(71,'KM',NULL,'Comores',1),(72,'CG',NULL,'Congo',1),(73,'CD',NULL,'République démocratique du Congo',1),(74,'CK',NULL,'Iles Cook',1),(75,'CR',NULL,'Costa Rica',1),(76,'HR',NULL,'Croatie',1),(77,'CU',NULL,'Cuba',1),(78,'CY',NULL,'Chypre',1),(79,'CZ',NULL,'République Tchèque',1),(80,'DK',NULL,'Danemark',1),(81,'DJ',NULL,'Djibouti',1),(82,'DM',NULL,'Dominique',1),(83,'DO',NULL,'République Dominicaine',1),(84,'EC',NULL,'Equateur',1),(85,'EG',NULL,'Egypte',1),(86,'SV',NULL,'Salvador',1),(87,'GQ',NULL,'Guinée Equatoriale',1),(88,'ER',NULL,'Erythrée',1),(89,'EE',NULL,'Estonie',1),(90,'ET',NULL,'Ethiopie',1),(91,'FK',NULL,'Iles Falkland',1),(92,'FO',NULL,'Iles Féroé',1),(93,'FJ',NULL,'Iles Fidji',1),(94,'FI',NULL,'Finlande',1),(95,'GF',NULL,'Guyane française',1),(96,'PF',NULL,'Polynésie française',1),(97,'TF',NULL,'Terres australes françaises',1),(98,'GM',NULL,'Gambie',1),(99,'GE',NULL,'Géorgie',1),(100,'GH',NULL,'Ghana',1),(101,'GI',NULL,'Gibraltar',1),(102,'GR',NULL,'Grèce',1),(103,'GL',NULL,'Groenland',1),(104,'GD',NULL,'Grenade',1),(105,'GP',NULL,'Guadeloupe',1),(106,'GU',NULL,'Guam',1),(107,'GT',NULL,'Guatemala',1),(108,'GN',NULL,'Guinée',1),(109,'GW',NULL,'Guinée-Bissao',1),(110,'GY',NULL,'Guyana',1),(111,'HT',NULL,'Haiti',1),(112,'HM',NULL,'Iles Heard et McDonald',1),(113,'VA',NULL,'Saint-Siège (Vatican)',1),(114,'HN',NULL,'Honduras',1),(115,'HK',NULL,'Hong Kong',1),(116,'IS',NULL,'Islande',1),(117,'IN',NULL,'India',1),(118,'ID',NULL,'Indonésie',1),(119,'IR',NULL,'Iran',1),(120,'IQ',NULL,'Iraq',1),(121,'IL',NULL,'Israel',1),(122,'JM',NULL,'Jamaïque',1),(123,'JP',NULL,'Japon',1),(124,'JO',NULL,'Jordanie',1),(125,'KZ',NULL,'Kazakhstan',1),(126,'KE',NULL,'Kenya',1),(127,'KI',NULL,'Kiribati',1),(128,'KP',NULL,'Corée du Nord',1),(129,'KR',NULL,'Corée du Sud',1),(130,'KW',NULL,'Koweït',1),(131,'KG',NULL,'Kirghizistan',1),(132,'LA',NULL,'Laos',1),(133,'LV',NULL,'Lettonie',1),(134,'LB',NULL,'Liban',1),(135,'LS',NULL,'Lesotho',1),(136,'LR',NULL,'Liberia',1),(137,'LY',NULL,'Libye',1),(138,'LI',NULL,'Liechtenstein',1),(139,'LT',NULL,'Lituanie',1),(140,'LU',NULL,'Luxembourg',1),(141,'MO',NULL,'Macao',1),(142,'MK',NULL,'ex-République yougoslave de Macédoine',1),(143,'MG',NULL,'Madagascar',1),(144,'MW',NULL,'Malawi',1),(145,'MY',NULL,'Malaisie',1),(146,'MV',NULL,'Maldives',1),(147,'ML',NULL,'Mali',1),(148,'MT',NULL,'Malte',1),(149,'MH',NULL,'Iles Marshall',1),(150,'MQ',NULL,'Martinique',1),(151,'MR',NULL,'Mauritanie',1),(152,'MU',NULL,'Maurice',1),(153,'YT',NULL,'Mayotte',1),(154,'MX',NULL,'Mexique',1),(155,'FM',NULL,'Micronésie',1),(156,'MD',NULL,'Moldavie',1),(157,'MN',NULL,'Mongolie',1),(158,'MS',NULL,'Monserrat',1),(159,'MZ',NULL,'Mozambique',1),(160,'MM',NULL,'Birmanie (Myanmar)',1),(161,'NA',NULL,'Namibie',1),(162,'NR',NULL,'Nauru',1),(163,'NP',NULL,'Népal',1),(164,'AN',NULL,'Antilles néerlandaises',1),(165,'NC',NULL,'Nouvelle-Calédonie',1),(166,'NZ',NULL,'Nouvelle-Zélande',1),(167,'NI',NULL,'Nicaragua',1),(168,'NE',NULL,'Niger',1),(169,'NG',NULL,'Nigeria',1),(170,'NU',NULL,'Nioué',1),(171,'NF',NULL,'Ile Norfolk',1),(172,'MP',NULL,'Mariannes du Nord',1),(173,'NO',NULL,'Norvège',1),(174,'OM',NULL,'Oman',1),(175,'PK',NULL,'Pakistan',1),(176,'PW',NULL,'Palaos',1),(177,'PS',NULL,'territoire Palestinien Occupé',1),(178,'PA',NULL,'Panama',1),(179,'PG',NULL,'Papouasie-Nouvelle-Guinée',1),(180,'PY',NULL,'Paraguay',1),(181,'PE',NULL,'Pérou',1),(182,'PH',NULL,'Philippines',1),(183,'PN',NULL,'Iles Pitcairn',1),(184,'PL',NULL,'Pologne',1),(185,'PR',NULL,'Porto Rico',1),(186,'QA',NULL,'Qatar',1),(187,'RE',NULL,'Réunion',1),(188,'RO',NULL,'Roumanie',1),(189,'RW',NULL,'Rwanda',1),(190,'SH',NULL,'Sainte-Hélène',1),(191,'KN',NULL,'Saint-Christophe-et-Niévès',1),(192,'LC',NULL,'Sainte-Lucie',1),(193,'PM',NULL,'Saint-Pierre-et-Miquelon',1),(194,'VC',NULL,'Saint-Vincent-et-les-Grenadines',1),(195,'WS',NULL,'Samoa',1),(196,'SM',NULL,'Saint-Marin',1),(197,'ST',NULL,'Sao Tomé-et-Principe',1),(198,'RS',NULL,'Serbie',1),(199,'SC',NULL,'Seychelles',1),(200,'SL',NULL,'Sierra Leone',1),(201,'SK',NULL,'Slovaquie',1),(202,'SI',NULL,'Slovénie',1),(203,'SB',NULL,'Iles Salomon',1),(204,'SO',NULL,'Somalie',1),(205,'ZA',NULL,'Afrique du Sud',1),(206,'GS',NULL,'Iles Géorgie du Sud et Sandwich du Sud',1),(207,'LK',NULL,'Sri Lanka',1),(208,'SD',NULL,'Soudan',1),(209,'SR',NULL,'Suriname',1),(210,'SJ',NULL,'Iles Svalbard et Jan Mayen',1),(211,'SZ',NULL,'Swaziland',1),(212,'SY',NULL,'Syrie',1),(213,'TW',NULL,'Taïwan',1),(214,'TJ',NULL,'Tadjikistan',1),(215,'TZ',NULL,'Tanzanie',1),(216,'TH',NULL,'Thaïlande',1),(217,'TL',NULL,'Timor Oriental',1),(218,'TK',NULL,'Tokélaou',1),(219,'TO',NULL,'Tonga',1),(220,'TT',NULL,'Trinité-et-Tobago',1),(221,'TR',NULL,'Turquie',1),(222,'TM',NULL,'Turkménistan',1),(223,'TC',NULL,'Iles Turks-et-Caicos',1),(224,'TV',NULL,'Tuvalu',1),(225,'UG',NULL,'Ouganda',1),(226,'UA',NULL,'Ukraine',1),(227,'AE',NULL,'Émirats arabes unis',1),(228,'UM',NULL,'Iles mineures éloignées des États-Unis',1),(229,'UY',NULL,'Uruguay',1),(230,'UZ',NULL,'Ouzbékistan',1),(231,'VU',NULL,'Vanuatu',1),(232,'VE',NULL,'Vénézuela',1),(233,'VN',NULL,'Viêt Nam',1),(234,'VG',NULL,'Iles Vierges britanniques',1),(235,'VI',NULL,'Iles Vierges américaines',1),(236,'WF',NULL,'Wallis-et-Futuna',1),(237,'EH',NULL,'Sahara occidental',1),(238,'YE',NULL,'Yémen',1),(239,'ZM',NULL,'Zambie',1),(240,'ZW',NULL,'Zimbabwe',1),(241,'GG',NULL,'Guernesey',1),(242,'IM',NULL,'Ile de Man',1),(243,'JE',NULL,'Jersey',1),(244,'ME',NULL,'Monténégro',1),(245,'BL',NULL,'Saint-Barthélemy',1),(246,'MF',NULL,'Saint-Martin',1); +/*!40000 ALTER TABLE `llx_c_pays` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_propalst` +-- + +DROP TABLE IF EXISTS `llx_c_propalst`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_propalst` ( + `id` smallint(6) NOT NULL, + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_propalst` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_propalst` +-- + +LOCK TABLES `llx_c_propalst` WRITE; +/*!40000 ALTER TABLE `llx_c_propalst` DISABLE KEYS */; +INSERT INTO `llx_c_propalst` VALUES (0,'PR_DRAFT','Brouillon',1),(1,'PR_OPEN','Ouverte',1),(2,'PR_SIGNED','Signée',1),(3,'PR_NOTSIGNED','Non Signée',1),(4,'PR_FAC','Facturée',1); +/*!40000 ALTER TABLE `llx_c_propalst` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_prospectlevel` +-- + +DROP TABLE IF EXISTS `llx_c_prospectlevel`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_prospectlevel` ( + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `active` smallint(6) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_prospectlevel` +-- + +LOCK TABLES `llx_c_prospectlevel` WRITE; +/*!40000 ALTER TABLE `llx_c_prospectlevel` DISABLE KEYS */; +INSERT INTO `llx_c_prospectlevel` VALUES ('PL_HIGH','High',4,1,NULL),('PL_LOW','Low',2,1,NULL),('PL_MEDIUM','Medium',3,1,NULL),('PL_NONE','None',1,1,NULL); +/*!40000 ALTER TABLE `llx_c_prospectlevel` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_regions` +-- + +DROP TABLE IF EXISTS `llx_c_regions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_regions` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code_region` int(11) NOT NULL, + `fk_pays` int(11) NOT NULL, + `cheflieu` varchar(50) DEFAULT NULL, + `tncc` int(11) DEFAULT NULL, + `nom` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `code_region` (`code_region`), + KEY `idx_c_regions_fk_pays` (`fk_pays`), + CONSTRAINT `fk_c_regions_fk_pays` FOREIGN KEY (`fk_pays`) REFERENCES `llx_c_pays` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=23210 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_regions` +-- + +LOCK TABLES `llx_c_regions` WRITE; +/*!40000 ALTER TABLE `llx_c_regions` DISABLE KEYS */; +INSERT INTO `llx_c_regions` VALUES (1,0,0,'0',0,'-',1),(101,1,1,'97105',3,'Guadeloupe',1),(102,2,1,'97209',3,'Martinique',1),(103,3,1,'97302',3,'Guyane',1),(104,4,1,'97411',3,'Réunion',1),(105,11,1,'75056',1,'Île-de-France',1),(106,21,1,'51108',0,'Champagne-Ardenne',1),(107,22,1,'80021',0,'Picardie',1),(108,23,1,'76540',0,'Haute-Normandie',1),(109,24,1,'45234',2,'Centre',1),(110,25,1,'14118',0,'Basse-Normandie',1),(111,26,1,'21231',0,'Bourgogne',1),(112,31,1,'59350',2,'Nord-Pas-de-Calais',1),(113,41,1,'57463',0,'Lorraine',1),(114,42,1,'67482',1,'Alsace',1),(115,43,1,'25056',0,'Franche-Comté',1),(116,52,1,'44109',4,'Pays de la Loire',1),(117,53,1,'35238',0,'Bretagne',1),(118,54,1,'86194',2,'Poitou-Charentes',1),(119,72,1,'33063',1,'Aquitaine',1),(120,73,1,'31555',0,'Midi-Pyrénées',1),(121,74,1,'87085',2,'Limousin',1),(122,82,1,'69123',2,'Rhône-Alpes',1),(123,83,1,'63113',1,'Auvergne',1),(124,91,1,'34172',2,'Languedoc-Roussillon',1),(125,93,1,'13055',0,'Provence-Alpes-Côte d\'Azur',1),(126,94,1,'2A004',0,'Corse',1),(201,201,2,'',1,'Flandre',1),(202,202,2,'',2,'Wallonie',1),(203,203,2,'',3,'Bruxelles-Capitale',1),(301,301,3,NULL,1,'Abruzzo',1),(302,302,3,NULL,1,'Basilicata',1),(303,303,3,NULL,1,'Calabria',1),(304,304,3,NULL,1,'Campania',1),(305,305,3,NULL,1,'Emilia-Romagna',1),(306,306,3,NULL,1,'Friuli-Venezia Giulia',1),(307,307,3,NULL,1,'Lazio',1),(308,308,3,NULL,1,'Liguria',1),(309,309,3,NULL,1,'Lombardia',1),(310,310,3,NULL,1,'Marche',1),(311,311,3,NULL,1,'Molise',1),(312,312,3,NULL,1,'Piemonte',1),(313,313,3,NULL,1,'Puglia',1),(314,314,3,NULL,1,'Sardegna',1),(315,315,3,NULL,1,'Sicilia',1),(316,316,3,NULL,1,'Toscana',1),(317,317,3,NULL,1,'Trentino-Alto Adige',1),(318,318,3,NULL,1,'Umbria',1),(319,319,3,NULL,1,'Valle d Aosta',1),(320,320,3,NULL,1,'Veneto',1),(401,401,4,'',0,'Andalucia',1),(402,402,4,'',0,'Aragón',1),(403,403,4,'',0,'Castilla y León',1),(404,404,4,'',0,'Castilla la Mancha',1),(405,405,4,'',0,'Canarias',1),(406,406,4,'',0,'Cataluña',1),(407,407,4,'',0,'Comunidad de Ceuta',1),(408,408,4,'',0,'Comunidad Foral de Navarra',1),(409,409,4,'',0,'Comunidad de Melilla',1),(410,410,4,'',0,'Cantabria',1),(411,411,4,'',0,'Comunidad Valenciana',1),(412,412,4,'',0,'Extemadura',1),(413,413,4,'',0,'Galicia',1),(414,414,4,'',0,'Islas Baleares',1),(415,415,4,'',0,'La Rioja',1),(416,416,4,'',0,'Comunidad de Madrid',1),(417,417,4,'',0,'Región de Murcia',1),(418,418,4,'',0,'Principado de Asturias',1),(419,419,4,'',0,'Pais Vasco',1),(420,420,4,'',0,'Otros',1),(601,601,6,'',1,'Cantons',1),(1001,1001,10,'',0,'Ariana',1),(1002,1002,10,'',0,'Béja',1),(1003,1003,10,'',0,'Ben Arous',1),(1004,1004,10,'',0,'Bizerte',1),(1005,1005,10,'',0,'Gabès',1),(1006,1006,10,'',0,'Gafsa',1),(1007,1007,10,'',0,'Jendouba',1),(1008,1008,10,'',0,'Kairouan',1),(1009,1009,10,'',0,'Kasserine',1),(1010,1010,10,'',0,'Kébili',1),(1011,1011,10,'',0,'La Manouba',1),(1012,1012,10,'',0,'Le Kef',1),(1013,1013,10,'',0,'Mahdia',1),(1014,1014,10,'',0,'Médenine',1),(1015,1015,10,'',0,'Monastir',1),(1016,1016,10,'',0,'Nabeul',1),(1017,1017,10,'',0,'Sfax',1),(1018,1018,10,'',0,'Sidi Bouzid',1),(1019,1019,10,'',0,'Siliana',1),(1020,1020,10,'',0,'Sousse',1),(1021,1021,10,'',0,'Tataouine',1),(1022,1022,10,'',0,'Tozeur',1),(1023,1023,10,'',0,'Tunis',1),(1024,1024,10,'',0,'Zaghouan',1),(1101,1101,11,'',0,'United-States',1),(1201,1201,12,'',0,'Tanger-Tétouan',1),(1202,1202,12,'',0,'Gharb-Chrarda-Beni Hssen',1),(1203,1203,12,'',0,'Taza-Al Hoceima-Taounate',1),(1204,1204,12,'',0,'L\'Oriental',1),(1205,1205,12,'',0,'Fès-Boulemane',1),(1206,1206,12,'',0,'Meknès-Tafialet',1),(1207,1207,12,'',0,'Rabat-Salé-Zemour-Zaër',1),(1208,1208,12,'',0,'Grand Cassablanca',1),(1209,1209,12,'',0,'Chaouia-Ouardigha',1),(1210,1210,12,'',0,'Doukahla-Adba',1),(1211,1211,12,'',0,'Marrakech-Tensift-Al Haouz',1),(1212,1212,12,'',0,'Tadla-Azilal',1),(1213,1213,12,'',0,'Sous-Massa-Drâa',1),(1214,1214,12,'',0,'Guelmim-Es Smara',1),(1215,1215,12,'',0,'Laâyoune-Boujdour-Sakia el Hamra',1),(1216,1216,12,'',0,'Oued Ed-Dahab Lagouira',1),(1301,1301,13,'',0,'Algerie',1),(2301,2301,23,'',0,'Norte',1),(2302,2302,23,'',0,'Litoral',1),(2303,2303,23,'',0,'Cuyana',1),(2304,2304,23,'',0,'Central',1),(2305,2305,23,'',0,'Patagonia',1),(2801,2801,28,'',0,'Australia',1),(4601,4601,46,'',0,'Barbados',1),(6701,6701,67,NULL,NULL,'Tarapacá',1),(6702,6702,67,NULL,NULL,'Antofagasta',1),(6703,6703,67,NULL,NULL,'Atacama',1),(6704,6704,67,NULL,NULL,'Coquimbo',1),(6705,6705,67,NULL,NULL,'Valparaíso',1),(6706,6706,67,NULL,NULL,'General Bernardo O Higgins',1),(6707,6707,67,NULL,NULL,'Maule',1),(6708,6708,67,NULL,NULL,'Biobío',1),(6709,6709,67,NULL,NULL,'Raucanía',1),(6710,6710,67,NULL,NULL,'Los Lagos',1),(6711,6711,67,NULL,NULL,'Aysén General Carlos Ibáñez del Campo',1),(6712,6712,67,NULL,NULL,'Magallanes y Antártica Chilena',1),(6713,6713,67,NULL,NULL,'Santiago',1),(6714,6714,67,NULL,NULL,'Los Ríos',1),(6715,6715,67,NULL,NULL,'Arica y Parinacota',1),(7001,7001,70,'',0,'Colombie',1),(8601,8601,86,NULL,NULL,'Central',1),(8602,8602,86,NULL,NULL,'Oriental',1),(8603,8603,86,NULL,NULL,'Occidental',1),(10201,10201,102,NULL,NULL,'??????',1),(10202,10202,102,NULL,NULL,'?????? ??????',1),(10203,10203,102,NULL,NULL,'???????? ?????????',1),(10204,10204,102,NULL,NULL,'?????',1),(10205,10205,102,NULL,NULL,'????????? ????????? ??? ?????',1),(10206,10206,102,NULL,NULL,'???????',1),(10207,10207,102,NULL,NULL,'????? ?????',1),(10208,10208,102,NULL,NULL,'?????? ??????',1),(10209,10209,102,NULL,NULL,'????????????',1),(10210,10210,102,NULL,NULL,'????? ??????',1),(10211,10211,102,NULL,NULL,'?????? ??????',1),(10212,10212,102,NULL,NULL,'????????',1),(10213,10213,102,NULL,NULL,'?????? ?????????',1),(11401,11401,114,'',0,'Honduras',1),(11701,11701,117,'',0,'India',1),(15201,15201,152,'',0,'Rivière Noire',1),(15202,15202,152,'',0,'Flacq',1),(15203,15203,152,'',0,'Grand Port',1),(15204,15204,152,'',0,'Moka',1),(15205,15205,152,'',0,'Pamplemousses',1),(15206,15206,152,'',0,'Plaines Wilhems',1),(15207,15207,152,'',0,'Port-Louis',1),(15208,15208,152,'',0,'Rivière du Rempart',1),(15209,15209,152,'',0,'Savanne',1),(15210,15210,152,'',0,'Rodrigues',1),(15211,15211,152,'',0,'Les îles Agaléga',1),(15212,15212,152,'',0,'Les écueils des Cargados Carajos',1),(15401,15401,154,'',0,'Mexique',1),(23201,23201,232,'',0,'Los Andes',1),(23202,23202,232,'',0,'Capital',1),(23203,23203,232,'',0,'Central',1),(23204,23204,232,'',0,'Cento Occidental',1),(23205,23205,232,'',0,'Guayana',1),(23206,23206,232,'',0,'Insular',1),(23207,23207,232,'',0,'Los Llanos',1),(23208,23208,232,'',0,'Nor-Oriental',1),(23209,23209,232,'',0,'Zuliana',1); +/*!40000 ALTER TABLE `llx_c_regions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_revenuestamp` +-- + +DROP TABLE IF EXISTS `llx_c_revenuestamp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_revenuestamp` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_pays` int(11) NOT NULL, + `taux` double NOT NULL, + `note` varchar(128) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code_sell` varchar(15) DEFAULT NULL, + `accountancy_code_buy` varchar(15) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_revenuestamp` +-- + +LOCK TABLES `llx_c_revenuestamp` WRITE; +/*!40000 ALTER TABLE `llx_c_revenuestamp` DISABLE KEYS */; +INSERT INTO `llx_c_revenuestamp` VALUES (101,10,0.6,'Timbre fiscal1',1,'aa','bb'),(103,30,10,'111',1,'1111','1111'),(104,10,5,'fdsf',1,'dfd',NULL); +/*!40000 ALTER TABLE `llx_c_revenuestamp` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_shipment_mode` +-- + +DROP TABLE IF EXISTS `llx_c_shipment_mode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_shipment_mode` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `code` varchar(30) NOT NULL, + `libelle` varchar(50) NOT NULL, + `description` text, + `tracking` varchar(256) NOT NULL, + `active` tinyint(4) DEFAULT '0', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_shipment_mode` +-- + +LOCK TABLES `llx_c_shipment_mode` WRITE; +/*!40000 ALTER TABLE `llx_c_shipment_mode` DISABLE KEYS */; +INSERT INTO `llx_c_shipment_mode` VALUES (1,'2010-10-09 23:43:16','CATCH','Catch','Catch by client','',1,NULL),(2,'2010-10-09 23:43:16','TRANS','Transporter','Generic transporter','',1,NULL),(3,'2010-10-09 23:43:16','COLSUI','Colissimo Suivi','Colissimo Suivi','',0,NULL),(4,'2011-07-18 17:28:27','LETTREMAX','Lettre Max','Courrier Suivi et Lettre Max','',0,NULL),(5,'2013-02-24 01:48:17','UPS','UPS','United Parcel Service','',0,NULL),(6,'2013-02-24 01:48:17','KIALA','KIALA','Relais Kiala','',0,NULL),(7,'2013-02-24 01:48:17','GLS','GLS','General Logistics Systems','',0,NULL),(8,'2013-02-24 01:48:17','CHRONO','Chronopost','Chronopost','',0,NULL),(9,'2013-02-24 01:48:18','UPS','UPS','United Parcel Service','http://wwwapps.ups.com/etracking/tracking.cgi?InquiryNumber2=&InquiryNumber3=&tracknums_displayed=3&loc=fr_FR&TypeOfInquiryNumber=T&HTMLVersion=4.0&InquiryNumber22=&InquiryNumber32=&track=Track&Suivi.x=64&Suivi.y=7&Suivi=Valider&InquiryNumber1={TRACKID}',0,NULL),(10,'2013-02-24 01:48:18','KIALA','KIALA','Relais Kiala','http://www.kiala.fr/tnt/delivery/{TRACKID}',0,NULL),(11,'2013-02-24 01:48:18','GLS','GLS','General Logistics Systems','http://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/FR01/FR/5004.htm?txtAction=71000&txtRefNo={TRACKID}',0,NULL),(12,'2013-02-24 01:48:18','CHRONO','Chronopost','Chronopost','http://www.chronopost.fr/expedier/inputLTNumbersNoJahia.do?listeNumeros={TRACKID}',0,NULL); +/*!40000 ALTER TABLE `llx_c_shipment_mode` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_source` +-- + +DROP TABLE IF EXISTS `llx_c_source`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_source` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) NOT NULL, + `label` varchar(60) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_source` +-- + +LOCK TABLES `llx_c_source` WRITE; +/*!40000 ALTER TABLE `llx_c_source` DISABLE KEYS */; +INSERT INTO `llx_c_source` VALUES (1,'SRC_00','Proposition commerciale',1),(2,'SRC_01','Internet',1),(3,'SRC_02','Campagne courrier',1),(4,'SRC_03','Campagne téléphone',1),(5,'SRC_04','Campagne fax',1),(6,'SRC_05','Commercial',1),(7,'SRC_06','Magasin',1); +/*!40000 ALTER TABLE `llx_c_source` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_stcomm` +-- + +DROP TABLE IF EXISTS `llx_c_stcomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_stcomm` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_stcomm` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_stcomm` +-- + +LOCK TABLES `llx_c_stcomm` WRITE; +/*!40000 ALTER TABLE `llx_c_stcomm` DISABLE KEYS */; +INSERT INTO `llx_c_stcomm` VALUES (-1,'ST_NO','Ne pas contacter',1),(0,'ST_NEVER','Jamais contacté',1),(1,'ST_TODO','A contacter',1),(2,'ST_PEND','Contact en cours',1),(3,'ST_DONE','Contactée',1); +/*!40000 ALTER TABLE `llx_c_stcomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_tva` +-- + +DROP TABLE IF EXISTS `llx_c_tva`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_tva` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_pays` int(11) NOT NULL, + `taux` double NOT NULL, + `localtax1` double NOT NULL DEFAULT '0', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2` double NOT NULL DEFAULT '0', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `note` varchar(128) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code_sell` varchar(15) DEFAULT NULL, + `accountancy_code_buy` varchar(15) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2463 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_tva` +-- + +LOCK TABLES `llx_c_tva` WRITE; +/*!40000 ALTER TABLE `llx_c_tva` DISABLE KEYS */; +INSERT INTO `llx_c_tva` VALUES (11,1,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(21,2,21,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,21,5.2,'3',-21,'1',0,'VAT standard rate',1,NULL,NULL),(42,4,10,1.4,'3',-21,'1',0,'VAT reduced rate',1,NULL,NULL),(43,4,4,0.5,'3',-21,'1',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,0,0,'3',-21,'1',0,'VAT Rate 0',1,NULL,NULL),(51,5,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(52,5,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(53,5,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(61,6,7.6,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,3.6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,2.4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,17.5,0,'0',0,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(91,9,17,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,13,0,'0',0,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,3,0,'0',0,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,6,0,'0',0,'0',0,'VAT 6%',1,NULL,NULL),(102,10,12,1,'4',0,'0',0,'VAT 12%',1,NULL,NULL),(103,10,18,0,'0',0,'0',0,'VAT 18%',1,NULL,NULL),(104,10,7.5,1,'4',0,'0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,15,1,'4',0,'0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,22.5,1,'4',0,'0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(111,11,0,0,'0',0,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,4,0,'0',0,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,6,0,'0',0,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,7,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,7,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,5,9.975,'1',0,'0',0,'TPS and TVQ rate',1,NULL,NULL),(171,17,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(172,17,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(173,17,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(201,20,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,6,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,21,0,'0',0,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,10.5,0,'0',0,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,0,0,'0',0,'0',0,'IVA Rate 0',1,NULL,NULL),(251,25,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(271,27,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,10,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(462,46,15,0,'0',0,'0',0,'VAT 15%',1,NULL,NULL),(463,46,7.5,0,'0',0,'0',0,'VAT 7.5%',1,NULL,NULL),(591,59,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,13,0,'0',0,'0',0,'IVA 13',1,NULL,NULL),(862,86,0,0,'0',0,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,0,0,'0',0,'0',0,'No ISV',1,NULL,NULL),(1142,114,12,0,'0',0,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,25.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,0,0,'0',0,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,12.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,4,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1231,123,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,5,0,'0',0,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,3,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1521,152,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,15,0,'0',0,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(1542,154,16,0,'0',0,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,10,0,'0',0,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,8,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,3,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,24,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,9,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,0,0,'0',0,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,8.5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(2322,232,12,0,'0',0,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,8,0,'0',0,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,4,15,0,'0',0,'0',0,'aaaa',1,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_tva` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_contact` +-- + +DROP TABLE IF EXISTS `llx_c_type_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_contact` ( + `rowid` int(11) NOT NULL, + `element` varchar(30) NOT NULL, + `source` varchar(8) NOT NULL DEFAULT 'external', + `code` varchar(32) NOT NULL, + `libelle` varchar(64) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_c_type_contact_uk` (`element`,`source`,`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_contact` +-- + +LOCK TABLES `llx_c_type_contact` WRITE; +/*!40000 ALTER TABLE `llx_c_type_contact` DISABLE KEYS */; +INSERT INTO `llx_c_type_contact` VALUES (10,'contrat','internal','SALESREPSIGN','Commercial signataire du contrat',1,NULL),(11,'contrat','internal','SALESREPFOLL','Commercial suivi du contrat',1,NULL),(20,'contrat','external','BILLING','Contact client facturation contrat',1,NULL),(21,'contrat','external','CUSTOMER','Contact client suivi contrat',1,NULL),(22,'contrat','external','SALESREPSIGN','Contact client signataire contrat',1,NULL),(31,'propal','internal','SALESREPFOLL','Commercial à l\'origine de la propale',1,NULL),(40,'propal','external','BILLING','Contact client facturation propale',1,NULL),(41,'propal','external','CUSTOMER','Contact client suivi propale',1,NULL),(50,'facture','internal','SALESREPFOLL','Responsable suivi du paiement',1,NULL),(60,'facture','external','BILLING','Contact client facturation',1,NULL),(61,'facture','external','SHIPPING','Contact client livraison',1,NULL),(62,'facture','external','SERVICE','Contact client prestation',1,NULL),(70,'invoice_supplier','internal','SALESREPFOLL','Responsable suivi du paiement',1,NULL),(71,'invoice_supplier','external','BILLING','Contact fournisseur facturation',1,NULL),(72,'invoice_supplier','external','SHIPPING','Contact fournisseur livraison',1,NULL),(73,'invoice_supplier','external','SERVICE','Contact fournisseur prestation',1,NULL),(80,'agenda','internal','ACTOR','Responsable',1,NULL),(81,'agenda','internal','GUEST','Guest',1,NULL),(85,'agenda','external','ACTOR','Responsable',1,NULL),(86,'agenda','external','GUEST','Guest',1,NULL),(91,'commande','internal','SALESREPFOLL','Responsable suivi de la commande',1,NULL),(100,'commande','external','BILLING','Contact client facturation commande',1,NULL),(101,'commande','external','CUSTOMER','Contact client suivi commande',1,NULL),(102,'commande','external','SHIPPING','Contact client livraison commande',1,NULL),(120,'fichinter','internal','INTERREPFOLL','Responsable suivi de l\'intervention',1,NULL),(121,'fichinter','internal','INTERVENING','Intervenant',1,NULL),(130,'fichinter','external','BILLING','Contact client facturation intervention',1,NULL),(131,'fichinter','external','CUSTOMER','Contact client suivi de l\'intervention',1,NULL),(140,'order_supplier','internal','SALESREPFOLL','Responsable suivi de la commande',1,NULL),(141,'order_supplier','internal','SHIPPING','Responsable réception de la commande',1,NULL),(142,'order_supplier','external','BILLING','Contact fournisseur facturation commande',1,NULL),(143,'order_supplier','external','CUSTOMER','Contact fournisseur suivi commande',1,NULL),(145,'order_supplier','external','SHIPPING','Contact fournisseur livraison commande',1,NULL),(160,'project','internal','PROJECTLEADER','Chef de Projet',1,NULL),(161,'project','internal','PROJECTCONTRIBUTOR','Intervenant',1,NULL),(170,'project','external','PROJECTLEADER','Chef de Projet',1,NULL),(171,'project','external','PROJECTCONTRIBUTOR','Intervenant',1,NULL),(180,'project_task','internal','TASKEXECUTIVE','Responsable',1,NULL),(181,'project_task','internal','TASKCONTRIBUTOR','Intervenant',1,NULL),(190,'project_task','external','TASKEXECUTIVE','Responsable',1,NULL),(191,'project_task','external','TASKCONTRIBUTOR','Intervenant',1,NULL),(200,'societe','external','GENERALREF','Généraliste (référent)',0,'cabinetmed'),(201,'societe','external','GENERALISTE','Généraliste',0,'cabinetmed'),(210,'societe','external','SPECCHIROR','Chirurgien ortho',0,'cabinetmed'),(211,'societe','external','SPECCHIROT','Chirurgien autre',0,'cabinetmed'),(220,'societe','external','SPECDERMA','Dermatologue',0,'cabinetmed'),(225,'societe','external','SPECENDOC','Endocrinologue',0,'cabinetmed'),(230,'societe','external','SPECGYNECO','Gynécologue',0,'cabinetmed'),(240,'societe','external','SPECGASTRO','Gastroantérologue',0,'cabinetmed'),(245,'societe','external','SPECINTERNE','Interniste',0,'cabinetmed'),(250,'societe','external','SPECCARDIO','Cardiologue',0,'cabinetmed'),(260,'societe','external','SPECNEPHRO','Néphrologue',0,'cabinetmed'),(263,'societe','external','SPECPNEUMO','Pneumologue',0,'cabinetmed'),(265,'societe','external','SPECNEURO','Neurologue',0,'cabinetmed'),(270,'societe','external','SPECRHUMATO','Rhumatologue',0,'cabinetmed'),(280,'societe','external','KINE','Kinésithérapeute',0,'cabinetmed'); +/*!40000 ALTER TABLE `llx_c_type_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_fees` +-- + +DROP TABLE IF EXISTS `llx_c_type_fees`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_fees` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_type_fees` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_fees` +-- + +LOCK TABLES `llx_c_type_fees` WRITE; +/*!40000 ALTER TABLE `llx_c_type_fees` DISABLE KEYS */; +INSERT INTO `llx_c_type_fees` VALUES (1,'TF_OTHER','Other',1,NULL),(2,'TF_TRIP','Trip',1,NULL),(3,'TF_LUNCH','Lunch',1,NULL); +/*!40000 ALTER TABLE `llx_c_type_fees` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_typent` +-- + +DROP TABLE IF EXISTS `llx_c_typent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_typent` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_typent` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_typent` +-- + +LOCK TABLES `llx_c_typent` WRITE; +/*!40000 ALTER TABLE `llx_c_typent` DISABLE KEYS */; +INSERT INTO `llx_c_typent` VALUES (0,'TE_UNKNOWN','-',1,NULL),(1,'TE_STARTUP','Start-up',1,NULL),(2,'TE_GROUP','Grand groupe',1,NULL),(3,'TE_MEDIUM','PME/PMI',1,NULL),(4,'TE_SMALL','TPE',1,NULL),(5,'TE_ADMIN','Administration',1,NULL),(6,'TE_WHOLE','Grossiste',1,NULL),(7,'TE_RETAIL','Revendeur',1,NULL),(8,'TE_PRIVATE','Particulier',1,NULL),(100,'TE_OTHER','Autres',1,NULL),(101,'TE_HOMME','Homme',0,'cabinetmed'),(102,'TE_FEMME','Femme',0,'cabinetmed'); +/*!40000 ALTER TABLE `llx_c_typent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_ziptown` +-- + +DROP TABLE IF EXISTS `llx_c_ziptown`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_ziptown` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(5) DEFAULT NULL, + `fk_county` int(11) DEFAULT NULL, + `fk_pays` int(11) NOT NULL DEFAULT '0', + `zip` varchar(10) NOT NULL, + `town` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ziptown_fk_pays` (`zip`,`town`,`fk_pays`), + KEY `idx_c_ziptown_fk_county` (`fk_county`), + KEY `idx_c_ziptown_fk_pays` (`fk_pays`), + KEY `idx_c_ziptown_zip` (`zip`), + CONSTRAINT `fk_c_ziptown_fk_county` FOREIGN KEY (`fk_county`) REFERENCES `llx_c_departements` (`rowid`), + CONSTRAINT `fk_c_ziptown_fk_pays` FOREIGN KEY (`fk_pays`) REFERENCES `llx_c_pays` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_ziptown` +-- + +LOCK TABLES `llx_c_ziptown` WRITE; +/*!40000 ALTER TABLE `llx_c_ziptown` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_ziptown` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie` +-- + +DROP TABLE IF EXISTS `llx_categorie`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_parent` int(11) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `type` tinyint(4) NOT NULL DEFAULT '1', + `entity` int(11) NOT NULL DEFAULT '1', + `description` text, + `fk_soc` int(11) DEFAULT NULL, + `visible` tinyint(4) NOT NULL DEFAULT '1', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_categorie_ref` (`entity`,`fk_parent`,`label`,`type`), + KEY `idx_categorie_type` (`type`), + KEY `idx_categorie_label` (`label`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie` +-- + +LOCK TABLES `llx_categorie` WRITE; +/*!40000 ALTER TABLE `llx_categorie` DISABLE KEYS */; +INSERT INTO `llx_categorie` VALUES (1,0,'MySupplierCategory',1,1,'This is description of category MyCategory for suppliers
',NULL,0,NULL),(2,0,'MyCategory',1,1,'This is description of MyCategory for customer and prospects
',NULL,0,NULL),(3,7,'Hot products',1,1,'This is description of hot products
',NULL,0,NULL),(4,0,'Cold products',1,1,'This is a description of cold products
',NULL,0,NULL),(5,7,'ChildChild 2a x',0,1,'
',NULL,0,NULL),(6,7,'ChildChild 2a',0,1,'
',NULL,0,NULL),(7,9,'Child 2',0,1,'
',NULL,0,NULL),(8,7,'ChildChild 2b',0,1,'
',NULL,0,NULL),(9,0,'Parent',0,1,'
',NULL,0,NULL),(10,0,'XL Cutomers',0,1,'
',NULL,0,NULL),(11,9,'Child 1',0,1,'',NULL,0,NULL),(12,0,'cccc',2,1,'',NULL,0,NULL),(13,0,'ccc2',2,1,'gdfgdfgdf',NULL,0,NULL),(14,0,'ccc3',2,1,'',NULL,0,NULL),(15,13,'ccc2a',2,1,'',NULL,0,NULL),(16,15,'ccc2a1',2,1,'desc,b,nb,fhgfg hf',NULL,0,NULL); +/*!40000 ALTER TABLE `llx_categorie` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_association` +-- + +DROP TABLE IF EXISTS `llx_categorie_association`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_association` ( + `fk_categorie_mere` int(11) NOT NULL, + `fk_categorie_fille` int(11) NOT NULL, + UNIQUE KEY `uk_categorie_association` (`fk_categorie_mere`,`fk_categorie_fille`), + UNIQUE KEY `uk_categorie_association_fk_categorie_fille` (`fk_categorie_fille`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_association` +-- + +LOCK TABLES `llx_categorie_association` WRITE; +/*!40000 ALTER TABLE `llx_categorie_association` DISABLE KEYS */; +INSERT INTO `llx_categorie_association` VALUES (3,5),(9,11); +/*!40000 ALTER TABLE `llx_categorie_association` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_contact` +-- + +DROP TABLE IF EXISTS `llx_categorie_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_contact` ( + `fk_categorie` int(11) NOT NULL, + `fk_socpeople` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_socpeople`), + KEY `idx_categorie_contact_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_contact_fk_socpeople` (`fk_socpeople`), + CONSTRAINT `fk_categorie_contact_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_contact_fk_socpeople` FOREIGN KEY (`fk_socpeople`) REFERENCES `llx_socpeople` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_contact` +-- + +LOCK TABLES `llx_categorie_contact` WRITE; +/*!40000 ALTER TABLE `llx_categorie_contact` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_categorie_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_fournisseur` ( + `fk_categorie` int(11) NOT NULL, + `fk_societe` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_societe`), + KEY `idx_categorie_fournisseur_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_fournisseur_fk_societe` (`fk_societe`), + CONSTRAINT `fk_categorie_fournisseur_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_fournisseur_fk_soc` FOREIGN KEY (`fk_societe`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_fournisseur` +-- + +LOCK TABLES `llx_categorie_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_categorie_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_categorie_fournisseur` VALUES (1,2,NULL),(9,2,NULL); +/*!40000 ALTER TABLE `llx_categorie_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_member` +-- + +DROP TABLE IF EXISTS `llx_categorie_member`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_member` ( + `fk_categorie` int(11) NOT NULL, + `fk_member` int(11) NOT NULL, + PRIMARY KEY (`fk_categorie`,`fk_member`), + KEY `idx_categorie_member_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_member_fk_member` (`fk_member`), + CONSTRAINT `fk_categorie_member_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_member_member_rowid` FOREIGN KEY (`fk_member`) REFERENCES `llx_adherent` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_member` +-- + +LOCK TABLES `llx_categorie_member` WRITE; +/*!40000 ALTER TABLE `llx_categorie_member` DISABLE KEYS */; +INSERT INTO `llx_categorie_member` VALUES (7,2),(8,1); +/*!40000 ALTER TABLE `llx_categorie_member` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_product` +-- + +DROP TABLE IF EXISTS `llx_categorie_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_product` ( + `fk_categorie` int(11) NOT NULL, + `fk_product` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_product`), + KEY `idx_categorie_product_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_product_fk_product` (`fk_product`), + CONSTRAINT `fk_categorie_product_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_product_product_rowid` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_product` +-- + +LOCK TABLES `llx_categorie_product` WRITE; +/*!40000 ALTER TABLE `llx_categorie_product` DISABLE KEYS */; +INSERT INTO `llx_categorie_product` VALUES (5,1,NULL),(5,2,NULL),(5,3,NULL),(6,2,NULL),(6,3,NULL); +/*!40000 ALTER TABLE `llx_categorie_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_societe` +-- + +DROP TABLE IF EXISTS `llx_categorie_societe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_societe` ( + `fk_categorie` int(11) NOT NULL, + `fk_societe` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_societe`), + KEY `idx_categorie_societe_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_societe_fk_societe` (`fk_societe`), + CONSTRAINT `fk_categorie_societe_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_societe_fk_soc` FOREIGN KEY (`fk_societe`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_societe` +-- + +LOCK TABLES `llx_categorie_societe` WRITE; +/*!40000 ALTER TABLE `llx_categorie_societe` DISABLE KEYS */; +INSERT INTO `llx_categorie_societe` VALUES (2,2,NULL),(2,19,NULL),(10,4,NULL); +/*!40000 ALTER TABLE `llx_categorie_societe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_chargesociales` +-- + +DROP TABLE IF EXISTS `llx_chargesociales`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_chargesociales` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_ech` datetime NOT NULL, + `libelle` varchar(80) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_type` int(11) NOT NULL, + `amount` double NOT NULL DEFAULT '0', + `paye` smallint(6) NOT NULL DEFAULT '0', + `periode` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_chargesociales` +-- + +LOCK TABLES `llx_chargesociales` WRITE; +/*!40000 ALTER TABLE `llx_chargesociales` DISABLE KEYS */; +INSERT INTO `llx_chargesociales` VALUES (4,'2011-08-09 00:00:00','fff',1,60,10,1,'2011-08-01','2012-12-08 13:11:10',NULL,NULL); +/*!40000 ALTER TABLE `llx_chargesociales` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande` +-- + +DROP TABLE IF EXISTS `llx_commande`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `ref_client` varchar(255) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `date_commande` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `source` smallint(6) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `amount_ht` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `facture` tinyint(4) DEFAULT '0', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(2) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `fk_input_reason` int(11) DEFAULT NULL, + `fk_delivery_address` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_commande_ref` (`ref`,`entity`), + KEY `idx_commande_fk_soc` (`fk_soc`), + KEY `idx_commande_fk_user_author` (`fk_user_author`), + KEY `idx_commande_fk_user_valid` (`fk_user_valid`), + KEY `idx_commande_fk_user_cloture` (`fk_user_cloture`), + KEY `idx_commande_fk_projet` (`fk_projet`), + KEY `idx_commande_fk_account` (`fk_account`), + KEY `idx_commande_fk_currency` (`fk_currency`), + CONSTRAINT `fk_commande_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_commande_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_commande_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_commande_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_commande_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande` +-- + +LOCK TABLES `llx_commande` WRITE; +/*!40000 ALTER TABLE `llx_commande` DISABLE KEYS */; +INSERT INTO `llx_commande` VALUES (1,'2012-12-08 13:11:07',1,NULL,'CO1107-0002',1,NULL,NULL,'','2011-07-20 15:23:12','2011-08-08 13:59:09',NULL,'2011-07-20',1,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','',0,NULL,NULL,1,1,NULL,0,NULL,NULL,NULL,NULL),(2,'2013-02-12 16:06:51',1,NULL,'CO1107-0003',1,NULL,NULL,'','2011-07-20 23:20:12','2013-02-12 17:06:51',NULL,'2011-07-21',1,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,0,NULL,NULL,0,NULL,NULL,NULL,NULL),(3,'2013-02-17 17:27:56',1,NULL,'CO1107-0004',1,NULL,NULL,'','2011-07-20 23:22:53','2013-02-17 18:27:56',NULL,'2011-07-21',1,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,30.00000000,30.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'2012-12-08 13:11:07',1,NULL,'CO1108-0001',1,NULL,NULL,'','2011-08-08 03:04:11','2011-08-08 03:04:21',NULL,'2011-08-08',1,1,NULL,NULL,2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'2013-02-17 15:22:14',19,NULL,'(PROV6)',1,NULL,NULL,'','2013-02-17 16:22:14',NULL,NULL,'2013-02-17',1,NULL,NULL,NULL,0,0,0,NULL,0,11.76000000,0.00000000,0.00000000,60.00000000,71.76000000,'','','',0,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,'2013-02-17 17:38:37',18,NULL,'CO1302-0005',1,NULL,NULL,'gfdf','2013-02-17 16:28:22','2013-02-17 18:38:14',NULL,'2013-02-17',1,1,NULL,NULL,2,0,0,NULL,0,3.22000000,0.00000000,0.00000000,20.00000000,23.22000000,'','','',0,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'2013-03-08 09:02:31',23,NULL,'(PROV8)',1,NULL,NULL,'fdfs','2013-03-08 10:02:31',NULL,NULL,'2013-03-08',1,NULL,NULL,NULL,0,0,0,NULL,0,0.00000000,0.00000000,0.00000000,5.00000000,5.00000000,'','','',0,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_commande` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_extrafields` +-- + +LOCK TABLES `llx_commande_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) NOT NULL, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(30) DEFAULT NULL, + `ref_supplier` varchar(30) DEFAULT NULL, + `fk_projet` int(11) DEFAULT '0', + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_approve` datetime DEFAULT NULL, + `date_commande` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_approve` int(11) DEFAULT NULL, + `source` smallint(6) NOT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `amount_ht` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_input_method` int(11) DEFAULT '0', + `fk_cond_reglement` int(11) DEFAULT '0', + `fk_mode_reglement` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_commande_fournisseur_ref` (`ref`,`fk_soc`,`entity`), + KEY `idx_commande_fournisseur_fk_soc` (`fk_soc`), + CONSTRAINT `fk_commande_fournisseur_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur` +-- + +LOCK TABLES `llx_commande_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseur` VALUES (1,'2012-12-08 13:11:07',13,'CF1007-0001',1,NULL,NULL,NULL,'2010-07-11 17:13:40','2010-07-11 17:15:42',NULL,'2010-07-11',1,1,NULL,0,5,0,0,0,39.20000000,0.00000000,0.00000000,200.00000000,239.20000000,NULL,NULL,'muscadet',2,0,0,NULL,NULL,NULL),(2,'2012-12-08 13:11:07',1,'CF1007-0002',1,NULL,NULL,NULL,'2010-07-11 18:46:28','2010-07-11 18:47:33',NULL,'2010-07-11',1,1,NULL,0,3,0,0,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,NULL,NULL,'muscadet',4,0,0,NULL,NULL,NULL),(3,'2012-12-08 13:11:07',17,'(PROV3)',1,NULL,NULL,NULL,'2011-08-04 23:00:52',NULL,NULL,NULL,1,NULL,NULL,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL),(4,'2012-12-08 13:11:07',17,'(PROV4)',1,NULL,NULL,NULL,'2011-08-04 23:19:32',NULL,NULL,NULL,1,NULL,NULL,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL),(5,'2012-12-08 13:11:07',17,'(PROV5)',1,NULL,NULL,NULL,'2011-08-04 23:22:16',NULL,NULL,NULL,1,NULL,NULL,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL),(6,'2012-12-08 13:11:07',17,'CF1108-0003',1,NULL,NULL,NULL,'2011-08-04 23:22:54','2011-08-08 15:04:37',NULL,NULL,1,1,NULL,0,2,0,0,0,0.98000000,0.00000000,0.00000000,5.00000000,5.98000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL),(7,'2012-12-08 13:11:07',17,'(PROV7)',1,NULL,NULL,NULL,'2011-08-04 23:23:29',NULL,NULL,NULL,1,NULL,NULL,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL),(8,'2012-12-08 13:11:07',17,'(PROV8)',1,NULL,NULL,NULL,'2011-08-04 23:36:10',NULL,NULL,NULL,1,NULL,NULL,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL),(13,'2013-03-09 18:39:41',1,'CF1303-0004',1,NULL,NULL,0,'2013-03-09 19:39:18','2013-03-09 19:39:27','2013-03-09 19:39:32','2013-03-09',1,1,1,0,3,0,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,NULL,NULL,'muscadet',1,0,0,NULL,NULL,NULL),(14,'2013-03-22 09:26:43',16,'(PROV14)',1,NULL,'gdfg',0,'2013-03-22 10:26:38',NULL,NULL,NULL,1,NULL,NULL,0,0,0,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','muscadet',0,0,0,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_commande_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_dispatch` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_dispatch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_dispatch` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `qty` float DEFAULT NULL, + `fk_entrepot` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseur_dispatch_fk_commande` (`fk_commande`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_dispatch` +-- + +LOCK TABLES `llx_commande_fournisseur_dispatch` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseur_dispatch` VALUES (1,2,4,2,1,1,'2010-07-11 18:49:44'); +/*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseur_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_extrafields` +-- + +LOCK TABLES `llx_commande_fournisseur_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_fournisseur_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_log` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datelog` datetime NOT NULL, + `fk_commande` int(11) NOT NULL, + `fk_statut` smallint(6) NOT NULL, + `fk_user` int(11) NOT NULL, + `comment` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_log` +-- + +LOCK TABLES `llx_commande_fournisseur_log` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_log` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseur_log` VALUES (1,'2010-07-11 15:13:40','2010-07-11 17:13:40',1,0,1,NULL),(2,'2010-07-11 15:15:42','2010-07-11 17:15:42',1,1,1,NULL),(3,'2010-07-11 15:16:28','2010-07-11 17:16:28',1,2,1,NULL),(4,'2010-07-11 15:19:14','2010-07-11 00:00:00',1,3,1,NULL),(5,'2010-07-11 15:19:36','2010-07-11 00:00:00',1,5,1,NULL),(6,'2010-07-11 16:46:28','2010-07-11 18:46:28',2,0,1,NULL),(7,'2010-07-11 16:47:33','2010-07-11 18:47:33',2,1,1,NULL),(8,'2010-07-11 16:47:41','2010-07-11 18:47:41',2,2,1,NULL),(9,'2010-07-11 16:48:00','2010-07-11 00:00:00',2,3,1,NULL),(10,'2011-08-04 21:00:52','2011-08-04 23:00:52',3,0,1,NULL),(11,'2011-08-04 21:19:32','2011-08-04 23:19:32',4,0,1,NULL),(12,'2011-08-04 21:22:16','2011-08-04 23:22:16',5,0,1,NULL),(13,'2011-08-04 21:22:54','2011-08-04 23:22:54',6,0,1,NULL),(14,'2011-08-04 21:23:29','2011-08-04 23:23:29',7,0,1,NULL),(15,'2011-08-04 21:36:10','2011-08-04 23:36:10',8,0,1,NULL),(19,'2011-08-08 13:04:37','2011-08-08 15:04:37',6,1,1,NULL),(20,'2011-08-08 13:04:38','2011-08-08 15:04:38',6,2,1,NULL),(29,'2013-03-09 18:39:18','2013-03-09 19:39:18',13,0,1,NULL),(30,'2013-03-09 18:39:27','2013-03-09 19:39:27',13,1,1,NULL),(31,'2013-03-09 18:39:32','2013-03-09 19:39:32',13,2,1,NULL),(32,'2013-03-09 18:39:41','2013-03-09 00:00:00',13,3,1,'hf'),(33,'2013-03-22 09:26:38','2013-03-22 10:26:38',14,0,1,NULL); +/*!40000 ALTER TABLE `llx_commande_fournisseur_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseurdet` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseurdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseurdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) NOT NULL, + `fk_product` int(11) DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT '0.000', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseurdet` +-- + +LOCK TABLES `llx_commande_fournisseurdet` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseurdet` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseurdet` VALUES (1,1,NULL,'','','Chips',19.600,0.000,'',0.000,'',10,0,0,20.00000000,200.00000000,39.20000000,0.00000000,0.00000000,239.20000000,0,NULL,NULL,0,NULL),(2,2,4,'ABCD','Decapsuleur','',0.000,0.000,'',0.000,'',20,0,0,10.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL),(3,6,NULL,'','','ljkljl',19.600,0.000,'',0.000,'',1,0,0,5.00000000,5.00000000,0.98000000,0.00000000,0.00000000,5.98000000,0,NULL,NULL,0,NULL),(6,13,NULL,'','','dfgdf',0.000,0.000,'0',0.000,'0',1,0,0,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL),(7,14,NULL,'','','gfdgd',0.000,0.000,'0',0.000,'0',1,0,0,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL); +/*!40000 ALTER TABLE `llx_commande_fournisseurdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commandedet` +-- + +DROP TABLE IF EXISTS `llx_commandedet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commandedet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `localtax1_tx` double(6,3) DEFAULT NULL, + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT NULL, + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `fk_remise_except` int(11) DEFAULT NULL, + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commandedet_fk_commande` (`fk_commande`), + KEY `idx_commandedet_fk_product` (`fk_product`), + CONSTRAINT `fk_commandedet_fk_commande` FOREIGN KEY (`fk_commande`) REFERENCES `llx_commande` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commandedet` +-- + +LOCK TABLES `llx_commandedet` WRITE; +/*!40000 ALTER TABLE `llx_commandedet` DISABLE KEYS */; +INSERT INTO `llx_commandedet` VALUES (1,1,NULL,NULL,NULL,'Product 1',0.000,0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL),(2,1,NULL,2,NULL,'',0.000,0.000,'',0.000,'',1,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL),(3,1,NULL,5,NULL,'cccc',0.000,0.000,'',0.000,'',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL),(4,2,NULL,NULL,NULL,'hgf',0.000,0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL),(10,5,NULL,NULL,NULL,'gfdgdf',0.000,0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL),(11,6,NULL,NULL,NULL,'gdfg',19.600,0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL),(12,6,NULL,NULL,NULL,'gfdgd',19.600,0.000,'',0.000,'',1,0,0,NULL,50,50.00000000,50.00000000,9.80000000,0.00000000,0.00000000,59.80000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL),(13,7,NULL,NULL,NULL,'gfdg',19.600,0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL),(14,3,NULL,NULL,NULL,'gdfgdf',0.000,0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL),(15,3,NULL,NULL,NULL,'fghfgh',0.000,0.000,'',0.000,'',1,0,0,NULL,20,20.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL),(16,7,NULL,4,NULL,'',12.500,0.000,'',0.000,'',1,0,0,NULL,5,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL),(17,7,NULL,4,NULL,'eeee',12.500,0.000,'',0.000,'',1,0,0,NULL,5,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL),(18,8,NULL,NULL,NULL,'fdsfs',0.000,0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL),(19,8,NULL,NULL,NULL,'fsdfsf',0.000,0.000,'',0.000,'',1,0,0,NULL,-5,-5.00000000,-5.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL); +/*!40000 ALTER TABLE `llx_commandedet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commandedet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commandedet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commandedet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commandedet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commandedet_extrafields` +-- + +LOCK TABLES `llx_commandedet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commandedet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commandedet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_compta` +-- + +DROP TABLE IF EXISTS `llx_compta`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_compta` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `datev` date DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `fk_compta_account` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `valid` tinyint(4) DEFAULT '0', + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_compta` +-- + +LOCK TABLES `llx_compta` WRITE; +/*!40000 ALTER TABLE `llx_compta` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_compta` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_compta_account` +-- + +DROP TABLE IF EXISTS `llx_compta_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_compta_account` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `number` varchar(12) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_compta_account` +-- + +LOCK TABLES `llx_compta_account` WRITE; +/*!40000 ALTER TABLE `llx_compta_account` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_compta_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_compta_compte_generaux` +-- + +DROP TABLE IF EXISTS `llx_compta_compte_generaux`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_compta_compte_generaux` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_creation` datetime DEFAULT NULL, + `numero` varchar(50) DEFAULT NULL, + `intitule` varchar(255) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `numero` (`numero`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_compta_compte_generaux` +-- + +LOCK TABLES `llx_compta_compte_generaux` WRITE; +/*!40000 ALTER TABLE `llx_compta_compte_generaux` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_compta_compte_generaux` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_cond_reglement` +-- + +DROP TABLE IF EXISTS `llx_cond_reglement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_cond_reglement` ( + `rowid` int(11) NOT NULL, + `code` varchar(16) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `active` tinyint(4) DEFAULT '1', + `libelle` varchar(255) DEFAULT NULL, + `libelle_facture` text, + `fdm` tinyint(4) DEFAULT NULL, + `nbjour` smallint(6) DEFAULT NULL, + `decalage` smallint(6) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_cond_reglement` +-- + +LOCK TABLES `llx_cond_reglement` WRITE; +/*!40000 ALTER TABLE `llx_cond_reglement` DISABLE KEYS */; +INSERT INTO `llx_cond_reglement` VALUES (1,'RECEP',1,1,'A réception','Réception de facture',0,0,NULL),(2,'30D',2,1,'30 jours','Réglement à 30 jours',0,30,NULL),(3,'30DENDMONTH',3,1,'30 jours fin de mois','Réglement à 30 jours fin de mois',1,30,NULL),(4,'60D',4,1,'60 jours','Réglement à 60 jours',0,60,NULL),(5,'60DENDMONTH',5,1,'60 jours fin de mois','Réglement à 60 jours fin de mois',1,60,NULL); +/*!40000 ALTER TABLE `llx_cond_reglement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_congespayes` +-- + +DROP TABLE IF EXISTS `llx_congespayes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_congespayes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL, + `date_create` datetime NOT NULL, + `description` varchar(255) COLLATE latin1_german2_ci NOT NULL, + `date_debut` date NOT NULL, + `date_fin` date NOT NULL, + `statut` int(11) NOT NULL DEFAULT '1', + `fk_validator` int(11) NOT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_refuse` datetime DEFAULT NULL, + `fk_user_refuse` int(11) DEFAULT NULL, + `date_cancel` datetime DEFAULT NULL, + `fk_user_cancel` int(11) DEFAULT NULL, + `detail_refuse` varchar(250) COLLATE latin1_german2_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_congespayes` +-- + +LOCK TABLES `llx_congespayes` WRITE; +/*!40000 ALTER TABLE `llx_congespayes` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_congespayes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_congespayes_config` +-- + +DROP TABLE IF EXISTS `llx_congespayes_config`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_congespayes_config` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE latin1_german2_ci NOT NULL, + `value` text COLLATE latin1_german2_ci, + PRIMARY KEY (`rowid`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_congespayes_config` +-- + +LOCK TABLES `llx_congespayes_config` WRITE; +/*!40000 ALTER TABLE `llx_congespayes_config` DISABLE KEYS */; +INSERT INTO `llx_congespayes_config` VALUES (1,'userGroup','2'),(2,'lastUpdate','1331893531'),(3,'nbUser','9'),(4,'delayForRequest','30'),(5,'AlertValidatorDelay','1'),(6,'AlertValidatorSolde','1'),(7,'nbCongesDeducted','1.20'),(8,'nbCongesEveryMonth','2.50'); +/*!40000 ALTER TABLE `llx_congespayes_config` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_congespayes_events` +-- + +DROP TABLE IF EXISTS `llx_congespayes_events`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_congespayes_events` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE latin1_german2_ci NOT NULL, + `value` text COLLATE latin1_german2_ci NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_congespayes_events` +-- + +LOCK TABLES `llx_congespayes_events` WRITE; +/*!40000 ALTER TABLE `llx_congespayes_events` DISABLE KEYS */; +INSERT INTO `llx_congespayes_events` VALUES (1,'Mariage','3.00'); +/*!40000 ALTER TABLE `llx_congespayes_events` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_congespayes_logs` +-- + +DROP TABLE IF EXISTS `llx_congespayes_logs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_congespayes_logs` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_action` datetime NOT NULL, + `fk_user_action` int(11) NOT NULL, + `fk_user_update` int(11) NOT NULL, + `type_action` varchar(255) COLLATE latin1_german2_ci NOT NULL, + `prev_solde` varchar(255) COLLATE latin1_german2_ci NOT NULL, + `new_solde` varchar(255) COLLATE latin1_german2_ci NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_congespayes_logs` +-- + +LOCK TABLES `llx_congespayes_logs` WRITE; +/*!40000 ALTER TABLE `llx_congespayes_logs` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_congespayes_logs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_congespayes_users` +-- + +DROP TABLE IF EXISTS `llx_congespayes_users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_congespayes_users` ( + `fk_user` int(11) NOT NULL, + `nb_conges` float NOT NULL DEFAULT '0', + PRIMARY KEY (`fk_user`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_congespayes_users` +-- + +LOCK TABLES `llx_congespayes_users` WRITE; +/*!40000 ALTER TABLE `llx_congespayes_users` DISABLE KEYS */; +INSERT INTO `llx_congespayes_users` VALUES (1,0),(2,0),(3,0),(4,0),(5,0),(6,0),(7,0),(8,0),(9,0); +/*!40000 ALTER TABLE `llx_congespayes_users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_const` +-- + +DROP TABLE IF EXISTS `llx_const`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_const` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `value` text NOT NULL, + `type` varchar(6) DEFAULT NULL, + `visible` tinyint(4) NOT NULL DEFAULT '1', + `note` text, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_const` (`name`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=5357 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_const` +-- + +LOCK TABLES `llx_const` WRITE; +/*!40000 ALTER TABLE `llx_const` DISABLE KEYS */; +INSERT INTO `llx_const` VALUES (5,'SYSLOG_LEVEL',0,'7','chaine',0,'Level of debug info to show','2010-07-08 11:17:57'),(8,'MAIN_UPLOAD_DOC',0,'2048','chaine',0,'Max size for file upload (0 means no upload allowed)','2010-07-08 11:17:57'),(9,'MAIN_SEARCHFORM_SOCIETE',0,'1','yesno',0,'Show form for quick company search','2010-07-08 11:17:57'),(10,'MAIN_SEARCHFORM_CONTACT',0,'1','yesno',0,'Show form for quick contact search','2010-07-08 11:17:57'),(11,'MAIN_SEARCHFORM_PRODUITSERVICE',0,'1','yesno',0,'Show form for quick product search','2010-07-08 11:17:58'),(12,'MAIN_SEARCHFORM_ADHERENT',0,'1','yesno',0,'Show form for quick member search','2010-07-08 11:17:58'),(16,'MAIN_SIZE_LISTE_LIMIT',0,'25','chaine',0,'Longueur maximum des listes','2010-07-08 11:17:58'),(17,'MAIN_SHOW_WORKBOARD',0,'1','yesno',0,'Affichage tableau de bord de travail Dolibarr','2010-07-08 11:17:58'),(29,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',1,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2010-07-08 11:17:58'),(33,'SOCIETE_NOLIST_COURRIER',0,'1','yesno',0,'Liste les fichiers du repertoire courrier','2010-07-08 11:17:58'),(35,'SOCIETE_CODECOMPTA_ADDON',1,'mod_codecompta_panicum','yesno',0,'Module to control third parties codes','2010-07-08 11:17:58'),(36,'ADHERENT_MAIL_REQUIRED',1,'1','yesno',0,'EMail required to create a new member','2010-07-08 11:17:58'),(37,'ADHERENT_MAIL_FROM',1,'adherents@domain.com','chaine',0,'Sender EMail for automatic emails','2010-07-08 11:17:58'),(38,'ADHERENT_MAIL_RESIL',1,'Your subscription has been resiliated.\r\nWe hope to see you soon again','texte',0,'Mail resiliation','2010-07-08 11:17:58'),(39,'ADHERENT_MAIL_VALID',1,'Your subscription has been validated.\r\nThis is a remind of your personal information :\r\n\r\n%INFOS%\r\n\r\n','texte',0,'Mail de validation','2010-07-08 11:17:59'),(40,'ADHERENT_MAIL_COTIS',1,'Hello %PRENOM%,\r\nThanks for your subscription.\r\nThis email confirms that your subscription has been received and processed.\r\n\r\n','texte',0,'Mail de validation de cotisation','2010-07-08 11:17:59'),(41,'ADHERENT_MAIL_VALID_SUBJECT',1,'Your subscription has been validated','chaine',0,'Sujet du mail de validation','2010-07-08 11:17:59'),(42,'ADHERENT_MAIL_RESIL_SUBJECT',1,'Resiliating your subscription','chaine',0,'Sujet du mail de resiliation','2010-07-08 11:17:59'),(43,'ADHERENT_MAIL_COTIS_SUBJECT',1,'Receipt of your subscription','chaine',0,'Sujet du mail de validation de cotisation','2010-07-08 11:17:59'),(44,'MAILING_EMAIL_FROM',1,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2010-07-08 11:17:59'),(45,'ADHERENT_USE_MAILMAN',1,'0','yesno',0,'Utilisation de Mailman','2010-07-08 11:17:59'),(46,'ADHERENT_MAILMAN_UNSUB_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%','chaine',0,'Url de desinscription aux listes mailman','2010-07-08 11:17:59'),(47,'ADHERENT_MAILMAN_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%','chaine',0,'Url pour les inscriptions mailman','2010-07-08 11:17:59'),(48,'ADHERENT_MAILMAN_LISTS',1,'test-test,test-test2','chaine',0,'Listes auxquelles inscrire les nouveaux adherents','2010-07-08 11:17:59'),(49,'ADHERENT_MAILMAN_ADMINPW',1,'','chaine',0,'Mot de passe Admin des liste mailman','2010-07-08 11:17:59'),(50,'ADHERENT_MAILMAN_SERVER',1,'lists.domain.com','chaine',0,'Serveur hebergeant les interfaces d Admin des listes mailman','2010-07-08 11:17:59'),(51,'ADHERENT_MAILMAN_LISTS_COTISANT',1,'','chaine',0,'Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement','2010-07-08 11:17:59'),(52,'ADHERENT_USE_SPIP',1,'0','yesno',0,'Utilisation de SPIP ?','2010-07-08 11:17:59'),(53,'ADHERENT_USE_SPIP_AUTO',1,'0','yesno',0,'Utilisation de SPIP automatiquement','2010-07-08 11:17:59'),(54,'ADHERENT_SPIP_USER',1,'user','chaine',0,'user spip','2010-07-08 11:17:59'),(55,'ADHERENT_SPIP_PASS',1,'pass','chaine',0,'Pass de connection','2010-07-08 11:17:59'),(56,'ADHERENT_SPIP_SERVEUR',1,'localhost','chaine',0,'serveur spip','2010-07-08 11:17:59'),(57,'ADHERENT_SPIP_DB',1,'spip','chaine',0,'db spip','2010-07-08 11:17:59'),(58,'ADHERENT_CARD_HEADER_TEXT',1,'%ANNEE%','chaine',0,'Texte imprime sur le haut de la carte adherent','2010-07-08 11:17:59'),(59,'ADHERENT_CARD_FOOTER_TEXT',1,'Association AZERTY','chaine',0,'Texte imprime sur le bas de la carte adherent','2010-07-08 11:17:59'),(61,'FCKEDITOR_ENABLE_USER',1,'1','yesno',0,'Activation fckeditor sur notes utilisateurs','2010-07-08 11:17:59'),(62,'FCKEDITOR_ENABLE_SOCIETE',1,'1','yesno',0,'Activation fckeditor sur notes societe','2010-07-08 11:17:59'),(63,'FCKEDITOR_ENABLE_PRODUCTDESC',1,'1','yesno',0,'Activation fckeditor sur notes produits','2010-07-08 11:17:59'),(64,'FCKEDITOR_ENABLE_MEMBER',1,'1','yesno',0,'Activation fckeditor sur notes adherent','2010-07-08 11:17:59'),(65,'FCKEDITOR_ENABLE_MAILING',1,'1','yesno',0,'Activation fckeditor sur emailing','2010-07-08 11:17:59'),(66,'OSC_DB_HOST',1,'localhost','chaine',0,'Host for OSC database for OSCommerce module 1','2010-07-08 11:17:59'),(67,'DON_ADDON_MODEL',1,'html_cerfafr','chaine',0,'','2010-07-08 11:18:00'),(68,'PROPALE_ADDON',1,'mod_propale_marbre','chaine',0,'','2010-07-08 11:18:00'),(69,'PROPALE_ADDON_PDF',1,'azur','chaine',0,'','2010-07-08 11:18:00'),(70,'COMMANDE_ADDON',1,'mod_commande_marbre','chaine',0,'','2010-07-08 11:18:00'),(71,'COMMANDE_ADDON_PDF',1,'einstein','chaine',0,'','2010-07-08 11:18:00'),(72,'COMMANDE_SUPPLIER_ADDON',1,'mod_commande_fournisseur_muguet','chaine',0,'','2010-07-08 11:18:00'),(73,'COMMANDE_SUPPLIER_ADDON_PDF',1,'muscadet','chaine',0,'','2010-07-08 11:18:00'),(74,'EXPEDITION_ADDON',1,'enlevement','chaine',0,'','2010-07-08 11:18:00'),(76,'FICHEINTER_ADDON',1,'pacific','chaine',0,'','2010-07-08 11:18:00'),(77,'FICHEINTER_ADDON_PDF',1,'soleil','chaine',0,'','2010-07-08 11:18:00'),(79,'FACTURE_ADDON_PDF',1,'crabe','chaine',0,'','2010-07-08 11:18:00'),(80,'PROPALE_VALIDITY_DURATION',1,'15','chaine',0,'Durée de validitée des propales','2010-07-08 11:18:00'),(230,'COMPANY_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2010-07-08 11:26:20'),(238,'LIVRAISON_ADDON_PDF',1,'typhon','chaine',0,'Nom du gestionnaire de generation des commandes en PDF','2010-07-08 11:26:27'),(239,'LIVRAISON_ADDON_NUMBER',1,'mod_livraison_jade','chaine',0,'Nom du gestionnaire de numerotation des bons de livraison','2013-03-20 13:17:36'),(242,'MAIN_SUBMODULE_EXPEDITION',1,'1','chaine',0,'','2010-07-08 11:26:34'),(245,'FACTURE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2010-07-08 11:28:53'),(249,'DON_FORM',1,'fsfe.fr.php','chaine',0,'Nom du gestionnaire de formulaire de dons','2010-07-08 11:29:00'),(252,'MAIN_MODULE_ADHERENT',1,'1',NULL,0,NULL,'2010-07-08 11:29:05'),(253,'ADHERENT_BANK_USE_AUTO',1,'','yesno',0,'Insertion automatique des cotisation dans le compte banquaire','2010-07-08 11:29:05'),(254,'ADHERENT_BANK_ACCOUNT',1,'','chaine',0,'ID du Compte banquaire utilise','2010-07-08 11:29:05'),(255,'ADHERENT_BANK_CATEGORIE',1,'','chaine',0,'ID de la categorie banquaire des cotisations','2010-07-08 11:29:05'),(256,'ADHERENT_ETIQUETTE_TYPE',1,'L7163','chaine',0,'Type d etiquette (pour impression de planche d etiquette)','2010-07-08 11:29:05'),(260,'MAIN_MODULE_STOCK',1,'1',NULL,0,NULL,'2010-07-08 11:29:18'),(269,'PROJECT_ADDON_PDF',1,'baleine','chaine',0,'Nom du gestionnaire de generation des projets en PDF','2010-07-08 11:29:33'),(270,'PROJECT_ADDON',1,'mod_project_simple','chaine',0,'Nom du gestionnaire de numerotation des projets','2010-07-08 11:29:33'),(271,'MAIN_MODULE_MAILING',1,'1',NULL,0,NULL,'2010-07-08 11:29:37'),(272,'MAIN_MODULE_EXPORT',1,'1',NULL,0,NULL,'2010-07-08 11:29:41'),(273,'MAIN_MODULE_IMPORT',1,'1',NULL,0,NULL,'2010-07-08 11:29:45'),(274,'MAIN_MODULE_CATEGORIE',1,'1',NULL,0,NULL,'2010-07-08 11:29:59'),(275,'MAIN_MODULE_BOOKMARK',1,'1',NULL,0,NULL,'2010-07-08 11:30:03'),(276,'MAIN_MODULE_WEBSERVICES',1,'1',NULL,0,NULL,'2010-07-08 11:30:30'),(278,'MAIN_MODULE_GEOIPMAXMIND',1,'1',NULL,0,NULL,'2010-07-08 11:30:36'),(279,'MAIN_MODULE_EXTERNALRSS',1,'1',NULL,0,NULL,'2010-07-08 11:30:38'),(292,'MAIN_MODULE_FCKEDITOR',1,'1',NULL,0,NULL,'2010-07-08 11:56:27'),(368,'STOCK_USERSTOCK_AUTOCREATE',1,'1','chaine',0,'','2010-07-08 22:44:59'),(369,'EXPEDITION_ADDON_PDF',1,'merou','chaine',0,'','2010-07-08 22:58:07'),(370,'MAIN_SUBMODULE_LIVRAISON',1,'1','chaine',0,'','2010-07-08 23:00:29'),(377,'FACTURE_ADDON',1,'mod_facture_terre','chaine',0,'','2010-07-08 23:08:12'),(380,'ADHERENT_CARD_TEXT',1,'%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','',0,'Texte imprime sur la carte adherent','2010-07-08 23:14:46'),(381,'ADHERENT_CARD_TEXT_RIGHT',1,'aaa','',0,'','2010-07-08 23:14:55'),(384,'PRODUIT_SOUSPRODUITS',1,'1','chaine',0,'','2010-07-08 23:22:12'),(385,'PRODUIT_USE_SEARCH_TO_SELECT',1,'1','chaine',0,'','2010-07-08 23:22:19'),(386,'STOCK_CALCULATE_ON_SHIPMENT',1,'1','chaine',0,'','2010-07-08 23:23:21'),(387,'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER',1,'1','chaine',0,'','2010-07-08 23:23:26'),(392,'MAIN_AGENDA_XCAL_EXPORTKEY',1,'dolibarr','chaine',0,'','2010-07-08 23:27:50'),(393,'MAIN_AGENDA_EXPORT_PAST_DELAY',1,'100','chaine',0,'','2010-07-08 23:27:50'),(523,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',1,'1','chaine',0,'','2010-07-10 12:48:49'),(524,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',1,'1','chaine',0,'','2010-07-10 12:48:49'),(525,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',1,'1','chaine',0,'','2010-07-10 12:48:49'),(526,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',1,'1','chaine',0,'','2010-07-10 12:48:49'),(527,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',1,'1','chaine',0,'','2010-07-10 12:48:49'),(528,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',1,'1','chaine',0,'','2010-07-10 12:48:49'),(529,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',1,'1','chaine',0,'','2010-07-10 12:48:49'),(530,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',1,'1','chaine',0,'','2010-07-10 12:48:49'),(531,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',1,'1','chaine',0,'','2010-07-10 12:48:49'),(532,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',1,'1','chaine',0,'','2010-07-10 12:48:49'),(533,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2010-07-10 12:48:50'),(534,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2010-07-10 12:48:50'),(602,'MAIN_MODULE_PROJET',1,'1',NULL,0,NULL,'2010-07-11 13:26:54'),(610,'CASHDESK_ID_THIRDPARTY',1,'7','chaine',0,'','2010-07-11 17:08:18'),(611,'CASHDESK_ID_BANKACCOUNT_CASH',1,'3','chaine',0,'','2010-07-11 17:08:18'),(612,'CASHDESK_ID_BANKACCOUNT_CHEQUE',1,'1','chaine',0,'','2010-07-11 17:08:18'),(613,'CASHDESK_ID_BANKACCOUNT_CB',1,'1','chaine',0,'','2010-07-11 17:08:18'),(614,'CASHDESK_ID_WAREHOUSE',1,'2','chaine',0,'','2010-07-11 17:08:18'),(660,'LDAP_USER_DN',1,'ou=users,dc=my-domain,dc=com','chaine',0,NULL,'2010-07-18 10:25:27'),(661,'LDAP_GROUP_DN',1,'ou=groups,dc=my-domain,dc=com','chaine',0,NULL,'2010-07-18 10:25:27'),(662,'LDAP_FILTER_CONNECTION',1,'&(objectClass=user)(objectCategory=person)','chaine',0,NULL,'2010-07-18 10:25:27'),(663,'LDAP_FIELD_LOGIN',1,'uid','chaine',0,NULL,'2010-07-18 10:25:27'),(664,'LDAP_FIELD_FULLNAME',1,'cn','chaine',0,NULL,'2010-07-18 10:25:27'),(665,'LDAP_FIELD_NAME',1,'sn','chaine',0,NULL,'2010-07-18 10:25:27'),(666,'LDAP_FIELD_FIRSTNAME',1,'givenname','chaine',0,NULL,'2010-07-18 10:25:27'),(667,'LDAP_FIELD_MAIL',1,'mail','chaine',0,NULL,'2010-07-18 10:25:27'),(668,'LDAP_FIELD_PHONE',1,'telephonenumber','chaine',0,NULL,'2010-07-18 10:25:27'),(669,'LDAP_FIELD_FAX',1,'facsimiletelephonenumber','chaine',0,NULL,'2010-07-18 10:25:27'),(670,'LDAP_FIELD_MOBILE',1,'mobile','chaine',0,NULL,'2010-07-18 10:25:27'),(671,'LDAP_SERVER_TYPE',1,'openldap','chaine',0,'','2010-07-18 10:25:46'),(672,'LDAP_SERVER_PROTOCOLVERSION',1,'3','chaine',0,'','2010-07-18 10:25:47'),(673,'LDAP_SERVER_HOST',1,'localhost','chaine',0,'','2010-07-18 10:25:47'),(674,'LDAP_SERVER_PORT',1,'389','chaine',0,'','2010-07-18 10:25:47'),(675,'LDAP_SERVER_USE_TLS',1,'0','chaine',0,'','2010-07-18 10:25:47'),(676,'LDAP_SYNCHRO_ACTIVE',1,'dolibarr2ldap','chaine',0,'','2010-07-18 10:25:47'),(677,'LDAP_CONTACT_ACTIVE',1,'1','chaine',0,'','2010-07-18 10:25:47'),(678,'LDAP_MEMBER_ACTIVE',1,'1','chaine',0,'','2010-07-18 10:25:47'),(807,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',1,'1','chaine',0,NULL,'2011-07-18 17:27:52'),(808,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',1,'1','chaine',0,NULL,'2011-07-18 17:27:52'),(834,'MAIN_MODULE_CASHDESK',1,'1',NULL,0,NULL,'2011-07-18 17:30:24'),(969,'MAIN_MODULE_PRELEVEMENT',1,'1',NULL,0,NULL,'2011-07-18 18:01:59'),(973,'MAIN_MODULE_WORKFLOW',1,'1',NULL,0,NULL,'2011-07-18 18:02:20'),(974,'MAIN_MODULE_WORKFLOW_TRIGGERS',1,'1','chaine',0,NULL,'2011-07-18 18:02:20'),(975,'WORKFLOW_PROPAL_AUTOCREATE_ORDER',1,'1','chaine',0,'','2011-07-18 18:02:24'),(978,'MAIN_MODULE_NOTIFICATION',1,'1',NULL,0,NULL,'2011-07-18 18:03:06'),(979,'PRELEVEMENT_USER',1,'1','chaine',0,'','2011-07-18 18:05:50'),(980,'PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR',1,'1234567','chaine',0,'','2011-07-18 18:05:50'),(981,'PRELEVEMENT_ID_BANKACCOUNT',1,'1','chaine',0,'','2011-07-18 18:05:50'),(983,'FACTURE_RIB_NUMBER',1,'1','chaine',0,'','2011-07-18 18:35:14'),(984,'FACTURE_CHQ_NUMBER',1,'1','chaine',0,'','2011-07-18 18:35:14'),(1016,'GOOGLE_DUPLICATE_INTO_GCAL',1,'1','chaine',0,'','2011-07-18 21:40:20'),(1018,'MAIN_MODULE_SYSLOG',0,'1',NULL,0,NULL,'2011-07-20 11:36:47'),(1098,'MAIN_INFO_SOCIETE_LOGO',1,'dolibarr_125x125.png','chaine',0,'','2011-07-28 18:42:09'),(1099,'MAIN_INFO_SOCIETE_LOGO_SMALL',1,'dolibarr_125x125_small.png','chaine',0,'','2011-07-28 18:42:09'),(1100,'MAIN_INFO_SOCIETE_LOGO_MINI',1,'dolibarr_125x125_mini.png','chaine',0,'','2011-07-28 18:42:09'),(1138,'MAIN_VERSION_LAST_INSTALL',0,'3.1.0-beta','chaine',0,'Dolibarr version when install','2011-07-28 23:05:02'),(1152,'SOCIETE_CODECLIENT_ADDON',1,'mod_codeclient_monkey','chaine',0,'','2011-07-29 20:50:02'),(1231,'MAIN_UPLOAD_DOC',1,'2048','chaine',0,'','2011-07-29 21:04:00'),(1234,'MAIN_UMASK',1,'0664','chaine',0,'','2011-07-29 21:04:11'),(1240,'MAIN_LOGEVENTS_USER_LOGIN',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1241,'MAIN_LOGEVENTS_USER_LOGIN_FAILED',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1242,'MAIN_LOGEVENTS_USER_LOGOUT',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1243,'MAIN_LOGEVENTS_USER_CREATE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1244,'MAIN_LOGEVENTS_USER_MODIFY',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1245,'MAIN_LOGEVENTS_USER_NEW_PASSWORD',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1246,'MAIN_LOGEVENTS_USER_ENABLEDISABLE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1247,'MAIN_LOGEVENTS_USER_DELETE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1248,'MAIN_LOGEVENTS_GROUP_CREATE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1249,'MAIN_LOGEVENTS_GROUP_MODIFY',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1250,'MAIN_LOGEVENTS_GROUP_DELETE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1251,'MAIN_BOXES_MAXLINES',1,'5','',0,'','2011-07-29 21:05:42'),(1379,'CABINETMED_RHEUMATOLOGY_ON',1,'1','chaine',1,'Enable features for rheumatology','2011-08-01 21:47:53'),(1482,'EXPEDITION_ADDON_NUMBER',1,'mod_expedition_safor','chaine',0,'Nom du gestionnaire de numerotation des expeditions','2011-08-05 17:53:11'),(1490,'CONTRACT_ADDON',1,'mod_contract_serpis','chaine',0,'Nom du gestionnaire de numerotation des contrats','2011-08-05 18:11:58'),(1677,'COMMANDE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/orders','chaine',0,NULL,'2012-12-08 13:11:02'),(1698,'PRODUCT_CODEPRODUCT_ADDON',1,'mod_codeproduct_leopard','yesno',0,'Module to control product codes','2012-12-08 13:11:25'),(1718,'MAIN_MODULE_TAX',1,'1',NULL,0,NULL,'2012-12-08 13:12:41'),(1719,'ACCOUNTING_USEDICTTOEDIT',1,'1','chaine',1,'','2012-12-08 13:15:00'),(1724,'PROPALE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2012-12-08 13:17:14'),(1730,'OPENSTREETMAP_ENABLE_MAPS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1731,'OPENSTREETMAP_ENABLE_MAPS_CONTACTS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1732,'OPENSTREETMAP_ENABLE_MAPS_MEMBERS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1733,'OPENSTREETMAP_MAPS_ZOOM_LEVEL',1,'15','chaine',0,'','2012-12-08 13:22:47'),(1737,'MAIN_INFO_SOCIETE_COUNTRY',2,'1:FR:France','chaine',0,'','2013-02-26 21:56:28'),(1738,'MAIN_INFO_SOCIETE_NOM',2,'aaa','chaine',0,'','2012-12-08 14:08:14'),(1739,'MAIN_INFO_SOCIETE_STATE',2,'0','chaine',0,'','2013-02-27 14:20:27'),(1740,'MAIN_MONNAIE',2,'EUR','chaine',0,'','2012-12-08 14:08:14'),(1741,'MAIN_LANG_DEFAULT',2,'auto','chaine',0,'','2012-12-08 14:08:14'),(1742,'MAIN_MAIL_EMAIL_FROM',2,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2012-12-08 14:08:14'),(1743,'MAIN_MENU_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2013-02-11 19:43:54'),(1744,'MAIN_MENUFRONT_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2013-02-11 19:43:54'),(1745,'MAIN_MENU_SMARTPHONE',2,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2012-12-08 14:08:14'),(1746,'MAIN_MENUFRONT_SMARTPHONE',2,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2012-12-08 14:08:14'),(1747,'MAIN_THEME',2,'eldy','chaine',0,'Default theme','2012-12-08 14:08:14'),(1748,'MAIN_DELAY_ACTIONS_TODO',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2012-12-08 14:08:14'),(1749,'MAIN_DELAY_ORDERS_TO_PROCESS',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2012-12-08 14:08:14'),(1750,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2012-12-08 14:08:14'),(1751,'MAIN_DELAY_PROPALS_TO_CLOSE',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2012-12-08 14:08:14'),(1752,'MAIN_DELAY_PROPALS_TO_BILL',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2012-12-08 14:08:14'),(1753,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2012-12-08 14:08:14'),(1754,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2012-12-08 14:08:14'),(1755,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-12-08 14:08:14'),(1756,'MAIN_DELAY_RUNNING_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2012-12-08 14:08:14'),(1757,'MAIN_DELAY_MEMBERS',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2012-12-08 14:08:14'),(1758,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',2,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2012-12-08 14:08:14'),(1759,'MAILING_EMAIL_FROM',2,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-12-08 14:08:14'),(1760,'MAIN_INFO_SOCIETE_COUNTRY',3,'1:FR:France','chaine',0,'','2013-02-26 21:56:28'),(1761,'MAIN_INFO_SOCIETE_NOM',3,'bbb','chaine',0,'','2012-12-08 14:08:20'),(1762,'MAIN_INFO_SOCIETE_STATE',3,'0','chaine',0,'','2013-02-27 14:20:27'),(1763,'MAIN_MONNAIE',3,'EUR','chaine',0,'','2012-12-08 14:08:20'),(1764,'MAIN_LANG_DEFAULT',3,'auto','chaine',0,'','2012-12-08 14:08:20'),(1765,'MAIN_MAIL_EMAIL_FROM',3,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2012-12-08 14:08:20'),(1766,'MAIN_MENU_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2013-02-11 19:43:54'),(1767,'MAIN_MENUFRONT_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2013-02-11 19:43:54'),(1768,'MAIN_MENU_SMARTPHONE',3,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2012-12-08 14:08:20'),(1769,'MAIN_MENUFRONT_SMARTPHONE',3,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2012-12-08 14:08:20'),(1770,'MAIN_THEME',3,'eldy','chaine',0,'Default theme','2012-12-08 14:08:20'),(1771,'MAIN_DELAY_ACTIONS_TODO',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2012-12-08 14:08:20'),(1772,'MAIN_DELAY_ORDERS_TO_PROCESS',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2012-12-08 14:08:20'),(1773,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2012-12-08 14:08:20'),(1774,'MAIN_DELAY_PROPALS_TO_CLOSE',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2012-12-08 14:08:20'),(1775,'MAIN_DELAY_PROPALS_TO_BILL',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2012-12-08 14:08:20'),(1776,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2012-12-08 14:08:20'),(1777,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2012-12-08 14:08:20'),(1778,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-12-08 14:08:20'),(1779,'MAIN_DELAY_RUNNING_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2012-12-08 14:08:20'),(1780,'MAIN_DELAY_MEMBERS',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2012-12-08 14:08:20'),(1781,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',3,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2012-12-08 14:08:20'),(1782,'MAILING_EMAIL_FROM',3,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-12-08 14:08:20'),(1803,'SYSLOG_FILE',1,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2012-12-08 14:15:08'),(1804,'SYSLOG_HANDLERS',1,'[\"mod_syslog_file\"]','chaine',0,'','2012-12-08 14:15:08'),(1805,'MAIN_MODULE_SKINCOLOREDITOR',3,'1',NULL,0,NULL,'2012-12-08 14:35:40'),(1806,'MAIN_MODULE_SKINCOLOREDITOR_TABS_0',3,'user:+tabskincoloreditors:ColorEditor:skincoloreditor@skincoloreditor:/skincoloreditor/usercolors.php?id=__ID__','chaine',0,NULL,'2012-12-08 14:35:40'),(1867,'MAIN_MODULE_PAYPAL',1,'1',NULL,0,NULL,'2012-12-11 22:53:56'),(1922,'PAYPAL_API_SANDBOX',1,'1','chaine',0,'','2012-12-12 12:11:05'),(1923,'PAYPAL_API_USER',1,'seller_1355312017_biz_api1.nltechno.com','chaine',0,'','2012-12-12 12:11:05'),(1924,'PAYPAL_API_PASSWORD',1,'1355312040','chaine',0,'','2012-12-12 12:11:05'),(1925,'PAYPAL_API_SIGNATURE',1,'AXqqdsWBzvfn0q5iNmbuiDv1y.3EAXIMWyl4C5KvDReR9HDwwAd6dQ4Q','chaine',0,'','2012-12-12 12:11:05'),(1926,'PAYPAL_API_INTEGRAL_OR_PAYPALONLY',1,'integral','chaine',0,'','2012-12-12 12:11:05'),(1927,'PAYPAL_SECURITY_TOKEN',1,'50c82fab36bb3b6aa83e2a50691803b2','chaine',0,'','2012-12-12 12:11:05'),(1928,'PAYPAL_SECURITY_TOKEN_UNIQUE',1,'0','chaine',0,'','2012-12-12 12:11:05'),(1929,'PAYPAL_ADD_PAYMENT_URL',1,'1','chaine',0,'','2012-12-12 12:11:05'),(1980,'MAIN_PDF_FORMAT',1,'EUA4','chaine',0,'','2012-12-12 19:58:05'),(1981,'MAIN_PROFID1_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1982,'MAIN_PROFID2_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1983,'MAIN_PROFID3_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1984,'MAIN_PROFID4_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1985,'MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1990,'MAIN_SMS_SENDMODE',1,'ovh','chaine',0,'This is to enable OVH SMS engine','2012-12-17 21:19:01'),(2040,'MAIN_MAIL_SMTP_PORT',0,'465','chaine',0,'','2012-12-19 12:58:10'),(2041,'MAIN_MAIL_SMTP_SERVER',0,'smtp.gmail.com','chaine',0,'','2012-12-19 12:58:10'),(2044,'MAIN_MAIL_EMAIL_TLS',0,'1','chaine',0,'','2012-12-19 12:58:10'),(2251,'FCKEDITOR_TEST',1,'Test
\r\n\"\"fdfs','chaine',0,'','2012-12-19 19:12:24'),(2293,'SYSTEMTOOLS_MYSQLDUMP',1,'/usr/bin/mysqldump','chaine',0,'','2012-12-27 02:02:00'),(2305,'MAIN_MODULE_PROPALE',1,'1',NULL,0,NULL,'2013-01-02 20:33:16'),(2307,'MAIN_MODULE_CONTRAT',1,'1',NULL,0,NULL,'2013-01-02 20:33:17'),(2310,'MAIN_MODULE_EXPEDITION',1,'1',NULL,0,NULL,'2013-01-02 20:33:18'),(2313,'MAIN_MODULE_FILEMANAGER',1,'1',NULL,0,NULL,'2013-01-02 20:33:20'),(2314,'MAIN_MODULE_FILEMANAGER_CSS',1,'/filemanager/css/filemanager.css.php','chaine',0,NULL,'2013-01-02 20:33:20'),(2315,'MAIN_MODULE_FICHEINTER',1,'1',NULL,0,NULL,'2013-01-02 20:33:21'),(2321,'MAIN_MODULE_HOLIDAY',1,'1',NULL,0,NULL,'2013-01-02 20:33:24'),(2322,'MAIN_MODULE_HOLIDAY_TABS_0',1,'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->write:/holiday/index.php?mainmenu=holiday&id=__ID__','chaine',0,NULL,'2013-01-02 20:33:24'),(2786,'MAIN_SOAP_DEBUG',1,'1','chaine',1,'','2013-01-13 12:37:21'),(2835,'MAIN_USE_CONNECT_TIMEOUT',1,'10','chaine',0,'','2013-01-16 19:28:50'),(2836,'MAIN_USE_RESPONSE_TIMEOUT',1,'30','chaine',0,'','2013-01-16 19:28:50'),(2837,'MAIN_PROXY_USE',1,'0','chaine',0,'','2013-01-16 19:28:50'),(2838,'MAIN_PROXY_HOST',1,'localhost','chaine',0,'','2013-01-16 19:28:50'),(2839,'MAIN_PROXY_PORT',1,'8080','chaine',0,'','2013-01-16 19:28:50'),(2840,'MAIN_PROXY_USER',1,'aaa','chaine',0,'','2013-01-16 19:28:50'),(2841,'MAIN_PROXY_PASS',1,'bbb','chaine',0,'','2013-01-16 19:28:50'),(2848,'OVHSMS_NICK',1,'BN196-OVH','chaine',0,'','2013-01-16 19:32:36'),(2849,'OVHSMS_PASS',1,'bigone-10','chaine',0,'','2013-01-16 19:32:36'),(2850,'OVHSMS_SOAPURL',1,'https://www.ovh.com/soapi/soapi-re-1.55.wsdl','chaine',0,'','2013-01-16 19:32:36'),(2854,'THEME_ELDY_RGB',1,'bfbf00','chaine',0,'','2013-01-18 10:02:53'),(2855,'THEME_ELDY_ENABLE_PERSONALIZED',1,'0','chaine',0,'','2013-01-18 10:02:55'),(2858,'MAIN_SESSION_TIMEOUT',1,'2000','chaine',0,'','2013-01-19 17:01:53'),(2862,'TICKET_ADDON',1,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2013-01-19 17:16:10'),(2866,'MAIN_MODULE_PRODUCT',1,'1',NULL,0,NULL,'2013-01-19 17:16:10'),(2867,'FACSIM_ADDON',1,'mod_facsim_alcoy','chaine',0,'','2013-01-19 17:16:25'),(2868,'POS_SERVICES',1,'0','chaine',0,'','2013-01-19 17:16:51'),(2869,'POS_USE_TICKETS',1,'1','chaine',0,'','2013-01-19 17:16:51'),(2870,'POS_MAX_TTC',1,'100','chaine',0,'','2013-01-19 17:16:51'),(3190,'MAIN_MODULE_HOLIDAY',2,'1',NULL,0,NULL,'2013-02-01 08:52:34'),(3191,'MAIN_MODULE_HOLIDAY_TABS_0',2,'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->write:/holiday/index.php?mainmenu=holiday&id=__ID__','chaine',0,NULL,'2013-02-01 08:52:34'),(3195,'INVOICE_SUPPLIER_ADDON_PDF',1,'canelle','chaine',0,'','2013-02-10 19:50:27'),(3199,'MAIN_FORCE_RELOAD_PAGE',1,'1','chaine',0,NULL,'2013-02-12 16:22:55'),(3217,'MAIN_PDF_TITLE_BACKGROUND_COLOR',1,'240,240,240','chaine',1,'','2013-02-13 15:18:02'),(3223,'OVH_THIRDPARTY_IMPORT',1,'2','chaine',0,'','2013-02-13 16:20:18'),(3241,'COMPANY_USE_SEARCH_TO_SELECT',1,'2','chaine',0,'','2013-02-17 14:33:39'),(3409,'AGENDA_USE_EVENT_TYPE',1,'1','chaine',0,'','2013-02-27 18:12:24'),(3886,'MAIN_REMOVE_INSTALL_WARNING',1,'1','chaine',1,'','2013-03-02 18:32:50'),(4013,'MAIN_DELAY_ACTIONS_TODO',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4014,'MAIN_DELAY_PROPALS_TO_CLOSE',1,'31','chaine',0,'','2013-03-06 08:59:12'),(4015,'MAIN_DELAY_PROPALS_TO_BILL',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4016,'MAIN_DELAY_ORDERS_TO_PROCESS',1,'2','chaine',0,'','2013-03-06 08:59:12'),(4017,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',1,'31','chaine',0,'','2013-03-06 08:59:12'),(4018,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4019,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',1,'2','chaine',0,'','2013-03-06 08:59:12'),(4020,'MAIN_DELAY_RUNNING_SERVICES',1,'-15','chaine',0,'','2013-03-06 08:59:12'),(4021,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',1,'62','chaine',0,'','2013-03-06 08:59:13'),(4022,'MAIN_DELAY_MEMBERS',1,'31','chaine',0,'','2013-03-06 08:59:13'),(4023,'MAIN_DISABLE_METEO',1,'0','chaine',0,'','2013-03-06 08:59:13'),(4044,'ADHERENT_VAT_FOR_SUBSCRIPTIONS',1,'0','',0,'','2013-03-06 16:06:38'),(4047,'ADHERENT_BANK_USE',1,'bankviainvoice','',0,'','2013-03-06 16:12:30'),(4049,'PHPSANE_SCANIMAGE',1,'/usr/bin/scanimage','chaine',0,'','2013-03-06 21:54:13'),(4050,'PHPSANE_PNMTOJPEG',1,'/usr/bin/pnmtojpeg','chaine',0,'','2013-03-06 21:54:13'),(4051,'PHPSANE_PNMTOTIFF',1,'/usr/bin/pnmtotiff','chaine',0,'','2013-03-06 21:54:13'),(4052,'PHPSANE_OCR',1,'/usr/bin/gocr','chaine',0,'','2013-03-06 21:54:13'),(4548,'ECM_AUTO_TREE_ENABLED',1,'1','chaine',0,'','2013-03-10 15:57:21'),(4555,'WEBSERVICES_KEY',1,'dolibarrkey','chaine',0,'','2013-03-13 10:19:31'),(4579,'MAIN_MODULE_AGENDA',2,'1',NULL,0,NULL,'2013-03-13 15:29:19'),(4580,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4581,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4582,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4583,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4584,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4585,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4586,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4587,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4588,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4589,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4590,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4591,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4592,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4593,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4594,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4595,'MAIN_MODULE_GOOGLE',2,'1',NULL,0,NULL,'2013-03-13 15:29:47'),(4596,'MAIN_MODULE_GOOGLE_TABS_0',2,'agenda:+gcal:MenuAgendaGoogle:google@google:$conf->google->enabled && $conf->global->GOOGLE_ENABLE_AGENDA:/google/index.php','chaine',0,NULL,'2013-03-13 15:29:47'),(4597,'MAIN_MODULE_GOOGLE_TABS_1',2,'user:+gsetup:GoogleUserConf:google@google:$conf->google->enabled && $conf->global->GOOGLE_DUPLICATE_INTO_GCAL:/google/admin/google_calsync_user.php?id=__ID__','chaine',0,NULL,'2013-03-13 15:29:47'),(4598,'MAIN_MODULE_GOOGLE_TRIGGERS',2,'1','chaine',0,NULL,'2013-03-13 15:29:47'),(4599,'MAIN_MODULE_GOOGLE_HOOKS',2,'[\"toprightmenu\"]','chaine',0,NULL,'2013-03-13 15:29:47'),(4688,'GOOGLE_ENABLE_AGENDA',2,'1','chaine',0,'','2013-03-13 15:36:29'),(4689,'GOOGLE_AGENDA_NAME1',2,'eldy','chaine',0,'','2013-03-13 15:36:29'),(4690,'GOOGLE_AGENDA_SRC1',2,'eldy10@mail.com','chaine',0,'','2013-03-13 15:36:29'),(4691,'GOOGLE_AGENDA_COLOR1',2,'BE6D00','chaine',0,'','2013-03-13 15:36:29'),(4692,'GOOGLE_AGENDA_COLOR2',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4693,'GOOGLE_AGENDA_COLOR3',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4694,'GOOGLE_AGENDA_COLOR4',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4695,'GOOGLE_AGENDA_COLOR5',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4696,'GOOGLE_AGENDA_TIMEZONE',2,'Europe/Paris','chaine',0,'','2013-03-13 15:36:29'),(4697,'GOOGLE_AGENDA_NB',2,'5','chaine',0,'','2013-03-13 15:36:29'),(4702,'MAIN_FEATURES_LEVEL',0,'1','chaine',1,'Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development','2013-03-13 18:41:52'),(4711,'GOOGLE_ENABLE_AGENDA',1,'1','chaine',0,'','2013-03-13 19:37:38'),(4712,'GOOGLE_AGENDA_NAME1',1,'asso master','chaine',0,'','2013-03-13 19:37:38'),(4713,'GOOGLE_AGENDA_SRC1',1,'assodolibarr@mail.com','chaine',0,'','2013-03-13 19:37:38'),(4714,'GOOGLE_AGENDA_COLOR1',1,'1B887A','chaine',0,'','2013-03-13 19:37:38'),(4715,'GOOGLE_AGENDA_COLOR2',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4716,'GOOGLE_AGENDA_COLOR3',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4717,'GOOGLE_AGENDA_COLOR4',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4718,'GOOGLE_AGENDA_COLOR5',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4719,'GOOGLE_AGENDA_TIMEZONE',1,'Europe/Paris','chaine',0,'','2013-03-13 19:37:38'),(4720,'GOOGLE_AGENDA_NB',1,'5','chaine',0,'','2013-03-13 19:37:38'),(4725,'SOCIETE_CODECLIENT_ADDON',2,'mod_codeclient_leopard','chaine',0,'Module to control third parties codes','2013-03-13 20:21:35'),(4726,'SOCIETE_CODECOMPTA_ADDON',2,'mod_codecompta_panicum','chaine',0,'Module to control third parties codes','2013-03-13 20:21:35'),(4727,'SOCIETE_FISCAL_MONTH_START',2,'','chaine',0,'Mettre le numero du mois du debut d\\\'annee fiscale, ex: 9 pour septembre','2013-03-13 20:21:35'),(4728,'MAIN_SEARCHFORM_SOCIETE',2,'1','yesno',0,'Show form for quick company search','2013-03-13 20:21:35'),(4729,'MAIN_SEARCHFORM_CONTACT',2,'1','yesno',0,'Show form for quick contact search','2013-03-13 20:21:35'),(4730,'COMPANY_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2013-03-13 20:21:35'),(4743,'MAIN_MODULE_CLICKTODIAL',2,'1',NULL,0,NULL,'2013-03-13 20:30:28'),(4744,'MAIN_MODULE_NOTIFICATION',2,'1',NULL,0,NULL,'2013-03-13 20:30:34'),(4745,'MAIN_MODULE_WEBSERVICES',2,'1',NULL,0,NULL,'2013-03-13 20:30:41'),(4746,'MAIN_MODULE_PROPALE',2,'1',NULL,0,NULL,'2013-03-13 20:32:38'),(4747,'PROPALE_ADDON_PDF',2,'azur','chaine',0,'Nom du gestionnaire de generation des propales en PDF','2013-03-13 20:32:38'),(4748,'PROPALE_ADDON',2,'mod_propale_marbre','chaine',0,'Nom du gestionnaire de numerotation des propales','2013-03-13 20:32:38'),(4749,'PROPALE_VALIDITY_DURATION',2,'15','chaine',0,'Duration of validity of business proposals','2013-03-13 20:32:38'),(4750,'PROPALE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2013-03-13 20:32:38'),(4752,'MAIN_MODULE_TAX',2,'1',NULL,0,NULL,'2013-03-13 20:32:47'),(4753,'MAIN_MODULE_DON',2,'1',NULL,0,NULL,'2013-03-13 20:32:54'),(4754,'DON_ADDON_MODEL',2,'html_cerfafr','chaine',0,'Nom du gestionnaire de generation de recu de dons','2013-03-13 20:32:54'),(4755,'POS_USE_TICKETS',2,'1','chaine',0,'','2013-03-13 20:33:09'),(4756,'POS_MAX_TTC',2,'100','chaine',0,'','2013-03-13 20:33:09'),(4757,'MAIN_MODULE_POS',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4758,'TICKET_ADDON',2,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2013-03-13 20:33:09'),(4759,'MAIN_MODULE_BANQUE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4760,'MAIN_MODULE_FACTURE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4761,'FACTURE_ADDON_PDF',2,'crabe','chaine',0,'Name of PDF model of invoice','2013-03-13 20:33:09'),(4762,'FACTURE_ADDON',2,'mod_facture_terre','chaine',0,'Name of numbering numerotation rules of invoice','2013-03-13 20:33:09'),(4763,'FACTURE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2013-03-13 20:33:09'),(4764,'MAIN_MODULE_SOCIETE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4765,'MAIN_MODULE_PRODUCT',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4766,'PRODUCT_CODEPRODUCT_ADDON',2,'mod_codeproduct_leopard','chaine',0,'Module to control product codes','2013-03-13 20:33:09'),(4767,'MAIN_SEARCHFORM_PRODUITSERVICE',2,'1','yesno',0,'Show form for quick product search','2013-03-13 20:33:09'),(4772,'FACSIM_ADDON',2,'mod_facsim_alcoy','chaine',0,'','2013-03-13 20:33:32'),(4773,'MAIN_MODULE_MAILING',2,'1',NULL,0,NULL,'2013-03-13 20:33:37'),(4774,'MAIN_MODULE_OPENSURVEY',2,'1',NULL,0,NULL,'2013-03-13 20:33:42'),(4782,'AGENDA_USE_EVENT_TYPE',2,'1','chaine',0,'','2013-03-13 20:53:36'),(4884,'AGENDA_DISABLE_EXT',2,'1','chaine',0,'','2013-03-13 22:03:40'),(4919,'MAIN_MODULE_COMPTABILITE',1,'1',NULL,0,NULL,'2013-03-20 20:04:28'),(4922,'MAIN_MODULE_BANQUE',1,'1',NULL,0,NULL,'2013-03-20 20:04:28'),(4928,'COMMANDE_SUPPLIER_ADDON_NUMBER',1,'mod_commande_fournisseur_muguet','chaine',0,'Nom du gestionnaire de numerotation des commandes fournisseur','2013-03-22 09:24:29'),(4929,'INVOICE_SUPPLIER_ADDON_NUMBER',1,'mod_facture_fournisseur_cactus','chaine',0,'Nom du gestionnaire de numerotation des factures fournisseur','2013-03-22 09:24:29'),(4986,'MAIN_MODULE_CRON',1,'1',NULL,0,NULL,'2013-03-23 17:24:25'),(5001,'MAIN_CRON_KEY',0,'bc54582fe30d5d4a830c6f582ec28810','chaine',0,'','2013-03-23 17:54:53'),(5009,'CRON_KEY',0,'2c2e755c20be2014098f629865598006','chaine',0,'','2013-03-23 18:06:24'),(5075,'MAIN_MENU_STANDARD',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5076,'MAIN_MENU_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5077,'MAIN_MENUFRONT_STANDARD',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5078,'MAIN_MENUFRONT_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5079,'MAIN_MODULE_OPENSURVEY',1,'1',NULL,0,NULL,'2013-03-24 02:57:18'),(5083,'FCKEDITOR_ENABLE_USERSIGN',1,'1','chaine',1,'','2013-03-24 15:59:39'),(5102,'MAIN_INFO_SOCIETE_COUNTRY',1,'1:FR:France','chaine',0,'','2013-03-24 18:34:54'),(5103,'MAIN_INFO_SOCIETE_NOM',1,'MyBigCompany','chaine',0,'','2013-03-24 18:34:54'),(5104,'MAIN_INFO_SOCIETE_ADDRESS',1,'21 Jump street','chaine',0,'','2013-03-24 18:34:54'),(5105,'MAIN_INFO_SOCIETE_TOWN',1,'MyTown','chaine',0,'','2013-03-24 18:34:54'),(5106,'MAIN_INFO_SOCIETE_ZIP',1,'75500','chaine',0,'','2013-03-24 18:34:54'),(5107,'MAIN_INFO_SOCIETE_STATE',1,'0','chaine',0,'','2013-03-24 18:34:54'),(5108,'MAIN_MONNAIE',1,'EUR','chaine',0,'','2013-03-24 18:34:54'),(5109,'MAIN_INFO_SOCIETE_TEL',1,'09123123','chaine',0,'','2013-03-24 18:34:54'),(5110,'MAIN_INFO_SOCIETE_FAX',1,'09123124','chaine',0,'','2013-03-24 18:34:54'),(5111,'MAIN_INFO_SOCIETE_MAIL',1,'myemail@mybigcompany.com','chaine',0,'','2013-03-24 18:34:54'),(5112,'MAIN_INFO_SOCIETE_WEB',1,'http://www.dolibarr.org','chaine',0,'','2013-03-24 18:34:54'),(5113,'MAIN_INFO_SOCIETE_NOTE',1,'This is note about my company','chaine',0,'','2013-03-24 18:34:54'),(5114,'MAIN_INFO_CAPITAL',1,'10000','chaine',0,'','2013-03-24 18:34:54'),(5115,'MAIN_INFO_SOCIETE_FORME_JURIDIQUE',1,'0','chaine',0,'','2013-03-24 18:34:54'),(5116,'MAIN_INFO_TVAINTRA',1,'IN1234567','chaine',0,'','2013-03-24 18:34:54'),(5117,'SOCIETE_FISCAL_MONTH_START',1,'0','chaine',0,'','2013-03-24 18:34:54'),(5118,'FACTURE_TVAOPTION',1,'reel','chaine',0,'','2013-03-24 18:34:54'),(5119,'MAIN_LANG_DEFAULT',1,'en_US','chaine',0,'','2013-03-24 18:35:07'),(5120,'MAIN_MULTILANGS',1,'1','chaine',0,'','2013-03-24 18:35:07'),(5121,'MAIN_SIZE_LISTE_LIMIT',1,'25','chaine',0,'','2013-03-24 18:35:07'),(5122,'MAIN_DISABLE_JAVASCRIPT',1,'0','chaine',0,'','2013-03-24 18:35:07'),(5123,'MAIN_BUTTON_HIDE_UNAUTHORIZED',1,'0','chaine',0,'','2013-03-24 18:35:07'),(5124,'MAIN_START_WEEK',1,'1','chaine',0,'','2013-03-24 18:35:07'),(5125,'MAIN_SHOW_LOGO',1,'0','chaine',0,'','2013-03-24 18:35:07'),(5126,'MAIN_FIRSTNAME_NAME_POSITION',1,'0','chaine',0,'','2013-03-24 18:35:07'),(5127,'MAIN_THEME',1,'eldy','chaine',0,'','2013-03-24 18:35:07'),(5128,'MAIN_SEARCHFORM_CONTACT',1,'1','chaine',0,'','2013-03-24 18:35:07'),(5129,'MAIN_SEARCHFORM_SOCIETE',1,'1','chaine',0,'','2013-03-24 18:35:07'),(5130,'MAIN_SEARCHFORM_PRODUITSERVICE',1,'1','chaine',0,'','2013-03-24 18:35:07'),(5131,'MAIN_SEARCHFORM_ADHERENT',1,'1','chaine',0,'','2013-03-24 18:35:07'),(5132,'MAIN_HELPCENTER_DISABLELINK',0,'1','chaine',0,'','2013-03-24 18:35:07'),(5133,'MAIN_HOME',1,'__(NoteSomeFeaturesAreDisabled)__
\r\n
\r\n__(SomeTranslationAreUncomplete)__
','chaine',0,'','2013-03-24 18:35:07'),(5134,'MAIN_HELP_DISABLELINK',0,'0','chaine',0,'','2013-03-24 18:35:07'),(5135,'MAIN_BUGTRACK_ENABLELINK',1,'0','chaine',0,'','2013-03-24 18:35:07'),(5137,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',1,'1','chaine',0,NULL,'2013-09-08 23:06:08'),(5139,'SOCIETE_ADD_REF_IN_LIST',1,'','yesno',0,'Display customer ref into select list','2013-09-08 23:06:08'),(5150,'PROJECT_TASK_ADDON_PDF',1,'','chaine',0,'Name of PDF/ODT tasks manager class','2013-09-08 23:06:14'),(5151,'PROJECT_TASK_ADDON',1,'mod_task_simple','chaine',0,'Name of Numbering Rule task manager class','2013-09-08 23:06:14'),(5152,'PROJECT_TASK_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/tasks','chaine',0,'','2013-09-08 23:06:14'),(5164,'MAIN_AGENDA_ACTIONAUTO_COMPANY_SENTBYMAIL',1,'1','chaine',0,NULL,'2013-11-06 23:35:12'),(5190,'MAIN_MODULE_GOOGLE',1,'1',NULL,0,NULL,'2013-11-07 00:01:39'),(5191,'MAIN_MODULE_GOOGLE_TABS_0',1,'agenda:+gcal:MenuAgendaGoogle:google@google:$conf->google->enabled && $conf->global->GOOGLE_ENABLE_AGENDA:/google/index.php','chaine',0,NULL,'2013-11-07 00:01:39'),(5192,'MAIN_MODULE_GOOGLE_TABS_1',1,'user:+gsetup:GoogleUserConf:google@google:$conf->google->enabled && $conf->global->GOOGLE_DUPLICATE_INTO_GCAL:/google/admin/google_calsync_user.php?id=__ID__','chaine',0,NULL,'2013-11-07 00:01:39'),(5193,'MAIN_MODULE_GOOGLE_TRIGGERS',1,'1','chaine',0,NULL,'2013-11-07 00:01:39'),(5194,'MAIN_MODULE_GOOGLE_HOOKS',1,'[\"toprightmenu\"]','chaine',0,NULL,'2013-11-07 00:01:39'),(5195,'GOOGLE_DUPLICATE_INTO_THIRDPARTIES',1,'1','chaine',0,'','2013-11-07 00:02:34'),(5196,'GOOGLE_DUPLICATE_INTO_CONTACTS',1,'0','chaine',0,'','2013-11-07 00:02:34'),(5197,'GOOGLE_DUPLICATE_INTO_MEMBERS',1,'0','chaine',0,'','2013-11-07 00:02:34'),(5198,'GOOGLE_CONTACT_LOGIN',1,'eldy10@mail.com','chaine',0,'','2013-11-07 00:02:34'),(5199,'GOOGLE_CONTACT_PASSWORD',1,'ld101010-ge','chaine',0,'','2013-11-07 00:02:34'),(5200,'GOOGLE_TAG_PREFIX',1,'Dolibarr (Thirdparties)','chaine',0,'','2013-11-07 00:02:34'),(5201,'GOOGLE_TAG_PREFIX_CONTACTS',1,'Dolibarr (Contacts/Addresses)','chaine',0,'','2013-11-07 00:02:34'),(5202,'GOOGLE_TAG_PREFIX_MEMBERS',1,'Dolibarr (Members)','chaine',0,'','2013-11-07 00:02:34'),(5203,'MODULE_GOOGLE_DEBUG',1,'1','chaine',1,'','2013-11-07 00:16:31'),(5221,'MAIN_MODULE_AGENDA',1,'1',NULL,0,NULL,'2014-04-05 14:19:21'),(5222,'MAIN_MODULE_SOCIETE',1,'1',NULL,0,NULL,'2014-04-05 14:19:21'),(5223,'MAIN_MODULE_SERVICE',1,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5224,'MAIN_MODULE_COMMANDE',1,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5225,'MAIN_MODULE_FACTURE',1,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5226,'MAIN_MODULE_FOURNISSEUR',1,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5227,'MAIN_MODULE_USER',0,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5228,'MAIN_MODULE_DEPLACEMENT',1,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5229,'MAIN_MODULE_DON',1,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5230,'MAIN_MODULE_ECM',1,'1',NULL,0,NULL,'2014-04-05 14:19:22'),(5231,'MAIN_VERSION_LAST_UPGRADE',0,'3.5.2','chaine',0,'Dolibarr version for last upgrade','2014-04-05 14:19:24'),(5233,'MAIN_DISABLE_ALL_MAILS',1,'1','chaine',0,'','2014-04-05 14:20:25'),(5234,'MAIN_MAIL_SENDMODE',0,'mail','chaine',0,'','2014-04-05 14:20:25'),(5235,'MAIN_MAIL_SMTPS_ID',0,'eldy10@mail.com','chaine',0,'','2014-04-05 14:20:25'),(5236,'MAIN_MAIL_SMTPS_PW',0,'ld101010-ge','chaine',0,'','2014-04-05 14:20:25'); +/*!40000 ALTER TABLE `llx_const` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contrat` +-- + +DROP TABLE IF EXISTS `llx_contrat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contrat` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_contrat` datetime DEFAULT NULL, + `statut` smallint(6) DEFAULT '0', + `mise_en_service` datetime DEFAULT NULL, + `fin_validite` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_commercial_signature` int(11) NOT NULL, + `fk_commercial_suivi` int(11) NOT NULL, + `fk_user_author` int(11) NOT NULL DEFAULT '0', + `fk_user_mise_en_service` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_contrat_ref` (`ref`,`entity`), + KEY `idx_contrat_fk_soc` (`fk_soc`), + KEY `idx_contrat_fk_user_author` (`fk_user_author`), + CONSTRAINT `fk_contrat_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_contrat_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contrat` +-- + +LOCK TABLES `llx_contrat` WRITE; +/*!40000 ALTER TABLE `llx_contrat` DISABLE KEYS */; +INSERT INTO `llx_contrat` VALUES (1,'CONTRACT1',1,'2010-07-08 23:53:55','2010-07-09 01:53:25','2010-07-09 00:00:00',1,NULL,NULL,NULL,3,NULL,2,2,1,NULL,NULL,NULL,NULL,NULL,NULL),(2,'CONTRAT1',1,'2010-07-10 16:18:16','2010-07-10 18:13:37','2010-07-10 00:00:00',1,NULL,NULL,NULL,2,NULL,2,2,1,NULL,NULL,NULL,NULL,NULL,NULL),(3,'CT1303-0001',1,'2013-03-06 09:05:07','2013-03-06 10:04:57','2013-03-06 00:00:00',1,NULL,NULL,NULL,19,NULL,1,1,1,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_contrat` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contrat_extrafields` +-- + +DROP TABLE IF EXISTS `llx_contrat_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contrat_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contrat_extrafields` +-- + +LOCK TABLES `llx_contrat_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_contrat_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contrat_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet` +-- + +DROP TABLE IF EXISTS `llx_contratdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_contrat` int(11) NOT NULL, + `fk_product` int(11) DEFAULT NULL, + `statut` smallint(6) DEFAULT '0', + `label` text, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `date_commande` datetime DEFAULT NULL, + `date_ouverture_prevue` datetime DEFAULT NULL, + `date_ouverture` datetime DEFAULT NULL, + `date_fin_validite` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double NOT NULL, + `remise_percent` double DEFAULT '0', + `subprice` double(24,8) DEFAULT '0.00000000', + `price_ht` double DEFAULT NULL, + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '1', + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_user_author` int(11) NOT NULL DEFAULT '0', + `fk_user_ouverture` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `commentaire` text, + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_fk_contrat` (`fk_contrat`), + KEY `idx_contratdet_fk_product` (`fk_product`), + KEY `idx_contratdet_date_ouverture_prevue` (`date_ouverture_prevue`), + KEY `idx_contratdet_date_ouverture` (`date_ouverture`), + KEY `idx_contratdet_date_fin_validite` (`date_fin_validite`), + CONSTRAINT `fk_contratdet_fk_contrat` FOREIGN KEY (`fk_contrat`) REFERENCES `llx_contrat` (`rowid`), + CONSTRAINT `fk_contratdet_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet` +-- + +LOCK TABLES `llx_contratdet` WRITE; +/*!40000 ALTER TABLE `llx_contratdet` DISABLE KEYS */; +INSERT INTO `llx_contratdet` VALUES (1,'2013-03-06 09:00:00',1,3,4,'','',NULL,NULL,'2010-07-09 00:00:00','2010-07-09 12:00:00','2013-03-15 00:00:00',NULL,0.000,0.000,'',0.000,'',1,0,0.00000000,0,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,0,0,0.00000000,0,1,1,''),(2,'2010-07-10 16:14:14',2,NULL,0,'','Abonnement annuel assurance',NULL,NULL,'2010-07-10 00:00:00',NULL,'2011-07-10 00:00:00',NULL,1.000,0.000,'',0.000,'',1,0,10.00000000,10,0,10.00000000,0.10000000,0.00000000,0.00000000,10.10000000,1,0,NULL,0.00000000,0,NULL,NULL,NULL),(3,'2013-03-05 10:20:58',2,3,5,'','gdfg',NULL,NULL,'2010-07-10 00:00:00','2010-07-10 12:00:00','2011-07-09 00:00:00','2013-03-06 12:00:00',4.000,0.000,'',0.000,'',1,0,0.00000000,0,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,0,0,0.00000000,0,1,1,''),(4,'2012-12-08 13:11:17',2,3,0,'','',NULL,NULL,'2010-07-10 00:00:00',NULL,NULL,NULL,0.000,0.000,'',0.000,'',1,10,40.00000000,40,NULL,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,0,NULL,0.00000000,0,NULL,1,''),(5,'2013-03-06 09:05:40',3,NULL,4,'','gfdg',NULL,NULL,NULL,'2013-03-06 12:00:00','2013-03-07 12:00:00',NULL,0.000,0.000,'',0.000,'',1,0,10.00000000,10,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,0,0,0.00000000,0,1,1,''); +/*!40000 ALTER TABLE `llx_contratdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet_log` +-- + +DROP TABLE IF EXISTS `llx_contratdet_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_contratdet` int(11) NOT NULL, + `date` datetime NOT NULL, + `statut` smallint(6) NOT NULL, + `fk_user_author` int(11) NOT NULL, + `commentaire` text, + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_log_fk_contratdet` (`fk_contratdet`), + KEY `idx_contratdet_log_date` (`date`), + CONSTRAINT `fk_contratdet_log_fk_contratdet` FOREIGN KEY (`fk_contratdet`) REFERENCES `llx_contratdet` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet_log` +-- + +LOCK TABLES `llx_contratdet_log` WRITE; +/*!40000 ALTER TABLE `llx_contratdet_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contratdet_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_cotisation` +-- + +DROP TABLE IF EXISTS `llx_cotisation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_cotisation` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `dateadh` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `cotisation` double DEFAULT NULL, + `fk_bank` int(11) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_cotisation` (`fk_adherent`,`dateadh`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_cotisation` +-- + +LOCK TABLES `llx_cotisation` WRITE; +/*!40000 ALTER TABLE `llx_cotisation` DISABLE KEYS */; +INSERT INTO `llx_cotisation` VALUES (1,'2010-07-10 13:05:30','2010-07-10 15:05:30',2,'2010-07-10 00:00:00','2011-07-10',20,NULL,'Adhésion/cotisation 2010'),(2,'2010-07-11 14:20:00','2010-07-11 16:20:00',2,'2011-07-11 00:00:00','2012-07-10',10,NULL,'Adhésion/cotisation 2011'),(3,'2010-07-18 10:20:33','2010-07-18 12:20:33',2,'2012-07-11 00:00:00','2013-07-17',10,NULL,'Adhésion/cotisation 2012'),(4,'2013-03-06 15:43:37','2013-03-06 16:43:37',2,'2013-07-18 00:00:00','2014-07-17',10,NULL,'Adhésion/cotisation 2013'),(5,'2013-03-06 15:44:12','2013-03-06 16:44:12',2,'2014-07-18 00:00:00','2015-07-17',11,NULL,'Adhésion/cotisation 2014'),(6,'2013-03-06 15:47:48','2013-03-06 16:47:48',2,'2015-07-18 00:00:00','2016-07-17',10,NULL,'Adhésion/cotisation 2015'),(7,'2013-03-06 15:48:16','2013-03-06 16:48:16',2,'2016-07-18 00:00:00','2017-07-17',20,22,'Adhésion/cotisation 2016'),(8,'2013-03-20 13:17:57','2013-03-20 14:17:57',1,'2010-07-10 00:00:00','2011-07-09',10,NULL,'Adhésion/cotisation 2010'),(10,'2013-03-20 13:30:11','2013-03-20 14:30:11',1,'2011-07-10 00:00:00','2012-07-09',10,23,'Adhésion/cotisation 2011'); +/*!40000 ALTER TABLE `llx_cotisation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_cronjob` +-- + +DROP TABLE IF EXISTS `llx_cronjob`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_cronjob` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `jobtype` varchar(10) NOT NULL, + `label` text NOT NULL, + `command` varchar(255) DEFAULT NULL, + `classesname` varchar(255) DEFAULT NULL, + `objectname` varchar(255) DEFAULT NULL, + `methodename` varchar(255) DEFAULT NULL, + `params` text NOT NULL, + `md5params` varchar(32) DEFAULT NULL, + `module_name` varchar(255) DEFAULT NULL, + `priority` int(11) DEFAULT '0', + `datelastrun` datetime DEFAULT NULL, + `datenextrun` datetime DEFAULT NULL, + `datestart` datetime DEFAULT NULL, + `dateend` datetime DEFAULT NULL, + `datelastresult` datetime DEFAULT NULL, + `lastresult` text, + `lastoutput` text, + `unitfrequency` int(11) NOT NULL DEFAULT '0', + `frequency` int(11) NOT NULL DEFAULT '0', + `nbrun` int(11) DEFAULT NULL, + `status` int(11) NOT NULL DEFAULT '1', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `note` text, + `libname` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_cronjob` +-- + +LOCK TABLES `llx_cronjob` WRITE; +/*!40000 ALTER TABLE `llx_cronjob` DISABLE KEYS */; +INSERT INTO `llx_cronjob` VALUES (1,'2013-03-23 18:18:39','2013-03-23 19:18:39','command','aaa','aaaa','','','','','','',0,NULL,NULL,'2013-03-23 19:18:00',NULL,NULL,NULL,NULL,3600,3600,0,0,1,1,'',NULL); +/*!40000 ALTER TABLE `llx_cronjob` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_deplacement` +-- + +DROP TABLE IF EXISTS `llx_deplacement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_deplacement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dated` datetime DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `type` varchar(12) NOT NULL, + `fk_statut` int(11) NOT NULL DEFAULT '1', + `km` double DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT '0', + `note_private` text, + `note_public` text, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_deplacement` +-- + +LOCK TABLES `llx_deplacement` WRITE; +/*!40000 ALTER TABLE `llx_deplacement` DISABLE KEYS */; +INSERT INTO `llx_deplacement` VALUES (1,NULL,1,'2010-07-09 01:58:04','2010-07-08 23:58:18','2010-07-09 12:00:00',2,1,NULL,'TF_LUNCH',1,10,2,1,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_deplacement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_document_generator` +-- + +DROP TABLE IF EXISTS `llx_document_generator`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_document_generator` ( + `rowid` int(10) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `classfile` varchar(255) NOT NULL, + `class` varchar(255) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_document_generator` +-- + +LOCK TABLES `llx_document_generator` WRITE; +/*!40000 ALTER TABLE `llx_document_generator` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_document_generator` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_document_model` +-- + +DROP TABLE IF EXISTS `llx_document_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_document_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `type` varchar(20) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `description` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_document_model` (`nom`,`type`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=242 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_document_model` +-- + +LOCK TABLES `llx_document_model` WRITE; +/*!40000 ALTER TABLE `llx_document_model` DISABLE KEYS */; +INSERT INTO `llx_document_model` VALUES (9,'merou',1,'shipping',NULL,NULL),(15,'fsfe.fr.php',1,'donation',NULL,NULL),(21,'baleine',1,'project',NULL,NULL),(174,'azur',1,'propal',NULL,NULL),(175,'rouget',1,'shipping',NULL,NULL),(176,'typhon',1,'delivery',NULL,NULL),(178,'soleil',1,'ficheinter',NULL,NULL),(181,'generic_invoice_odt',1,'invoice','ODT templates','FACTURE_ADDON_PDF_ODT_PATH'),(193,'canelle2',1,'invoice_supplier','canelle2',NULL),(195,'canelle',1,'invoice_supplier','canelle',NULL),(198,'azur',2,'propal',NULL,NULL),(199,'html_cerfafr',2,'donation',NULL,NULL),(200,'crabe',2,'invoice',NULL,NULL),(201,'generic_odt',1,'company','ODT templates','COMPANY_ADDON_PDF_ODT_PATH'),(220,'einstein',1,'order',NULL,NULL),(221,'crabe',1,'invoice',NULL,NULL),(222,'muscadet',1,'order_supplier',NULL,NULL),(223,'html_cerfafr',1,'donation',NULL,NULL); +/*!40000 ALTER TABLE `llx_document_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_dolicloud_emailstemplates` +-- + +DROP TABLE IF EXISTS `llx_dolicloud_emailstemplates`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_dolicloud_emailstemplates` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `emailtype` varchar(128) NOT NULL, + `lang` varchar(12) NOT NULL, + `topic` varchar(256) NOT NULL, + `content` text NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_dolicloud_emailstemplates` (`emailtype`,`lang`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_dolicloud_emailstemplates` +-- + +LOCK TABLES `llx_dolicloud_emailstemplates` WRITE; +/*!40000 ALTER TABLE `llx_dolicloud_emailstemplates` DISABLE KEYS */; +INSERT INTO `llx_dolicloud_emailstemplates` VALUES (1,'PasswordAssistance','en_US','DoliCloud (online Dolibarr ERP & CRM) - Password assistance: how to reset your password','\n

Dear ${person.firstName},

\n

\n To continue the password reset process for the account ${person.email}\n click on the link below.
\n

\n

${resetPasswordLink}

\n

Note that this process is to reset the password for your dashboard, not for your application login. You may find more information on all different user/password reset process onto the following page.\n

\n

If clicking doesn\'t seem to work, you can copy and paste the link into your browser\'s\n address window, or retype it there. Once you have returned to our site, we will give instructions for resetting your password.

\n

If you did not request to have your password reset you can safely ignore this email.\n It is likely another user entered your email address by mistake while trying to reset a password. Rest assured your customer account is safe.

\n

We will never e-mail you and ask you to disclose or verify your password, credit card, or banking account number. \n If you receive a suspicious e-mail with a link to update your account information,\n do not click on the link - instead, report the e-mail to us for investigation.

\n

\n Sincerly,
\n The DoliCloud Team
\n -----------------------------------------
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n

\n '),(2,'InstanceDeployed','en_US','Welcome to DoliCloud (online Dolibarr ERP & CRM) - Your instance is ready',' \n

Hello ${person.firstName},

\n

\n We are delighted to welcome you as a user of DoliCloud, the Ondemand service of Dolibarr ERP & CRM.\n

\n

\n Your ${appPackage.name} is installed, setup and ready for you.\n Here are the details you need to get started:\n

\n
Your Dolibarr ERP & CRM :\n
    \n
  • URL: ${appInstance.url}
  • \n
  • Login: ${appPackage.defaultUser}
  • \n
  • Password: ${appInstance.defaultPassword}
  • \n
\n
Your Dolicloud dashboard :\n \n \n
\n Sincerly,
\n The DoliCloud Team
\n -----------------------------------------
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n \n '),(3,'InvoiceFailure','en_US','DoliCloud (online Dolibarr ERP & CRM) - Invoice Payment Failure',' \n

Dear DoliCloud Customer,

\n

\n An attempt to take payment for invoice(s) owed has failed. Please update your payment method, or contact your bank or payment method provider.
\n Should failure to take this payment continue, access to our service will be discontinued, and any data you have with us maybe lost.
\n
\nPlease login to your Dolicloud dashboard to update and fix your credit card or paypal information as soon as possible to prevent any interuptions in service.
\nRemind: Your DoliCloud dashboard login is ${person.email}
\n

\n

\n The error we received from your bank was:
\n ${invoice.notes.collect{ it }.join(\' \')}\n


\n\n Sincerly,
\n The DoliCloud Team
\n -----------------------------------------
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n \n '),(4,'CustomerInstanceClosed','en_US','DoliCloud (online Dolibarr ERP & CRM) - Account Closure',' \n

Dear Customer,

\n

\n We wish to inform you your account has now been closed. We are sorry to see you got, but thank you for your custom.\n We hope you will a customer of ours in the future.
\nIf you think this is an error, please contact us at support@dolicloud.com\n


\n Sincerly,
\n The DoliCloud Team
\n -----------------------------------------
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n \n '),(5,'CustomerInstanceClosureRequested','en_US','DoliCloud (online Dolibarr ERP & CRM) - Customer Account Closure Requested Confirmation','

Dear Customer,

We are sorry to see you go, and appreciate the custom you have given us.

The closure of your account will be executed at the end of your current trialing or billing period (${customerAccount.nextBillingDate.format(\'dd MMM yyyy\')}). Once the closure is complete your instance and its related data will be destroyed and unretrievable.
If you change your mind before that date you can halt the closure process, and continue being our customer. For this, go to your Dolicloud dashboard.
Remind: Your DoliCloud dashboard login is ${person.email}


Sincerly,
The DoliCloud Team
-----------------------------------------
EMail: support@dolicloud.com
Web: http://www.dolicloud.com '),(6,'CreditCardExpiring','en_US','DoliCloud (online Dolibarr ERP & CRM) - Urgent: Your credit card is expiring',' \n

Dear Customer,

\n

\n We wish to inform you that your payment method will soon expire.
\n \n Please login to your Dolicloud dashboard to update your credit card information as soon as possible to prevent any interuptions in service.
\nRemind: Your DoliCloud dashboard login is ${person.email}
\n

\n

If you have any questions relating to the above please do not hesitate get in touch.

\n
\n\n Sincerly,
\n The DoliCloud Team
\n -----------------------------------------
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n \n '),(7,'GentleTrialExpiringReminder','en_US','DoliCloud (online Dolibarr ERP & CRM) - Your Trial will soon expire',' \n

Hello ${person.firstName},

\n

\n Just a quick reminder that trial of your online Dolibarr ERP & CRM will expire soon. If you wish to continue using this service, please login to your DoliCloud console to add a payment method (credit card or paypal accepted).\n

\n

\nFor this, click to go on your DoliCloud dashboard: https://www.on.dolicloud.com/
\nRemind: Your DoliCloud dashboard login is ${person.email}
\n

\n
\n Sincerly,
\n The DoliCloud Team
\n -----------------------------------------
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n \n '),(8,'ChannelPartnerCreated','en_US','Channel Partner Created',' \n

Hello ${person.firstName},

\n

\n We are delighted to welcome you as a Channel Partner of ${appProvider.name}.\n

\n

\n Your account has been setup for you.\n Here are the details you need to get started:\n

\n
    \n
  • Login link: ${serverURL}
  • \n
  • Username: ${person.email}
  • \n
  • Temporary Password: ${person.tmpPassword}
  • \n
\n

\n Sincerly,
\n The ${appProvider.name} Team\n

\n \n '),(9,'CustomerAccountSuspended','en_US','DoliCloud (online Dolibarr ERP & CRM) - Account Suspension','\n

Dear Customer,

\n

We wish to inform you your account has been suspended. This is likely due to a payment problem. If you wish to engage with us in addressing this send an email to support@dolicloud.com


\n Sincerly,
\n The DoliCloud Team
\n ==========================================
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n \n '),(10,'CustomerInstanceUpdated','en_US','DoliCloud (online Dolibarr ERP & CRM) - Instance upgrade','\n

Dear Customer,

\n

We wish to inform you your instance has been upgraded to last stable version. If you experience problem after this upgrade, you can contact us at support@dolicloud.com


\n Sincerly,
\n The DoliCloud Team
\n ==========================================
\n EMail: support@dolicloud.com
\n Web: http://www.dolicloud.com\n \n '); +/*!40000 ALTER TABLE `llx_dolicloud_emailstemplates` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_domain` +-- + +DROP TABLE IF EXISTS `llx_domain`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_domain` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_domain` +-- + +LOCK TABLES `llx_domain` WRITE; +/*!40000 ALTER TABLE `llx_domain` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_domain` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_don` +-- + +DROP TABLE IF EXISTS `llx_don`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_don` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `datec` datetime DEFAULT NULL, + `datedon` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_paiement` int(11) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `societe` varchar(50) DEFAULT NULL, + `address` text, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `country` varchar(50) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `phone` varchar(24) DEFAULT NULL, + `phone_mobile` varchar(24) DEFAULT NULL, + `public` smallint(6) NOT NULL DEFAULT '1', + `fk_don_projet` int(11) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_don` +-- + +LOCK TABLES `llx_don` WRITE; +/*!40000 ALTER TABLE `llx_don` DISABLE KEYS */; +INSERT INTO `llx_don` VALUES (1,NULL,1,'2010-07-08 23:57:17',1,'2010-07-09 01:55:33','2010-07-09 12:00:00',10,1,'Donator','','Guest company','','','','France','',NULL,NULL,1,1,1,1,'',NULL,'html_cerfafr',NULL); +/*!40000 ALTER TABLE `llx_don` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecm_directories` +-- + +DROP TABLE IF EXISTS `llx_ecm_directories`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecm_directories` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_parent` int(11) DEFAULT NULL, + `description` varchar(255) NOT NULL, + `cachenbofdoc` int(11) NOT NULL DEFAULT '0', + `fullpath` varchar(255) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_c` datetime DEFAULT NULL, + `date_m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_c` int(11) DEFAULT NULL, + `fk_user_m` int(11) DEFAULT NULL, + `acl` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_ecm_directories` (`label`,`fk_parent`,`entity`), + KEY `idx_ecm_directories_fk_user_c` (`fk_user_c`), + KEY `idx_ecm_directories_fk_user_m` (`fk_user_m`), + CONSTRAINT `fk_ecm_directories_fk_user_c` FOREIGN KEY (`fk_user_c`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_ecm_directories_fk_user_m` FOREIGN KEY (`fk_user_m`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecm_directories` +-- + +LOCK TABLES `llx_ecm_directories` WRITE; +/*!40000 ALTER TABLE `llx_ecm_directories` DISABLE KEYS */; +INSERT INTO `llx_ecm_directories` VALUES (1,'Répertoire_1',1,0,'',1,NULL,NULL,'2010-07-11 16:27:26','2010-07-11 14:27:44',1,NULL,NULL),(2,'dddd',1,0,'',3,NULL,NULL,'2013-02-20 19:11:05','2013-02-20 18:11:05',1,NULL,NULL),(3,'bbb',1,2,'',0,NULL,NULL,'2013-02-20 19:11:05','2013-02-20 18:11:06',1,NULL,NULL),(4,'aaa',1,2,'',1,NULL,NULL,'2013-02-20 19:11:05','2013-02-20 18:11:06',1,NULL,NULL),(5,'gggggg',1,0,'',2,NULL,NULL,'2013-02-20 19:11:05','2013-02-20 18:11:05',1,NULL,NULL),(6,'mmm',1,0,'',0,NULL,NULL,'2013-02-20 19:11:05','2013-02-20 18:11:05',1,NULL,NULL),(7,'aaa',1,0,'',1,NULL,NULL,'2013-02-20 19:11:05','2013-02-20 18:11:05',1,NULL,NULL); +/*!40000 ALTER TABLE `llx_ecm_directories` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecm_documents` +-- + +DROP TABLE IF EXISTS `llx_ecm_documents`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecm_documents` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `filename` varchar(255) NOT NULL, + `filesize` int(11) NOT NULL, + `filemime` varchar(32) NOT NULL, + `fullpath_dol` varchar(255) NOT NULL, + `fullpath_orig` varchar(255) NOT NULL, + `description` text, + `manualkeyword` text, + `fk_create` int(11) NOT NULL, + `fk_update` int(11) DEFAULT NULL, + `date_c` datetime NOT NULL, + `date_u` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_directory` int(11) DEFAULT NULL, + `fk_status` smallint(6) DEFAULT '0', + `private` smallint(6) DEFAULT '0', + `crc` varchar(32) NOT NULL DEFAULT '', + `cryptkey` varchar(50) NOT NULL DEFAULT '', + `cipher` varchar(50) NOT NULL DEFAULT 'twofish', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_ecm_documents` (`fullpath_dol`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecm_documents` +-- + +LOCK TABLES `llx_ecm_documents` WRITE; +/*!40000 ALTER TABLE `llx_ecm_documents` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_ecm_documents` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_contact` +-- + +DROP TABLE IF EXISTS `llx_element_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_contact` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datecreate` datetime DEFAULT NULL, + `statut` smallint(6) DEFAULT '5', + `element_id` int(11) NOT NULL, + `fk_c_type_contact` int(11) NOT NULL, + `fk_socpeople` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_contact_idx1` (`element_id`,`fk_c_type_contact`,`fk_socpeople`), + KEY `fk_element_contact_fk_c_type_contact` (`fk_c_type_contact`), + KEY `idx_element_contact_fk_socpeople` (`fk_socpeople`), + CONSTRAINT `fk_element_contact_fk_c_type_contact` FOREIGN KEY (`fk_c_type_contact`) REFERENCES `llx_c_type_contact` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_contact` +-- + +LOCK TABLES `llx_element_contact` WRITE; +/*!40000 ALTER TABLE `llx_element_contact` DISABLE KEYS */; +INSERT INTO `llx_element_contact` VALUES (1,'2010-07-09 00:49:43',4,1,160,1),(2,'2010-07-09 00:49:56',4,2,160,1),(3,'2010-07-09 00:50:19',4,3,160,1),(4,'2010-07-09 00:50:42',4,4,160,1),(5,'2010-07-09 01:52:36',4,1,120,1),(6,'2010-07-09 01:53:25',4,1,10,2),(7,'2010-07-09 01:53:25',4,1,11,2),(8,'2010-07-10 18:13:37',4,2,10,2),(9,'2010-07-10 18:13:37',4,2,11,2),(10,'2010-07-11 15:15:55',4,1,180,1),(11,'2010-07-11 16:22:36',4,5,160,1),(12,'2010-07-11 16:23:53',4,2,180,1),(13,'2013-01-23 15:04:27',4,19,200,5),(14,'2013-01-23 16:06:37',4,19,210,2),(15,'2013-01-23 16:12:43',4,19,220,2),(16,'2013-03-06 10:04:57',4,3,10,1),(17,'2013-03-06 10:04:57',4,3,11,1); +/*!40000 ALTER TABLE `llx_element_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_element` +-- + +DROP TABLE IF EXISTS `llx_element_element`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_element` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_source` int(11) NOT NULL, + `sourcetype` varchar(32) NOT NULL, + `fk_target` int(11) NOT NULL, + `targettype` varchar(32) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_element_idx1` (`fk_source`,`sourcetype`,`fk_target`,`targettype`), + KEY `idx_element_element_fk_target` (`fk_target`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_element` +-- + +LOCK TABLES `llx_element_element` WRITE; +/*!40000 ALTER TABLE `llx_element_element` DISABLE KEYS */; +INSERT INTO `llx_element_element` VALUES (7,1,'shipping',154,'facture'),(8,1,'shipping',155,'facture'),(9,1,'shipping',156,'facture'),(1,2,'contrat',2,'facture'),(2,2,'propal',1,'commande'),(11,2,'shipping',157,'facture'),(3,5,'commande',1,'shipping'),(6,5,'commande',153,'facture'),(10,7,'commande',2,'shipping'),(4,9,'propal',6,'commande'),(5,11,'propal',7,'commande'),(12,12,'propal',8,'commande'),(13,12,'propal',162,'facture'); +/*!40000 ALTER TABLE `llx_element_element` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_lock` +-- + +DROP TABLE IF EXISTS `llx_element_lock`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_lock` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_element` int(11) NOT NULL, + `elementtype` varchar(32) NOT NULL, + `datel` datetime DEFAULT NULL, + `datem` datetime DEFAULT NULL, + `sessionid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_lock` +-- + +LOCK TABLES `llx_element_lock` WRITE; +/*!40000 ALTER TABLE `llx_element_lock` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_element_lock` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_rang` +-- + +DROP TABLE IF EXISTS `llx_element_rang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_rang` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_parent` int(11) NOT NULL, + `parenttype` varchar(16) NOT NULL, + `fk_child` int(11) NOT NULL, + `childtype` varchar(16) NOT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_rang_idx1` (`fk_parent`,`parenttype`,`fk_child`,`childtype`), + KEY `idx_element_rang_fk_parent` (`fk_parent`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_rang` +-- + +LOCK TABLES `llx_element_rang` WRITE; +/*!40000 ALTER TABLE `llx_element_rang` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_element_rang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_tag` +-- + +DROP TABLE IF EXISTS `llx_element_tag`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_tag` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `lang` varchar(5) NOT NULL, + `tag` varchar(255) NOT NULL, + `fk_element` int(11) NOT NULL, + `element` varchar(64) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_element_tag` (`entity`,`lang`,`tag`,`fk_element`,`element`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_tag` +-- + +LOCK TABLES `llx_element_tag` WRITE; +/*!40000 ALTER TABLE `llx_element_tag` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_element_tag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_entity` +-- + +DROP TABLE IF EXISTS `llx_entity`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_entity` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) NOT NULL, + `description` text, + `datec` datetime DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `options` text, + `visible` tinyint(4) NOT NULL DEFAULT '1', + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + KEY `idx_entity_fk_user_creat` (`fk_user_creat`), + CONSTRAINT `fk_entity_fk_user_creat` FOREIGN KEY (`fk_user_creat`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_entity` +-- + +LOCK TABLES `llx_entity` WRITE; +/*!40000 ALTER TABLE `llx_entity` DISABLE KEYS */; +INSERT INTO `llx_entity` VALUES (1,'2012-12-08 14:07:29','Master entity','Master entity, can not be deleted','2012-12-08 15:07:29',1,NULL,1,1),(2,'2012-12-08 14:08:27','aaa','','2012-12-08 15:08:14',1,'{\"referent\":null,\"sharings\":{\"product\":null,\"societe\":null,\"category\":null}}',1,1),(3,'2012-12-08 14:08:26','bbb','','2012-12-08 15:08:20',1,'{\"referent\":null,\"sharings\":{\"product\":null,\"societe\":null,\"category\":null}}',1,1); +/*!40000 ALTER TABLE `llx_entity` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_entrepot` +-- + +DROP TABLE IF EXISTS `llx_entrepot`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_entrepot` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `description` text, + `lieu` varchar(64) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_departement` int(11) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `statut` tinyint(4) DEFAULT '1', + `valo_pmp` float(12,4) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_entrepot_label` (`label`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_entrepot` +-- + +LOCK TABLES `llx_entrepot` WRITE; +/*!40000 ALTER TABLE `llx_entrepot` DISABLE KEYS */; +INSERT INTO `llx_entrepot` VALUES (1,'2010-07-09 00:31:22','2010-07-08 22:40:36','WAREHOUSEHOUSTON',1,'Warehouse located at Houston','Warehouse houston','','','Houston',NULL,11,1,NULL,1,NULL),(2,'2010-07-09 00:41:03','2010-07-08 22:41:03','WAREHOUSEPARIS',1,'
','Warehouse Paris','','75000','Paris',NULL,1,1,NULL,1,NULL),(3,'2010-07-11 16:18:59','2010-07-11 14:18:59','Stock personnel Dupont',1,'Cet entrepôt représente le stock personnel de Alain Dupont','','','','',NULL,0,1,NULL,1,NULL),(4,'2013-01-23 17:52:27','2013-01-23 16:52:27','Stock personnel aaa',1,'Cet entrepôt représente le stock personnel de aaa','','','','',NULL,81,1,NULL,1,NULL),(5,'2013-01-23 17:52:37','2013-01-23 16:52:37','Stock personnel bbb',1,'Cet entrepôt représente le stock personnel de bbb','','','','',NULL,81,1,NULL,1,NULL),(6,'2013-02-16 20:22:40','2013-02-16 19:22:40','Stock personnel aaab',1,'Cet entrepôt représente le stock personnel de aaab','','','','',NULL,1,1,NULL,1,NULL),(7,'2013-02-16 20:48:15','2013-02-16 19:48:15','Stock personnel zzz',1,'Cet entrepôt représente le stock personnel de zzz','','','','',NULL,1,1,NULL,1,NULL),(8,'2013-02-16 20:50:07','2013-02-16 19:50:07','Stock personnel zzzg',1,'Cet entrepôt représente le stock personnel de zzzg','','','','',NULL,1,1,NULL,1,NULL); +/*!40000 ALTER TABLE `llx_entrepot` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_event_element` +-- + +DROP TABLE IF EXISTS `llx_event_element`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_event_element` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_source` int(11) NOT NULL, + `fk_target` int(11) NOT NULL, + `targettype` varchar(32) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_event_element` +-- + +LOCK TABLES `llx_event_element` WRITE; +/*!40000 ALTER TABLE `llx_event_element` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_event_element` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_events` +-- + +DROP TABLE IF EXISTS `llx_events`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_events` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `type` varchar(32) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `dateevent` datetime DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `description` varchar(250) NOT NULL, + `ip` varchar(32) NOT NULL, + `user_agent` varchar(255) DEFAULT NULL, + `fk_object` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_events_dateevent` (`dateevent`) +) ENGINE=InnoDB AUTO_INCREMENT=573 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_events` +-- + +LOCK TABLES `llx_events` WRITE; +/*!40000 ALTER TABLE `llx_events` DISABLE KEYS */; +INSERT INTO `llx_events` VALUES (30,'2011-07-18 18:23:06','USER_LOGOUT',1,'2011-07-18 20:23:06',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(31,'2011-07-18 18:23:12','USER_LOGIN_FAILED',1,'2011-07-18 20:23:12',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(32,'2011-07-18 18:23:17','USER_LOGIN',1,'2011-07-18 20:23:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(33,'2011-07-18 20:10:51','USER_LOGIN_FAILED',1,'2011-07-18 22:10:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(34,'2011-07-18 20:10:55','USER_LOGIN',1,'2011-07-18 22:10:55',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(35,'2011-07-18 21:18:57','USER_LOGIN',1,'2011-07-18 23:18:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(36,'2011-07-20 10:34:10','USER_LOGIN',1,'2011-07-20 12:34:10',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(37,'2011-07-20 12:36:44','USER_LOGIN',1,'2011-07-20 14:36:44',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(38,'2011-07-20 13:20:51','USER_LOGIN_FAILED',1,'2011-07-20 15:20:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(39,'2011-07-20 13:20:54','USER_LOGIN',1,'2011-07-20 15:20:54',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(40,'2011-07-20 15:03:46','USER_LOGIN_FAILED',1,'2011-07-20 17:03:46',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(41,'2011-07-20 15:03:55','USER_LOGIN',1,'2011-07-20 17:03:55',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(42,'2011-07-20 18:05:05','USER_LOGIN_FAILED',1,'2011-07-20 20:05:05',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(43,'2011-07-20 18:05:08','USER_LOGIN',1,'2011-07-20 20:05:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(44,'2011-07-20 21:08:53','USER_LOGIN_FAILED',1,'2011-07-20 23:08:53',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(45,'2011-07-20 21:08:56','USER_LOGIN',1,'2011-07-20 23:08:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(46,'2011-07-21 01:26:12','USER_LOGIN',1,'2011-07-21 03:26:12',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(47,'2011-07-21 22:35:45','USER_LOGIN_FAILED',1,'2011-07-22 00:35:45',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(48,'2011-07-21 22:35:49','USER_LOGIN',1,'2011-07-22 00:35:49',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(49,'2011-07-26 23:09:47','USER_LOGIN_FAILED',1,'2011-07-27 01:09:47',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(50,'2011-07-26 23:09:50','USER_LOGIN',1,'2011-07-27 01:09:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(51,'2011-07-27 17:02:27','USER_LOGIN_FAILED',1,'2011-07-27 19:02:27',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(52,'2011-07-27 17:02:32','USER_LOGIN',1,'2011-07-27 19:02:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(53,'2011-07-27 23:33:37','USER_LOGIN_FAILED',1,'2011-07-28 01:33:37',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(54,'2011-07-27 23:33:41','USER_LOGIN',1,'2011-07-28 01:33:41',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(55,'2011-07-28 18:20:36','USER_LOGIN_FAILED',1,'2011-07-28 20:20:36',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(56,'2011-07-28 18:20:38','USER_LOGIN',1,'2011-07-28 20:20:38',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(57,'2011-07-28 20:13:30','USER_LOGIN_FAILED',1,'2011-07-28 22:13:30',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(58,'2011-07-28 20:13:34','USER_LOGIN',1,'2011-07-28 22:13:34',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(59,'2011-07-28 20:22:51','USER_LOGIN',1,'2011-07-28 22:22:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(60,'2011-07-28 23:05:06','USER_LOGIN',1,'2011-07-29 01:05:06',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(61,'2011-07-29 20:15:50','USER_LOGIN_FAILED',1,'2011-07-29 22:15:50',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(62,'2011-07-29 20:15:53','USER_LOGIN',1,'2011-07-29 22:15:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(68,'2011-07-29 20:51:01','USER_LOGOUT',1,'2011-07-29 22:51:01',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(69,'2011-07-29 20:51:05','USER_LOGIN',1,'2011-07-29 22:51:05',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(70,'2011-07-30 08:46:20','USER_LOGIN_FAILED',1,'2011-07-30 10:46:20',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(71,'2011-07-30 08:46:38','USER_LOGIN_FAILED',1,'2011-07-30 10:46:38',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(72,'2011-07-30 08:46:42','USER_LOGIN',1,'2011-07-30 10:46:42',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(73,'2011-07-30 10:05:12','USER_LOGIN_FAILED',1,'2011-07-30 12:05:12',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(74,'2011-07-30 10:05:15','USER_LOGIN',1,'2011-07-30 12:05:15',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(75,'2011-07-30 12:15:46','USER_LOGIN',1,'2011-07-30 14:15:46',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(76,'2011-07-31 22:19:30','USER_LOGIN',1,'2011-08-01 00:19:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(77,'2011-07-31 23:32:52','USER_LOGIN',1,'2011-08-01 01:32:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(78,'2011-08-01 01:24:50','USER_LOGIN_FAILED',1,'2011-08-01 03:24:50',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(79,'2011-08-01 01:24:54','USER_LOGIN',1,'2011-08-01 03:24:54',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(80,'2011-08-01 19:31:36','USER_LOGIN_FAILED',1,'2011-08-01 21:31:35',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(81,'2011-08-01 19:31:39','USER_LOGIN',1,'2011-08-01 21:31:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(82,'2011-08-01 20:01:36','USER_LOGIN',1,'2011-08-01 22:01:36',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(83,'2011-08-01 20:52:54','USER_LOGIN_FAILED',1,'2011-08-01 22:52:54',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(84,'2011-08-01 20:52:58','USER_LOGIN',1,'2011-08-01 22:52:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(85,'2011-08-01 21:17:28','USER_LOGIN_FAILED',1,'2011-08-01 23:17:28',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(86,'2011-08-01 21:17:31','USER_LOGIN',1,'2011-08-01 23:17:31',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(87,'2011-08-04 11:55:17','USER_LOGIN',1,'2011-08-04 13:55:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(88,'2011-08-04 20:19:03','USER_LOGIN_FAILED',1,'2011-08-04 22:19:03',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(89,'2011-08-04 20:19:07','USER_LOGIN',1,'2011-08-04 22:19:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(90,'2011-08-05 17:51:42','USER_LOGIN_FAILED',1,'2011-08-05 19:51:42',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(91,'2011-08-05 17:51:47','USER_LOGIN',1,'2011-08-05 19:51:47',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(92,'2011-08-05 17:56:03','USER_LOGIN',1,'2011-08-05 19:56:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(93,'2011-08-05 17:59:10','USER_LOGIN',1,'2011-08-05 19:59:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30',NULL),(94,'2011-08-05 18:01:58','USER_LOGIN',1,'2011-08-05 20:01:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30',NULL),(95,'2011-08-05 19:59:56','USER_LOGIN',1,'2011-08-05 21:59:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(96,'2011-08-06 18:33:22','USER_LOGIN',1,'2011-08-06 20:33:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(97,'2011-08-07 00:56:59','USER_LOGIN',1,'2011-08-07 02:56:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(98,'2011-08-07 22:49:14','USER_LOGIN',1,'2011-08-08 00:49:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(99,'2011-08-07 23:05:18','USER_LOGOUT',1,'2011-08-08 01:05:18',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(105,'2011-08-08 00:41:09','USER_LOGIN',1,'2011-08-08 02:41:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(106,'2011-08-08 11:58:55','USER_LOGIN',1,'2011-08-08 13:58:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(107,'2011-08-08 14:35:48','USER_LOGIN',1,'2011-08-08 16:35:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(108,'2011-08-08 14:36:31','USER_LOGOUT',1,'2011-08-08 16:36:31',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(109,'2011-08-08 14:38:28','USER_LOGIN',1,'2011-08-08 16:38:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(110,'2011-08-08 14:39:02','USER_LOGOUT',1,'2011-08-08 16:39:02',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(111,'2011-08-08 14:39:10','USER_LOGIN',1,'2011-08-08 16:39:10',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(112,'2011-08-08 14:39:28','USER_LOGOUT',1,'2011-08-08 16:39:28',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(113,'2011-08-08 14:39:37','USER_LOGIN',1,'2011-08-08 16:39:37',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(114,'2011-08-08 14:50:02','USER_LOGOUT',1,'2011-08-08 16:50:02',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(115,'2011-08-08 14:51:45','USER_LOGIN_FAILED',1,'2011-08-08 16:51:45',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(116,'2011-08-08 14:51:52','USER_LOGIN',1,'2011-08-08 16:51:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(117,'2011-08-08 15:09:54','USER_LOGOUT',1,'2011-08-08 17:09:54',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(118,'2011-08-08 15:10:19','USER_LOGIN_FAILED',1,'2011-08-08 17:10:19',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(119,'2011-08-08 15:10:28','USER_LOGIN',1,'2011-08-08 17:10:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(121,'2011-08-08 15:14:58','USER_LOGOUT',1,'2011-08-08 17:14:58',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(122,'2011-08-08 15:15:00','USER_LOGIN_FAILED',1,'2011-08-08 17:15:00',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(123,'2011-08-08 15:17:57','USER_LOGIN',1,'2011-08-08 17:17:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(124,'2011-08-08 15:35:56','USER_LOGOUT',1,'2011-08-08 17:35:56',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(125,'2011-08-08 15:36:05','USER_LOGIN',1,'2011-08-08 17:36:05',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(126,'2011-08-08 17:32:42','USER_LOGIN',1,'2011-08-08 19:32:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(127,'2012-12-08 13:49:37','USER_LOGOUT',1,'2012-12-08 14:49:37',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(128,'2012-12-08 13:49:42','USER_LOGIN',1,'2012-12-08 14:49:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(129,'2012-12-08 13:50:12','USER_LOGOUT',1,'2012-12-08 14:50:12',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(130,'2012-12-08 13:50:14','USER_LOGIN',1,'2012-12-08 14:50:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(131,'2012-12-08 13:50:17','USER_LOGOUT',1,'2012-12-08 14:50:17',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(132,'2012-12-08 13:52:47','USER_LOGIN',1,'2012-12-08 14:52:47',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(133,'2012-12-08 13:53:08','USER_MODIFY',1,'2012-12-08 14:53:08',1,'User admin modified','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(134,'2012-12-08 14:08:45','USER_LOGOUT',1,'2012-12-08 15:08:45',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(135,'2012-12-08 14:09:09','USER_LOGIN',1,'2012-12-08 15:09:09',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(136,'2012-12-08 14:11:43','USER_LOGOUT',1,'2012-12-08 15:11:43',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(137,'2012-12-08 14:11:45','USER_LOGIN',1,'2012-12-08 15:11:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(138,'2012-12-08 14:22:53','USER_LOGOUT',1,'2012-12-08 15:22:53',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(139,'2012-12-08 14:22:54','USER_LOGIN',1,'2012-12-08 15:22:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(140,'2012-12-08 14:23:10','USER_LOGOUT',1,'2012-12-08 15:23:10',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(141,'2012-12-08 14:23:11','USER_LOGIN',1,'2012-12-08 15:23:11',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(142,'2012-12-08 14:23:49','USER_LOGOUT',1,'2012-12-08 15:23:49',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(143,'2012-12-08 14:23:50','USER_LOGIN',1,'2012-12-08 15:23:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(144,'2012-12-08 14:28:08','USER_LOGOUT',1,'2012-12-08 15:28:08',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(145,'2012-12-08 14:35:15','USER_LOGIN',1,'2012-12-08 15:35:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(146,'2012-12-08 14:35:18','USER_LOGOUT',1,'2012-12-08 15:35:18',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(147,'2012-12-08 14:36:07','USER_LOGIN',1,'2012-12-08 15:36:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(148,'2012-12-08 14:36:09','USER_LOGOUT',1,'2012-12-08 15:36:09',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(149,'2012-12-08 14:36:41','USER_LOGIN',1,'2012-12-08 15:36:41',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(150,'2012-12-08 15:59:13','USER_LOGIN',1,'2012-12-08 16:59:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(151,'2012-12-09 11:49:52','USER_LOGIN',1,'2012-12-09 12:49:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(152,'2012-12-09 13:46:31','USER_LOGIN',1,'2012-12-09 14:46:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(153,'2012-12-09 19:03:14','USER_LOGIN',1,'2012-12-09 20:03:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(154,'2012-12-10 00:16:31','USER_LOGIN',1,'2012-12-10 01:16:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(170,'2012-12-11 22:03:31','USER_LOGIN',1,'2012-12-11 23:03:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(171,'2012-12-12 00:32:39','USER_LOGIN',1,'2012-12-12 01:32:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(172,'2012-12-12 10:49:59','USER_LOGIN',1,'2012-12-12 11:49:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(175,'2012-12-12 10:57:40','USER_MODIFY',1,'2012-12-12 11:57:40',1,'Modification utilisateur admin','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(176,'2012-12-12 13:29:15','USER_LOGIN',1,'2012-12-12 14:29:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(177,'2012-12-12 13:30:15','USER_LOGIN',1,'2012-12-12 14:30:15',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(178,'2012-12-12 13:40:08','USER_LOGOUT',1,'2012-12-12 14:40:08',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(179,'2012-12-12 13:40:10','USER_LOGIN',1,'2012-12-12 14:40:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(180,'2012-12-12 13:40:26','USER_MODIFY',1,'2012-12-12 14:40:26',1,'Modification utilisateur admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(181,'2012-12-12 13:40:34','USER_LOGOUT',1,'2012-12-12 14:40:34',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(182,'2012-12-12 13:42:23','USER_LOGIN',1,'2012-12-12 14:42:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(183,'2012-12-12 13:43:02','USER_NEW_PASSWORD',1,'2012-12-12 14:43:02',NULL,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(184,'2012-12-12 13:43:25','USER_LOGOUT',1,'2012-12-12 14:43:25',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(185,'2012-12-12 13:43:27','USER_LOGIN_FAILED',1,'2012-12-12 14:43:27',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(186,'2012-12-12 13:43:30','USER_LOGIN',1,'2012-12-12 14:43:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(187,'2012-12-12 14:52:11','USER_LOGIN',1,'2012-12-12 15:52:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(188,'2012-12-12 17:53:00','USER_LOGIN_FAILED',1,'2012-12-12 18:53:00',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(189,'2012-12-12 17:53:07','USER_LOGIN_FAILED',1,'2012-12-12 18:53:07',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(190,'2012-12-12 17:53:51','USER_NEW_PASSWORD',1,'2012-12-12 18:53:51',NULL,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(191,'2012-12-12 17:54:00','USER_LOGIN',1,'2012-12-12 18:54:00',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(192,'2012-12-12 17:54:10','USER_NEW_PASSWORD',1,'2012-12-12 18:54:10',1,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(193,'2012-12-12 17:54:10','USER_MODIFY',1,'2012-12-12 18:54:10',1,'Modification utilisateur admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(194,'2012-12-12 18:57:09','USER_LOGIN',1,'2012-12-12 19:57:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(195,'2012-12-12 23:04:08','USER_LOGIN',1,'2012-12-13 00:04:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(196,'2012-12-17 20:03:14','USER_LOGIN',1,'2012-12-17 21:03:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(197,'2012-12-17 21:18:45','USER_LOGIN',1,'2012-12-17 22:18:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(198,'2012-12-17 22:30:08','USER_LOGIN',1,'2012-12-17 23:30:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(199,'2012-12-18 23:32:03','USER_LOGIN',1,'2012-12-19 00:32:03',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(200,'2012-12-19 09:38:03','USER_LOGIN',1,'2012-12-19 10:38:03',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(201,'2012-12-19 11:23:35','USER_LOGIN',1,'2012-12-19 12:23:35',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(202,'2012-12-19 12:46:22','USER_LOGIN',1,'2012-12-19 13:46:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(214,'2012-12-19 19:11:31','USER_LOGIN',1,'2012-12-19 20:11:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(215,'2012-12-21 16:36:57','USER_LOGIN',1,'2012-12-21 17:36:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(216,'2012-12-21 16:38:43','USER_NEW_PASSWORD',1,'2012-12-21 17:38:43',1,'Changement mot de passe de adupont','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(217,'2012-12-21 16:38:43','USER_MODIFY',1,'2012-12-21 17:38:43',1,'Modification utilisateur adupont','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(218,'2012-12-21 16:38:51','USER_LOGOUT',1,'2012-12-21 17:38:51',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(219,'2012-12-21 16:38:55','USER_LOGIN',1,'2012-12-21 17:38:55',3,'(UserLogged,adupont)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(220,'2012-12-21 16:48:18','USER_LOGOUT',1,'2012-12-21 17:48:18',3,'(UserLogoff,adupont)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(221,'2012-12-21 16:48:20','USER_LOGIN',1,'2012-12-21 17:48:20',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(222,'2012-12-26 18:28:18','USER_LOGIN',1,'2012-12-26 19:28:18',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(223,'2012-12-26 20:00:24','USER_LOGIN',1,'2012-12-26 21:00:24',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(224,'2012-12-27 01:10:27','USER_LOGIN',1,'2012-12-27 02:10:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(225,'2012-12-28 19:12:08','USER_LOGIN',1,'2012-12-28 20:12:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(226,'2012-12-28 20:16:58','USER_LOGIN',1,'2012-12-28 21:16:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(227,'2012-12-29 14:35:46','USER_LOGIN',1,'2012-12-29 15:35:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(228,'2012-12-29 14:37:59','USER_LOGOUT',1,'2012-12-29 15:37:59',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(229,'2012-12-29 14:38:00','USER_LOGIN',1,'2012-12-29 15:38:00',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(230,'2012-12-29 17:16:48','USER_LOGIN',1,'2012-12-29 18:16:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(231,'2012-12-31 12:02:59','USER_LOGIN',1,'2012-12-31 13:02:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(232,'2013-01-02 20:32:51','USER_LOGIN',1,'2013-01-02 21:32:51',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0',NULL),(233,'2013-01-02 20:58:59','USER_LOGIN',1,'2013-01-02 21:58:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(234,'2013-01-03 09:25:07','USER_LOGIN',1,'2013-01-03 10:25:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(235,'2013-01-03 19:39:31','USER_LOGIN',1,'2013-01-03 20:39:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(236,'2013-01-04 22:40:19','USER_LOGIN',1,'2013-01-04 23:40:19',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(237,'2013-01-05 12:59:59','USER_LOGIN',1,'2013-01-05 13:59:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(238,'2013-01-05 15:28:52','USER_LOGIN',1,'2013-01-05 16:28:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(239,'2013-01-05 17:02:08','USER_LOGIN',1,'2013-01-05 18:02:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(240,'2013-01-06 12:13:33','USER_LOGIN',1,'2013-01-06 13:13:33',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(241,'2013-01-07 01:21:15','USER_LOGIN',1,'2013-01-07 02:21:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(242,'2013-01-07 01:46:31','USER_LOGOUT',1,'2013-01-07 02:46:31',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(243,'2013-01-07 19:54:50','USER_LOGIN',1,'2013-01-07 20:54:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(244,'2013-01-08 21:55:01','USER_LOGIN',1,'2013-01-08 22:55:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(245,'2013-01-09 11:13:28','USER_LOGIN',1,'2013-01-09 12:13:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(246,'2013-01-10 18:30:46','USER_LOGIN',1,'2013-01-10 19:30:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(247,'2013-01-11 18:03:26','USER_LOGIN',1,'2013-01-11 19:03:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(248,'2013-01-12 11:15:04','USER_LOGIN',1,'2013-01-12 12:15:04',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(249,'2013-01-12 14:42:44','USER_LOGIN',1,'2013-01-12 15:42:44',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(250,'2013-01-13 12:07:17','USER_LOGIN',1,'2013-01-13 13:07:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(251,'2013-01-13 17:37:58','USER_LOGIN',1,'2013-01-13 18:37:58',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(252,'2013-01-13 19:24:21','USER_LOGIN',1,'2013-01-13 20:24:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(253,'2013-01-13 19:29:19','USER_LOGOUT',1,'2013-01-13 20:29:19',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(254,'2013-01-13 21:39:39','USER_LOGIN',1,'2013-01-13 22:39:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(255,'2013-01-14 00:52:21','USER_LOGIN',1,'2013-01-14 01:52:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(256,'2013-01-16 11:34:31','USER_LOGIN',1,'2013-01-16 12:34:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(257,'2013-01-16 15:36:21','USER_LOGIN',1,'2013-01-16 16:36:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(258,'2013-01-16 19:17:36','USER_LOGIN',1,'2013-01-16 20:17:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(259,'2013-01-16 19:48:08','GROUP_CREATE',1,'2013-01-16 20:48:08',1,'Création groupe ggg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(260,'2013-01-16 21:48:53','USER_LOGIN',1,'2013-01-16 22:48:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(261,'2013-01-17 19:55:53','USER_LOGIN',1,'2013-01-17 20:55:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(262,'2013-01-18 09:48:01','USER_LOGIN',1,'2013-01-18 10:48:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(263,'2013-01-18 13:22:36','USER_LOGIN',1,'2013-01-18 14:22:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(264,'2013-01-18 16:10:23','USER_LOGIN',1,'2013-01-18 17:10:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(265,'2013-01-18 17:41:40','USER_LOGIN',1,'2013-01-18 18:41:40',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(266,'2013-01-19 14:33:48','USER_LOGIN',1,'2013-01-19 15:33:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(267,'2013-01-19 16:47:43','USER_LOGIN',1,'2013-01-19 17:47:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(268,'2013-01-19 16:59:43','USER_LOGIN',1,'2013-01-19 17:59:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(269,'2013-01-19 17:00:22','USER_LOGIN',1,'2013-01-19 18:00:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(270,'2013-01-19 17:04:16','USER_LOGOUT',1,'2013-01-19 18:04:16',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(271,'2013-01-19 17:04:18','USER_LOGIN',1,'2013-01-19 18:04:18',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(272,'2013-01-20 00:34:19','USER_LOGIN',1,'2013-01-20 01:34:19',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(273,'2013-01-21 11:54:17','USER_LOGIN',1,'2013-01-21 12:54:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(274,'2013-01-21 13:48:15','USER_LOGIN',1,'2013-01-21 14:48:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(275,'2013-01-21 14:30:22','USER_LOGIN',1,'2013-01-21 15:30:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(276,'2013-01-21 15:10:46','USER_LOGIN',1,'2013-01-21 16:10:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(277,'2013-01-21 17:27:43','USER_LOGIN',1,'2013-01-21 18:27:43',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(278,'2013-01-21 21:48:15','USER_LOGIN',1,'2013-01-21 22:48:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(279,'2013-01-21 21:50:42','USER_LOGIN',1,'2013-01-21 22:50:42',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(280,'2013-01-23 09:28:26','USER_LOGIN',1,'2013-01-23 10:28:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(281,'2013-01-23 13:21:57','USER_LOGIN',1,'2013-01-23 14:21:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(282,'2013-01-23 16:52:00','USER_LOGOUT',1,'2013-01-23 17:52:00',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(283,'2013-01-23 16:52:05','USER_LOGIN_FAILED',1,'2013-01-23 17:52:05',NULL,'Bad value for login or password - login=bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(284,'2013-01-23 16:52:09','USER_LOGIN',1,'2013-01-23 17:52:09',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(285,'2013-01-23 16:52:27','USER_CREATE',1,'2013-01-23 17:52:27',1,'Création utilisateur aaa','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(286,'2013-01-23 16:52:27','USER_NEW_PASSWORD',1,'2013-01-23 17:52:27',1,'Changement mot de passe de aaa','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(287,'2013-01-23 16:52:37','USER_CREATE',1,'2013-01-23 17:52:37',1,'Création utilisateur bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(288,'2013-01-23 16:52:37','USER_NEW_PASSWORD',1,'2013-01-23 17:52:37',1,'Changement mot de passe de bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(289,'2013-01-23 16:53:15','USER_LOGOUT',1,'2013-01-23 17:53:15',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(290,'2013-01-23 16:53:20','USER_LOGIN',1,'2013-01-23 17:53:20',4,'(UserLogged,aaa)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(291,'2013-01-23 19:16:58','USER_LOGIN',1,'2013-01-23 20:16:58',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(292,'2013-01-26 10:54:07','USER_LOGIN',1,'2013-01-26 11:54:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(293,'2013-01-29 10:15:36','USER_LOGIN',1,'2013-01-29 11:15:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(294,'2013-01-30 17:42:50','USER_LOGIN',1,'2013-01-30 18:42:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(295,'2013-02-01 08:49:55','USER_LOGIN',1,'2013-02-01 09:49:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(296,'2013-02-01 08:51:57','USER_LOGOUT',1,'2013-02-01 09:51:57',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(297,'2013-02-01 08:52:39','USER_LOGIN',1,'2013-02-01 09:52:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(298,'2013-02-01 21:03:01','USER_LOGIN',1,'2013-02-01 22:03:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(299,'2013-02-10 19:48:39','USER_LOGIN',1,'2013-02-10 20:48:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(300,'2013-02-10 20:46:48','USER_LOGIN',1,'2013-02-10 21:46:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(301,'2013-02-10 21:39:23','USER_LOGIN',1,'2013-02-10 22:39:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(302,'2013-02-11 19:00:13','USER_LOGIN',1,'2013-02-11 20:00:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(303,'2013-02-11 19:43:44','USER_LOGIN_FAILED',1,'2013-02-11 20:43:44',NULL,'Unknown column \'u.fk_user\' in \'field list\'','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(304,'2013-02-11 19:44:01','USER_LOGIN',1,'2013-02-11 20:44:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(305,'2013-02-12 00:27:35','USER_LOGIN',1,'2013-02-12 01:27:35',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(306,'2013-02-12 00:27:38','USER_LOGOUT',1,'2013-02-12 01:27:38',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(307,'2013-02-12 00:28:07','USER_LOGIN',1,'2013-02-12 01:28:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(308,'2013-02-12 00:28:09','USER_LOGOUT',1,'2013-02-12 01:28:09',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(309,'2013-02-12 00:28:26','USER_LOGIN',1,'2013-02-12 01:28:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(310,'2013-02-12 00:28:30','USER_LOGOUT',1,'2013-02-12 01:28:30',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(311,'2013-02-12 12:42:15','USER_LOGIN',1,'2013-02-12 13:42:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(312,'2013-02-12 13:46:16','USER_LOGIN',1,'2013-02-12 14:46:16',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(313,'2013-02-12 14:54:28','USER_LOGIN',1,'2013-02-12 15:54:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(314,'2013-02-12 16:04:46','USER_LOGIN',1,'2013-02-12 17:04:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(315,'2013-02-13 14:02:43','USER_LOGIN',1,'2013-02-13 15:02:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(316,'2013-02-13 14:48:30','USER_LOGIN',1,'2013-02-13 15:48:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(317,'2013-02-13 17:44:53','USER_LOGIN',1,'2013-02-13 18:44:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(318,'2013-02-15 08:44:36','USER_LOGIN',1,'2013-02-15 09:44:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(319,'2013-02-15 08:53:20','USER_LOGIN',1,'2013-02-15 09:53:20',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(320,'2013-02-16 19:10:28','USER_LOGIN',1,'2013-02-16 20:10:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(321,'2013-02-16 19:22:40','USER_CREATE',1,'2013-02-16 20:22:40',1,'Création utilisateur aaab','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(322,'2013-02-16 19:22:40','USER_NEW_PASSWORD',1,'2013-02-16 20:22:40',1,'Changement mot de passe de aaab','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(323,'2013-02-16 19:48:15','USER_CREATE',1,'2013-02-16 20:48:15',1,'Création utilisateur zzz','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(324,'2013-02-16 19:48:15','USER_NEW_PASSWORD',1,'2013-02-16 20:48:15',1,'Changement mot de passe de zzz','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(325,'2013-02-16 19:50:08','USER_CREATE',1,'2013-02-16 20:50:08',1,'Création utilisateur zzzg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(326,'2013-02-16 19:50:08','USER_NEW_PASSWORD',1,'2013-02-16 20:50:08',1,'Changement mot de passe de zzzg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(327,'2013-02-16 21:20:03','USER_LOGIN',1,'2013-02-16 22:20:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(328,'2013-02-17 14:30:51','USER_LOGIN',1,'2013-02-17 15:30:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(329,'2013-02-17 17:21:22','USER_LOGIN',1,'2013-02-17 18:21:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(330,'2013-02-17 17:48:43','USER_MODIFY',1,'2013-02-17 18:48:43',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(331,'2013-02-17 17:48:47','USER_MODIFY',1,'2013-02-17 18:48:47',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(332,'2013-02-17 17:48:51','USER_MODIFY',1,'2013-02-17 18:48:51',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(333,'2013-02-17 17:48:56','USER_MODIFY',1,'2013-02-17 18:48:56',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(334,'2013-02-18 22:00:01','USER_LOGIN',1,'2013-02-18 23:00:01',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(335,'2013-02-19 08:19:52','USER_LOGIN',1,'2013-02-19 09:19:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(336,'2013-02-19 22:00:52','USER_LOGIN',1,'2013-02-19 23:00:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(337,'2013-02-20 09:34:52','USER_LOGIN',1,'2013-02-20 10:34:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(338,'2013-02-20 13:12:28','USER_LOGIN',1,'2013-02-20 14:12:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(339,'2013-02-20 17:19:44','USER_LOGIN',1,'2013-02-20 18:19:44',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(340,'2013-02-20 19:07:21','USER_MODIFY',1,'2013-02-20 20:07:21',1,'Modification utilisateur adupont','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(341,'2013-02-20 19:47:17','USER_LOGIN',1,'2013-02-20 20:47:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(342,'2013-02-20 19:48:01','USER_MODIFY',1,'2013-02-20 20:48:01',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(343,'2013-02-21 08:27:07','USER_LOGIN',1,'2013-02-21 09:27:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(344,'2013-02-23 13:34:13','USER_LOGIN',1,'2013-02-23 14:34:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(345,'2013-02-24 01:06:41','USER_LOGIN_FAILED',1,'2013-02-24 02:06:41',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(346,'2013-02-24 01:06:45','USER_LOGIN_FAILED',1,'2013-02-24 02:06:45',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(347,'2013-02-24 01:06:55','USER_LOGIN_FAILED',1,'2013-02-24 02:06:55',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(348,'2013-02-24 01:07:03','USER_LOGIN_FAILED',1,'2013-02-24 02:07:03',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(349,'2013-02-24 01:07:21','USER_LOGIN_FAILED',1,'2013-02-24 02:07:21',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(350,'2013-02-24 01:08:12','USER_LOGIN_FAILED',1,'2013-02-24 02:08:12',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(351,'2013-02-24 01:08:42','USER_LOGIN_FAILED',1,'2013-02-24 02:08:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(352,'2013-02-24 01:08:50','USER_LOGIN_FAILED',1,'2013-02-24 02:08:50',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(353,'2013-02-24 01:09:08','USER_LOGIN_FAILED',1,'2013-02-24 02:09:08',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(354,'2013-02-24 01:09:42','USER_LOGIN_FAILED',1,'2013-02-24 02:09:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(355,'2013-02-24 01:09:50','USER_LOGIN_FAILED',1,'2013-02-24 02:09:50',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(356,'2013-02-24 01:10:05','USER_LOGIN_FAILED',1,'2013-02-24 02:10:05',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(357,'2013-02-24 01:10:22','USER_LOGIN_FAILED',1,'2013-02-24 02:10:22',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(358,'2013-02-24 01:10:30','USER_LOGIN_FAILED',1,'2013-02-24 02:10:30',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(359,'2013-02-24 01:10:56','USER_LOGIN_FAILED',1,'2013-02-24 02:10:56',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(360,'2013-02-24 01:11:26','USER_LOGIN_FAILED',1,'2013-02-24 02:11:26',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(361,'2013-02-24 01:12:06','USER_LOGIN_FAILED',1,'2013-02-24 02:12:06',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(362,'2013-02-24 01:21:14','USER_LOGIN_FAILED',1,'2013-02-24 02:21:14',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(363,'2013-02-24 01:21:25','USER_LOGIN_FAILED',1,'2013-02-24 02:21:25',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(364,'2013-02-24 01:21:54','USER_LOGIN_FAILED',1,'2013-02-24 02:21:54',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(365,'2013-02-24 01:22:14','USER_LOGIN_FAILED',1,'2013-02-24 02:22:14',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(366,'2013-02-24 01:22:37','USER_LOGIN_FAILED',1,'2013-02-24 02:22:37',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(367,'2013-02-24 01:23:01','USER_LOGIN_FAILED',1,'2013-02-24 02:23:01',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(368,'2013-02-24 01:23:39','USER_LOGIN_FAILED',1,'2013-02-24 02:23:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(369,'2013-02-24 01:24:04','USER_LOGIN_FAILED',1,'2013-02-24 02:24:04',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(370,'2013-02-24 01:24:39','USER_LOGIN_FAILED',1,'2013-02-24 02:24:39',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(371,'2013-02-24 01:25:01','USER_LOGIN_FAILED',1,'2013-02-24 02:25:01',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(372,'2013-02-24 01:25:12','USER_LOGIN_FAILED',1,'2013-02-24 02:25:12',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(373,'2013-02-24 01:27:30','USER_LOGIN_FAILED',1,'2013-02-24 02:27:30',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(374,'2013-02-24 01:28:00','USER_LOGIN_FAILED',1,'2013-02-24 02:28:00',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(375,'2013-02-24 01:28:35','USER_LOGIN_FAILED',1,'2013-02-24 02:28:35',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(376,'2013-02-24 01:29:03','USER_LOGIN_FAILED',1,'2013-02-24 02:29:03',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(377,'2013-02-24 01:29:55','USER_LOGIN_FAILED',1,'2013-02-24 02:29:55',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(378,'2013-02-24 01:32:40','USER_LOGIN_FAILED',1,'2013-02-24 02:32:40',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(379,'2013-02-24 01:39:33','USER_LOGIN_FAILED',1,'2013-02-24 02:39:33',NULL,'Identifiants login ou mot de passe incorrects - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(380,'2013-02-24 01:39:38','USER_LOGIN_FAILED',1,'2013-02-24 02:39:38',NULL,'Identifiants login ou mot de passe incorrects - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(381,'2013-02-24 01:39:47','USER_LOGIN_FAILED',1,'2013-02-24 02:39:47',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(382,'2013-02-24 01:40:54','USER_LOGIN_FAILED',1,'2013-02-24 02:40:54',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(383,'2013-02-24 01:47:57','USER_LOGIN_FAILED',1,'2013-02-24 02:47:57',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(384,'2013-02-24 01:48:05','USER_LOGIN_FAILED',1,'2013-02-24 02:48:05',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(385,'2013-02-24 01:48:07','USER_LOGIN_FAILED',1,'2013-02-24 02:48:07',NULL,'Unknown column \'u.lastname\' in \'field list\'','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(386,'2013-02-24 01:48:35','USER_LOGIN',1,'2013-02-24 02:48:35',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(387,'2013-02-24 01:56:32','USER_LOGIN',1,'2013-02-24 02:56:32',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(388,'2013-02-24 02:05:55','USER_LOGOUT',1,'2013-02-24 03:05:55',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(389,'2013-02-24 02:39:52','USER_LOGIN',1,'2013-02-24 03:39:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(390,'2013-02-24 02:51:10','USER_LOGOUT',1,'2013-02-24 03:51:10',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(391,'2013-02-24 12:46:41','USER_LOGIN',1,'2013-02-24 13:46:41',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(392,'2013-02-24 12:46:52','USER_LOGOUT',1,'2013-02-24 13:46:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(393,'2013-02-24 12:46:56','USER_LOGIN',1,'2013-02-24 13:46:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(394,'2013-02-24 12:47:56','USER_LOGOUT',1,'2013-02-24 13:47:56',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(395,'2013-02-24 12:48:00','USER_LOGIN',1,'2013-02-24 13:48:00',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(396,'2013-02-24 12:48:11','USER_LOGOUT',1,'2013-02-24 13:48:11',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(397,'2013-02-24 12:48:32','USER_LOGIN',1,'2013-02-24 13:48:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(398,'2013-02-24 12:52:22','USER_LOGOUT',1,'2013-02-24 13:52:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(399,'2013-02-24 12:52:27','USER_LOGIN',1,'2013-02-24 13:52:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(400,'2013-02-24 12:52:54','USER_LOGOUT',1,'2013-02-24 13:52:54',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(401,'2013-02-24 12:52:59','USER_LOGIN',1,'2013-02-24 13:52:59',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(402,'2013-02-24 12:55:39','USER_LOGOUT',1,'2013-02-24 13:55:39',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(403,'2013-02-24 12:55:59','USER_LOGIN',1,'2013-02-24 13:55:59',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(404,'2013-02-24 12:56:07','USER_LOGOUT',1,'2013-02-24 13:56:07',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(405,'2013-02-24 12:56:23','USER_LOGIN',1,'2013-02-24 13:56:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(406,'2013-02-24 12:56:46','USER_LOGOUT',1,'2013-02-24 13:56:46',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(407,'2013-02-24 12:58:30','USER_LOGIN',1,'2013-02-24 13:58:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(408,'2013-02-24 12:58:33','USER_LOGOUT',1,'2013-02-24 13:58:33',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(409,'2013-02-24 12:58:51','USER_LOGIN',1,'2013-02-24 13:58:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(410,'2013-02-24 12:58:58','USER_LOGOUT',1,'2013-02-24 13:58:58',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(411,'2013-02-24 13:18:53','USER_LOGIN',1,'2013-02-24 14:18:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(412,'2013-02-24 13:19:52','USER_LOGOUT',1,'2013-02-24 14:19:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(413,'2013-02-24 15:39:31','USER_LOGIN_FAILED',1,'2013-02-24 16:39:31',NULL,'ErrorBadValueForCode - login=admin','127.0.0.1',NULL,NULL),(414,'2013-02-24 15:42:07','USER_LOGIN',1,'2013-02-24 16:42:07',1,'(UserLogged,admin)','127.0.0.1',NULL,NULL),(415,'2013-02-24 15:42:52','USER_LOGOUT',1,'2013-02-24 16:42:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(416,'2013-02-24 16:04:21','USER_LOGIN',1,'2013-02-24 17:04:21',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(417,'2013-02-24 16:11:28','USER_LOGIN_FAILED',1,'2013-02-24 17:11:28',NULL,'ErrorBadValueForCode - login=admin','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(418,'2013-02-24 16:11:37','USER_LOGIN',1,'2013-02-24 17:11:37',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(419,'2013-02-24 16:36:52','USER_LOGOUT',1,'2013-02-24 17:36:52',1,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(420,'2013-02-24 16:40:37','USER_LOGIN',1,'2013-02-24 17:40:37',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(421,'2013-02-24 16:57:16','USER_LOGIN',1,'2013-02-24 17:57:16',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(422,'2013-02-24 17:01:30','USER_LOGOUT',1,'2013-02-24 18:01:30',1,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(423,'2013-02-24 17:02:33','USER_LOGIN',1,'2013-02-24 18:02:33',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(424,'2013-02-24 17:14:22','USER_LOGOUT',1,'2013-02-24 18:14:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(425,'2013-02-24 17:15:07','USER_LOGIN_FAILED',1,'2013-02-24 18:15:07',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(426,'2013-02-24 17:15:20','USER_LOGIN',1,'2013-02-24 18:15:20',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(427,'2013-02-24 17:20:14','USER_LOGIN',1,'2013-02-24 18:20:14',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(428,'2013-02-24 17:20:51','USER_LOGIN',1,'2013-02-24 18:20:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(429,'2013-02-24 17:20:54','USER_LOGOUT',1,'2013-02-24 18:20:54',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(430,'2013-02-24 17:21:19','USER_LOGIN',1,'2013-02-24 18:21:19',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(431,'2013-02-24 17:32:35','USER_LOGIN',1,'2013-02-24 18:32:35',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(432,'2013-02-24 18:28:48','USER_LOGIN',1,'2013-02-24 19:28:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(433,'2013-02-24 18:29:27','USER_LOGOUT',1,'2013-02-24 19:29:27',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(434,'2013-02-24 18:29:32','USER_LOGIN',1,'2013-02-24 19:29:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(435,'2013-02-24 20:13:13','USER_LOGOUT',1,'2013-02-24 21:13:13',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(436,'2013-02-24 20:13:17','USER_LOGIN',1,'2013-02-24 21:13:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(437,'2013-02-25 08:57:16','USER_LOGIN',1,'2013-02-25 09:57:16',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(438,'2013-02-25 08:57:59','USER_LOGOUT',1,'2013-02-25 09:57:59',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(439,'2013-02-25 09:15:02','USER_LOGIN',1,'2013-02-25 10:15:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(440,'2013-02-25 09:15:50','USER_LOGOUT',1,'2013-02-25 10:15:50',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(441,'2013-02-25 09:15:57','USER_LOGIN',1,'2013-02-25 10:15:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(442,'2013-02-25 09:16:12','USER_LOGOUT',1,'2013-02-25 10:16:12',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(443,'2013-02-25 09:16:19','USER_LOGIN',1,'2013-02-25 10:16:19',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(444,'2013-02-25 09:16:25','USER_LOGOUT',1,'2013-02-25 10:16:25',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(445,'2013-02-25 09:16:39','USER_LOGIN_FAILED',1,'2013-02-25 10:16:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(446,'2013-02-25 09:16:42','USER_LOGIN_FAILED',1,'2013-02-25 10:16:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(447,'2013-02-25 09:16:54','USER_LOGIN_FAILED',1,'2013-02-25 10:16:54',NULL,'Identificadors d'usuari o contrasenya incorrectes - login=gfdg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(448,'2013-02-25 09:17:53','USER_LOGIN',1,'2013-02-25 10:17:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(449,'2013-02-25 09:18:37','USER_LOGOUT',1,'2013-02-25 10:18:37',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(450,'2013-02-25 09:18:41','USER_LOGIN',1,'2013-02-25 10:18:41',4,'(UserLogged,aaa)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(451,'2013-02-25 09:18:47','USER_LOGOUT',1,'2013-02-25 10:18:47',4,'(UserLogoff,aaa)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(452,'2013-02-25 10:05:34','USER_LOGIN',1,'2013-02-25 11:05:34',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(453,'2013-02-26 21:51:40','USER_LOGIN',1,'2013-02-26 22:51:40',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(454,'2013-02-26 23:30:06','USER_LOGIN',1,'2013-02-27 00:30:06',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(455,'2013-02-27 14:13:11','USER_LOGIN',1,'2013-02-27 15:13:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(456,'2013-02-27 18:12:06','USER_LOGIN_FAILED',1,'2013-02-27 19:12:06',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(457,'2013-02-27 18:12:10','USER_LOGIN',1,'2013-02-27 19:12:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(458,'2013-02-27 20:20:08','USER_LOGIN',1,'2013-02-27 21:20:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(459,'2013-03-01 22:12:03','USER_LOGIN',1,'2013-03-01 23:12:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(460,'2013-03-02 11:45:50','USER_LOGIN',1,'2013-03-02 12:45:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(461,'2013-03-02 15:53:51','USER_LOGIN_FAILED',1,'2013-03-02 16:53:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(462,'2013-03-02 15:53:53','USER_LOGIN',1,'2013-03-02 16:53:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(463,'2013-03-02 18:32:32','USER_LOGIN',1,'2013-03-02 19:32:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(464,'2013-03-02 22:59:36','USER_LOGIN',1,'2013-03-02 23:59:36',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(465,'2013-03-03 16:26:26','USER_LOGIN',1,'2013-03-03 17:26:26',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(466,'2013-03-03 22:50:27','USER_LOGIN',1,'2013-03-03 23:50:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(467,'2013-03-04 08:29:27','USER_LOGIN',1,'2013-03-04 09:29:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(468,'2013-03-04 18:27:28','USER_LOGIN',1,'2013-03-04 19:27:28',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; NP06)',NULL),(469,'2013-03-04 19:27:23','USER_LOGIN',1,'2013-03-04 20:27:23',1,'(UserLogged,admin)','192.168.0.254','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',NULL),(470,'2013-03-04 19:35:14','USER_LOGIN',1,'2013-03-04 20:35:14',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(471,'2013-03-04 19:55:49','USER_LOGIN',1,'2013-03-04 20:55:49',1,'(UserLogged,admin)','192.168.0.254','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)',NULL),(472,'2013-03-04 21:16:13','USER_LOGIN',1,'2013-03-04 22:16:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(473,'2013-03-05 10:17:30','USER_LOGIN',1,'2013-03-05 11:17:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(474,'2013-03-05 11:02:43','USER_LOGIN',1,'2013-03-05 12:02:43',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(475,'2013-03-05 23:14:39','USER_LOGIN',1,'2013-03-06 00:14:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(476,'2013-03-06 08:58:57','USER_LOGIN',1,'2013-03-06 09:58:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(477,'2013-03-06 14:29:40','USER_LOGIN',1,'2013-03-06 15:29:40',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(478,'2013-03-06 21:53:02','USER_LOGIN',1,'2013-03-06 22:53:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(479,'2013-03-07 21:14:39','USER_LOGIN',1,'2013-03-07 22:14:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(480,'2013-03-08 00:06:05','USER_LOGIN',1,'2013-03-08 01:06:05',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(481,'2013-03-08 01:38:13','USER_LOGIN',1,'2013-03-08 02:38:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(482,'2013-03-08 08:59:50','USER_LOGIN',1,'2013-03-08 09:59:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(483,'2013-03-09 12:08:51','USER_LOGIN',1,'2013-03-09 13:08:51',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(484,'2013-03-09 15:19:53','USER_LOGIN',1,'2013-03-09 16:19:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(495,'2013-03-09 18:06:21','USER_LOGIN',1,'2013-03-09 19:06:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(496,'2013-03-09 20:01:24','USER_LOGIN',1,'2013-03-09 21:01:24',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(497,'2013-03-09 23:36:45','USER_LOGIN',1,'2013-03-10 00:36:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(498,'2013-03-10 14:37:13','USER_LOGIN',1,'2013-03-10 15:37:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(499,'2013-03-10 17:54:12','USER_LOGIN',1,'2013-03-10 18:54:12',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(500,'2013-03-11 08:57:09','USER_LOGIN',1,'2013-03-11 09:57:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(501,'2013-03-11 22:05:13','USER_LOGIN',1,'2013-03-11 23:05:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(502,'2013-03-12 08:34:27','USER_LOGIN',1,'2013-03-12 09:34:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(503,'2013-03-13 09:11:02','USER_LOGIN',1,'2013-03-13 10:11:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(504,'2013-03-13 10:02:11','USER_LOGIN',1,'2013-03-13 11:02:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(505,'2013-03-13 13:20:58','USER_LOGIN',1,'2013-03-13 14:20:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(506,'2013-03-13 16:19:28','USER_LOGIN',1,'2013-03-13 17:19:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(507,'2013-03-13 18:34:30','USER_LOGIN',1,'2013-03-13 19:34:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(508,'2013-03-14 08:25:02','USER_LOGIN',1,'2013-03-14 09:25:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(509,'2013-03-14 19:15:22','USER_LOGIN',1,'2013-03-14 20:15:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(510,'2013-03-14 21:58:53','USER_LOGIN',1,'2013-03-14 22:58:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(511,'2013-03-14 21:58:59','USER_LOGOUT',1,'2013-03-14 22:58:59',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(512,'2013-03-14 21:59:07','USER_LOGIN',1,'2013-03-14 22:59:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(513,'2013-03-14 22:58:22','USER_LOGOUT',1,'2013-03-14 23:58:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(514,'2013-03-14 23:00:25','USER_LOGIN',1,'2013-03-15 00:00:25',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(515,'2013-03-16 12:14:28','USER_LOGIN',1,'2013-03-16 13:14:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(516,'2013-03-16 16:09:01','USER_LOGIN',1,'2013-03-16 17:09:01',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(517,'2013-03-16 16:57:11','USER_LOGIN',1,'2013-03-16 17:57:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(518,'2013-03-16 19:31:31','USER_LOGIN',1,'2013-03-16 20:31:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(519,'2013-03-17 17:44:39','USER_LOGIN',1,'2013-03-17 18:44:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(520,'2013-03-17 20:40:57','USER_LOGIN',1,'2013-03-17 21:40:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(521,'2013-03-17 23:14:05','USER_LOGIN',1,'2013-03-18 00:14:05',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(522,'2013-03-17 23:28:47','USER_LOGOUT',1,'2013-03-18 00:28:47',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(523,'2013-03-17 23:28:54','USER_LOGIN',1,'2013-03-18 00:28:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(524,'2013-03-18 17:37:30','USER_LOGIN',1,'2013-03-18 18:37:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(525,'2013-03-18 18:11:37','USER_LOGIN',1,'2013-03-18 19:11:37',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(526,'2013-03-19 08:35:08','USER_LOGIN',1,'2013-03-19 09:35:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(527,'2013-03-19 09:20:23','USER_LOGIN',1,'2013-03-19 10:20:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(528,'2013-03-20 13:17:13','USER_LOGIN',1,'2013-03-20 14:17:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(529,'2013-03-20 14:44:31','USER_LOGIN',1,'2013-03-20 15:44:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(530,'2013-03-20 18:24:25','USER_LOGIN',1,'2013-03-20 19:24:25',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(531,'2013-03-20 19:15:54','USER_LOGIN',1,'2013-03-20 20:15:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(532,'2013-03-21 18:40:47','USER_LOGIN',1,'2013-03-21 19:40:47',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(533,'2013-03-21 21:42:24','USER_LOGIN',1,'2013-03-21 22:42:24',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(534,'2013-03-22 08:39:23','USER_LOGIN',1,'2013-03-22 09:39:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(535,'2013-03-23 13:04:55','USER_LOGIN',1,'2013-03-23 14:04:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(536,'2013-03-23 15:47:43','USER_LOGIN',1,'2013-03-23 16:47:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(537,'2013-03-23 22:56:36','USER_LOGIN',1,'2013-03-23 23:56:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(538,'2013-03-24 01:22:32','USER_LOGIN',1,'2013-03-24 02:22:32',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(539,'2013-03-24 14:40:42','USER_LOGIN',1,'2013-03-24 15:40:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(540,'2013-03-24 15:30:26','USER_LOGOUT',1,'2013-03-24 16:30:26',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(541,'2013-03-24 15:30:29','USER_LOGIN',1,'2013-03-24 16:30:29',2,'(UserLogged,demo)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(542,'2013-03-24 15:49:40','USER_LOGOUT',1,'2013-03-24 16:49:40',2,'(UserLogoff,demo)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(543,'2013-03-24 15:49:48','USER_LOGIN',1,'2013-03-24 16:49:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(544,'2013-03-24 15:52:35','USER_MODIFY',1,'2013-03-24 16:52:35',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(545,'2013-03-24 15:52:52','USER_MODIFY',1,'2013-03-24 16:52:52',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(546,'2013-03-24 15:53:09','USER_MODIFY',1,'2013-03-24 16:53:09',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(547,'2013-03-24 15:53:23','USER_MODIFY',1,'2013-03-24 16:53:23',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(548,'2013-03-24 16:00:04','USER_MODIFY',1,'2013-03-24 17:00:04',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(549,'2013-03-24 16:01:50','USER_MODIFY',1,'2013-03-24 17:01:50',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(550,'2013-03-24 16:10:14','USER_MODIFY',1,'2013-03-24 17:10:14',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(551,'2013-03-24 16:55:13','USER_LOGIN',1,'2013-03-24 17:55:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(552,'2013-03-24 17:44:29','USER_LOGIN',1,'2013-03-24 18:44:29',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(553,'2013-09-08 23:06:26','USER_LOGIN',1,'2013-09-09 01:06:26',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36',NULL),(554,'2013-10-21 22:32:28','USER_LOGIN',1,'2013-10-22 00:32:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36',NULL),(555,'2013-10-21 22:32:48','USER_LOGIN',1,'2013-10-22 00:32:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36',NULL),(556,'2013-11-07 00:01:51','USER_LOGIN',1,'2013-11-07 01:01:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36',NULL),(557,'2014-04-05 14:19:30','USER_LOGIN',1,'2014-04-05 16:19:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36',NULL); +/*!40000 ALTER TABLE `llx_events` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition` +-- + +DROP TABLE IF EXISTS `llx_expedition`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_customer` varchar(30) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_int` varchar(30) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_expedition` datetime DEFAULT NULL, + `date_delivery` datetime DEFAULT NULL, + `fk_address` int(11) DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `tracking_number` varchar(50) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `height` int(11) DEFAULT NULL, + `height_unit` int(11) DEFAULT NULL, + `width` int(11) DEFAULT NULL, + `size_units` int(11) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `weight_units` int(11) DEFAULT NULL, + `weight` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_expedition_uk_ref` (`ref`,`entity`), + KEY `idx_expedition_fk_soc` (`fk_soc`), + KEY `idx_expedition_fk_user_author` (`fk_user_author`), + KEY `idx_expedition_fk_user_valid` (`fk_user_valid`), + KEY `idx_expedition_fk_shipping_method` (`fk_shipping_method`), + CONSTRAINT `fk_expedition_fk_shipping_method` FOREIGN KEY (`fk_shipping_method`) REFERENCES `llx_c_shipment_mode` (`rowid`), + CONSTRAINT `fk_expedition_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_expedition_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_expedition_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition` +-- + +LOCK TABLES `llx_expedition` WRITE; +/*!40000 ALTER TABLE `llx_expedition` DISABLE KEYS */; +INSERT INTO `llx_expedition` VALUES (1,'2013-02-17 17:22:51','SH1302-0001',1,NULL,1,NULL,NULL,'2011-08-08 03:05:34',1,'2013-02-17 18:22:51',1,NULL,'2011-08-09 00:00:00',NULL,NULL,'',1,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(2,'2013-02-17 17:38:47','SH1302-0002',1,'gfdf',18,NULL,NULL,'2013-02-17 18:38:37',1,'2013-02-17 18:38:47',1,NULL,NULL,NULL,NULL,'',1,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_expedition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition_methode` +-- + +DROP TABLE IF EXISTS `llx_expedition_methode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition_methode` ( + `rowid` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `code` varchar(30) NOT NULL, + `libelle` varchar(50) NOT NULL, + `description` text, + `active` tinyint(4) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition_methode` +-- + +LOCK TABLES `llx_expedition_methode` WRITE; +/*!40000 ALTER TABLE `llx_expedition_methode` DISABLE KEYS */; +INSERT INTO `llx_expedition_methode` VALUES (1,'2010-07-08 11:18:00','CATCH','Catch','Catch by client',1),(2,'2010-07-08 11:18:00','TRANS','Transporter','Generic transporter',1),(3,'2010-07-08 11:18:01','COLSUI','Colissimo Suivi','Colissimo Suivi',0); +/*!40000 ALTER TABLE `llx_expedition_methode` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expeditiondet` +-- + +DROP TABLE IF EXISTS `llx_expeditiondet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expeditiondet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expedition` int(11) NOT NULL, + `fk_origin_line` int(11) DEFAULT NULL, + `fk_entrepot` int(11) DEFAULT NULL, + `qty` double DEFAULT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_expeditiondet_fk_expedition` (`fk_expedition`), + CONSTRAINT `fk_expeditiondet_fk_expedition` FOREIGN KEY (`fk_expedition`) REFERENCES `llx_expedition` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expeditiondet` +-- + +LOCK TABLES `llx_expeditiondet` WRITE; +/*!40000 ALTER TABLE `llx_expeditiondet` DISABLE KEYS */; +INSERT INTO `llx_expeditiondet` VALUES (1,1,10,3,1,0),(2,2,13,NULL,1,0),(3,2,16,NULL,1,0),(4,2,17,NULL,1,0); +/*!40000 ALTER TABLE `llx_expeditiondet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_export_compta` +-- + +DROP TABLE IF EXISTS `llx_export_compta`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_export_compta` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(12) NOT NULL, + `date_export` datetime NOT NULL, + `fk_user` int(11) NOT NULL, + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_export_compta` +-- + +LOCK TABLES `llx_export_compta` WRITE; +/*!40000 ALTER TABLE `llx_export_compta` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_export_compta` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_export_model` +-- + +DROP TABLE IF EXISTS `llx_export_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_export_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL DEFAULT '0', + `label` varchar(50) NOT NULL, + `type` varchar(20) NOT NULL, + `field` text NOT NULL, + `filter` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_export_model` (`label`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_export_model` +-- + +LOCK TABLES `llx_export_model` WRITE; +/*!40000 ALTER TABLE `llx_export_model` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_export_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_extrafields` +-- + +DROP TABLE IF EXISTS `llx_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `elementtype` varchar(64) NOT NULL DEFAULT 'member', + `name` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) NOT NULL, + `type` varchar(8) DEFAULT NULL, + `size` varchar(8) DEFAULT NULL, + `pos` int(11) DEFAULT '0', + `param` text, + `fieldunique` int(11) DEFAULT '0', + `fieldrequired` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_extrafields_name` (`name`,`entity`,`elementtype`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_extrafields` +-- + +LOCK TABLES `llx_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_extrafields` DISABLE KEYS */; +INSERT INTO `llx_extrafields` VALUES (2,'adherent','zzz',1,'2013-09-08 23:04:20','zzz','varchar','255',0,NULL,0,0),(22,'societe','jjjj',1,'2013-09-08 23:04:20','jjj','varchar','255',0,NULL,0,0); +/*!40000 ALTER TABLE `llx_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture` +-- + +DROP TABLE IF EXISTS `llx_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `facnumber` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `type` smallint(6) NOT NULL DEFAULT '0', + `ref_client` varchar(255) DEFAULT NULL, + `increment` varchar(10) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `date_valid` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `paye` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `close_code` varchar(16) DEFAULT NULL, + `close_note` varchar(128) DEFAULT NULL, + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `revenuestamp` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(2) DEFAULT NULL, + `fk_cond_reglement` int(11) NOT NULL DEFAULT '1', + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_facture_uk_facnumber` (`facnumber`,`entity`), + KEY `idx_facture_fk_soc` (`fk_soc`), + KEY `idx_facture_fk_user_author` (`fk_user_author`), + KEY `idx_facture_fk_user_valid` (`fk_user_valid`), + KEY `idx_facture_fk_facture_source` (`fk_facture_source`), + KEY `idx_facture_fk_projet` (`fk_projet`), + KEY `idx_facture_fk_account` (`fk_account`), + KEY `idx_facture_fk_currency` (`fk_currency`), + CONSTRAINT `fk_facture_fk_facture_source` FOREIGN KEY (`fk_facture_source`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_facture_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_facture_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=329 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture` +-- + +LOCK TABLES `llx_facture` WRITE; +/*!40000 ALTER TABLE `llx_facture` DISABLE KEYS */; +INSERT INTO `llx_facture` VALUES (1,'FA1007-0001',1,NULL,NULL,0,NULL,NULL,9,'2010-07-10 14:55:26','2010-07-10',NULL,'2011-07-20 11:18:39',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.02000000,0.02000000,1,1,1,NULL,1,NULL,NULL,1,0,'2010-07-10',NULL,NULL,'crabe',NULL,NULL),(2,'FA1007-0002',1,NULL,NULL,0,NULL,NULL,2,'2010-07-10 18:20:13','2010-07-10',NULL,'2011-08-08 00:54:05',1,10.00000000,NULL,NULL,0,NULL,NULL,0.10000000,0.00000000,0.00000000,0.00000000,46.00000000,46.10000000,2,1,1,NULL,NULL,NULL,NULL,1,0,'2010-07-10',NULL,NULL,'crabe',NULL,NULL),(3,'FA1107-0006',1,NULL,NULL,0,NULL,NULL,10,'2011-07-18 20:33:35','2011-07-18',NULL,'2012-12-08 16:39:01',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,15.00000000,15.00000000,2,1,1,NULL,1,NULL,NULL,1,0,'2011-07-18',NULL,NULL,'crabe',NULL,NULL),(5,'FA1108-0003',1,NULL,NULL,0,NULL,NULL,7,'2011-08-01 03:34:11','2011-08-01',NULL,'2011-08-01 01:34:11',1,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,2,1,1,NULL,NULL,NULL,NULL,0,6,'2011-08-01',NULL,NULL,'',NULL,NULL),(6,'FA1108-0004',1,NULL,NULL,0,NULL,NULL,7,'2011-08-06 20:33:53','2011-08-06',NULL,'2011-08-06 18:35:13',1,0.00000000,NULL,NULL,0,NULL,NULL,0.98000000,0.00000000,0.00000000,0.00000000,5.00000000,5.98000000,2,1,1,NULL,NULL,NULL,NULL,0,4,'2011-08-06','Cash\nReceived : 6 EUR\nRendu : 0.02 EUR\n\n--------------------------------------',NULL,'crabe',NULL,NULL),(8,'FA1108-0005',1,NULL,NULL,3,NULL,NULL,2,'2011-08-08 02:41:44','2011-08-08',NULL,'2011-08-08 00:53:40',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,2,1,1,NULL,NULL,NULL,NULL,1,0,'2011-08-08',NULL,NULL,'crabe',NULL,NULL),(9,'FA1108-0007',1,NULL,NULL,3,NULL,NULL,10,'2011-08-08 02:55:14','2011-08-08',NULL,'2011-08-08 00:55:26',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2011-08-08',NULL,NULL,'crabe',NULL,NULL),(10,'AV1212-0001',1,NULL,NULL,2,NULL,NULL,10,'2012-12-08 17:45:20','2012-12-08','2012-12-08','2012-12-08 16:57:11',0,0.00000000,NULL,NULL,0,NULL,NULL,-0.63000000,0.00000000,0.00000000,0.00000000,-11.00000000,-11.63000000,1,1,1,3,NULL,NULL,NULL,0,0,'2012-12-08',NULL,NULL,'crabe',NULL,NULL),(11,'FA1212-0008',1,NULL,NULL,0,NULL,NULL,10,'2012-12-08 17:58:13','2012-12-08','2012-12-08','2012-12-08 16:58:27',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2012-12-08',NULL,NULL,'crabe',NULL,NULL),(12,'AV1212-0002',1,NULL,NULL,2,NULL,NULL,10,'2012-12-08 18:20:14','2012-12-08','2012-12-08','2012-12-09 17:35:07',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,-5.00000000,2,1,1,3,NULL,NULL,NULL,0,0,'2012-12-08',NULL,NULL,'crabe',NULL,NULL),(13,'FA1212-0011',1,NULL,NULL,0,NULL,NULL,7,'2012-12-09 20:04:19','2012-12-09','2013-02-12','2013-02-12 14:54:37',0,0.00000000,NULL,NULL,0,NULL,NULL,2.74000000,0.00000000,0.00000000,0.00000000,14.00000000,16.74000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2012-12-09',NULL,NULL,'crabe',NULL,NULL),(32,'FA1212-0021',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:34:23','2012-12-11','2013-03-24','2013-03-24 14:54:00',0,0.00000000,NULL,NULL,0,NULL,NULL,90.00000000,0.00000000,0.00000000,0.60000000,520.00000000,610.60000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2012-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL),(33,'(PROV33)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:34:23','2012-12-11',NULL,'2012-12-11 08:34:23',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-11','This is a comment (private)','This is a comment (public)','',NULL,NULL),(55,'FA1212-0009',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:35:51','2012-12-11','2012-12-12','2012-12-12 17:54:19',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2012-12-11','This is a comment (private)','This is a comment (public)','',NULL,NULL),(56,'(PROV56)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:35:52','2012-12-11',NULL,'2012-12-11 08:35:52',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-11','This is a comment (private)','This is a comment (public)','',NULL,NULL),(78,'(PROV78)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:36:41','2012-12-11',NULL,'2012-12-11 08:36:41',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-11','This is a comment (private)','This is a comment (public)','',NULL,NULL),(79,'(PROV79)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:36:41','2012-12-11',NULL,'2012-12-19 16:56:16',0,0.00000000,NULL,NULL,0,NULL,NULL,7.60000000,0.66000000,-3.00000000,0.00000000,50.00000000,55.26000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-11','This is a comment (private)','This is a comment (public)','',NULL,NULL),(121,'(PROV121)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-19 18:39:38','2012-12-19',NULL,'2012-12-19 17:39:38',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-19','This is a comment (private)','This is a comment (public)','',NULL,NULL),(122,'(PROV122)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-19 18:39:38','2012-12-19',NULL,'2012-12-19 17:39:38',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-19','This is a comment (private)','This is a comment (public)','',NULL,NULL),(146,'(PROV146)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-19 18:48:41','2012-12-19',NULL,'2013-01-18 14:51:01',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-19','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL),(147,'(PROV147)',1,NULL,NULL,0,NULL,NULL,1,'2012-12-19 18:48:42','2012-12-19',NULL,'2012-12-19 17:48:42',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2012-12-19','This is a comment (private)','This is a comment (public)','',NULL,NULL),(148,'FS1301-0001',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:22:48','2013-01-19','2013-01-19','2013-01-19 17:22:48',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,1,NULL,NULL,NULL,NULL,0,1,'2013-01-19',NULL,NULL,'',NULL,NULL),(149,'(PROV149)',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:30:05','2013-01-19',NULL,'2013-02-13 14:02:53',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,0,1,NULL,NULL,NULL,NULL,NULL,0,0,'2013-01-19',NULL,NULL,'crabe',NULL,NULL),(150,'FA6801-0010',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:31:10','2013-01-19','2013-01-19','2013-01-19 17:31:10',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,1,NULL,NULL,NULL,NULL,0,1,'2013-01-19',NULL,NULL,'',NULL,NULL),(151,'FS1301-0002',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:31:58','2013-01-19','2013-01-19','2013-01-19 17:31:58',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,1,NULL,NULL,NULL,NULL,0,1,'2013-01-19',NULL,NULL,'',NULL,NULL),(152,'FA1302-0012',1,NULL,NULL,0,NULL,NULL,18,'2013-02-17 16:26:53','2013-02-17','2013-02-17','2013-02-17 15:27:00',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2013-02-17',NULL,NULL,'crabe',NULL,NULL),(153,'(PROV153)',1,NULL,NULL,0,NULL,NULL,1,'2013-02-17 18:22:24','2013-02-17',NULL,'2013-02-17 17:22:24',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-02-17',NULL,NULL,'crabe',NULL,NULL),(154,'(PROV154)',1,NULL,NULL,0,NULL,NULL,1,'2013-02-17 18:24:21','2013-02-17',NULL,'2013-02-17 17:24:21',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-02-17',NULL,NULL,'crabe',NULL,NULL),(155,'(PROV155)',1,NULL,NULL,0,NULL,NULL,1,'2013-02-17 18:30:30','2013-02-17',NULL,'2013-02-17 17:30:30',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-02-17',NULL,NULL,'crabe',NULL,NULL),(156,'(PROV156)',1,NULL,NULL,0,NULL,NULL,1,'2013-02-17 18:37:01','2013-02-17',NULL,'2013-02-17 17:37:01',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-02-17',NULL,NULL,'crabe',NULL,NULL),(157,'(PROV157)',1,NULL,NULL,0,NULL,NULL,18,'2013-02-17 18:39:23','2013-02-17',NULL,'2013-02-17 17:39:23',0,0.00000000,NULL,NULL,0,NULL,NULL,3.22000000,0.00000000,0.00000000,0.00000000,20.00000000,23.22000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-02-17',NULL,NULL,'crabe',NULL,NULL),(158,'FA1307-0013',1,NULL,NULL,0,NULL,NULL,12,'2013-03-06 16:43:37','2013-07-18','2013-03-23','2013-03-23 17:23:03',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2013-07-18',NULL,NULL,'crabe',NULL,NULL),(159,'FA1407-0014',1,NULL,NULL,0,NULL,NULL,12,'2013-03-06 16:44:12','2014-07-18','2013-03-06','2013-03-06 15:44:12',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,11.00000000,11.00000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2014-07-18',NULL,NULL,'',NULL,NULL),(160,'FA1507-0015',1,NULL,NULL,0,NULL,NULL,12,'2013-03-06 16:47:48','2015-07-18','2013-03-06','2013-03-06 15:47:48',0,0.00000000,NULL,NULL,0,NULL,NULL,1.11000000,0.00000000,0.00000000,0.00000000,8.89000000,10.00000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2015-07-18',NULL,NULL,'',NULL,NULL),(161,'FA1607-0016',1,NULL,NULL,0,NULL,NULL,12,'2013-03-06 16:48:16','2016-07-18','2013-03-06','2013-03-06 15:48:16',0,0.00000000,NULL,NULL,0,NULL,NULL,2.22000000,0.00000000,0.00000000,0.00000000,17.78000000,20.00000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2016-07-18',NULL,NULL,'',NULL,NULL),(162,'(PROV162)',1,NULL,NULL,0,'fdfs',NULL,23,'2013-03-08 10:02:54','2013-03-08',NULL,'2013-03-08 09:02:54',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,5.00000000,5.00000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-08',NULL,NULL,'crabe',NULL,NULL),(184,'(PROV184)',1,NULL,NULL,0,NULL,NULL,1,'2013-03-09 18:19:36','2013-03-09',NULL,'2013-03-09 17:19:36',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-09','This is a comment (private)','This is a comment (public)','',NULL,NULL),(185,'(PROV185)',1,NULL,NULL,0,NULL,NULL,1,'2013-03-09 18:19:36','2013-03-09',NULL,'2013-03-09 17:19:36',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-09','This is a comment (private)','This is a comment (public)','',NULL,NULL),(186,'(PROV186)',1,NULL,NULL,0,NULL,NULL,1,'2013-03-09 18:26:56','2013-03-09',NULL,'2013-03-09 17:26:56',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-09','This is a comment (private)','This is a comment (public)','',NULL,NULL),(187,'(PROV187)',1,NULL,NULL,0,NULL,NULL,1,'2013-03-09 18:26:56','2013-03-09',NULL,'2013-03-09 17:26:56',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-09','This is a comment (private)','This is a comment (public)','',NULL,NULL),(206,'(PROV206)',1,NULL,NULL,0,NULL,NULL,1,'2013-03-09 18:34:05','2013-03-09',NULL,'2013-03-09 17:34:05',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-09','This is a comment (private)','This is a comment (public)','',NULL,NULL),(207,'(PROV207)',1,NULL,NULL,0,NULL,NULL,1,'2013-03-09 18:34:05','2013-03-09',NULL,'2013-03-10 14:45:36',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-09','This is a comment (private)','This is a comment (public)','generic_invoice_odt:/var/www/dolibarrnew/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL),(208,'FA1303-0017',1,NULL,NULL,0,NULL,NULL,26,'2013-03-10 15:58:11','2013-03-10','2013-03-10','2013-03-10 14:58:34',0,0.00000000,NULL,NULL,0,NULL,NULL,1.25000000,0.00000000,0.00000000,0.00000000,10.00000000,11.25000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2013-03-10',NULL,NULL,'generic_invoice_odt:/var/www/dolibarrnew/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL),(209,'FA1303-0018',1,NULL,NULL,0,NULL,NULL,19,'2013-03-19 09:37:51','2013-03-19','2013-03-19','2013-03-19 08:38:10',0,0.00000000,NULL,NULL,0,NULL,NULL,-1.25000000,0.00000000,0.00000000,0.00000000,10.00000000,8.75000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2013-03-19',NULL,NULL,'crabe',NULL,NULL),(210,'FA1107-0019',1,NULL,NULL,0,NULL,NULL,10,'2013-03-20 14:30:11','2011-07-10','2013-03-20','2013-03-20 13:30:11',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,1,1,1,NULL,NULL,NULL,NULL,1,0,'2011-07-10',NULL,NULL,'',NULL,NULL),(211,'FA1303-0020',1,NULL,NULL,0,NULL,NULL,19,'2013-03-22 09:40:10','2013-03-22','2013-03-23','2013-03-23 16:31:13',0,0.00000000,NULL,NULL,0,NULL,NULL,0.60000000,0.00000000,0.00000000,0.40000000,110.00000000,111.00000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2013-03-22',NULL,NULL,'crabe',NULL,NULL),(239,'(PROV239)',1,NULL,NULL,0,NULL,NULL,1,'2014-04-05 16:20:58','2014-04-05',NULL,'2014-04-05 14:20:58',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2014-04-05','This is a comment (private)','This is a comment (public)','',NULL,NULL),(240,'(PROV240)',1,NULL,NULL,0,NULL,NULL,1,'2014-04-05 16:20:58','2014-04-05',NULL,'2014-04-05 14:20:58',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2014-04-05','This is a comment (private)','This is a comment (public)','',NULL,NULL),(278,'(PROV278)',1,NULL,NULL,0,NULL,NULL,1,'2014-04-05 16:22:42','2014-04-05',NULL,'2014-04-05 14:22:42',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2014-04-05','This is a comment (private)','This is a comment (public)','',NULL,NULL),(279,'(PROV279)',1,NULL,NULL,0,NULL,NULL,1,'2014-04-05 16:22:42','2014-04-05',NULL,'2014-04-05 14:22:42',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2014-04-05','This is a comment (private)','This is a comment (public)','',NULL,NULL),(317,'(PROV317)',1,NULL,NULL,0,NULL,NULL,1,'2014-04-05 16:27:28','2014-04-05',NULL,'2014-04-05 14:27:28',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2014-04-05','This is a comment (private)','This is a comment (public)','',NULL,NULL),(318,'(PROV318)',1,NULL,NULL,0,NULL,NULL,1,'2014-04-05 16:27:28','2014-04-05',NULL,'2014-04-05 14:27:28',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,0,1,NULL,NULL,NULL,NULL,NULL,1,0,'2014-04-05','This is a comment (private)','This is a comment (public)','',NULL,NULL); +/*!40000 ALTER TABLE `llx_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_extrafields` +-- + +LOCK TABLES `llx_facture_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `ref_supplier` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(30) DEFAULT NULL, + `type` smallint(6) NOT NULL DEFAULT '0', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `libelle` varchar(255) DEFAULT NULL, + `paye` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise` double(24,8) DEFAULT '0.00000000', + `close_code` varchar(16) DEFAULT NULL, + `close_note` varchar(128) DEFAULT NULL, + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_facture_fourn_ref_supplier` (`ref_supplier`,`fk_soc`,`entity`), + UNIQUE KEY `uk_facture_fourn_ref` (`ref`,`entity`), + KEY `idx_facture_fourn_date_lim_reglement` (`date_lim_reglement`), + KEY `idx_facture_fourn_fk_soc` (`fk_soc`), + KEY `idx_facture_fourn_fk_user_author` (`fk_user_author`), + KEY `idx_facture_fourn_fk_user_valid` (`fk_user_valid`), + KEY `idx_facture_fourn_fk_projet` (`fk_projet`), + CONSTRAINT `fk_facture_fourn_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn` +-- + +LOCK TABLES `llx_facture_fourn` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn` DISABLE KEYS */; +INSERT INTO `llx_facture_fourn` VALUES (1,NULL,'aaa',1,NULL,0,17,'2011-08-04 22:21:18','2011-08-04','2012-12-09 19:03:52','',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,16.00000000,3.14000000,19.14000000,0,1,NULL,NULL,NULL,1,NULL,NULL,'','',NULL,NULL,NULL),(16,NULL,'FR70813',1,NULL,0,1,'2012-12-19 15:24:11','2003-04-11','2013-02-10 20:55:42','OVH FR70813',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,829.00000000,162.48000000,991.48000000,1,1,1,NULL,NULL,1,NULL,'2003-04-11','','',NULL,NULL,NULL),(17,NULL,'FR81385',1,NULL,0,1,'2013-02-13 17:19:35','2003-06-04','2013-02-13 16:19:35','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,1,NULL,'2003-06-04','','',NULL,NULL,NULL),(18,NULL,'FR81385',1,NULL,0,2,'2013-02-13 17:20:25','2003-06-04','2013-02-13 16:20:25','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,1,NULL,'2003-06-04','','',NULL,NULL,NULL),(19,NULL,'FR813852',1,NULL,0,2,'2013-03-16 17:59:02','2013-03-16','2013-03-16 16:59:11','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,1,NULL,NULL,'','',NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_facture_fourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_det` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_det`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_det` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture_fourn` int(11) NOT NULL, + `fk_product` int(11) DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `pu_ht` double(24,8) DEFAULT NULL, + `pu_ttc` double(24,8) DEFAULT NULL, + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `tva_tx` double(6,3) DEFAULT NULL, + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `total_ht` double(24,8) DEFAULT NULL, + `tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_code_ventilation` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_det_fk_facture` (`fk_facture_fourn`), + CONSTRAINT `fk_facture_fourn_det_fk_facture` FOREIGN KEY (`fk_facture_fourn`) REFERENCES `llx_facture_fourn` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_det` +-- + +LOCK TABLES `llx_facture_fourn_det` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_det` DISABLE KEYS */; +INSERT INTO `llx_facture_fourn_det` VALUES (1,1,NULL,NULL,NULL,'aaa',10.00000000,11.96000000,1.6,0,19.600,0.000,'',0.000,'',16.00000000,3.14000000,0.00000000,0.00000000,19.14000000,0,NULL,NULL,0,NULL,0),(44,16,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/04/2003 à 11/10/2003',414.00000000,495.14400000,1,0,19.600,0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,0),(45,16,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/10/2003 à 11/04/2004',414.00000000,495.14400000,1,0,19.600,0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,0),(46,16,NULL,NULL,NULL,'ref :sd.installation.annuel
Frais de mise en service d\'un serveur dédié pour un paiement annuel
',1.00000000,1.19600000,1,0,19.600,0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0),(47,17,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0),(48,17,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0),(49,18,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0),(50,18,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0),(51,19,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,0.000,'0',0.000,'0',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0),(52,19,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,0.000,'0',0.000,'0',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0); +/*!40000 ALTER TABLE `llx_facture_fourn_det` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_extrafields` +-- + +LOCK TABLES `llx_facture_fourn_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_fourn_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_rec` +-- + +DROP TABLE IF EXISTS `llx_facture_rec`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_rec` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `titre` varchar(50) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_user_author` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT '0', + `fk_mode_reglement` int(11) DEFAULT '0', + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `last_gen` varchar(7) DEFAULT NULL, + `unit_frequency` varchar(2) DEFAULT 'd', + `date_when` datetime DEFAULT NULL, + `date_last_gen` datetime DEFAULT NULL, + `nb_gen_done` int(11) DEFAULT NULL, + `nb_gen_max` int(11) DEFAULT NULL, + `frequency` int(11) DEFAULT NULL, + `usenewprice` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_facture_rec_uk_titre` (`titre`,`entity`), + KEY `idx_facture_rec_fk_soc` (`fk_soc`), + KEY `idx_facture_rec_fk_user_author` (`fk_user_author`), + KEY `idx_facture_rec_fk_projet` (`fk_projet`), + CONSTRAINT `fk_facture_rec_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_rec_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_rec_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_rec` +-- + +LOCK TABLES `llx_facture_rec` WRITE; +/*!40000 ALTER TABLE `llx_facture_rec` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_rec` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet` +-- + +DROP TABLE IF EXISTS `llx_facturedet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `fk_remise_except` int(11) DEFAULT NULL, + `subprice` double(24,8) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT NULL, + `total_tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_code_ventilation` int(11) NOT NULL DEFAULT '0', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fk_remise_except` (`fk_remise_except`,`fk_facture`), + KEY `idx_facturedet_fk_facture` (`fk_facture`), + KEY `idx_facturedet_fk_product` (`fk_product`), + CONSTRAINT `fk_facturedet_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=1622 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet` +-- + +LOCK TABLES `llx_facturedet` WRITE; +/*!40000 ALTER TABLE `llx_facturedet` DISABLE KEYS */; +INSERT INTO `llx_facturedet` VALUES (1,1,NULL,4,NULL,'',0.000,0.000,'',0.000,'',2,0,0,NULL,0.01000000,0.01000000,0.02000000,0.00000000,0.00000000,0.00000000,0.02000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(3,2,NULL,3,NULL,'Service S1',0.000,0.000,'',0.000,'',1,10,4,NULL,40.00000000,36.00000000,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,'2010-07-10 00:00:00',NULL,0,NULL,0.00000000,0,0,2,NULL),(4,2,NULL,NULL,NULL,'Abonnement annuel assurance',1.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.10000000,0.00000000,0.00000000,10.10000000,0,'2010-07-10 00:00:00','2011-07-10 00:00:00',0,NULL,0.00000000,0,0,3,NULL),(11,3,NULL,4,NULL,'afsdfsdfsdfsdf',0.000,0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(12,3,NULL,NULL,NULL,'dfdfd',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(13,5,NULL,4,NULL,'Decapsuleur',12.500,0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(14,6,NULL,4,NULL,'Decapsuleur',19.600,0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.98000000,0.00000000,0.00000000,5.98000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(21,8,NULL,NULL,NULL,'dddd',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(22,9,NULL,NULL,NULL,'ggg',19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(23,10,NULL,4,NULL,'',12.500,0.000,'',0.000,'',1,0,0,NULL,-5.00000000,NULL,-5.00000000,-0.63000000,0.00000000,0.00000000,-5.63000000,0,NULL,NULL,0,NULL,12.00000000,0,0,1,NULL),(24,10,NULL,1,NULL,'A beatifull pink dress\r\nlkm',0.000,0.000,'',0.000,'',1,0,0,NULL,-6.00000000,NULL,-6.00000000,0.00000000,0.00000000,0.00000000,-6.00000000,0,NULL,NULL,0,0,0.00000000,0,0,2,NULL),(25,11,NULL,4,NULL,'jljk',12.500,0.000,'',0.000,'',1,0,0,NULL,5.00000000,NULL,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(26,12,NULL,1,NULL,'A beatifull pink dress\r\nhfghf',0.000,0.000,'',0.000,'',1,0,0,NULL,-5.00000000,NULL,-5.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,0,NULL,NULL,0,0,0.00000000,0,0,1,NULL),(27,13,NULL,NULL,NULL,'gdfgdf',19.600,0.000,'',0.000,'',1.4,0,0,NULL,10.00000000,NULL,14.00000000,2.74000000,0.00000000,0.00000000,16.74000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(137,33,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(138,33,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(256,55,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(257,55,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(258,56,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(259,56,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(377,78,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(378,78,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(385,79,NULL,NULL,NULL,'hfghfg',10.000,1.400,'',-15.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.00000000,0.14000000,-1.50000000,9.64000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(386,79,NULL,NULL,NULL,'gdfg',15.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.50000000,0.00000000,0.00000000,11.50000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(387,79,NULL,NULL,NULL,'fdsf',21.000,5.200,'',-15.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,2.10000000,0.52000000,-1.50000000,11.12000000,0,NULL,NULL,0,NULL,0.00000000,0,0,3,NULL),(388,79,NULL,NULL,NULL,'ghfgh',15.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.50000000,0.00000000,0.00000000,11.50000000,0,NULL,NULL,0,NULL,0.00000000,0,0,4,NULL),(389,79,NULL,NULL,NULL,'ghfgh',15.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.50000000,0.00000000,0.00000000,11.50000000,0,NULL,NULL,0,NULL,0.00000000,0,0,5,NULL),(618,121,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(619,121,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(620,122,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(621,122,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(749,146,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(750,146,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(751,147,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(752,147,NULL,NULL,NULL,'Desc',10.000,0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(753,13,NULL,2,NULL,'(Pays d\'origine: Albanie)',0.000,0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,0,0.00000000,0,0,2,NULL),(754,148,NULL,11,NULL,'hfghf',0.000,0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(755,148,NULL,4,NULL,'Decapsuleur',12.500,0.000,'',0.000,'',1,0,0,NULL,5.00000000,NULL,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(756,149,NULL,5,NULL,'aaaa',19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(757,150,NULL,2,NULL,'Product P1',12.500,0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(758,151,NULL,2,NULL,'Product P1',12.500,0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(759,152,NULL,NULL,NULL,'gdfgfd',19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(760,153,NULL,NULL,NULL,'gfdgdf',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(761,154,NULL,NULL,NULL,'',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(762,155,NULL,NULL,NULL,'',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(763,156,NULL,NULL,NULL,'gfdgdf',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(764,157,NULL,NULL,NULL,'gfdg',19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(765,157,NULL,4,NULL,'Decapsuleur',12.500,0.000,'',0.000,'',1,0,0,NULL,5.00000000,NULL,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(766,157,NULL,4,NULL,'eeee',12.500,0.000,'',0.000,'',1,0,0,NULL,5.00000000,NULL,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(768,32,NULL,NULL,NULL,'mlml',18.000,0.000,'',0.000,'',1,0,0,NULL,100.00000000,NULL,100.00000000,18.00000000,0.00000000,0.00000000,118.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,3,NULL),(769,32,NULL,NULL,NULL,'mlkml',18.000,0.000,'',0.000,'',1,0,0,NULL,400.00000000,NULL,400.00000000,72.00000000,0.00000000,0.00000000,472.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,4,NULL),(770,158,NULL,NULL,NULL,'Adhésion/cotisation 2013',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,'2013-07-18 00:00:00','2014-07-17 00:00:00',0,NULL,0.00000000,0,0,1,NULL),(771,159,NULL,NULL,NULL,'Adhésion/cotisation 2014',0.000,0.000,'',0.000,'',1,0,0,NULL,11.00000000,NULL,11.00000000,0.00000000,0.00000000,0.00000000,11.00000000,1,'2014-07-18 00:00:00','2015-07-17 00:00:00',0,NULL,0.00000000,0,0,1,NULL),(772,160,NULL,NULL,NULL,'Adhésion/cotisation 2015',12.500,0.000,'',0.000,'',1,0,0,NULL,8.88889000,NULL,8.89000000,1.11000000,0.00000000,0.00000000,10.00000000,1,'2015-07-18 00:00:00','2016-07-17 00:00:00',0,NULL,0.00000000,0,0,1,NULL),(773,161,NULL,NULL,NULL,'Adhésion/cotisation 2016',12.500,0.000,'',0.000,'',1,0,0,NULL,17.77778000,NULL,17.78000000,2.22000000,0.00000000,0.00000000,20.00000000,1,'2016-07-18 00:00:00','2017-07-17 00:00:00',0,NULL,0.00000000,0,0,1,NULL),(774,162,NULL,NULL,NULL,'fdsfs',0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,3,NULL),(775,162,NULL,NULL,NULL,'fsdfsf',0.000,0.000,'',0.000,'',1,0,0,1,-5.00000000,NULL,-5.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,0,NULL,NULL,2,NULL,0.00000000,0,0,1,NULL),(776,32,NULL,NULL,NULL,'fsdfsdfds',0.000,0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,5,NULL),(777,32,NULL,NULL,NULL,'fsdfsdfds',0.000,0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,6,NULL),(779,32,NULL,NULL,NULL,'fsdfds',0.000,0.000,'0',0.000,'0',0,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,9,NULL,NULL,0,0,0.00000000,0,0,2,NULL),(780,32,NULL,NULL,NULL,'ffsdf',0.000,0.000,'0',0.000,'0',0,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,9,NULL,NULL,0,NULL,0.00000000,0,1790,1,NULL),(781,162,NULL,NULL,NULL,'hh',0.000,0.000,'0',0.000,'0',0,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,9,NULL,NULL,0,NULL,0.00000000,0,1790,2,NULL),(899,184,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(900,184,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(901,185,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(902,185,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(903,186,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(904,186,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(905,187,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(906,187,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1014,206,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1015,206,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1016,207,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1017,207,NULL,NULL,NULL,'Desc',10.000,0.000,'0',0.000,'0',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1018,208,NULL,NULL,NULL,'ggdfg',12.500,0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,1.25000000,0.00000000,0.00000000,11.25000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1019,209,NULL,NULL,NULL,'hfghgf',12.500,0.000,'0',0.000,'0',1,0,0,2,-10.00000000,NULL,-10.00000000,-1.25000000,0.00000000,0.00000000,-11.25000000,0,NULL,NULL,2,NULL,0.00000000,0,0,-1,NULL),(1020,209,NULL,NULL,NULL,'fsdfsd',0.000,0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL),(1021,209,NULL,NULL,NULL,'hfg',0.000,0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1022,210,NULL,NULL,NULL,'Adhésion/cotisation 2011',0.000,0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,'2011-07-10 00:00:00','2012-07-09 00:00:00',0,NULL,0.00000000,0,0,1,NULL),(1023,211,NULL,NULL,NULL,'gfdg',6.000,0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.60000000,0.00000000,0.00000000,10.60000000,0,NULL,NULL,0,0,0.00000000,0,0,1,NULL),(1024,211,NULL,1,NULL,'A beatifull pink dress\nghkhgj',0.000,0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,NULL,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1186,239,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1187,239,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1188,240,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1189,240,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1385,278,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1386,278,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1387,279,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1388,279,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1584,317,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1585,317,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL),(1586,318,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL),(1587,318,NULL,NULL,NULL,'Desc',10.000,0.000,'3',0.000,'1',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL); +/*!40000 ALTER TABLE `llx_facturedet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facturedet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facturedet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet_extrafields` +-- + +LOCK TABLES `llx_facturedet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facturedet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facturedet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet_rec` +-- + +DROP TABLE IF EXISTS `llx_facturedet_rec`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet_rec` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `subprice` double(24,8) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT NULL, + `total_tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet_rec` +-- + +LOCK TABLES `llx_facturedet_rec` WRITE; +/*!40000 ALTER TABLE `llx_facturedet_rec` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facturedet_rec` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinter` +-- + +DROP TABLE IF EXISTS `llx_fichinter`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinter` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT '0', + `fk_contrat` int(11) DEFAULT '0', + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `datei` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `duree` double DEFAULT NULL, + `description` text, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fichinter_ref` (`ref`,`entity`), + KEY `idx_fichinter_fk_soc` (`fk_soc`), + CONSTRAINT `fk_fichinter_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinter` +-- + +LOCK TABLES `llx_fichinter` WRITE; +/*!40000 ALTER TABLE `llx_fichinter` DISABLE KEYS */; +INSERT INTO `llx_fichinter` VALUES (1,2,1,0,'FI1007-0001',1,'2010-07-08 23:51:54','2010-07-09 01:42:41','2010-07-09 01:51:54',NULL,1,1,1,51000,NULL,NULL,NULL,'soleil',NULL),(2,1,NULL,0,'FI1007-0002',1,'2012-12-08 13:11:07','2010-07-11 16:07:51',NULL,NULL,1,NULL,0,3600,'ferfrefeferf',NULL,NULL,'soleil',NULL); +/*!40000 ALTER TABLE `llx_fichinter` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinter_extrafields` +-- + +DROP TABLE IF EXISTS `llx_fichinter_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinter_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_ficheinter_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinter_extrafields` +-- + +LOCK TABLES `llx_fichinter_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_fichinter_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_fichinter_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinterdet` +-- + +DROP TABLE IF EXISTS `llx_fichinterdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinterdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_fichinter` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `date` datetime DEFAULT NULL, + `description` text, + `duree` int(11) DEFAULT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_fichinterdet_fk_fichinter` (`fk_fichinter`), + CONSTRAINT `fk_fichinterdet_fk_fichinter` FOREIGN KEY (`fk_fichinter`) REFERENCES `llx_fichinter` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinterdet` +-- + +LOCK TABLES `llx_fichinterdet` WRITE; +/*!40000 ALTER TABLE `llx_fichinterdet` DISABLE KEYS */; +INSERT INTO `llx_fichinterdet` VALUES (1,1,NULL,'2010-07-07 04:00:00','Intervention sur site',3600,0),(2,1,NULL,'2010-07-08 11:00:00','Autre',47400,0),(3,2,NULL,'2010-07-11 05:00:00','Pres',3600,0); +/*!40000 ALTER TABLE `llx_fichinterdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_filemanager_roots` +-- + +DROP TABLE IF EXISTS `llx_filemanager_roots`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_filemanager_roots` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `rootlabel` varchar(64) DEFAULT NULL, + `rootpath` text, + `note` text, + `position` int(11) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_filemanager_root` (`rootlabel`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_filemanager_roots` +-- + +LOCK TABLES `llx_filemanager_roots` WRITE; +/*!40000 ALTER TABLE `llx_filemanager_roots` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_filemanager_roots` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday` +-- + +DROP TABLE IF EXISTS `llx_holiday`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL, + `date_create` datetime NOT NULL, + `description` varchar(255) NOT NULL, + `date_debut` date NOT NULL, + `date_fin` date NOT NULL, + `halfday` int(11) DEFAULT '0', + `statut` int(11) NOT NULL DEFAULT '1', + `fk_validator` int(11) NOT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_refuse` datetime DEFAULT NULL, + `fk_user_refuse` int(11) DEFAULT NULL, + `date_cancel` datetime DEFAULT NULL, + `fk_user_cancel` int(11) DEFAULT NULL, + `detail_refuse` varchar(250) DEFAULT NULL, + `note_private` text, + `note_public` text, + `note` text, + PRIMARY KEY (`rowid`), + KEY `idx_holiday_fk_user` (`fk_user`), + KEY `idx_holiday_date_debut` (`date_debut`), + KEY `idx_holiday_date_fin` (`date_fin`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday` +-- + +LOCK TABLES `llx_holiday` WRITE; +/*!40000 ALTER TABLE `llx_holiday` DISABLE KEYS */; +INSERT INTO `llx_holiday` VALUES (1,1,'2013-02-17 19:06:35','gdf','2013-02-10','2013-02-11',0,3,1,'2013-02-17 19:06:57',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_holiday` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_config` +-- + +DROP TABLE IF EXISTS `llx_holiday_config`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_config` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `value` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_config` +-- + +LOCK TABLES `llx_holiday_config` WRITE; +/*!40000 ALTER TABLE `llx_holiday_config` DISABLE KEYS */; +INSERT INTO `llx_holiday_config` VALUES (1,'userGroup','1'),(2,'lastUpdate','20130301231231'),(3,'nbUser','8'),(4,'delayForRequest','31'),(5,'AlertValidatorDelay','0'),(6,'AlertValidatorSolde','0'),(7,'nbHolidayDeducted','1'),(8,'nbHolidayEveryMonth','2.08334'); +/*!40000 ALTER TABLE `llx_holiday_config` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_events` +-- + +DROP TABLE IF EXISTS `llx_holiday_events`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_events` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `name` varchar(255) NOT NULL, + `value` text NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_holiday_name` (`name`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_events` +-- + +LOCK TABLES `llx_holiday_events` WRITE; +/*!40000 ALTER TABLE `llx_holiday_events` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_holiday_events` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_logs` +-- + +DROP TABLE IF EXISTS `llx_holiday_logs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_logs` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_action` datetime NOT NULL, + `fk_user_action` int(11) NOT NULL, + `fk_user_update` int(11) NOT NULL, + `type_action` varchar(255) NOT NULL, + `prev_solde` varchar(255) NOT NULL, + `new_solde` varchar(255) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_logs` +-- + +LOCK TABLES `llx_holiday_logs` WRITE; +/*!40000 ALTER TABLE `llx_holiday_logs` DISABLE KEYS */; +INSERT INTO `llx_holiday_logs` VALUES (1,'2013-01-17 21:03:15',1,1,'Event : Mise à jour mensuelle','0.00','2.08'),(2,'2013-01-17 21:03:15',1,2,'Event : Mise à jour mensuelle','0.00','2.08'),(3,'2013-01-17 21:03:15',1,3,'Event : Mise à jour mensuelle','0.00','2.08'),(4,'2013-02-01 09:53:26',1,1,'Event : Mise à jour mensuelle','2.08','4.16'),(5,'2013-02-01 09:53:26',1,2,'Event : Mise à jour mensuelle','2.08','4.16'),(6,'2013-02-01 09:53:26',1,3,'Event : Mise à jour mensuelle','2.08','4.16'),(7,'2013-02-01 09:53:26',1,1,'Event : Mise à jour mensuelle','4.17','6.25'),(8,'2013-02-01 09:53:26',1,2,'Event : Mise à jour mensuelle','4.17','6.25'),(9,'2013-02-01 09:53:26',1,3,'Event : Mise à jour mensuelle','4.17','6.25'),(10,'2013-02-01 09:53:26',1,4,'Event : Mise à jour mensuelle','0.00','2.08'),(11,'2013-02-01 09:53:31',1,1,'Event : Mise à jour mensuelle','6.25','8.33'),(12,'2013-02-01 09:53:31',1,2,'Event : Mise à jour mensuelle','6.25','8.33'),(13,'2013-02-01 09:53:31',1,3,'Event : Mise à jour mensuelle','6.25','8.33'),(14,'2013-02-01 09:53:31',1,4,'Event : Mise à jour mensuelle','2.08','4.16'),(15,'2013-02-01 09:53:31',1,1,'Event : Mise à jour mensuelle','8.33','10.41'),(16,'2013-02-01 09:53:31',1,2,'Event : Mise à jour mensuelle','8.33','10.41'),(17,'2013-02-01 09:53:31',1,3,'Event : Mise à jour mensuelle','8.33','10.41'),(18,'2013-02-01 09:53:31',1,4,'Event : Mise à jour mensuelle','4.17','6.25'),(19,'2013-02-01 09:53:33',1,1,'Event : Mise à jour mensuelle','10.42','12.50'),(20,'2013-02-01 09:53:33',1,2,'Event : Mise à jour mensuelle','10.42','12.50'),(21,'2013-02-01 09:53:33',1,3,'Event : Mise à jour mensuelle','10.42','12.50'),(22,'2013-02-01 09:53:33',1,4,'Event : Mise à jour mensuelle','6.25','8.33'),(23,'2013-02-01 09:53:34',1,1,'Event : Mise à jour mensuelle','12.50','14.58'),(24,'2013-02-01 09:53:34',1,2,'Event : Mise à jour mensuelle','12.50','14.58'),(25,'2013-02-01 09:53:34',1,3,'Event : Mise à jour mensuelle','12.50','14.58'),(26,'2013-02-01 09:53:34',1,4,'Event : Mise à jour mensuelle','8.33','10.41'),(27,'2013-02-01 09:53:34',1,1,'Event : Mise à jour mensuelle','14.58','16.66'),(28,'2013-02-01 09:53:34',1,2,'Event : Mise à jour mensuelle','14.58','16.66'),(29,'2013-02-01 09:53:34',1,3,'Event : Mise à jour mensuelle','14.58','16.66'),(30,'2013-02-01 09:53:34',1,4,'Event : Mise à jour mensuelle','10.42','12.50'),(31,'2013-02-01 09:53:36',1,1,'Event : Mise à jour mensuelle','16.67','18.75'),(32,'2013-02-01 09:53:36',1,2,'Event : Mise à jour mensuelle','16.67','18.75'),(33,'2013-02-01 09:53:36',1,3,'Event : Mise à jour mensuelle','16.67','18.75'),(34,'2013-02-01 09:53:36',1,4,'Event : Mise à jour mensuelle','12.50','14.58'),(35,'2013-02-01 09:53:36',1,1,'Event : Mise à jour mensuelle','18.75','20.83'),(36,'2013-02-01 09:53:36',1,2,'Event : Mise à jour mensuelle','18.75','20.83'),(37,'2013-02-01 09:53:36',1,3,'Event : Mise à jour mensuelle','18.75','20.83'),(38,'2013-02-01 09:53:36',1,4,'Event : Mise à jour mensuelle','14.58','16.66'),(39,'2013-02-01 09:53:37',1,1,'Event : Mise à jour mensuelle','20.83','22.91'),(40,'2013-02-01 09:53:37',1,2,'Event : Mise à jour mensuelle','20.83','22.91'),(41,'2013-02-01 09:53:37',1,3,'Event : Mise à jour mensuelle','20.83','22.91'),(42,'2013-02-01 09:53:37',1,4,'Event : Mise à jour mensuelle','16.67','18.75'),(43,'2013-02-01 09:53:37',1,1,'Event : Mise à jour mensuelle','22.92','25.00'),(44,'2013-02-01 09:53:37',1,2,'Event : Mise à jour mensuelle','22.92','25.00'),(45,'2013-02-01 09:53:37',1,3,'Event : Mise à jour mensuelle','22.92','25.00'),(46,'2013-02-01 09:53:37',1,4,'Event : Mise à jour mensuelle','18.75','20.83'),(47,'2013-02-01 09:53:44',1,1,'Event : Mise à jour mensuelle','25.00','27.08'),(48,'2013-02-01 09:53:44',1,2,'Event : Mise à jour mensuelle','25.00','27.08'),(49,'2013-02-01 09:53:44',1,3,'Event : Mise à jour mensuelle','25.00','27.08'),(50,'2013-02-01 09:53:44',1,4,'Event : Mise à jour mensuelle','20.83','22.91'),(51,'2013-02-01 09:53:47',1,1,'Event : Mise à jour mensuelle','27.08','29.16'),(52,'2013-02-01 09:53:47',1,2,'Event : Mise à jour mensuelle','27.08','29.16'),(53,'2013-02-01 09:53:47',1,3,'Event : Mise à jour mensuelle','27.08','29.16'),(54,'2013-02-01 09:53:47',1,4,'Event : Mise à jour mensuelle','22.92','25.00'),(55,'2013-02-01 09:53:47',1,1,'Event : Mise à jour mensuelle','29.17','31.25'),(56,'2013-02-01 09:53:47',1,2,'Event : Mise à jour mensuelle','29.17','31.25'),(57,'2013-02-01 09:53:47',1,3,'Event : Mise à jour mensuelle','29.17','31.25'),(58,'2013-02-01 09:53:47',1,4,'Event : Mise à jour mensuelle','25.00','27.08'),(59,'2013-02-01 09:53:49',1,1,'Event : Mise à jour mensuelle','31.25','33.33'),(60,'2013-02-01 09:53:49',1,2,'Event : Mise à jour mensuelle','31.25','33.33'),(61,'2013-02-01 09:53:49',1,3,'Event : Mise à jour mensuelle','31.25','33.33'),(62,'2013-02-01 09:53:49',1,4,'Event : Mise à jour mensuelle','27.08','29.16'),(63,'2013-02-01 09:53:52',1,1,'Event : Mise à jour mensuelle','33.33','35.41'),(64,'2013-02-01 09:53:52',1,2,'Event : Mise à jour mensuelle','33.33','35.41'),(65,'2013-02-01 09:53:52',1,3,'Event : Mise à jour mensuelle','33.33','35.41'),(66,'2013-02-01 09:53:52',1,4,'Event : Mise à jour mensuelle','29.17','31.25'),(67,'2013-02-01 09:53:52',1,1,'Event : Mise à jour mensuelle','35.42','37.50'),(68,'2013-02-01 09:53:52',1,2,'Event : Mise à jour mensuelle','35.42','37.50'),(69,'2013-02-01 09:53:52',1,3,'Event : Mise à jour mensuelle','35.42','37.50'),(70,'2013-02-01 09:53:52',1,4,'Event : Mise à jour mensuelle','31.25','33.33'),(71,'2013-02-01 09:53:53',1,1,'Event : Mise à jour mensuelle','37.50','39.58'),(72,'2013-02-01 09:53:53',1,2,'Event : Mise à jour mensuelle','37.50','39.58'),(73,'2013-02-01 09:53:53',1,3,'Event : Mise à jour mensuelle','37.50','39.58'),(74,'2013-02-01 09:53:53',1,4,'Event : Mise à jour mensuelle','33.33','35.41'),(75,'2013-02-01 09:53:54',1,1,'Event : Mise à jour mensuelle','39.58','41.66'),(76,'2013-02-01 09:53:54',1,2,'Event : Mise à jour mensuelle','39.58','41.66'),(77,'2013-02-01 09:53:54',1,3,'Event : Mise à jour mensuelle','39.58','41.66'),(78,'2013-02-01 09:53:54',1,4,'Event : Mise à jour mensuelle','35.42','37.50'),(79,'2013-02-01 09:53:54',1,1,'Event : Mise à jour mensuelle','41.67','43.75'),(80,'2013-02-01 09:53:54',1,2,'Event : Mise à jour mensuelle','41.67','43.75'),(81,'2013-02-01 09:53:54',1,3,'Event : Mise à jour mensuelle','41.67','43.75'),(82,'2013-02-01 09:53:54',1,4,'Event : Mise à jour mensuelle','37.50','39.58'),(83,'2013-02-01 09:55:49',1,1,'Event : Mise à jour mensuelle','43.75','45.83'),(84,'2013-02-01 09:55:49',1,2,'Event : Mise à jour mensuelle','43.75','45.83'),(85,'2013-02-01 09:55:49',1,3,'Event : Mise à jour mensuelle','43.75','45.83'),(86,'2013-02-01 09:55:49',1,4,'Event : Mise à jour mensuelle','39.58','41.66'),(87,'2013-02-01 09:55:56',1,1,'Event : Mise à jour mensuelle','45.83','47.91'),(88,'2013-02-01 09:55:56',1,2,'Event : Mise à jour mensuelle','45.83','47.91'),(89,'2013-02-01 09:55:56',1,3,'Event : Mise à jour mensuelle','45.83','47.91'),(90,'2013-02-01 09:55:56',1,4,'Event : Mise à jour mensuelle','41.67','43.75'),(91,'2013-02-01 09:56:01',1,1,'Event : Mise à jour mensuelle','47.92','50.00'),(92,'2013-02-01 09:56:01',1,2,'Event : Mise à jour mensuelle','47.92','50.00'),(93,'2013-02-01 09:56:01',1,3,'Event : Mise à jour mensuelle','47.92','50.00'),(94,'2013-02-01 09:56:01',1,4,'Event : Mise à jour mensuelle','43.75','45.83'),(95,'2013-02-01 09:56:01',1,1,'Event : Mise à jour mensuelle','50.00','52.08'),(96,'2013-02-01 09:56:01',1,2,'Event : Mise à jour mensuelle','50.00','52.08'),(97,'2013-02-01 09:56:01',1,3,'Event : Mise à jour mensuelle','50.00','52.08'),(98,'2013-02-01 09:56:01',1,4,'Event : Mise à jour mensuelle','45.83','47.91'),(99,'2013-02-01 09:56:03',1,1,'Event : Mise à jour mensuelle','52.08','54.16'),(100,'2013-02-01 09:56:03',1,2,'Event : Mise à jour mensuelle','52.08','54.16'),(101,'2013-02-01 09:56:03',1,3,'Event : Mise à jour mensuelle','52.08','54.16'),(102,'2013-02-01 09:56:03',1,4,'Event : Mise à jour mensuelle','47.92','50.00'),(103,'2013-02-01 09:56:03',1,1,'Event : Mise à jour mensuelle','54.17','56.25'),(104,'2013-02-01 09:56:03',1,2,'Event : Mise à jour mensuelle','54.17','56.25'),(105,'2013-02-01 09:56:03',1,3,'Event : Mise à jour mensuelle','54.17','56.25'),(106,'2013-02-01 09:56:03',1,4,'Event : Mise à jour mensuelle','50.00','52.08'),(107,'2013-02-01 09:56:05',1,1,'Event : Mise à jour mensuelle','56.25','58.33'),(108,'2013-02-01 09:56:05',1,2,'Event : Mise à jour mensuelle','56.25','58.33'),(109,'2013-02-01 09:56:05',1,3,'Event : Mise à jour mensuelle','56.25','58.33'),(110,'2013-02-01 09:56:05',1,4,'Event : Mise à jour mensuelle','52.08','54.16'),(111,'2013-02-01 09:56:06',1,1,'Event : Mise à jour mensuelle','58.33','60.41'),(112,'2013-02-01 09:56:06',1,2,'Event : Mise à jour mensuelle','58.33','60.41'),(113,'2013-02-01 09:56:06',1,3,'Event : Mise à jour mensuelle','58.33','60.41'),(114,'2013-02-01 09:56:06',1,4,'Event : Mise à jour mensuelle','54.17','56.25'),(115,'2013-02-01 09:56:06',1,1,'Event : Mise à jour mensuelle','60.42','62.50'),(116,'2013-02-01 09:56:06',1,2,'Event : Mise à jour mensuelle','60.42','62.50'),(117,'2013-02-01 09:56:06',1,3,'Event : Mise à jour mensuelle','60.42','62.50'),(118,'2013-02-01 09:56:06',1,4,'Event : Mise à jour mensuelle','56.25','58.33'),(119,'2013-02-01 09:56:07',1,1,'Event : Mise à jour mensuelle','62.50','64.58'),(120,'2013-02-01 09:56:07',1,2,'Event : Mise à jour mensuelle','62.50','64.58'),(121,'2013-02-01 09:56:07',1,3,'Event : Mise à jour mensuelle','62.50','64.58'),(122,'2013-02-01 09:56:07',1,4,'Event : Mise à jour mensuelle','58.33','60.41'),(123,'2013-02-01 09:56:07',1,1,'Event : Mise à jour mensuelle','64.58','66.66'),(124,'2013-02-01 09:56:07',1,2,'Event : Mise à jour mensuelle','64.58','66.66'),(125,'2013-02-01 09:56:07',1,3,'Event : Mise à jour mensuelle','64.58','66.66'),(126,'2013-02-01 09:56:07',1,4,'Event : Mise à jour mensuelle','60.42','62.50'),(127,'2013-02-01 09:56:50',1,1,'Event : Mise à jour mensuelle','66.67','68.75'),(128,'2013-02-01 09:56:50',1,2,'Event : Mise à jour mensuelle','66.67','68.75'),(129,'2013-02-01 09:56:50',1,3,'Event : Mise à jour mensuelle','66.67','68.75'),(130,'2013-02-01 09:56:50',1,4,'Event : Mise à jour mensuelle','62.50','64.58'),(131,'2013-02-01 09:56:50',1,1,'Event : Mise à jour mensuelle','68.75','70.83'),(132,'2013-02-01 09:56:50',1,2,'Event : Mise à jour mensuelle','68.75','70.83'),(133,'2013-02-01 09:56:50',1,3,'Event : Mise à jour mensuelle','68.75','70.83'),(134,'2013-02-01 09:56:50',1,4,'Event : Mise à jour mensuelle','64.58','66.66'),(135,'2013-02-17 18:49:21',1,1,'Event : Mise à jour mensuelle','70.83','72.91'),(136,'2013-02-17 18:49:21',1,2,'Event : Mise à jour mensuelle','70.83','72.91'),(137,'2013-02-17 18:49:21',1,3,'Event : Mise à jour mensuelle','70.83','72.91'),(138,'2013-02-17 18:49:21',1,4,'Event : Mise à jour mensuelle','66.67','68.75'),(139,'2013-02-17 19:06:57',1,1,'Event : Holiday','72.92','71.92'),(140,'2013-03-01 23:12:31',1,1,'Event : Mise à jour mensuelle','71.92','74.00'),(141,'2013-03-01 23:12:31',1,2,'Event : Mise à jour mensuelle','72.92','75.00'),(142,'2013-03-01 23:12:31',1,3,'Event : Mise à jour mensuelle','72.92','75.00'),(143,'2013-03-01 23:12:31',1,4,'Event : Mise à jour mensuelle','68.75','70.83'),(144,'2013-03-01 23:12:31',1,5,'Event : Mise à jour mensuelle','0.00','2.08'); +/*!40000 ALTER TABLE `llx_holiday_logs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_users` +-- + +DROP TABLE IF EXISTS `llx_holiday_users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_users` ( + `fk_user` int(11) NOT NULL, + `nb_holiday` double NOT NULL DEFAULT '0', + PRIMARY KEY (`fk_user`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_users` +-- + +LOCK TABLES `llx_holiday_users` WRITE; +/*!40000 ALTER TABLE `llx_holiday_users` DISABLE KEYS */; +INSERT INTO `llx_holiday_users` VALUES (1,74.00334000000001),(2,75.00024000000003),(3,75.00024000000003),(4,70.83356000000002),(5,2.08334); +/*!40000 ALTER TABLE `llx_holiday_users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_import_model` +-- + +DROP TABLE IF EXISTS `llx_import_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_import_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL DEFAULT '0', + `label` varchar(50) NOT NULL, + `type` varchar(20) NOT NULL, + `field` text NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_import_model` (`label`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_import_model` +-- + +LOCK TABLES `llx_import_model` WRITE; +/*!40000 ALTER TABLE `llx_import_model` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_import_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_links` +-- + +DROP TABLE IF EXISTS `llx_links`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_links` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datea` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `label` varchar(255) NOT NULL, + `objecttype` varchar(255) NOT NULL, + `objectid` int(11) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_links` +-- + +LOCK TABLES `llx_links` WRITE; +/*!40000 ALTER TABLE `llx_links` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_links` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraison` +-- + +DROP TABLE IF EXISTS `llx_livraison`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraison` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_customer` varchar(30) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_int` varchar(30) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_delivery` date DEFAULT NULL, + `fk_address` int(11) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_livraison_uk_ref` (`ref`,`entity`), + KEY `idx_livraison_fk_soc` (`fk_soc`), + KEY `idx_livraison_fk_user_author` (`fk_user_author`), + KEY `idx_livraison_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_livraison_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_livraison_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_livraison_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraison` +-- + +LOCK TABLES `llx_livraison` WRITE; +/*!40000 ALTER TABLE `llx_livraison` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraison` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraisondet` +-- + +DROP TABLE IF EXISTS `llx_livraisondet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraisondet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_livraison` int(11) DEFAULT NULL, + `fk_origin_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `description` text, + `qty` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_livraisondet_fk_expedition` (`fk_livraison`), + CONSTRAINT `fk_livraisondet_fk_livraison` FOREIGN KEY (`fk_livraison`) REFERENCES `llx_livraison` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraisondet` +-- + +LOCK TABLES `llx_livraisondet` WRITE; +/*!40000 ALTER TABLE `llx_livraisondet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraisondet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_localtax` +-- + +DROP TABLE IF EXISTS `llx_localtax`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_localtax` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_localtax` +-- + +LOCK TABLES `llx_localtax` WRITE; +/*!40000 ALTER TABLE `llx_localtax` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_localtax` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_mailing` +-- + +DROP TABLE IF EXISTS `llx_mailing`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_mailing` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `statut` smallint(6) DEFAULT '0', + `titre` varchar(60) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `sujet` varchar(60) DEFAULT NULL, + `body` mediumtext, + `bgcolor` varchar(8) DEFAULT NULL, + `bgimage` varchar(255) DEFAULT NULL, + `cible` varchar(60) DEFAULT NULL, + `nbemail` int(11) DEFAULT NULL, + `email_from` varchar(160) DEFAULT NULL, + `email_replyto` varchar(160) DEFAULT NULL, + `email_errorsto` varchar(160) DEFAULT NULL, + `tag` varchar(128) DEFAULT NULL, + `date_creat` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_appro` datetime DEFAULT NULL, + `date_envoi` datetime DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_appro` int(11) DEFAULT NULL, + `joined_file1` varchar(255) DEFAULT NULL, + `joined_file2` varchar(255) DEFAULT NULL, + `joined_file3` varchar(255) DEFAULT NULL, + `joined_file4` varchar(255) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_mailing` +-- + +LOCK TABLES `llx_mailing` WRITE; +/*!40000 ALTER TABLE `llx_mailing` DISABLE KEYS */; +INSERT INTO `llx_mailing` VALUES (3,1,'My commercial emailing',1,'Buy my product','Please buy my product','','',NULL,2,'dolibarr@domain.com','','',NULL,'2010-07-11 13:15:59','2010-07-11 13:46:20',NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,NULL),(4,0,'Copy of My commercial emailing',1,'Buy my product','This is a new éEéé"Mailing content
\r\n
\r\n\r\nYou can adit it with the WYSIWYG editor.
\r\nIt is\r\n
    \r\n
  • \r\n Fast
  • \r\n
  • \r\n Easy to use
  • \r\n
  • \r\n Pretty
  • \r\n
','','',NULL,NULL,'dolibarr@domain.com','','',NULL,'2011-07-18 20:44:33',NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_mailing` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_mailing_cibles` +-- + +DROP TABLE IF EXISTS `llx_mailing_cibles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_mailing_cibles` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_mailing` int(11) NOT NULL, + `fk_contact` int(11) NOT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `email` varchar(160) NOT NULL, + `other` varchar(255) DEFAULT NULL, + `tag` varchar(128) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `source_url` varchar(160) DEFAULT NULL, + `source_id` int(11) DEFAULT NULL, + `source_type` varchar(16) DEFAULT NULL, + `date_envoi` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_mailing_cibles` (`fk_mailing`,`email`), + KEY `idx_mailing_cibles_email` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_mailing_cibles` +-- + +LOCK TABLES `llx_mailing_cibles` WRITE; +/*!40000 ALTER TABLE `llx_mailing_cibles` DISABLE KEYS */; +INSERT INTO `llx_mailing_cibles` VALUES (1,1,0,'Dupont','Alain','toto@aa.com','Date fin=10/07/2011',NULL,0,'0',NULL,NULL,NULL),(2,2,0,'Swiss customer supplier','','abademail@aa.com','',NULL,0,'0',NULL,NULL,NULL),(3,2,0,'Smith Vick','','vsmith@email.com','',NULL,0,'0',NULL,NULL,NULL),(4,3,0,'Swiss customer supplier','','abademail@aa.com','',NULL,0,'0',NULL,NULL,NULL),(5,3,0,'Smith Vick','','vsmith@email.com','',NULL,0,'0',NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_mailing_cibles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_menu` +-- + +DROP TABLE IF EXISTS `llx_menu`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_menu` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `menu_handler` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `module` varchar(64) DEFAULT NULL, + `type` varchar(4) NOT NULL, + `mainmenu` varchar(100) NOT NULL, + `fk_menu` int(11) NOT NULL, + `fk_leftmenu` varchar(24) DEFAULT NULL, + `fk_mainmenu` varchar(24) DEFAULT NULL, + `position` int(11) NOT NULL, + `url` varchar(255) NOT NULL, + `target` varchar(100) DEFAULT NULL, + `titre` varchar(255) NOT NULL, + `langs` varchar(100) DEFAULT NULL, + `level` smallint(6) DEFAULT NULL, + `leftmenu` varchar(100) DEFAULT NULL, + `perms` varchar(255) DEFAULT NULL, + `enabled` varchar(255) DEFAULT '1', + `usertype` int(11) NOT NULL DEFAULT '0', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_menu_uk_menu` (`menu_handler`,`fk_menu`,`position`,`url`,`entity`), + KEY `idx_menu_menuhandler_type` (`menu_handler`,`type`) +) ENGINE=InnoDB AUTO_INCREMENT=108509 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_menu` +-- + +LOCK TABLES `llx_menu` WRITE; +/*!40000 ALTER TABLE `llx_menu` DISABLE KEYS */; +INSERT INTO `llx_menu` VALUES (19289,'all',1,'cashdesk','top','cashdesk',0,NULL,NULL,100,'/cashdesk/index.php?user=__LOGIN__','pointofsale','CashDeskMenu','cashdesk',NULL,NULL,'1','$conf->cashdesk->enabled',0,'2012-12-08 13:11:09'),(87303,'all',1,'filemanager','top','filemanager',0,NULL,NULL,100,'/filemanager/index.php','','FileManager','filemanager@filemanager',NULL,NULL,'$user->rights->filemanager->read','$conf->filemanager->enabled',2,'2013-01-02 20:33:20'),(87422,'smartphone',1,NULL,'top','home',0,NULL,NULL,1,'/index.php?mainmenu=home&leftmenu=','','Home','',-1,'','','1',2,'2013-02-24 18:29:15'),(87423,'smartphone',1,NULL,'top','companies',0,NULL,NULL,2,'/societe/index.php?mainmenu=companies&leftmenu=','','ThirdParties','companies',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->societe->enabled || $conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(87424,'smartphone',1,NULL,'top','products',0,NULL,NULL,3,'/product/index.php?mainmenu=products&leftmenu=','','Products/Services','products',-1,'','$user->rights->produit->lire||$user->rights->service->lire','$conf->product->enabled || $conf->service->enabled',0,'2013-02-24 18:29:15'),(87426,'smartphone',1,NULL,'top','commercial',0,NULL,NULL,5,'/comm/index.php?mainmenu=commercial&leftmenu=','','Commercial','commercial',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(87427,'smartphone',1,NULL,'top','accountancy',0,NULL,NULL,6,'/compta/index.php?mainmenu=accountancy&leftmenu=','','MenuFinancial','compta',-1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->commande->lire || $user->rights->facture->lire','$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled',2,'2013-02-24 18:29:15'),(87428,'smartphone',1,NULL,'top','project',0,NULL,NULL,7,'/projet/index.php?mainmenu=project&leftmenu=','','Projects','projects',-1,'','$user->rights->projet->lire','$conf->projet->enabled',0,'2013-02-24 18:29:15'),(87429,'smartphone',1,NULL,'top','tools',0,NULL,NULL,8,'/core/tools.php?mainmenu=tools&leftmenu=','','Tools','other',-1,'','$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run','$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled',2,'2013-02-24 18:29:15'),(87432,'smartphone',1,NULL,'top','shop',0,NULL,NULL,11,'/boutique/index.php?mainmenu=shop&leftmenu=','','OSCommerce','shop',-1,'','','! empty($conf->boutique->enabled)',0,'2013-02-24 18:29:15'),(87434,'smartphone',1,NULL,'top','members',0,NULL,NULL,15,'/adherents/index.php?mainmenu=members&leftmenu=','','Members','members',-1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(87435,'smartphone',1,NULL,'top','bank',0,NULL,NULL,6,'/compta/bank/index.php?mainmenu=bank&leftmenu=bank','','MenuBankCash','banks',-1,'','$user->rights->banque->lire || $user->rights->prelevement->bons->lire','$conf->banque->enabled || $conf->prelevement->enabled',2,'2013-02-24 18:29:15'),(87521,'smartphone',1,NULL,'left','home',87422,NULL,NULL,0,'/admin/index.php?leftmenu=setup','','Setup','admin',0,'','','$user->admin',2,'2013-02-24 18:29:15'),(87522,'smartphone',1,NULL,'left','home',87521,NULL,NULL,1,'/admin/company.php?leftmenu=setup','','MenuCompanySetup','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87523,'smartphone',1,NULL,'left','home',87521,NULL,NULL,4,'/admin/ihm.php?leftmenu=setup','','GUISetup','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87524,'smartphone',1,NULL,'left','home',87521,NULL,NULL,2,'/admin/modules.php?leftmenu=setup','','Modules','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87525,'smartphone',1,NULL,'left','home',87521,NULL,NULL,5,'/admin/boxes.php?leftmenu=setup','','Boxes','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87526,'smartphone',1,NULL,'left','home',87521,NULL,NULL,3,'/admin/menus.php?leftmenu=setup','','Menus','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87527,'smartphone',1,NULL,'left','home',87521,NULL,NULL,6,'/admin/delais.php?leftmenu=setup','','Alerts','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87529,'smartphone',1,NULL,'left','home',87521,NULL,NULL,7,'/admin/perms.php?leftmenu=setup','','Security','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87530,'smartphone',1,NULL,'left','home',87521,NULL,NULL,9,'/admin/mails.php?leftmenu=setup','','Emails','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87531,'smartphone',1,NULL,'left','home',87521,NULL,NULL,8,'/admin/limits.php?leftmenu=setup','','MenuLimits','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87532,'smartphone',1,NULL,'left','home',87521,NULL,NULL,10,'/admin/dict.php?leftmenu=setup','','DictionnarySetup','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87533,'smartphone',1,NULL,'left','home',87521,NULL,NULL,11,'/admin/const.php?leftmenu=setup','','OtherSetup','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87621,'smartphone',1,NULL,'left','home',87422,NULL,NULL,1,'/admin/system/index.php?leftmenu=system','','SystemInfo','admin',0,'','','$user->admin',2,'2013-02-24 18:29:15'),(87622,'smartphone',1,NULL,'left','home',87621,NULL,NULL,0,'/admin/system/dolibarr.php?leftmenu=system','','Dolibarr','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87623,'smartphone',1,NULL,'left','home',87622,NULL,NULL,1,'/admin/system/constall.php?leftmenu=system','','AllParameters','admin',2,'','','1',2,'2013-02-24 18:29:15'),(87624,'smartphone',1,NULL,'left','home',87622,NULL,NULL,4,'/admin/system/about.php?leftmenu=system','','About','admin',2,'','','1',2,'2013-02-24 18:29:15'),(87625,'smartphone',1,NULL,'left','home',87621,NULL,NULL,1,'/admin/system/os.php?leftmenu=system','','OS','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87626,'smartphone',1,NULL,'left','home',87621,NULL,NULL,2,'/admin/system/web.php?leftmenu=system','','WebServer','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87627,'smartphone',1,NULL,'left','home',87621,NULL,NULL,3,'/admin/system/phpinfo.php?leftmenu=system','','Php','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87628,'smartphone',1,NULL,'left','home',87622,NULL,NULL,3,'/admin/triggers.php?leftmenu=system','','Triggers','admin',2,'','','1',2,'2013-02-24 18:29:15'),(87629,'smartphone',1,NULL,'left','home',87622,NULL,NULL,2,'/admin/system/modules.php?leftmenu=system','','Modules','admin',2,'','','1',2,'2013-02-24 18:29:15'),(87631,'smartphone',1,NULL,'left','home',87621,NULL,NULL,4,'/admin/system/database.php?leftmenu=system','','Database','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87632,'smartphone',1,NULL,'left','home',87631,NULL,NULL,0,'/admin/system/database-tables.php?leftmenu=system','','Tables','admin',2,'','','1',2,'2013-02-24 18:29:15'),(87721,'smartphone',1,NULL,'left','home',87422,NULL,NULL,2,'/admin/tools/index.php?leftmenu=admintools','','SystemTools','admin',0,'','','$user->admin',2,'2013-02-24 18:29:15'),(87722,'smartphone',1,NULL,'left','home',87721,NULL,NULL,0,'/admin/tools/dolibarr_export.php?leftmenu=admintools','','Backup','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87723,'smartphone',1,NULL,'left','home',87721,NULL,NULL,1,'/admin/tools/dolibarr_import.php?leftmenu=admintools','','Restore','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87724,'smartphone',1,NULL,'left','home',87721,NULL,NULL,6,'/admin/tools/purge.php?leftmenu=admintools','','Purge','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87725,'smartphone',1,NULL,'left','home',87721,NULL,NULL,3,'/admin/tools/eaccelerator.php?leftmenu=admintools','','EAccelerator','admin',1,'','','1 && function_exists(\'eaccelerator_info\')',2,'2013-02-24 18:29:15'),(87726,'smartphone',1,NULL,'left','home',87721,NULL,NULL,2,'/admin/tools/update.php?leftmenu=admintools','','MenuUpgrade','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87727,'smartphone',1,NULL,'left','home',87721,NULL,NULL,4,'/admin/tools/listevents.php?leftmenu=admintools','','Audit','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87728,'smartphone',1,NULL,'left','home',87721,NULL,NULL,7,'/support/index.php?leftmenu=admintools','_blank','HelpCenter','help',1,'','','1',2,'2013-02-24 18:29:15'),(87729,'smartphone',1,NULL,'left','home',87721,NULL,NULL,5,'/admin/tools/listsessions.php?leftmenu=admintools','','Sessions','admin',1,'','','1',2,'2013-02-24 18:29:15'),(87821,'smartphone',1,NULL,'left','home',87422,NULL,NULL,3,'/user/home.php?leftmenu=users','','MenuUsersAndGroups','users',0,'','','1',2,'2013-02-24 18:29:15'),(87822,'smartphone',1,NULL,'left','home',87821,NULL,NULL,0,'/user/index.php?leftmenu=users','','Users','users',1,'','$user->rights->user->user->lire || $user->admin','1',2,'2013-02-24 18:29:15'),(87823,'smartphone',1,NULL,'left','home',87822,NULL,NULL,0,'/user/fiche.php?leftmenu=users&action=create','','NewUser','users',2,'','$user->rights->user->user->creer || $user->admin','1',2,'2013-02-24 18:29:15'),(87824,'smartphone',1,NULL,'left','home',87821,NULL,NULL,1,'/user/group/index.php?leftmenu=users','','Groups','users',1,'','($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin','1',2,'2013-02-24 18:29:15'),(87825,'smartphone',1,NULL,'left','home',87824,NULL,NULL,0,'/user/group/fiche.php?leftmenu=users&action=create','','NewGroup','users',2,'','($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin','1',2,'2013-02-24 18:29:15'),(87921,'smartphone',1,NULL,'left','companies',87423,NULL,NULL,0,'/societe/societe.php','','ThirdParty','companies',0,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(87922,'smartphone',1,NULL,'left','companies',87921,NULL,NULL,0,'/societe/soc.php?action=create','','MenuNewThirdParty','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(87924,'smartphone',1,NULL,'left','companies',87921,NULL,NULL,5,'/fourn/liste.php?leftmenu=suppliers','','ListSuppliersShort','suppliers',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(87925,'smartphone',1,NULL,'left','companies',87924,NULL,NULL,0,'/societe/soc.php?leftmenu=supplier&action=create&type=f','','NewSupplier','suppliers',2,'','$user->rights->societe->creer','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(87927,'smartphone',1,NULL,'left','companies',87921,NULL,NULL,3,'/comm/prospect/list.php?leftmenu=prospects','','ListProspectsShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(87928,'smartphone',1,NULL,'left','companies',87927,NULL,NULL,0,'/societe/soc.php?leftmenu=prospects&action=create&type=p','','MenuNewProspect','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(87930,'smartphone',1,NULL,'left','companies',87921,NULL,NULL,4,'/comm/list.php?leftmenu=customers','','ListCustomersShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(87931,'smartphone',1,NULL,'left','companies',87930,NULL,NULL,0,'/societe/soc.php?leftmenu=customers&action=create&type=c','','MenuNewCustomer','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(88021,'smartphone',1,NULL,'left','companies',87423,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','ContactsAddresses||Contacts@$conf->global->SOCIETE_ADDRESSES_MANAGEMENT','companies',0,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(88022,'smartphone',1,NULL,'left','companies',88021,NULL,NULL,0,'/contact/fiche.php?leftmenu=contacts&action=create','','NewContactAddress||NewContact@$conf->global->SOCIETE_ADDRESSES_MANAGEMENT','companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(88023,'smartphone',1,NULL,'left','companies',88021,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(88025,'smartphone',1,NULL,'left','companies',88023,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=p','','Prospects','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(88026,'smartphone',1,NULL,'left','companies',88023,NULL,NULL,2,'/contact/list.php?leftmenu=contacts&type=c','','Customers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(88027,'smartphone',1,NULL,'left','companies',88023,NULL,NULL,3,'/contact/list.php?leftmenu=contacts&type=f','','Suppliers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(88028,'smartphone',1,NULL,'left','companies',88023,NULL,NULL,4,'/contact/list.php?leftmenu=contacts&type=o','','Others','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(88071,'smartphone',1,NULL,'left','companies',87423,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=1','','SuppliersCategoriesShort','categories',0,'','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2013-02-24 18:29:15'),(88072,'smartphone',1,NULL,'left','companies',88071,NULL,NULL,0,'/categories/fiche.php?action=create&type=1','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2013-02-24 18:29:15'),(88081,'smartphone',1,NULL,'left','companies',87423,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=2','','CustomersProspectsCategoriesShort','categories',0,'','$user->rights->categorie->lire','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2013-02-24 18:29:15'),(88082,'smartphone',1,NULL,'left','companies',88081,NULL,NULL,0,'/categories/fiche.php?action=create&type=2','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2013-02-24 18:29:15'),(88121,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,1,'/comm/prospect/index.php?leftmenu=prospects','','Prospects','companies',0,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88122,'smartphone',1,NULL,'left','commercial',88121,NULL,NULL,0,'/societe/soc.php?leftmenu=prospects&action=create&type=p','','MenuNewProspect','companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88123,'smartphone',1,NULL,'left','commercial',88121,NULL,NULL,1,'/comm/prospect/list.php?leftmenu=prospects','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88124,'smartphone',1,NULL,'left','commercial',88123,NULL,NULL,0,'/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=-1','','LastProspectDoNotContact','companies',2,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88125,'smartphone',1,NULL,'left','commercial',88123,NULL,NULL,1,'/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=0','','LastProspectNeverContacted','companies',2,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88126,'smartphone',1,NULL,'left','commercial',88123,NULL,NULL,2,'/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=1','','LastProspectToContact','companies',2,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88127,'smartphone',1,NULL,'left','commercial',88123,NULL,NULL,3,'/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=2','','LastProspectContactInProcess','companies',2,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88128,'smartphone',1,NULL,'left','commercial',88123,NULL,NULL,4,'/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=3','','LastProspectContactDone','companies',2,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88129,'smartphone',1,NULL,'left','commercial',88121,NULL,NULL,2,'/contact/list.php?leftmenu=prospects&type=p','','Contacts','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88221,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,2,'/comm/index.php?leftmenu=customers','','Customers','companies',0,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88222,'smartphone',1,NULL,'left','commercial',88221,NULL,NULL,0,'/societe/soc.php?leftmenu=customers&action=create&type=c','','MenuNewCustomer','companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88223,'smartphone',1,NULL,'left','commercial',88221,NULL,NULL,1,'/comm/list.php?leftmenu=customers','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88224,'smartphone',1,NULL,'left','commercial',88221,NULL,NULL,2,'/contact/list.php?leftmenu=customers&type=c','','Contacts','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88321,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,3,'/contact/list.php?leftmenu=contacts','','Contacts','companies',0,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88322,'smartphone',1,NULL,'left','commercial',88321,NULL,NULL,0,'/contact/fiche.php?leftmenu=contacts&action=create','','NewContactAddress||NewContact@$conf->global->SOCIETE_ADDRESSES_MANAGEMENT','companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88323,'smartphone',1,NULL,'left','commercial',88321,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&action=create','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',0,'2013-02-24 18:29:15'),(88331,'smartphone',1,NULL,'left','commercial',88323,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=p','','Prospects','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88332,'smartphone',1,NULL,'left','commercial',88323,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=c','','Customers','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88333,'smartphone',1,NULL,'left','commercial',88323,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=f','','Suppliers','companies',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->societe->enabled && $conf->fournisseur->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88334,'smartphone',1,NULL,'left','commercial',88323,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=o','','Other','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled && $leftmenu==\"prospects\"',0,'2013-02-24 18:29:15'),(88521,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,4,'/comm/propal.php?leftmenu=propals','','Prop','propal',0,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2013-02-24 18:29:15'),(88522,'smartphone',1,NULL,'left','commercial',88521,NULL,NULL,0,'/societe/societe.php?leftmenu=propals','','NewPropal','propal',1,'','$user->rights->propale->creer','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-02-24 18:29:15'),(88523,'smartphone',1,NULL,'left','commercial',88521,NULL,NULL,1,'/comm/propal.php?viewstatut=0','','PropalsDraft','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-02-24 18:29:15'),(88524,'smartphone',1,NULL,'left','commercial',88521,NULL,NULL,2,'/comm/propal.php?viewstatut=1','','PropalsOpened','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-02-24 18:29:15'),(88525,'smartphone',1,NULL,'left','commercial',88521,NULL,NULL,3,'/comm/propal.php?viewstatut=2,3,4','','PropalStatusClosedShort','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-02-24 18:29:15'),(88526,'smartphone',1,NULL,'left','commercial',88521,NULL,NULL,4,'/comm/propal/stats/index.php?leftmenu=propals','','Statistics','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-02-24 18:29:15'),(88621,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,5,'/commande/index.php?leftmenu=orders','','CustomersOrders','orders',0,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2013-02-24 18:29:15'),(88622,'smartphone',1,NULL,'left','commercial',88621,NULL,NULL,0,'/societe/societe.php?leftmenu=orders','','NewOrder','orders',1,'','$user->rights->commande->creer','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88623,'smartphone',1,NULL,'left','commercial',88621,NULL,NULL,1,'/commande/liste.php?leftmenu=orders','','List','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88624,'smartphone',1,NULL,'left','commercial',88623,NULL,NULL,2,'/commande/liste.php?leftmenu=orders&viewstatut=0','','StatusOrderDraftShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88625,'smartphone',1,NULL,'left','commercial',88623,NULL,NULL,3,'/commande/liste.php?leftmenu=orders&viewstatut=1','','StatusOrderValidated','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88626,'smartphone',1,NULL,'left','commercial',88623,NULL,NULL,4,'/commande/liste.php?leftmenu=orders&viewstatut=2','','StatusOrderOnProcessShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88627,'smartphone',1,NULL,'left','commercial',88623,NULL,NULL,5,'/commande/liste.php?leftmenu=orders&viewstatut=3','','StatusOrderToBill','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88628,'smartphone',1,NULL,'left','commercial',88623,NULL,NULL,6,'/commande/liste.php?leftmenu=orders&viewstatut=4','','StatusOrderProcessed','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88629,'smartphone',1,NULL,'left','commercial',88623,NULL,NULL,7,'/commande/liste.php?leftmenu=orders&viewstatut=-1','','StatusOrderCanceledShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88630,'smartphone',1,NULL,'left','commercial',88621,NULL,NULL,4,'/commande/stats/index.php?leftmenu=orders','','Statistics','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-02-24 18:29:15'),(88721,'smartphone',1,NULL,'left','commercial',87424,NULL,NULL,6,'/expedition/index.php?leftmenu=sendings','','Shipments','orders',0,'','$user->rights->expedition->lire','$conf->expedition->enabled',2,'2013-02-24 18:29:15'),(88722,'smartphone',1,NULL,'left','commercial',88721,NULL,NULL,0,'/expedition/liste.php?leftmenu=sendings','','List','orders',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2013-02-24 18:29:15'),(88723,'smartphone',1,NULL,'left','commercial',88721,NULL,NULL,1,'/expedition/stats/index.php?leftmenu=sendings','','Statistics','orders',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2013-02-24 18:29:15'),(88821,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,7,'/contrat/index.php?leftmenu=contracts','','Contracts','contracts',0,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2013-02-24 18:29:15'),(88822,'smartphone',1,NULL,'left','commercial',88821,NULL,NULL,0,'/societe/societe.php?leftmenu=contracts','','NewContract','contracts',1,'','$user->rights->contrat->creer','$conf->contrat->enabled',2,'2013-02-24 18:29:15'),(88823,'smartphone',1,NULL,'left','commercial',88821,NULL,NULL,1,'/contrat/liste.php?leftmenu=contracts','','List','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2013-02-24 18:29:15'),(88824,'smartphone',1,NULL,'left','commercial',88821,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts','','MenuServices','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2013-02-24 18:29:15'),(88825,'smartphone',1,NULL,'left','commercial',88824,NULL,NULL,0,'/contrat/services.php?leftmenu=contracts&mode=0','','MenuInactiveServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-02-24 18:29:15'),(88826,'smartphone',1,NULL,'left','commercial',88824,NULL,NULL,1,'/contrat/services.php?leftmenu=contracts&mode=4','','MenuRunningServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-02-24 18:29:15'),(88827,'smartphone',1,NULL,'left','commercial',88824,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts&mode=4&filter=expired','','MenuExpiredServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-02-24 18:29:15'),(88828,'smartphone',1,NULL,'left','commercial',88824,NULL,NULL,3,'/contrat/services.php?leftmenu=contracts&mode=5','','MenuClosedServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-02-24 18:29:15'),(88921,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,8,'/fichinter/list.php?leftmenu=ficheinter','','Interventions','interventions',0,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2013-02-24 18:29:15'),(88922,'smartphone',1,NULL,'left','commercial',88921,NULL,NULL,0,'/fichinter/fiche.php?action=create&leftmenu=ficheinter','','NewIntervention','interventions',1,'','$user->rights->ficheinter->creer','$conf->ficheinter->enabled && $leftmenu==\"ficheinter\"',2,'2013-02-24 18:29:15'),(88923,'smartphone',1,NULL,'left','commercial',88921,NULL,NULL,1,'/fichinter/list.php?leftmenu=ficheinter','','List','interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled && $leftmenu==\"ficheinter\"',2,'2013-02-24 18:29:15'),(89021,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,3,'/fourn/facture/index.php?leftmenu=suppliers_bills','','BillsSuppliers','bills',0,'','$user->rights->fournisseur->facture->lire','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(89022,'smartphone',1,NULL,'left','accountancy',89021,NULL,NULL,0,'/fourn/facture/fiche.php?action=create&leftmenu=suppliers_bills','','NewBill','bills',1,'','$user->rights->fournisseur->facture->creer','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(89023,'smartphone',1,NULL,'left','accountancy',89021,NULL,NULL,1,'/fourn/facture/impayees.php?leftmenu=suppliers_bills','','Unpaid','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(89024,'smartphone',1,NULL,'left','accountancy',89021,NULL,NULL,2,'/fourn/facture/paiement.php?leftmenu=suppliers_bills','','Payments','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(89121,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills','','BillsCustomers','bills',0,'','$user->rights->facture->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(89122,'smartphone',1,NULL,'left','accountancy',89121,NULL,NULL,3,'/compta/clients.php?action=facturer&leftmenu=customers_bills','','NewBill','bills',1,'','$user->rights->facture->creer','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(89123,'smartphone',1,NULL,'left','accountancy',89121,NULL,NULL,4,'/compta/facture/fiche-rec.php?leftmenu=customers_bills','','Repeatable','bills',1,'','$user->rights->facture->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(89124,'smartphone',1,NULL,'left','accountancy',89121,NULL,NULL,5,'/compta/facture/impayees.php?action=facturer&leftmenu=customers_bills','','Unpaid','bills',1,'','$user->rights->facture->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(89125,'smartphone',1,NULL,'left','accountancy',89121,NULL,NULL,6,'/compta/paiement/liste.php?leftmenu=customers_bills','','Payments','bills',1,'','$user->rights->facture->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(89131,'smartphone',1,NULL,'left','accountancy',89125,NULL,NULL,1,'/compta/paiement/rapport.php?leftmenu=customers_bills','','Reportings','bills',2,'','$user->rights->facture->lire','$conf->societe->enabled',2,'2013-02-24 18:29:15'),(89132,'smartphone',1,NULL,'left','accountancy',87435,NULL,NULL,9,'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank','','MenuChequeDeposits','bills',0,'','$user->rights->facture->lire','$conf->facture->enabled && $conf->banque->enabled',2,'2013-02-24 18:29:15'),(89133,'smartphone',1,NULL,'left','accountancy',89132,NULL,NULL,0,'/compta/paiement/cheque/fiche.php?leftmenu=checks&action=new','','NewCheckDeposit','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled && $conf->banque->enabled',2,'2013-02-24 18:29:15'),(89134,'smartphone',1,NULL,'left','accountancy',89132,NULL,NULL,1,'/compta/paiement/cheque/liste.php?leftmenu=checks','','List','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled && $conf->banque->enabled',2,'2013-02-24 18:29:15'),(89135,'smartphone',1,NULL,'left','accountancy',89121,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills','','Statistics','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled && $conf->banque->enabled',2,'2013-02-24 18:29:15'),(89321,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,3,'/commande/liste.php?leftmenu=orders&viewstatut=3','','MenuOrdersToBill','orders',0,'','$user->rights->commande->lire','$conf->commande->enabled',0,'2013-02-24 18:29:15'),(89421,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,4,'/compta/dons/index.php?leftmenu=donations&mainmenu=accountancy','','Donations','donations',0,'','$user->rights->don->lire','$conf->don->enabled',2,'2013-02-24 18:29:15'),(89422,'smartphone',1,NULL,'left','accountancy',89421,NULL,NULL,0,'/compta/dons/fiche.php?leftmenu=donations&mainmenu=accountancy&action=create','','NewDonation','donations',1,'','$user->rights->don->creer','$conf->don->enabled && $leftmenu==\"donations\"',2,'2013-02-24 18:29:15'),(89423,'smartphone',1,NULL,'left','accountancy',89421,NULL,NULL,1,'/compta/dons/liste.php?leftmenu=donations&mainmenu=accountancy','','List','donations',1,'','$user->rights->don->lire','$conf->don->enabled && $leftmenu==\"donations\"',2,'2013-02-24 18:29:15'),(89521,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,5,'/compta/deplacement/index.php?leftmenu=tripsandexpenses','','TripsAndExpenses','trips',0,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2013-02-24 18:29:15'),(89522,'smartphone',1,NULL,'left','accountancy',89521,NULL,NULL,1,'/compta/deplacement/fiche.php?action=create&leftmenu=tripsandexpenses','','New','trips',1,'','$user->rights->deplacement->creer','$conf->deplacement->enabled && $leftmenu==\"tripsandexpenses\"',0,'2013-02-24 18:29:15'),(89523,'smartphone',1,NULL,'left','accountancy',89521,NULL,NULL,2,'/compta/deplacement/index.php?leftmenu=tripsandexpenses','','List','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled && $leftmenu==\"tripsandexpenses\"',0,'2013-02-24 18:29:15'),(89524,'smartphone',1,NULL,'left','accountancy',89521,NULL,NULL,2,'/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses','','Statistics','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled && $leftmenu==\"tripsandexpenses\"',0,'2013-02-24 18:29:15'),(89621,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,6,'/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy','','MenuTaxAndDividends','compta',0,'','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2013-02-24 18:29:15'),(89622,'smartphone',1,NULL,'left','accountancy',89621,NULL,NULL,1,'/compta/sociales/index.php?leftmenu=tax_social','','SocialContributions','',1,'','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2013-02-24 18:29:15'),(89623,'smartphone',1,NULL,'left','accountancy',89622,NULL,NULL,2,'/compta/sociales/charges.php?leftmenu=tax_social&action=create','','MenuNewSocialContribution','',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2013-02-24 18:29:15'),(89624,'smartphone',1,NULL,'left','accountancy',89622,NULL,NULL,3,'/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly','','Payments','',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2013-02-24 18:29:15'),(89721,'smartphone',1,NULL,'left','accountancy',89621,NULL,NULL,7,'/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy','','VAT','companies',1,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)',0,'2013-02-24 18:29:15'),(89722,'smartphone',1,NULL,'left','accountancy',89721,NULL,NULL,0,'/compta/tva/fiche.php?leftmenu=tax_vat&action=create','','NewPayment','companies',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-02-24 18:29:15'),(89723,'smartphone',1,NULL,'left','accountancy',89721,NULL,NULL,1,'/compta/tva/reglement.php?leftmenu=tax_vat','','Payments','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-02-24 18:29:15'),(89724,'smartphone',1,NULL,'left','accountancy',89721,NULL,NULL,2,'/compta/tva/clients.php?leftmenu=tax_vat','','ReportByCustomers','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-02-24 18:29:15'),(89725,'smartphone',1,NULL,'left','accountancy',89721,NULL,NULL,3,'/compta/tva/quadri_detail.php?leftmenu=tax_vat','','ReportByQuarter','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-02-24 18:29:15'),(89821,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,8,'/compta/ventilation/index.php?leftmenu=ventil','','Ventilation','companies',0,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89822,'smartphone',1,NULL,'left','accountancy',89821,NULL,NULL,0,'/compta/ventilation/liste.php','','ToDispatch','companies',1,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89823,'smartphone',1,NULL,'left','accountancy',89821,NULL,NULL,1,'/compta/ventilation/lignes.php','','Dispatched','companies',1,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89824,'smartphone',1,NULL,'left','accountancy',89821,NULL,NULL,2,'/compta/param/','','Setup','companies',1,'','$user->rights->compta->ventilation->parametrer','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89825,'smartphone',1,NULL,'left','accountancy',89824,NULL,NULL,0,'/compta/param/comptes/liste.php','','List','companies',2,'','$user->rights->compta->ventilation->parametrer','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89826,'smartphone',1,NULL,'left','accountancy',89824,NULL,NULL,1,'/compta/param/comptes/fiche.php?action=create','','New','companies',2,'','$user->rights->compta->ventilation->parametrer','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89827,'smartphone',1,NULL,'left','accountancy',89821,NULL,NULL,3,'/compta/export/','','Export','companies',1,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89828,'smartphone',1,NULL,'left','accountancy',89827,NULL,NULL,0,'/compta/export/index.php','','New','companies',2,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89829,'smartphone',1,NULL,'left','accountancy',89827,NULL,NULL,1,'/compta/export/liste.php','','List','companies',2,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-02-24 18:29:15'),(89921,'smartphone',1,NULL,'left','accountancy',87435,NULL,NULL,9,'/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank','','StandingOrders','withdrawals',0,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled',2,'2013-02-24 18:29:15'),(89922,'smartphone',1,NULL,'left','accountancy',89921,NULL,NULL,1,'/compta/prelevement/demandes.php?status=0&leftmenu=withdraw','','StandingOrderToProcess','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-02-24 18:29:15'),(89923,'smartphone',1,NULL,'left','accountancy',89921,NULL,NULL,0,'/compta/prelevement/create.php?leftmenu=withdraw','','NewStandingOrder','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-02-24 18:29:15'),(89924,'smartphone',1,NULL,'left','accountancy',89921,NULL,NULL,2,'/compta/prelevement/bons.php?leftmenu=withdraw','','WithdrawalsReceipts','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-02-24 18:29:15'),(89925,'smartphone',1,NULL,'left','accountancy',89921,NULL,NULL,3,'/compta/prelevement/liste.php?leftmenu=withdraw','','WithdrawalsLines','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-02-24 18:29:15'),(89927,'smartphone',1,NULL,'left','accountancy',89921,NULL,NULL,5,'/compta/prelevement/rejets.php?leftmenu=withdraw','','Rejects','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-02-24 18:29:15'),(89928,'smartphone',1,NULL,'left','accountancy',89921,NULL,NULL,6,'/compta/prelevement/stats.php?leftmenu=withdraw','','Statistics','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-02-24 18:29:15'),(90021,'smartphone',1,NULL,'left','accountancy',87435,NULL,NULL,1,'/compta/bank/index.php?leftmenu=bank&mainmenu=bank','','MenuBankCash','banks',0,'','$user->rights->banque->lire','$conf->banque->enabled',0,'2013-02-24 18:29:15'),(90022,'smartphone',1,NULL,'left','accountancy',90021,NULL,NULL,0,'/compta/bank/fiche.php?action=create&leftmenu=bank','','MenuNewFinancialAccount','banks',1,'','$user->rights->banque->configurer','$conf->banque->enabled && $leftmenu==bank',0,'2013-02-24 18:29:15'),(90023,'smartphone',1,NULL,'left','accountancy',90021,NULL,NULL,1,'/compta/bank/categ.php?leftmenu=bank','','Rubriques','categories',1,'','$user->rights->banque->configurer','$conf->banque->enabled && $leftmenu==bank',0,'2013-02-24 18:29:15'),(90024,'smartphone',1,NULL,'left','accountancy',90021,NULL,NULL,2,'/compta/bank/search.php?leftmenu=bank','','ListTransactions','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && $leftmenu==bank',0,'2013-02-24 18:29:15'),(90025,'smartphone',1,NULL,'left','accountancy',90021,NULL,NULL,3,'/compta/bank/budget.php?leftmenu=bank','','ListTransactionsByCategory','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && $leftmenu==bank',0,'2013-02-24 18:29:15'),(90027,'smartphone',1,NULL,'left','accountancy',90021,NULL,NULL,5,'/compta/bank/virement.php?leftmenu=bank','','BankTransfers','banks',1,'','$user->rights->banque->transfer','$conf->banque->enabled && $leftmenu==bank',0,'2013-02-24 18:29:15'),(90121,'smartphone',1,NULL,'left','accountancy',87427,NULL,NULL,11,'/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy','','Reportings','main',0,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-02-24 18:29:15'),(90122,'smartphone',1,NULL,'left','accountancy',90121,NULL,NULL,0,'/compta/resultat/index.php?leftmenu=ca','','ReportInOut','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-02-24 18:29:15'),(90123,'smartphone',1,NULL,'left','accountancy',90122,NULL,NULL,0,'/compta/resultat/clientfourn.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-02-24 18:29:15'),(90124,'smartphone',1,NULL,'left','accountancy',90121,NULL,NULL,1,'/compta/stats/index.php?leftmenu=ca','','ReportTurnover','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-02-24 18:29:15'),(90125,'smartphone',1,NULL,'left','accountancy',90124,NULL,NULL,0,'/compta/stats/casoc.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-02-24 18:29:15'),(90126,'smartphone',1,NULL,'left','accountancy',90124,NULL,NULL,1,'/compta/stats/cabyuser.php?leftmenu=ca','','ByUsers','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-02-24 18:29:15'),(90221,'smartphone',1,NULL,'left','products',87424,NULL,NULL,0,'/product/index.php?leftmenu=product&type=0','','Products','products',0,'','$user->rights->produit->lire','$conf->product->enabled',2,'2013-02-24 18:29:15'),(90222,'smartphone',1,NULL,'left','products',90221,NULL,NULL,0,'/product/fiche.php?leftmenu=product&action=create&type=0','','NewProduct','products',1,'','$user->rights->produit->creer','$conf->product->enabled',2,'2013-02-24 18:29:15'),(90223,'smartphone',1,NULL,'left','products',90221,NULL,NULL,1,'/product/liste.php?leftmenu=product&type=0','','List','products',1,'','$user->rights->produit->lire','$conf->product->enabled',2,'2013-02-24 18:29:15'),(90224,'smartphone',1,NULL,'left','products',90221,NULL,NULL,4,'/product/reassort.php?type=0','','Stocks','products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->product->enabled',2,'2013-02-24 18:29:15'),(90321,'smartphone',1,NULL,'left','products',87424,NULL,NULL,1,'/product/index.php?leftmenu=service&type=1','','Services','products',0,'','$user->rights->service->lire','$conf->service->enabled',2,'2013-02-24 18:29:15'),(90322,'smartphone',1,NULL,'left','products',90321,NULL,NULL,0,'/product/fiche.php?leftmenu=service&action=create&type=1','','NewService','products',1,'','$user->rights->service->creer','$conf->service->enabled',2,'2013-02-24 18:29:15'),(90323,'smartphone',1,NULL,'left','products',90321,NULL,NULL,1,'/product/liste.php?leftmenu=service&type=1','','List','products',1,'','$user->rights->service->lire','$conf->service->enabled',2,'2013-02-24 18:29:15'),(90421,'smartphone',1,NULL,'left','products',87424,NULL,NULL,2,'/product/stats/index.php?leftmenu=stats','','Statistics','main',0,'','$user->rights->service->lire','$conf->product->enabled || $conf->service->enabled',2,'2013-02-24 18:29:15'),(90422,'smartphone',1,NULL,'left','products',90421,NULL,NULL,0,'/product/popuprop.php?leftmenu=stats','','Popularity','main',1,'','$user->rights->produit->lire && $user->rights->produit>lire','$conf->propal->enabled',2,'2013-02-24 18:29:15'),(90521,'smartphone',1,NULL,'left','products',87424,NULL,NULL,3,'/product/stock/index.php?leftmenu=stock','','Stock','stocks',0,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2013-02-24 18:29:15'),(90522,'smartphone',1,NULL,'left','products',90521,NULL,NULL,0,'/product/stock/fiche.php?action=create','','MenuNewWarehouse','stocks',1,'','$user->rights->stock->creer','$conf->stock->enabled',2,'2013-02-24 18:29:15'),(90523,'smartphone',1,NULL,'left','products',90521,NULL,NULL,1,'/product/stock/liste.php','','List','stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2013-02-24 18:29:15'),(90524,'smartphone',1,NULL,'left','products',90521,NULL,NULL,2,'/product/stock/valo.php','','EnhancedValue','stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2013-02-24 18:29:15'),(90525,'smartphone',1,NULL,'left','products',90521,NULL,NULL,3,'/product/stock/mouvement.php','','Movements','stocks',1,'','$user->rights->stock->mouvement->lire','$conf->stock->enabled',2,'2013-02-24 18:29:15'),(90621,'smartphone',1,NULL,'left','products',87424,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=0','','Categories','categories',0,'','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2013-02-24 18:29:15'),(90622,'smartphone',1,NULL,'left','products',90621,NULL,NULL,0,'/categories/fiche.php?action=create&type=0','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2013-02-24 18:29:15'),(91021,'smartphone',1,NULL,'left','project',87428,NULL,NULL,0,'/projet/index.php?leftmenu=projects','','Projects','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91022,'smartphone',1,NULL,'left','project',91021,NULL,NULL,1,'/projet/fiche.php?leftmenu=projects&action=create','','NewProject','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91023,'smartphone',1,NULL,'left','project',91021,NULL,NULL,2,'/projet/liste.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91031,'smartphone',1,NULL,'left','project',87428,NULL,NULL,0,'/projet/index.php?leftmenu=projects&mode=mine','','MyProjects','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91032,'smartphone',1,NULL,'left','project',91031,NULL,NULL,1,'/projet/fiche.php?leftmenu=projects&action=create&mode=mine','','NewProject','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91033,'smartphone',1,NULL,'left','project',91031,NULL,NULL,2,'/projet/liste.php?leftmenu=projects&mode=mine','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91121,'smartphone',1,NULL,'left','project',87428,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects','','Activities','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91122,'smartphone',1,NULL,'left','project',91121,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create','','NewTask','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91123,'smartphone',1,NULL,'left','project',91121,NULL,NULL,2,'/projet/tasks/index.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91124,'smartphone',1,NULL,'left','project',91121,NULL,NULL,3,'/projet/activity/list.php?leftmenu=projects','','NewTimeSpent','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91221,'smartphone',1,NULL,'left','project',87428,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects&mode=mine','','MyActivities','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91222,'smartphone',1,NULL,'left','project',91221,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create&mode=mine','','NewTask','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91223,'smartphone',1,NULL,'left','project',91221,NULL,NULL,2,'/projet/tasks/index.php?leftmenu=projects&mode=mine','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91224,'smartphone',1,NULL,'left','project',91221,NULL,NULL,3,'/projet/activity/list.php?leftmenu=projects&mode=mine','','NewTimeSpent','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-02-24 18:29:15'),(91321,'smartphone',1,NULL,'left','tools',87429,NULL,NULL,0,'/comm/mailing/index.php?leftmenu=mailing','','EMailings','mails',0,'','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2013-02-24 18:29:15'),(91322,'smartphone',1,NULL,'left','tools',91321,NULL,NULL,0,'/comm/mailing/fiche.php?leftmenu=mailing&action=create','','NewMailing','mails',1,'','$user->rights->mailing->creer','$conf->mailing->enabled',0,'2013-02-24 18:29:15'),(91323,'smartphone',1,NULL,'left','tools',91321,NULL,NULL,1,'/comm/mailing/liste.php?leftmenu=mailing','','List','mails',1,'','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2013-02-24 18:29:15'),(91521,'smartphone',1,NULL,'left','tools',87429,NULL,NULL,2,'/exports/index.php?leftmenu=export','','FormatedExport','exports',0,'','$user->rights->export->lire','$conf->export->enabled',2,'2013-02-24 18:29:15'),(91522,'smartphone',1,NULL,'left','tools',91521,NULL,NULL,0,'/exports/export.php?leftmenu=export','','NewExport','exports',1,'','$user->rights->export->creer','$conf->export->enabled',2,'2013-02-24 18:29:15'),(91551,'smartphone',1,NULL,'left','tools',87429,NULL,NULL,2,'/imports/index.php?leftmenu=import','','FormatedImport','exports',0,'','$user->rights->import->run','$conf->import->enabled',2,'2013-02-24 18:29:15'),(91552,'smartphone',1,NULL,'left','tools',91551,NULL,NULL,0,'/imports/import.php?leftmenu=import','','NewImport','exports',1,'','$user->rights->import->run','$conf->import->enabled',2,'2013-02-24 18:29:15'),(91621,'smartphone',1,NULL,'left','members',87434,NULL,NULL,0,'/adherents/index.php?leftmenu=members&mainmenu=members','','Members','members',0,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91622,'smartphone',1,NULL,'left','members',91621,NULL,NULL,0,'/adherents/fiche.php?action=create','','NewMember','members',1,'','$user->rights->adherent->creer','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91623,'smartphone',1,NULL,'left','members',91621,NULL,NULL,1,'/adherents/liste.php','','List','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91624,'smartphone',1,NULL,'left','members',91623,NULL,NULL,2,'/adherents/liste.php?statut=-1','','MenuMembersToValidate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91625,'smartphone',1,NULL,'left','members',91623,NULL,NULL,3,'/adherents/liste.php?statut=1','','MenuMembersValidated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91626,'smartphone',1,NULL,'left','members',91623,NULL,NULL,4,'/adherents/liste.php?statut=1&filter=outofdate','','MenuMembersNotUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91627,'smartphone',1,NULL,'left','members',91623,NULL,NULL,5,'/adherents/liste.php?statut=1&filter=uptodate','','MenuMembersUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91628,'smartphone',1,NULL,'left','members',91623,NULL,NULL,6,'/adherents/liste.php?statut=0','','MenuMembersResiliated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91721,'smartphone',1,NULL,'left','members',87434,NULL,NULL,1,'/adherents/index.php?leftmenu=accountancy&mainmenu=members','','Subscriptions','compta',0,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91722,'smartphone',1,NULL,'left','members',91721,NULL,NULL,0,'/adherents/liste.php?statut=-1&leftmenu=accountancy&mainmenu=members','','NewSubscription','compta',1,'','$user->rights->adherent->cotisation->creer','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91723,'smartphone',1,NULL,'left','members',91721,NULL,NULL,1,'/adherents/cotisations.php?leftmenu=accountancy','','List','compta',1,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91921,'smartphone',1,NULL,'left','members',87434,NULL,NULL,3,'/adherents/index.php?leftmenu=export&mainmenu=members','','Exports','members',0,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91922,'smartphone',1,NULL,'left','members',91921,NULL,NULL,0,'/exports/index.php?leftmenu=export','','Datas','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled && $conf->export->enabled',2,'2013-02-24 18:29:15'),(91923,'smartphone',1,NULL,'left','members',91921,NULL,NULL,1,'/adherents/htpasswd.php?leftmenu=export','','Filehtpasswd','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(91924,'smartphone',1,NULL,'left','members',91921,NULL,NULL,2,'/adherents/cartes/carte.php?leftmenu=export','','MembersCards','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(92121,'smartphone',1,NULL,'left','members',87434,NULL,NULL,5,'/adherents/index.php?leftmenu=setup&mainmenu=members','','Setup','members',0,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(92122,'smartphone',1,NULL,'left','members',92121,NULL,NULL,0,'/adherents/type.php?leftmenu=setup','','MembersTypes','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(92123,'smartphone',1,NULL,'left','members',92121,NULL,NULL,1,'/adherents/options.php?leftmenu=setup','','MembersAttributes','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2013-02-24 18:29:15'),(92421,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,0,'/compta/index.php?leftmenu=suppliers','','Suppliers','companies',0,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(92422,'smartphone',1,NULL,'left','commercial',92421,NULL,NULL,0,'/societe/soc.php?leftmenu=suppliers&action=create&type=f','','NewSupplier','companies',1,'','$user->rights->societe->creer && $user->rights->fournisseur->lire','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(92423,'smartphone',1,NULL,'left','commercial',92421,NULL,NULL,1,'/fourn/liste.php?leftmenu=suppliers','','List','companies',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(92424,'smartphone',1,NULL,'left','commercial',92421,NULL,NULL,2,'/contact/list.php?leftmenu=suppliers&type=f','','Contacts','companies',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->fournisseur->enabled',2,'2013-02-24 18:29:15'),(92521,'smartphone',1,NULL,'left','commercial',87426,NULL,NULL,6,'/fourn/commande/index.php?leftmenu=orders_suppliers','','SuppliersOrders','orders',0,'','$user->rights->fournisseur->commande->lire','$conf->commande->enabled',2,'2013-02-24 18:29:15'),(92522,'smartphone',1,NULL,'left','commercial',92521,NULL,NULL,0,'/societe/societe.php?leftmenu=orders_suppliers','','NewOrder','orders',1,'','$user->rights->fournisseur->commande->creer','$conf->commande->enabled && $leftmenu==\"orders_suppliers\"',2,'2013-02-24 18:29:15'),(92523,'smartphone',1,NULL,'left','commercial',92521,NULL,NULL,1,'/fourn/commande/liste.php?leftmenu=orders_suppliers&viewstatut=0','','List','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->commande->enabled && $leftmenu==\"orders_suppliers\"',2,'2013-02-24 18:29:15'),(92529,'smartphone',1,NULL,'left','commercial',92521,NULL,NULL,7,'/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier','','Statistics','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->commande->enabled && $leftmenu==\"orders_suppliers\"',2,'2013-02-24 18:29:15'),(92621,'smartphone',1,NULL,'left','members',87434,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=3','','MembersCategoriesShort','categories',0,'','$user->rights->categorie->lire','$conf->adherent->enabled && $conf->categorie->enabled',2,'2013-02-24 18:29:15'),(92622,'smartphone',1,NULL,'left','members',92621,NULL,NULL,0,'/categories/fiche.php?action=create&type=3','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->adherent->enabled && $conf->categorie->enabled',2,'2013-02-24 18:29:15'),(103094,'all',2,'agenda','top','agenda',0,NULL,NULL,100,'/comm/action/index.php','','Agenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103095,'all',2,'agenda','left','agenda',103094,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103096,'all',2,'agenda','left','agenda',103095,NULL,NULL,101,'/comm/action/fiche.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103097,'all',2,'agenda','left','agenda',103095,NULL,NULL,102,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Calendar','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103098,'all',2,'agenda','left','agenda',103097,NULL,NULL,103,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103099,'all',2,'agenda','left','agenda',103097,NULL,NULL,104,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103100,'all',2,'agenda','left','agenda',103097,NULL,NULL,105,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103101,'all',2,'agenda','left','agenda',103097,NULL,NULL,106,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103102,'all',2,'agenda','left','agenda',103095,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103103,'all',2,'agenda','left','agenda',103102,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103104,'all',2,'agenda','left','agenda',103102,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103105,'all',2,'agenda','left','agenda',103102,NULL,NULL,115,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103106,'all',2,'agenda','left','agenda',103102,NULL,NULL,116,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103107,'all',2,'agenda','left','agenda',103095,NULL,NULL,120,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103108,'all',2,'pos','top','pos',0,NULL,NULL,100,'/pos/backend/listefac.php','','POS','pos@pos',NULL,'1','1','1',2,'2013-03-13 20:33:09'),(103109,'all',2,'pos','left','pos',103108,NULL,NULL,100,'/pos/backend/liste.php','','Tickets','pos@pos',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103110,'all',2,'pos','left','pos',103109,NULL,NULL,100,'/pos/backend/liste.php','','List','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103111,'all',2,'pos','left','pos',103110,NULL,NULL,100,'/pos/backend/liste.php?viewstatut=0','','StatusTicketDraft','pos@pos',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103112,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/liste.php?viewstatut=1','','StatusTicketClosed','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103113,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/liste.php?viewstatut=2','','StatusTicketProcessed','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103114,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/liste.php?viewtype=1','','StatusTicketReturned','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103115,'all',2,'pos','left','pos',103108,NULL,NULL,100,'/pos/backend/listefac.php','','Factures','pos@pos',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103116,'all',2,'pos','left','pos',103115,NULL,NULL,100,'/pos/backend/listefac.php','','List','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103117,'all',2,'pos','left','pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=0','','BillStatusDraft','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103118,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=1','','BillStatusValidated','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103119,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=2&viewtype=0','','BillStatusPaid','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103120,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewtype=2','','BillStatusReturned','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103121,'all',2,'pos','left','@pos',103108,NULL,NULL,100,'/pos/frontend/index.php','','POS','main',NULL,NULL,'$user->rights->pos->frontend','1',0,'2013-03-13 20:33:09'),(103122,'all',2,'pos','left','@pos',103121,NULL,NULL,100,'/pos/frontend/index.php','','NewTicket','main',NULL,NULL,'$user->rights->pos->frontend','1',0,'2013-03-13 20:33:09'),(103123,'all',2,'pos','left','@pos',103121,NULL,NULL,101,'/pos/backend/closes.php','','CloseandArching','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103124,'all',2,'pos','left','@pos',103108,NULL,NULL,100,'/pos/backend/terminal/cash.php','','Terminal','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103125,'all',2,'pos','left','@pos',103124,NULL,NULL,100,'/pos/backend/terminal/fiche.php?action=create','','NewCash','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103126,'all',2,'pos','left','@pos',103124,NULL,NULL,101,'/pos/backend/terminal/cash.php','','List','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103127,'all',2,'pos','left','@pos',103123,NULL,NULL,101,'/pos/backend/closes.php?viewstatut=0','','Arqueo','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103128,'all',2,'pos','left','@pos',103123,NULL,NULL,102,'/pos/backend/closes.php?viewstatut=1','','Closes','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103129,'all',2,'pos','left','@pos',103108,NULL,NULL,102,'/pos/backend/transfers.php','','Transfer','main',NULL,NULL,'$user->rights->pos->transfer','1',0,'2013-03-13 20:33:09'),(103130,'all',2,'pos','left','@pos',103108,NULL,NULL,102,'/pos/backend/resultat/index.php','','Rapport','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103131,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/casoc.php','','ReportsCustomer','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103132,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/causer.php','','ReportsUser','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103133,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/sellsjournal.php','','ReportsSells','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103134,'all',2,'opensurvey','top','opensurvey',0,NULL,NULL,200,'/opensurvey/index.php','','Surveys','opensurvey',NULL,NULL,'$user->rights->opensurvey->survey->read','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103135,'all',2,'opensurvey','left','opensurvey',-1,NULL,'opensurvey',200,'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey','','Survey','opensurvey@opensurvey',NULL,'opensurvey','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103136,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',210,'/opensurvey/public/index.php','_blank','NewSurvey','opensurvey@opensurvey',NULL,'opensurvey_new','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103137,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',220,'/opensurvey/list.php','','List','opensurvey@opensurvey',NULL,'opensurvey_list','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103160,'all',1,'cron','left','home',-1,'modulesadmintools','home',200,'/cron/list.php?status=1','','CronListActive','cron',NULL,NULL,'$user->rights->cron->read','$leftmenu==\'modulesadmintools\'',2,'2013-03-23 17:24:25'),(103161,'all',1,'cron','left','home',-1,'modulesadmintools','home',201,'/cron/list.php?status=0','','CronListInactive','cron',NULL,NULL,'$user->rights->cron->read','$leftmenu==\'modulesadmintools\'',2,'2013-03-23 17:24:25'),(103162,'auguria',1,'','top','home',0,NULL,NULL,1,'/index.php?mainmenu=home&leftmenu=','','Home','',-1,'','','1',2,'2013-03-24 02:31:47'),(103163,'auguria',1,'societe|fournisseur','top','companies',0,NULL,NULL,2,'/societe/index.php?mainmenu=companies&leftmenu=','','ThirdParties','companies',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->societe->enabled || $conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(103164,'auguria',1,'product|service','top','products',0,NULL,NULL,3,'/product/index.php?mainmenu=products&leftmenu=','','Products/Services','products',-1,'','$user->rights->produit->lire||$user->rights->service->lire','$conf->product->enabled || $conf->service->enabled',0,'2013-03-24 02:31:47'),(103166,'auguria',1,'propal|commande|fournisseur|contrat|ficheinter','top','commercial',0,NULL,NULL,5,'/comm/index.php?mainmenu=commercial&leftmenu=','','Commercial','commercial',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled',2,'2013-03-24 02:31:47'),(103167,'auguria',1,'comptabilite|accounting|facture|deplacement|don|tax','top','accountancy',0,NULL,NULL,6,'/compta/index.php?mainmenu=accountancy&leftmenu=','','MenuFinancial','compta',-1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire','$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled',2,'2013-03-24 02:31:47'),(103168,'auguria',1,'projet','top','project',0,NULL,NULL,7,'/projet/index.php?mainmenu=project&leftmenu=','','Projects','projects',-1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(103169,'auguria',1,'mailing|export|import','top','tools',0,NULL,NULL,8,'/core/tools.php?mainmenu=tools&leftmenu=','','Tools','other',-1,'','$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run','$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled',2,'2013-03-24 02:31:47'),(103172,'auguria',1,'boutique','top','shop',0,NULL,NULL,11,'/boutique/index.php?mainmenu=shop&leftmenu=','','OSCommerce','shop',-1,'','','! empty($conf->boutique->enabled)',0,'2013-03-24 02:31:47'),(103174,'auguria',1,'adherent','top','members',0,NULL,NULL,15,'/adherents/index.php?mainmenu=members&leftmenu=','','Members','members',-1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:47'),(103175,'auguria',1,'banque|prelevement','top','bank',0,NULL,NULL,6,'/compta/bank/index.php?mainmenu=bank&leftmenu=bank','','MenuBankCash','banks',-1,'','$user->rights->banque->lire || $user->rights->prelevement->bons->lire','$conf->banque->enabled || $conf->prelevement->enabled',0,'2013-03-24 02:31:47'),(103261,'auguria',1,'','left','home',103162,NULL,NULL,0,'/admin/index.php?leftmenu=setup','','Setup','admin',0,'setup','','$user->admin',2,'2013-03-24 02:31:47'),(103262,'auguria',1,'','left','home',103261,NULL,NULL,1,'/admin/company.php?leftmenu=setup','','MenuCompanySetup','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103263,'auguria',1,'','left','home',103261,NULL,NULL,4,'/admin/ihm.php?leftmenu=setup','','GUISetup','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103264,'auguria',1,'','left','home',103261,NULL,NULL,2,'/admin/modules.php?leftmenu=setup','','Modules','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103265,'auguria',1,'','left','home',103261,NULL,NULL,5,'/admin/boxes.php?leftmenu=setup','','Boxes','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103266,'auguria',1,'','left','home',103261,NULL,NULL,3,'/admin/menus.php?leftmenu=setup','','Menus','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103267,'auguria',1,'','left','home',103261,NULL,NULL,6,'/admin/delais.php?leftmenu=setup','','Alerts','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103268,'auguria',1,'','left','home',103261,NULL,NULL,9,'/admin/pdf.php?leftmenu=setup','','PDF','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103269,'auguria',1,'','left','home',103261,NULL,NULL,7,'/admin/proxy.php?leftmenu=setup','','Security','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103270,'auguria',1,'','left','home',103261,NULL,NULL,10,'/admin/mails.php?leftmenu=setup','','Emails','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103271,'auguria',1,'','left','home',103261,NULL,NULL,8,'/admin/limits.php?leftmenu=setup','','MenuLimits','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103272,'auguria',1,'','left','home',103261,NULL,NULL,12,'/admin/dict.php?leftmenu=setup','','DictionnarySetup','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103273,'auguria',1,'','left','home',103261,NULL,NULL,13,'/admin/const.php?leftmenu=setup','','OtherSetup','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103274,'auguria',1,'','left','home',103261,NULL,NULL,11,'/admin/sms.php?leftmenu=setup','','Sms','admin',1,'','','$leftmenu==\'setup\'',2,'2013-03-24 02:31:47'),(103362,'auguria',1,'','left','home',103461,NULL,NULL,0,'/admin/system/dolibarr.php?leftmenu=admintools','','InfoDolibarr','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103364,'auguria',1,'','left','home',103461,NULL,NULL,13,'/admin/system/about.php?leftmenu=admintools','','About','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103365,'auguria',1,'','left','home',103461,NULL,NULL,1,'/admin/system/os.php?leftmenu=admintools','','InfoOS','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103366,'auguria',1,'','left','home',103461,NULL,NULL,2,'/admin/system/web.php?leftmenu=admintools','','InfoWebServer','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103367,'auguria',1,'','left','home',103461,NULL,NULL,3,'/admin/system/phpinfo.php?leftmenu=admintools','','InfoPHP','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103368,'auguria',1,'','left','home',103362,NULL,NULL,3,'/admin/triggers.php?leftmenu=admintools','','Triggers','admin',2,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103369,'auguria',1,'','left','home',103362,NULL,NULL,2,'/admin/system/modules.php?leftmenu=admintools','','Modules','admin',2,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103371,'auguria',1,'','left','home',103461,NULL,NULL,4,'/admin/system/database.php?leftmenu=admintools','','InfoDatabase','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103461,'auguria',1,'','left','home',103162,NULL,NULL,2,'/admin/tools/index.php?leftmenu=admintools','','SystemTools','admin',0,'admintools','','$user->admin',2,'2013-03-24 02:31:47'),(103462,'auguria',1,'','left','home',103461,NULL,NULL,5,'/admin/tools/dolibarr_export.php?leftmenu=admintools','','Backup','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103463,'auguria',1,'','left','home',103461,NULL,NULL,6,'/admin/tools/dolibarr_import.php?leftmenu=admintools','','Restore','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103464,'auguria',1,'','left','home',103461,NULL,NULL,11,'/admin/tools/purge.php?leftmenu=admintools','','Purge','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103465,'auguria',1,'','left','home',103461,NULL,NULL,8,'/admin/tools/eaccelerator.php?leftmenu=admintools','','EAccelerator','admin',1,'','','$leftmenu==\'admintools\' && function_exists(\'eaccelerator_info\')',2,'2013-03-24 02:31:47'),(103466,'auguria',1,'','left','home',103461,NULL,NULL,7,'/admin/tools/update.php?leftmenu=admintools','','MenuUpgrade','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103467,'auguria',1,'','left','home',103461,NULL,NULL,9,'/admin/tools/listevents.php?leftmenu=admintools','','Audit','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103468,'auguria',1,'','left','home',103461,NULL,NULL,12,'/support/index.php?leftmenu=admintools','_blank','HelpCenter','help',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103469,'auguria',1,'','left','home',103461,NULL,NULL,10,'/admin/tools/listsessions.php?leftmenu=admintools','','Sessions','admin',1,'','','$leftmenu==\'admintools\'',2,'2013-03-24 02:31:47'),(103561,'auguria',1,'','left','home',103162,NULL,NULL,3,'/user/home.php?leftmenu=users','','MenuUsersAndGroups','users',0,'users','','1',2,'2013-03-24 02:31:47'),(103562,'auguria',1,'','left','home',103561,NULL,NULL,0,'/user/index.php?leftmenu=users','','Users','users',1,'','$user->rights->user->user->lire || $user->admin','$leftmenu==\'users\'',2,'2013-03-24 02:31:47'),(103563,'auguria',1,'','left','home',103562,NULL,NULL,0,'/user/fiche.php?leftmenu=users&action=create','','NewUser','users',2,'','$user->rights->user->user->creer || $user->admin','$leftmenu==\'users\'',2,'2013-03-24 02:31:47'),(103564,'auguria',1,'','left','home',103561,NULL,NULL,1,'/user/group/index.php?leftmenu=users','','Groups','users',1,'','($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin','$leftmenu==\'users\'',2,'2013-03-24 02:31:47'),(103565,'auguria',1,'','left','home',103564,NULL,NULL,0,'/user/group/fiche.php?leftmenu=users&action=create','','NewGroup','users',2,'','($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin','$leftmenu==\'users\'',2,'2013-03-24 02:31:47'),(103661,'auguria',1,'','left','companies',103163,NULL,NULL,0,'/societe/index.php?leftmenu=thirdparties','','ThirdParty','companies',0,'thirdparties','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103662,'auguria',1,'','left','companies',103661,NULL,NULL,0,'/societe/soc.php?action=create','','MenuNewThirdParty','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103664,'auguria',1,'','left','companies',103661,NULL,NULL,5,'/fourn/liste.php?leftmenu=suppliers','','ListSuppliersShort','suppliers',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(103665,'auguria',1,'','left','companies',103664,NULL,NULL,0,'/societe/soc.php?leftmenu=supplier&action=create&type=f','','NewSupplier','suppliers',2,'','$user->rights->societe->creer','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(103667,'auguria',1,'','left','companies',103661,NULL,NULL,3,'/comm/prospect/list.php?leftmenu=prospects','','ListProspectsShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103668,'auguria',1,'','left','companies',103667,NULL,NULL,0,'/societe/soc.php?leftmenu=prospects&action=create&type=p','','MenuNewProspect','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103670,'auguria',1,'','left','companies',103661,NULL,NULL,4,'/comm/list.php?leftmenu=customers','','ListCustomersShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103671,'auguria',1,'','left','companies',103670,NULL,NULL,0,'/societe/soc.php?leftmenu=customers&action=create&type=c','','MenuNewCustomer','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103761,'auguria',1,'','left','companies',103163,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','ContactsAddresses','companies',0,'contacts','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103762,'auguria',1,'','left','companies',103761,NULL,NULL,0,'/contact/fiche.php?leftmenu=contacts&action=create','','NewContactAddress','companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103763,'auguria',1,'','left','companies',103761,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103765,'auguria',1,'','left','companies',103763,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=p','','Prospects','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103766,'auguria',1,'','left','companies',103763,NULL,NULL,2,'/contact/list.php?leftmenu=contacts&type=c','','Customers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103767,'auguria',1,'','left','companies',103763,NULL,NULL,3,'/contact/list.php?leftmenu=contacts&type=f','','Suppliers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(103768,'auguria',1,'','left','companies',103763,NULL,NULL,4,'/contact/list.php?leftmenu=contacts&type=o','','Others','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2013-03-24 02:31:47'),(103811,'auguria',1,'','left','companies',103163,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=1','','SuppliersCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2013-03-24 02:31:47'),(103812,'auguria',1,'','left','companies',103811,NULL,NULL,0,'/categories/fiche.php?action=create&type=1','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2013-03-24 02:31:47'),(103821,'auguria',1,'','left','companies',103163,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=2','','CustomersProspectsCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2013-03-24 02:31:47'),(103822,'auguria',1,'','left','companies',103821,NULL,NULL,0,'/categories/fiche.php?action=create&type=2','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2013-03-24 02:31:47'),(104261,'auguria',1,'','left','commercial',103166,NULL,NULL,4,'/comm/propal/index.php?leftmenu=propals','','Prop','propal',0,'propals','$user->rights->propale->lire','$conf->propal->enabled',2,'2013-03-24 02:31:47'),(104262,'auguria',1,'','left','commercial',104261,NULL,NULL,0,'/societe/societe.php?leftmenu=propals','','NewPropal','propal',1,'','$user->rights->propale->creer','$conf->propal->enabled',2,'2013-03-24 02:31:47'),(104263,'auguria',1,'','left','commercial',104261,NULL,NULL,1,'/comm/propal/list.php?leftmenu=propals','','List','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2013-03-24 02:31:47'),(104264,'auguria',1,'','left','commercial',104263,NULL,NULL,2,'/comm/propal/list.php?leftmenu=propals&viewstatut=0','','PropalsDraft','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-03-24 02:31:47'),(104265,'auguria',1,'','left','commercial',104263,NULL,NULL,3,'/comm/propal/list.php?leftmenu=propals&viewstatut=1','','PropalsOpened','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-03-24 02:31:47'),(104266,'auguria',1,'','left','commercial',104263,NULL,NULL,4,'/comm/propal/list.php?leftmenu=propals&viewstatut=2','','PropalStatusSigned','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-03-24 02:31:47'),(104267,'auguria',1,'','left','commercial',104263,NULL,NULL,5,'/comm/propal/list.php?leftmenu=propals&viewstatut=3','','PropalStatusNotSigned','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-03-24 02:31:47'),(104268,'auguria',1,'','left','commercial',104263,NULL,NULL,6,'/comm/propal/list.php?leftmenu=propals&viewstatut=4','','PropalStatusBilled','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2013-03-24 02:31:47'),(104271,'auguria',1,'','left','commercial',104261,NULL,NULL,4,'/comm/propal/stats/index.php?leftmenu=propals','','Statistics','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2013-03-24 02:31:47'),(104361,'auguria',1,'','left','commercial',103166,NULL,NULL,5,'/commande/index.php?leftmenu=orders','','CustomersOrders','orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',2,'2013-03-24 02:31:47'),(104362,'auguria',1,'','left','commercial',104361,NULL,NULL,0,'/societe/societe.php?leftmenu=orders','','NewOrder','orders',1,'','$user->rights->commande->creer','$conf->commande->enabled',2,'2013-03-24 02:31:47'),(104363,'auguria',1,'','left','commercial',104361,NULL,NULL,1,'/commande/liste.php?leftmenu=orders','','List','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2013-03-24 02:31:47'),(104364,'auguria',1,'','left','commercial',104363,NULL,NULL,2,'/commande/liste.php?leftmenu=orders&viewstatut=0','','StatusOrderDraftShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-03-24 02:31:47'),(104365,'auguria',1,'','left','commercial',104363,NULL,NULL,3,'/commande/liste.php?leftmenu=orders&viewstatut=1','','StatusOrderValidated','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-03-24 02:31:47'),(104366,'auguria',1,'','left','commercial',104363,NULL,NULL,4,'/commande/liste.php?leftmenu=orders&viewstatut=2','','StatusOrderOnProcessShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-03-24 02:31:47'),(104367,'auguria',1,'','left','commercial',104363,NULL,NULL,5,'/commande/liste.php?leftmenu=orders&viewstatut=3','','StatusOrderToBill','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-03-24 02:31:47'),(104368,'auguria',1,'','left','commercial',104363,NULL,NULL,6,'/commande/liste.php?leftmenu=orders&viewstatut=4','','StatusOrderProcessed','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-03-24 02:31:47'),(104369,'auguria',1,'','left','commercial',104363,NULL,NULL,7,'/commande/liste.php?leftmenu=orders&viewstatut=-1','','StatusOrderCanceledShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2013-03-24 02:31:47'),(104370,'auguria',1,'','left','commercial',104361,NULL,NULL,4,'/commande/stats/index.php?leftmenu=orders','','Statistics','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2013-03-24 02:31:47'),(104461,'auguria',1,'','left','commercial',103164,NULL,NULL,6,'/expedition/index.php?leftmenu=sendings','','Shipments','sendings',0,'sendings','$user->rights->expedition->lire','$conf->expedition->enabled',2,'2013-03-24 02:31:47'),(104462,'auguria',1,'','left','commercial',104461,NULL,NULL,0,'/expedition/fiche.php?action=create2&leftmenu=sendings','','NewSending','sendings',1,'','$user->rights->expedition->creer','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2013-03-24 02:31:47'),(104463,'auguria',1,'','left','commercial',104461,NULL,NULL,1,'/expedition/liste.php?leftmenu=sendings','','List','sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2013-03-24 02:31:47'),(104464,'auguria',1,'','left','commercial',104461,NULL,NULL,2,'/expedition/stats/index.php?leftmenu=sendings','','Statistics','sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2013-03-24 02:31:47'),(104561,'auguria',1,'','left','commercial',103166,NULL,NULL,7,'/contrat/index.php?leftmenu=contracts','','Contracts','contracts',0,'contracts','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2013-03-24 02:31:47'),(104562,'auguria',1,'','left','commercial',104561,NULL,NULL,0,'/societe/societe.php?leftmenu=contracts','','NewContract','contracts',1,'','$user->rights->contrat->creer','$conf->contrat->enabled',2,'2013-03-24 02:31:47'),(104563,'auguria',1,'','left','commercial',104561,NULL,NULL,1,'/contrat/liste.php?leftmenu=contracts','','List','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2013-03-24 02:31:47'),(104564,'auguria',1,'','left','commercial',104561,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts','','MenuServices','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2013-03-24 02:31:47'),(104565,'auguria',1,'','left','commercial',104564,NULL,NULL,0,'/contrat/services.php?leftmenu=contracts&mode=0','','MenuInactiveServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-03-24 02:31:47'),(104566,'auguria',1,'','left','commercial',104564,NULL,NULL,1,'/contrat/services.php?leftmenu=contracts&mode=4','','MenuRunningServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-03-24 02:31:47'),(104567,'auguria',1,'','left','commercial',104564,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts&mode=4&filter=expired','','MenuExpiredServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-03-24 02:31:47'),(104568,'auguria',1,'','left','commercial',104564,NULL,NULL,3,'/contrat/services.php?leftmenu=contracts&mode=5','','MenuClosedServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2013-03-24 02:31:47'),(104661,'auguria',1,'','left','commercial',103166,NULL,NULL,8,'/fichinter/list.php?leftmenu=ficheinter','','Interventions','interventions',0,'ficheinter','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2013-03-24 02:31:47'),(104662,'auguria',1,'','left','commercial',104661,NULL,NULL,0,'/fichinter/fiche.php?action=create&leftmenu=ficheinter','','NewIntervention','interventions',1,'','$user->rights->ficheinter->creer','$conf->ficheinter->enabled',2,'2013-03-24 02:31:47'),(104663,'auguria',1,'','left','commercial',104661,NULL,NULL,1,'/fichinter/list.php?leftmenu=ficheinter','','List','interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2013-03-24 02:31:47'),(104761,'auguria',1,'','left','accountancy',103167,NULL,NULL,3,'/fourn/facture/index.php?leftmenu=suppliers_bills','','BillsSuppliers','bills',0,'supplier_bills','$user->rights->fournisseur->facture->lire','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(104762,'auguria',1,'','left','accountancy',104761,NULL,NULL,0,'/fourn/facture/fiche.php?action=create&leftmenu=suppliers_bills','','NewBill','bills',1,'','$user->rights->fournisseur->facture->creer','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(104763,'auguria',1,'','left','accountancy',104761,NULL,NULL,1,'/fourn/facture/impayees.php?leftmenu=suppliers_bills','','Unpaid','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(104764,'auguria',1,'','left','accountancy',104761,NULL,NULL,2,'/fourn/facture/paiement.php?leftmenu=suppliers_bills','','Payments','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(104765,'auguria',1,'','left','accountancy',104761,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier','','Statistics','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(104861,'auguria',1,'','left','accountancy',103167,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills','','BillsCustomers','bills',0,'customer_bills','$user->rights->facture->lire','$conf->facture->enabled',2,'2013-03-24 02:31:47'),(104862,'auguria',1,'','left','accountancy',104861,NULL,NULL,3,'/compta/clients.php?action=facturer&leftmenu=customers_bills','','NewBill','bills',1,'','$user->rights->facture->creer','$conf->facture->enabled',2,'2013-03-24 02:31:47'),(104863,'auguria',1,'','left','accountancy',104861,NULL,NULL,4,'/compta/facture/fiche-rec.php?leftmenu=customers_bills','','Repeatable','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2013-03-24 02:31:47'),(104864,'auguria',1,'','left','accountancy',104861,NULL,NULL,5,'/compta/facture/impayees.php?action=facturer&leftmenu=customers_bills','','Unpaid','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2013-03-24 02:31:47'),(104865,'auguria',1,'','left','accountancy',104861,NULL,NULL,6,'/compta/paiement/liste.php?leftmenu=customers_bills','','Payments','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2013-03-24 02:31:47'),(104871,'auguria',1,'','left','accountancy',104865,NULL,NULL,1,'/compta/paiement/rapport.php?leftmenu=customers_bills','','Reportings','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2013-03-24 02:31:47'),(104872,'auguria',1,'','left','accountancy',103175,NULL,NULL,9,'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank','','MenuChequeDeposits','bills',0,'checks','$user->rights->facture->lire','$conf->facture->enabled && $conf->banque->enabled',2,'2013-03-24 02:31:47'),(104873,'auguria',1,'','left','accountancy',104872,NULL,NULL,0,'/compta/paiement/cheque/fiche.php?leftmenu=checks&action=new','','NewCheckDeposit','compta',1,'','$user->rights->facture->lire','$conf->facture->enabled && $conf->banque->enabled',2,'2013-03-24 02:31:47'),(104874,'auguria',1,'','left','accountancy',104872,NULL,NULL,1,'/compta/paiement/cheque/liste.php?leftmenu=checks','','List','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled && $conf->banque->enabled',2,'2013-03-24 02:31:47'),(104875,'auguria',1,'','left','accountancy',104861,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills','','Statistics','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2013-03-24 02:31:47'),(105061,'auguria',1,'','left','accountancy',103167,NULL,NULL,3,'/commande/liste.php?leftmenu=orders&viewstatut=3','','MenuOrdersToBill','orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',0,'2013-03-24 02:31:47'),(105161,'auguria',1,'','left','accountancy',103167,NULL,NULL,4,'/compta/dons/index.php?leftmenu=donations&mainmenu=accountancy','','Donations','donations',0,'donations','$user->rights->don->lire','$conf->don->enabled',2,'2013-03-24 02:31:47'),(105162,'auguria',1,'','left','accountancy',105161,NULL,NULL,0,'/compta/dons/fiche.php?leftmenu=donations&mainmenu=accountancy&action=create','','NewDonation','donations',1,'','$user->rights->don->creer','$conf->don->enabled && $leftmenu==\"donations\"',2,'2013-03-24 02:31:47'),(105163,'auguria',1,'','left','accountancy',105161,NULL,NULL,1,'/compta/dons/liste.php?leftmenu=donations&mainmenu=accountancy','','List','donations',1,'','$user->rights->don->lire','$conf->don->enabled && $leftmenu==\"donations\"',2,'2013-03-24 02:31:47'),(105261,'auguria',1,'','left','accountancy',103167,NULL,NULL,5,'/compta/deplacement/index.php?leftmenu=tripsandexpenses','','TripsAndExpenses','trips',0,'tripsandexpenses','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2013-03-24 02:31:47'),(105262,'auguria',1,'','left','accountancy',105261,NULL,NULL,1,'/compta/deplacement/fiche.php?action=create&leftmenu=tripsandexpenses','','New','trips',1,'','$user->rights->deplacement->creer','$conf->deplacement->enabled && $leftmenu==\"tripsandexpenses\"',0,'2013-03-24 02:31:47'),(105263,'auguria',1,'','left','accountancy',105261,NULL,NULL,2,'/compta/deplacement/list.php?leftmenu=tripsandexpenses','','List','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled && $leftmenu==\"tripsandexpenses\"',0,'2013-03-24 02:31:47'),(105264,'auguria',1,'','left','accountancy',105261,NULL,NULL,2,'/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses','','Statistics','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled && $leftmenu==\"tripsandexpenses\"',0,'2013-03-24 02:31:47'),(105361,'auguria',1,'','left','accountancy',103167,NULL,NULL,6,'/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy','','MenuTaxAndDividends','compta',0,'tax','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2013-03-24 02:31:47'),(105362,'auguria',1,'','left','accountancy',105361,NULL,NULL,1,'/compta/sociales/index.php?leftmenu=tax_social','','SocialContributions','',1,'tax_social','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2013-03-24 02:31:47'),(105363,'auguria',1,'','left','accountancy',105362,NULL,NULL,2,'/compta/sociales/charges.php?leftmenu=tax_social&action=create','','MenuNewSocialContribution','',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2013-03-24 02:31:47'),(105364,'auguria',1,'','left','accountancy',105362,NULL,NULL,3,'/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly','','Payments','',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2013-03-24 02:31:47'),(105461,'auguria',1,'','left','accountancy',105361,NULL,NULL,7,'/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy','','VAT','companies',1,'tax_vat','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)',0,'2013-03-24 02:31:47'),(105462,'auguria',1,'','left','accountancy',105461,NULL,NULL,0,'/compta/tva/fiche.php?leftmenu=tax_vat&action=create','','NewPayment','companies',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-03-24 02:31:47'),(105463,'auguria',1,'','left','accountancy',105461,NULL,NULL,1,'/compta/tva/reglement.php?leftmenu=tax_vat','','Payments','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-03-24 02:31:47'),(105464,'auguria',1,'','left','accountancy',105461,NULL,NULL,2,'/compta/tva/clients.php?leftmenu=tax_vat','','ReportByCustomers','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-03-24 02:31:47'),(105465,'auguria',1,'','left','accountancy',105461,NULL,NULL,3,'/compta/tva/quadri_detail.php?leftmenu=tax_vat','','ReportByQuarter','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2013-03-24 02:31:47'),(105561,'auguria',1,'','left','accountancy',103167,NULL,NULL,8,'/compta/ventilation/index.php?leftmenu=ventil','','Ventilation','companies',0,'ventil','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105562,'auguria',1,'','left','accountancy',105561,NULL,NULL,0,'/compta/ventilation/liste.php','','ToDispatch','companies',1,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105563,'auguria',1,'','left','accountancy',105561,NULL,NULL,1,'/compta/ventilation/lignes.php','','Dispatched','companies',1,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105564,'auguria',1,'','left','accountancy',105561,NULL,NULL,2,'/compta/param/','','Setup','companies',1,'','$user->rights->compta->ventilation->parametrer','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105565,'auguria',1,'','left','accountancy',105564,NULL,NULL,0,'/compta/param/comptes/liste.php','','List','companies',2,'','$user->rights->compta->ventilation->parametrer','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105566,'auguria',1,'','left','accountancy',105564,NULL,NULL,1,'/compta/param/comptes/fiche.php?action=create','','New','companies',2,'','$user->rights->compta->ventilation->parametrer','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105567,'auguria',1,'','left','accountancy',105561,NULL,NULL,3,'/compta/export/','','Export','companies',1,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105568,'auguria',1,'','left','accountancy',105567,NULL,NULL,0,'/compta/export/index.php','','New','companies',2,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105569,'auguria',1,'','left','accountancy',105567,NULL,NULL,1,'/compta/export/liste.php','','List','companies',2,'','$user->rights->compta->ventilation->lire','$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION',0,'2013-03-24 02:31:47'),(105661,'auguria',1,'','left','accountancy',103175,NULL,NULL,9,'/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank','','StandingOrders','withdrawals',0,'withdraw','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled',2,'2013-03-24 02:31:47'),(105663,'auguria',1,'','left','accountancy',105661,NULL,NULL,0,'/compta/prelevement/create.php?leftmenu=withdraw','','NewStandingOrder','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-03-24 02:31:47'),(105664,'auguria',1,'','left','accountancy',105661,NULL,NULL,2,'/compta/prelevement/bons.php?leftmenu=withdraw','','WithdrawalsReceipts','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-03-24 02:31:47'),(105665,'auguria',1,'','left','accountancy',105661,NULL,NULL,3,'/compta/prelevement/liste.php?leftmenu=withdraw','','WithdrawalsLines','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-03-24 02:31:47'),(105667,'auguria',1,'','left','accountancy',105661,NULL,NULL,5,'/compta/prelevement/rejets.php?leftmenu=withdraw','','Rejects','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-03-24 02:31:47'),(105668,'auguria',1,'','left','accountancy',105661,NULL,NULL,6,'/compta/prelevement/stats.php?leftmenu=withdraw','','Statistics','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2013-03-24 02:31:47'),(105761,'auguria',1,'','left','accountancy',103175,NULL,NULL,1,'/compta/bank/index.php?leftmenu=bank&mainmenu=bank','','MenuBankCash','banks',0,'bank','$user->rights->banque->lire','$conf->banque->enabled',0,'2013-03-24 02:31:47'),(105762,'auguria',1,'','left','accountancy',105761,NULL,NULL,0,'/compta/bank/fiche.php?action=create&leftmenu=bank','','MenuNewFinancialAccount','banks',1,'','$user->rights->banque->configurer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2013-03-24 02:31:47'),(105763,'auguria',1,'','left','accountancy',105761,NULL,NULL,1,'/compta/bank/categ.php?leftmenu=bank','','Rubriques','categories',1,'','$user->rights->banque->configurer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2013-03-24 02:31:47'),(105764,'auguria',1,'','left','accountancy',105761,NULL,NULL,2,'/compta/bank/search.php?leftmenu=bank','','ListTransactions','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2013-03-24 02:31:47'),(105765,'auguria',1,'','left','accountancy',105761,NULL,NULL,3,'/compta/bank/budget.php?leftmenu=bank','','ListTransactionsByCategory','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2013-03-24 02:31:47'),(105767,'auguria',1,'','left','accountancy',105761,NULL,NULL,5,'/compta/bank/virement.php?leftmenu=bank','','BankTransfers','banks',1,'','$user->rights->banque->transfer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2013-03-24 02:31:47'),(105861,'auguria',1,'','left','accountancy',103167,NULL,NULL,11,'/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy','','Reportings','main',0,'ca','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105862,'auguria',1,'','left','accountancy',105861,NULL,NULL,0,'/compta/resultat/index.php?leftmenu=ca','','ReportInOut','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105863,'auguria',1,'','left','accountancy',105862,NULL,NULL,0,'/compta/resultat/clientfourn.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105864,'auguria',1,'','left','accountancy',105861,NULL,NULL,1,'/compta/stats/index.php?leftmenu=ca','','ReportTurnover','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105865,'auguria',1,'','left','accountancy',105864,NULL,NULL,0,'/compta/stats/casoc.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105866,'auguria',1,'','left','accountancy',105864,NULL,NULL,1,'/compta/stats/cabyuser.php?leftmenu=ca','','ByUsers','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105867,'auguria',1,'','left','accountancy',105861,NULL,NULL,1,'/compta/journal/sellsjournal.php?leftmenu=ca','','SellsJournal','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105868,'auguria',1,'','left','accountancy',105861,NULL,NULL,1,'/compta/journal/purchasesjournal.php?leftmenu=ca','','PurchasesJournal','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled || $conf->accounting->enabled',0,'2013-03-24 02:31:47'),(105961,'auguria',1,'','left','products',103164,NULL,NULL,0,'/product/index.php?leftmenu=product&type=0','','Products','products',0,'product','$user->rights->produit->lire','$conf->product->enabled',2,'2013-03-24 02:31:47'),(105962,'auguria',1,'','left','products',105961,NULL,NULL,0,'/product/fiche.php?leftmenu=product&action=create&type=0','','NewProduct','products',1,'','$user->rights->produit->creer','$conf->product->enabled',2,'2013-03-24 02:31:47'),(105963,'auguria',1,'','left','products',105961,NULL,NULL,1,'/product/liste.php?leftmenu=product&type=0','','List','products',1,'','$user->rights->produit->lire','$conf->product->enabled',2,'2013-03-24 02:31:47'),(105964,'auguria',1,'','left','products',105961,NULL,NULL,4,'/product/reassort.php?type=0','','Stocks','products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->product->enabled',2,'2013-03-24 02:31:47'),(105965,'auguria',1,'','left','products',105961,NULL,NULL,5,'/product/popuprop.php?leftmenu=stats&type=0','','Statistics','main',1,'','$user->rights->produit->lire','$conf->propal->enabled',2,'2013-03-24 02:31:47'),(106061,'auguria',1,'','left','products',103164,NULL,NULL,1,'/product/index.php?leftmenu=service&type=1','','Services','products',0,'service','$user->rights->service->lire','$conf->service->enabled',2,'2013-03-24 02:31:47'),(106062,'auguria',1,'','left','products',106061,NULL,NULL,0,'/product/fiche.php?leftmenu=service&action=create&type=1','','NewService','products',1,'','$user->rights->service->creer','$conf->service->enabled',2,'2013-03-24 02:31:47'),(106063,'auguria',1,'','left','products',106061,NULL,NULL,1,'/product/liste.php?leftmenu=service&type=1','','List','products',1,'','$user->rights->service->lire','$conf->service->enabled',2,'2013-03-24 02:31:47'),(106064,'auguria',1,'','left','products',106061,NULL,NULL,5,'/product/popuprop.php?leftmenu=stats&type=1','','Statistics','main',1,'','$user->rights->service->lire','$conf->propal->enabled',2,'2013-03-24 02:31:47'),(106261,'auguria',1,'','left','products',103164,NULL,NULL,3,'/product/stock/index.php?leftmenu=stock','','Stock','stocks',0,'stock','$user->rights->stock->lire','$conf->stock->enabled',2,'2013-03-24 02:31:47'),(106262,'auguria',1,'','left','products',106261,NULL,NULL,0,'/product/stock/fiche.php?action=create','','MenuNewWarehouse','stocks',1,'','$user->rights->stock->creer','$conf->stock->enabled',2,'2013-03-24 02:31:47'),(106263,'auguria',1,'','left','products',106261,NULL,NULL,1,'/product/stock/liste.php','','List','stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2013-03-24 02:31:47'),(106264,'auguria',1,'','left','products',106261,NULL,NULL,2,'/product/stock/valo.php','','EnhancedValue','stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2013-03-24 02:31:47'),(106265,'auguria',1,'','left','products',106261,NULL,NULL,3,'/product/stock/mouvement.php','','Movements','stocks',1,'','$user->rights->stock->mouvement->lire','$conf->stock->enabled',2,'2013-03-24 02:31:47'),(106361,'auguria',1,'','left','products',103164,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=0','','Categories','categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2013-03-24 02:31:47'),(106362,'auguria',1,'','left','products',106361,NULL,NULL,0,'/categories/fiche.php?action=create&type=0','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2013-03-24 02:31:47'),(106761,'auguria',1,'','left','project',103168,NULL,NULL,0,'/projet/index.php?leftmenu=projects','','Projects','projects',0,'projects','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106762,'auguria',1,'','left','project',106761,NULL,NULL,1,'/projet/fiche.php?leftmenu=projects&action=create','','NewProject','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106763,'auguria',1,'','left','project',106761,NULL,NULL,2,'/projet/liste.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106771,'auguria',1,'','left','project',103168,NULL,NULL,0,'/projet/index.php?leftmenu=projects&mode=mine','','MyProjects','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106772,'auguria',1,'','left','project',106771,NULL,NULL,1,'/projet/fiche.php?leftmenu=projects&action=create&mode=mine','','NewProject','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106773,'auguria',1,'','left','project',106771,NULL,NULL,2,'/projet/liste.php?leftmenu=projects&mode=mine','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106861,'auguria',1,'','left','project',103168,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects','','Activities','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106862,'auguria',1,'','left','project',106861,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create','','NewTask','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106863,'auguria',1,'','left','project',106861,NULL,NULL,2,'/projet/tasks/index.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106864,'auguria',1,'','left','project',106861,NULL,NULL,3,'/projet/activity/list.php?leftmenu=projects','','NewTimeSpent','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106961,'auguria',1,'','left','project',103168,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects&mode=mine','','MyActivities','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106962,'auguria',1,'','left','project',106961,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create&mode=mine','','NewTask','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106963,'auguria',1,'','left','project',106961,NULL,NULL,2,'/projet/tasks/index.php?leftmenu=projects&mode=mine','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(106964,'auguria',1,'','left','project',106961,NULL,NULL,3,'/projet/activity/list.php?leftmenu=projects&mode=mine','','NewTimeSpent','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2013-03-24 02:31:47'),(107061,'auguria',1,'','left','tools',103169,NULL,NULL,0,'/comm/mailing/index.php?leftmenu=mailing','','EMailings','mails',0,'mailing','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2013-03-24 02:31:47'),(107062,'auguria',1,'','left','tools',107061,NULL,NULL,0,'/comm/mailing/fiche.php?leftmenu=mailing&action=create','','NewMailing','mails',1,'','$user->rights->mailing->creer','$conf->mailing->enabled',0,'2013-03-24 02:31:47'),(107063,'auguria',1,'','left','tools',107061,NULL,NULL,1,'/comm/mailing/liste.php?leftmenu=mailing','','List','mails',1,'','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2013-03-24 02:31:47'),(107261,'auguria',1,'','left','tools',103169,NULL,NULL,2,'/exports/index.php?leftmenu=export','','FormatedExport','exports',0,'export','$user->rights->export->lire','$conf->export->enabled',2,'2013-03-24 02:31:47'),(107262,'auguria',1,'','left','tools',107261,NULL,NULL,0,'/exports/export.php?leftmenu=export','','NewExport','exports',1,'','$user->rights->export->creer','$conf->export->enabled',2,'2013-03-24 02:31:47'),(107291,'auguria',1,'','left','tools',103169,NULL,NULL,2,'/imports/index.php?leftmenu=import','','FormatedImport','exports',0,'import','$user->rights->import->run','$conf->import->enabled',2,'2013-03-24 02:31:47'),(107292,'auguria',1,'','left','tools',107291,NULL,NULL,0,'/imports/import.php?leftmenu=import','','NewImport','exports',1,'','$user->rights->import->run','$conf->import->enabled',2,'2013-03-24 02:31:47'),(107361,'auguria',1,'','left','members',103174,NULL,NULL,0,'/adherents/index.php?leftmenu=members&mainmenu=members','','Members','members',0,'members','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107362,'auguria',1,'','left','members',107361,NULL,NULL,0,'/adherents/fiche.php?leftmenu=members&action=create','','NewMember','members',1,'','$user->rights->adherent->creer','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107363,'auguria',1,'','left','members',107361,NULL,NULL,1,'/adherents/liste.php','','List','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107364,'auguria',1,'','left','members',107363,NULL,NULL,2,'/adherents/liste.php?leftmenu=members&statut=-1','','MenuMembersToValidate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107365,'auguria',1,'','left','members',107363,NULL,NULL,3,'/adherents/liste.php?leftmenu=members&statut=1','','MenuMembersValidated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107366,'auguria',1,'','left','members',107363,NULL,NULL,4,'/adherents/liste.php?leftmenu=members&statut=1&filter=outofdate','','MenuMembersNotUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107367,'auguria',1,'','left','members',107363,NULL,NULL,5,'/adherents/liste.php?leftmenu=members&statut=1&filter=uptodate','','MenuMembersUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107368,'auguria',1,'','left','members',107363,NULL,NULL,6,'/adherents/liste.php?leftmenu=members&statut=0','','MenuMembersResiliated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107369,'auguria',1,'','left','members',107361,NULL,NULL,7,'/adherents/stats/geo.php?leftmenu=members&mode=memberbycountry','','MenuMembersStats','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107461,'auguria',1,'','left','members',103174,NULL,NULL,1,'/adherents/index.php?leftmenu=members&mainmenu=members','','Subscriptions','compta',0,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107462,'auguria',1,'','left','members',107461,NULL,NULL,0,'/adherents/liste.php?statut=-1&leftmenu=accountancy&mainmenu=members','','NewSubscription','compta',1,'','$user->rights->adherent->cotisation->creer','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107463,'auguria',1,'','left','members',107461,NULL,NULL,1,'/adherents/cotisations.php?leftmenu=members','','List','compta',1,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107464,'auguria',1,'','left','members',107461,NULL,NULL,7,'/adherents/stats/index.php?leftmenu=members','','MenuMembersStats','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107661,'auguria',1,'','left','members',103174,NULL,NULL,3,'/adherents/index.php?leftmenu=export&mainmenu=members','','Exports','members',0,'export','$user->rights->adherent->export','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107662,'auguria',1,'','left','members',107661,NULL,NULL,0,'/exports/index.php?leftmenu=export','','Datas','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled && $conf->export->enabled',2,'2013-03-24 02:31:48'),(107663,'auguria',1,'','left','members',107661,NULL,NULL,1,'/adherents/htpasswd.php?leftmenu=export','','Filehtpasswd','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107664,'auguria',1,'','left','members',107661,NULL,NULL,2,'/adherents/cartes/carte.php?leftmenu=export','','MembersCards','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107861,'auguria',1,'','left','members',103174,NULL,NULL,5,'/adherents/type.php?leftmenu=setup&mainmenu=members','','MembersTypes','members',0,'setup','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107862,'auguria',1,'','left','members',107861,NULL,NULL,0,'/adherents/type.php?leftmenu=setup&mainmenu=members&action=create','','New','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(107863,'auguria',1,'','left','members',107861,NULL,NULL,1,'/adherents/type.php?leftmenu=setup&mainmenu=members','','List','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2013-03-24 02:31:48'),(108261,'auguria',1,'','left','commercial',103166,NULL,NULL,6,'/fourn/commande/index.php?leftmenu=orders_suppliers','','SuppliersOrders','orders',0,'orders_suppliers','$user->rights->fournisseur->commande->lire','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(108262,'auguria',1,'','left','commercial',108261,NULL,NULL,0,'/societe/societe.php?leftmenu=orders_suppliers','','NewOrder','orders',1,'','$user->rights->fournisseur->commande->creer','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(108263,'auguria',1,'','left','commercial',108261,NULL,NULL,1,'/fourn/commande/liste.php?leftmenu=orders_suppliers&viewstatut=0','','List','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(108269,'auguria',1,'','left','commercial',108261,NULL,NULL,7,'/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier','','Statistics','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->fournisseur->enabled',2,'2013-03-24 02:31:47'),(108361,'auguria',1,'','left','members',103174,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=3','','MembersCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->adherent->enabled && $conf->categorie->enabled',2,'2013-03-24 02:31:48'),(108362,'auguria',1,'','left','members',108361,NULL,NULL,0,'/categories/fiche.php?action=create&type=3','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->adherent->enabled && $conf->categorie->enabled',2,'2013-03-24 02:31:48'),(108363,'all',1,'opensurvey','top','opensurvey',0,NULL,NULL,200,'/opensurvey/index.php','','Surveys','opensurvey@opensurvey',NULL,NULL,'$user->rights->opensurvey->survey->read','$conf->opensurvey->enabled',0,'2013-03-24 02:57:18'),(108364,'all',1,'opensurvey','left','opensurvey',-1,NULL,'opensurvey',200,'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey','','Survey','opensurvey@opensurvey',NULL,'opensurvey','','$conf->opensurvey->enabled',0,'2013-03-24 02:57:18'),(108365,'all',1,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',210,'/opensurvey/public/index.php?origin=dolibarr','_blank','NewSurvey','opensurvey@opensurvey',NULL,'opensurvey_new','','$conf->opensurvey->enabled',0,'2013-03-24 02:57:18'),(108366,'all',1,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',220,'/opensurvey/list.php','','List','opensurvey@opensurvey',NULL,'opensurvey_list','','$conf->opensurvey->enabled',0,'2013-03-24 02:57:18'),(108439,'all',1,'agenda','top','agenda',0,NULL,NULL,100,'/comm/action/index.php','','Agenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108440,'all',1,'agenda','left','agenda',108439,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108441,'all',1,'agenda','left','agenda',108440,NULL,NULL,101,'/comm/action/fiche.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108442,'all',1,'agenda','left','agenda',108440,NULL,NULL,102,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Calendar','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108443,'all',1,'agenda','left','agenda',108442,NULL,NULL,103,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108444,'all',1,'agenda','left','agenda',108442,NULL,NULL,104,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108445,'all',1,'agenda','left','agenda',108442,NULL,NULL,105,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2014-04-05 14:19:21'),(108446,'all',1,'agenda','left','agenda',108442,NULL,NULL,106,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2014-04-05 14:19:21'),(108447,'all',1,'agenda','left','agenda',108440,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108448,'all',1,'agenda','left','agenda',108447,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108449,'all',1,'agenda','left','agenda',108447,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108450,'all',1,'agenda','left','agenda',108447,NULL,NULL,115,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2014-04-05 14:19:21'),(108451,'all',1,'agenda','left','agenda',108447,NULL,NULL,116,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2014-04-05 14:19:21'),(108452,'all',1,'agenda','left','agenda',108440,NULL,NULL,120,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2014-04-05 14:19:21'),(108453,'all',1,'ecm','top','ecm',0,NULL,NULL,100,'/ecm/index.php','','MenuECM','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup','$conf->ecm->enabled',2,'2014-04-05 14:19:22'),(108454,'all',1,'ecm','left','ecm',108453,NULL,NULL,101,'/ecm/index.php','','ECMArea','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2014-04-05 14:19:22'),(108455,'all',1,'ecm','left','ecm',108454,NULL,NULL,100,'/ecm/docdir.php?action=create','','ECMNewSection','ecm',NULL,NULL,'$user->rights->ecm->setup','$user->rights->ecm->setup',2,'2014-04-05 14:19:22'),(108456,'all',1,'ecm','left','ecm',108454,NULL,NULL,102,'/ecm/index.php?action=file_manager','','ECMFileManager','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2014-04-05 14:19:22'); +/*!40000 ALTER TABLE `llx_menu` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_milestone` +-- + +DROP TABLE IF EXISTS `llx_milestone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_milestone` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_element` int(11) NOT NULL, + `elementtype` varchar(16) NOT NULL, + `label` varchar(255) NOT NULL, + `options` varchar(255) DEFAULT NULL, + `priority` int(11) DEFAULT '0', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_milestone_fk_element` (`fk_element`,`elementtype`), + KEY `idx_milestone_fk_user_modif` (`fk_user_modif`), + CONSTRAINT `fk_milestone_fk_user_modif` FOREIGN KEY (`fk_user_modif`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_milestone` +-- + +LOCK TABLES `llx_milestone` WRITE; +/*!40000 ALTER TABLE `llx_milestone` DISABLE KEYS */; +INSERT INTO `llx_milestone` VALUES (2,779,'facture','azerty',NULL,0,'2013-03-09 12:19:30',NULL),(3,780,'facture','fsdf',NULL,0,'2013-03-09 13:01:08',NULL),(4,781,'facture','hhh',NULL,0,'2013-03-09 14:06:37',NULL); +/*!40000 ALTER TABLE `llx_milestone` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_monitoring_probes` +-- + +DROP TABLE IF EXISTS `llx_monitoring_probes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_monitoring_probes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(64) NOT NULL, + `groupname` varchar(64) DEFAULT NULL, + `url` varchar(250) NOT NULL, + `useproxy` int(11) DEFAULT '0', + `checkkey` varchar(250) DEFAULT NULL, + `maxval` int(11) DEFAULT NULL, + `frequency` int(11) DEFAULT '60', + `active` int(11) DEFAULT '1', + `status` int(11) DEFAULT '0', + `lastreset` datetime DEFAULT NULL, + `oldesterrortext` text, + `oldesterrordate` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_monitoring_probes` (`title`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_monitoring_probes` +-- + +LOCK TABLES `llx_monitoring_probes` WRITE; +/*!40000 ALTER TABLE `llx_monitoring_probes` DISABLE KEYS */; +INSERT INTO `llx_monitoring_probes` VALUES (1,'aaa',NULL,'http://www.chiensderace.com',0,'chiens',1000,10,1,1,'2011-04-20 23:46:41',NULL,NULL),(2,'ChatsDeRace',NULL,'http://www.chatsderace.com',0,'chats',1000,5,1,1,'2011-04-20 23:46:41',NULL,NULL); +/*!40000 ALTER TABLE `llx_monitoring_probes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify` +-- + +DROP TABLE IF EXISTS `llx_notify`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `daten` datetime DEFAULT NULL, + `fk_action` int(11) NOT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `objet_type` varchar(24) NOT NULL, + `objet_id` int(11) NOT NULL, + `email` varchar(255) DEFAULT NULL, + `type` varchar(16) DEFAULT 'email', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify` +-- + +LOCK TABLES `llx_notify` WRITE; +/*!40000 ALTER TABLE `llx_notify` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify_def` +-- + +DROP TABLE IF EXISTS `llx_notify_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify_def` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` date DEFAULT NULL, + `fk_action` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `type` varchar(16) DEFAULT 'email', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify_def` +-- + +LOCK TABLES `llx_notify_def` WRITE; +/*!40000 ALTER TABLE `llx_notify_def` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_comments` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_comments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_comments` ( + `id_comment` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_sondage` char(16) NOT NULL, + `comment` text NOT NULL, + `usercomment` text, + PRIMARY KEY (`id_comment`), + KEY `idx_id_comment` (`id_comment`), + KEY `idx_id_sondage` (`id_sondage`) +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_comments` +-- + +LOCK TABLES `llx_opensurvey_comments` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_comments` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_comments` VALUES (2,'434dio8rxfljs3p1','aaa','aaa'),(5,'434dio8rxfljs3p1','aaa','aaa'),(6,'434dio8rxfljs3p1','gfh','jj'),(11,'434dio8rxfljs3p1','fsdf','fdsf'),(12,'3imby4hf7joiilsu','fsdf','aa'),(16,'3imby4hf7joiilsu','gdfg','gfdg'),(17,'3imby4hf7joiilsu','gfdgd','gdfgd'),(18,'om4e7azfiurnjtqe','fds','fdsf'),(26,'qgsfrgb922rqzocy','gfdg','gfdg'),(27,'qgsfrgb922rqzocy','gfdg','gfd'),(28,'m4467s2mtk6khmxc','hgf','hgfh'),(29,'m4467s2mtk6khmxc','fgh','hgf'),(30,'ckanvbe7kt3rdb3h','hfgh','fdfds'),(31,'m4467s2mtk6khmxc','hgfh','hgf'); +/*!40000 ALTER TABLE `llx_opensurvey_comments` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_sondage` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_sondage`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_sondage` ( + `id_sondage` varchar(16) NOT NULL, + `id_sondage_admin` char(24) DEFAULT NULL, + `commentaires` text, + `mail_admin` varchar(128) DEFAULT NULL, + `nom_admin` varchar(64) DEFAULT NULL, + `titre` text, + `date_fin` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `format` varchar(2) DEFAULT NULL, + `mailsonde` varchar(2) DEFAULT '0', + `survey_link_visible` int(11) DEFAULT '1', + `origin` varchar(64) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id_sondage`), + KEY `idx_id_sondage_admin` (`id_sondage_admin`), + KEY `idx_date_fin` (`date_fin`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_sondage` +-- + +LOCK TABLES `llx_opensurvey_sondage` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_sondage` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_sondage` VALUES ('m4467s2mtk6khmxc','m4467s2mtk6khmxci2ysw682','fdffdshfghfj jhgjgh','aaa@aaa.com','fdfds','fdffds','2013-03-06 23:00:00','D+','1',1,'dolibarr','0000-00-00 00:00:00'); +/*!40000 ALTER TABLE `llx_opensurvey_sondage` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_sujet_studs` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_sujet_studs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_sujet_studs` ( + `id_sondage` char(16) NOT NULL, + `sujet` text +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_sujet_studs` +-- + +LOCK TABLES `llx_opensurvey_sujet_studs` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_sujet_studs` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_sujet_studs` VALUES ('434dio8rxfljs3p1','1362697200,1363734000'),('3eyn2drokozf3j4s','1362438000@10h,1363129200@10h'),('z2qcqjh5pm1q4p99','résolution 1,résolution 2,aaa,fdsfsdfsd@checkbox'),('xfwtrseu3ok1c4m6','gdfgfd@yesno,gfdgd@pourcontre,llll@pourcontre'),('om4e7azfiurnjtqe','g dfgdfdfg dfg dg dfg g fdg dfgd fg fg d@pourcontre,mmlml@checkbox'),('fubmr7n293akha5j','check@checkbox,yesno@yesno,pc@pourcontre'),('icaanayi59qto4fl','check@checkbox,yesno@yesno,pc@pourcontre'),('ipbkufzz4lr2vbpx','pc@pourcontre,fdsffd@checkbox'),('3imby4hf7joiilsu','fsdf@yesno,fsdfsd@checkbox,fsdf@pourcontre'),('q41jpgfd4ii3g9vx','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('xm6hysvkspo7gbx6','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('99sbps3ba3s8pq7b','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('6wstlvu2z9kxqweh','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('783p7f377offci4v','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('u4umbl5yb6lpydci','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('dn2euwlf2d4wyy6m','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('t896ed7af3ujdprx','fdfsd@pourcontre,fdsfs@pourcontre,fdsfsdf@checkbox'),('q5c4kucbbkuxjz8g','fdsfsd@pourcontre,fdsfs@pourcontre,fdsfsd@pourcontre'),('8mcdnf2hgcntfibe','fdsfsd@pourcontre,fdsfs@pourcontre,fdsfsd@pourcontre'),('7shynoad2x4zl8sw','fdsfsd@pourcontre,fdsfs@pourcontre,fdsfsd@pourcontre'),('x82rfs19p8fa21et','fdsfsd@pourcontre,fdsfs@pourcontre,fdsfsd@pourcontre'),('qgsfrgb922rqzocy','1364338800@20H-21H,1364338800@21H-22H,1364425200@20H-21H,1364425200@21H-22H,1364511600@20H-21H,1364511600@21H-22H'),('ah9xvaqu1ajjrqse','1391295600@2h-5h,1391295600@2h-5h,1364338800@20H-21H,1364338800@21H-22H,1364425200@20H-21H,1391295600@2h-5h'),('ckanvbe7kt3rdb3h','1363734000,1363820400'),('6v9xq6f9lemjiuba','1363734000,1363820400,1363906800,1363993200'),('m4467s2mtk6khmxc','1398981600,1357081200,1363734000,1363820400,1363993200,1398981600'); +/*!40000 ALTER TABLE `llx_opensurvey_sujet_studs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_user_studs` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_user_studs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_user_studs` ( + `id_users` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(64) NOT NULL, + `id_sondage` varchar(16) NOT NULL, + `reponses` varchar(100) NOT NULL, + PRIMARY KEY (`id_users`), + KEY `idx_id_users` (`id_users`), + KEY `idx_nom` (`nom`), + KEY `idx_id_sondage` (`id_sondage`), + KEY `idx_opensurvey_user_studs_id_users` (`id_users`), + KEY `idx_opensurvey_user_studs_nom` (`nom`), + KEY `idx_opensurvey_user_studs_id_sondage` (`id_sondage`) +) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_user_studs` +-- + +LOCK TABLES `llx_opensurvey_user_studs` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_user_studs` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_user_studs` VALUES (1,'gfdgdf','om4e7azfiurnjtqe','01'),(2,'aa','3imby4hf7joiilsu','210'),(3,'fsdf','z2qcqjh5pm1q4p99','0110'),(5,'hfghf','z2qcqjh5pm1q4p99','1110'),(6,'qqqq','ah9xvaqu1ajjrqse','000111'),(7,'hjgh','ah9xvaqu1ajjrqse','000010'),(8,'bcvb','qgsfrgb922rqzocy','011000'),(9,'gdfg','ah9xvaqu1ajjrqse','001000'),(10,'ggg','ah9xvaqu1ajjrqse','000100'),(11,'gfdgd','ah9xvaqu1ajjrqse','001000'),(12,'hhhh','ah9xvaqu1ajjrqse','010000'),(13,'iii','ah9xvaqu1ajjrqse','000100'),(14,'kkk','ah9xvaqu1ajjrqse','001000'),(15,'lllll','ah9xvaqu1ajjrqse','000001'),(16,'kk','ah9xvaqu1ajjrqse','000001'),(17,'gggg','ah9xvaqu1ajjrqse','001000'),(18,'mmmm','ah9xvaqu1ajjrqse','000000'),(19,'jkjkj','ah9xvaqu1ajjrqse','000001'),(20,'azerty','8mcdnf2hgcntfibe','012'),(21,'hfghfg','8mcdnf2hgcntfibe','012'),(22,'fd','ckanvbe7kt3rdb3h','10'),(23,'gfdgdf','m4467s2mtk6khmxc','00011'),(24,'hgfh','m4467s2mtk6khmxc','000111'); +/*!40000 ALTER TABLE `llx_opensurvey_user_studs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiement` +-- + +DROP TABLE IF EXISTS `llx_paiement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double(24,8) DEFAULT NULL, + `fk_paiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `fk_export_compta` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiement` +-- + +LOCK TABLES `llx_paiement` WRITE; +/*!40000 ALTER TABLE `llx_paiement` DISABLE KEYS */; +INSERT INTO `llx_paiement` VALUES (1,1,'2010-07-10 14:59:41','2010-07-10 12:59:41','2010-07-10 12:00:00',0.02000000,4,'','',4,1,NULL,0,0),(2,1,'2011-07-18 20:50:24','2011-07-18 18:50:24','2011-07-08 12:00:00',20.00000000,6,'','',5,1,NULL,0,0),(3,1,'2011-07-18 20:50:47','2011-07-18 18:50:47','2011-07-08 12:00:00',10.00000000,4,'','',6,1,NULL,0,0),(5,1,'2011-08-01 03:34:11','2011-08-01 01:34:11','2011-08-01 03:34:11',5.63000000,6,'','Payment Invoice FA1108-0003',8,1,NULL,0,0),(6,1,'2011-08-06 20:33:54','2011-08-06 18:33:54','2011-08-06 20:33:53',5.98000000,4,'','Payment Invoice FA1108-0004',13,1,NULL,0,0),(8,1,'2011-08-08 02:53:40','2011-08-08 00:53:40','2011-08-08 12:00:00',26.10000000,4,'','',14,1,NULL,0,0),(9,1,'2011-08-08 02:55:58','2011-08-08 00:55:58','2011-08-08 12:00:00',26.96000000,1,'','',15,1,NULL,0,0),(17,1,'2012-12-09 15:28:44','2012-12-09 14:28:44','2012-12-09 12:00:00',2.00000000,4,'','',16,1,NULL,0,0),(18,1,'2012-12-09 15:28:53','2012-12-09 14:28:53','2012-12-09 12:00:00',-2.00000000,4,'','',17,1,NULL,0,0),(19,1,'2012-12-09 17:35:55','2012-12-09 16:35:55','2012-12-09 12:00:00',-2.00000000,4,'','',18,1,NULL,0,0),(20,1,'2012-12-09 17:37:02','2012-12-09 16:37:02','2012-12-09 12:00:00',2.00000000,4,'','',19,1,NULL,0,0),(21,1,'2012-12-09 18:35:07','2012-12-09 17:35:07','2012-12-09 12:00:00',-2.00000000,4,'','',20,1,NULL,0,0),(23,1,'2012-12-12 18:54:33','2012-12-12 17:54:33','2012-12-12 12:00:00',1.00000000,1,'','',21,1,NULL,0,0),(24,1,'2013-03-06 16:48:16','2013-03-06 15:48:16','2013-03-06 00:00:00',20.00000000,4,'','Adhésion/cotisation 2016',22,1,NULL,0,0),(25,1,'2013-03-20 14:30:11','2013-03-20 13:30:11','2013-03-20 00:00:00',10.00000000,2,'','Adhésion/cotisation 2011',23,1,NULL,0,0); +/*!40000 ALTER TABLE `llx_paiement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiement_facture` +-- + +DROP TABLE IF EXISTS `llx_paiement_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiement_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_paiement` int(11) DEFAULT NULL, + `fk_facture` int(11) DEFAULT NULL, + `amount` double(24,8) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_paiement_facture` (`fk_paiement`,`fk_facture`), + KEY `idx_paiement_facture_fk_facture` (`fk_facture`), + KEY `idx_paiement_facture_fk_paiement` (`fk_paiement`), + CONSTRAINT `fk_paiement_facture_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_paiement_facture_fk_paiement` FOREIGN KEY (`fk_paiement`) REFERENCES `llx_paiement` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiement_facture` +-- + +LOCK TABLES `llx_paiement_facture` WRITE; +/*!40000 ALTER TABLE `llx_paiement_facture` DISABLE KEYS */; +INSERT INTO `llx_paiement_facture` VALUES (1,1,1,0.02000000),(2,2,2,20.00000000),(3,3,2,10.00000000),(5,5,5,5.63000000),(6,6,6,5.98000000),(9,8,2,16.10000000),(10,8,8,10.00000000),(11,9,3,15.00000000),(12,9,9,11.96000000),(20,17,11,2.00000000),(21,18,12,-2.00000000),(22,19,10,-1.00000000),(23,19,12,-1.00000000),(24,20,9,1.00000000),(25,20,11,1.00000000),(26,21,12,-2.00000000),(28,23,55,1.00000000),(29,24,161,20.00000000),(30,25,210,10.00000000); +/*!40000 ALTER TABLE `llx_paiement_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementcharge` +-- + +DROP TABLE IF EXISTS `llx_paiementcharge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementcharge` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_charge` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_typepaiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementcharge` +-- + +LOCK TABLES `llx_paiementcharge` WRITE; +/*!40000 ALTER TABLE `llx_paiementcharge` DISABLE KEYS */; +INSERT INTO `llx_paiementcharge` VALUES (4,4,'2011-08-05 23:11:37','2011-08-05 21:11:37','2011-08-05 12:00:00',10,2,'','',12,1,NULL); +/*!40000 ALTER TABLE `llx_paiementcharge` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementfourn` +-- + +DROP TABLE IF EXISTS `llx_paiementfourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementfourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_paiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementfourn` +-- + +LOCK TABLES `llx_paiementfourn` WRITE; +/*!40000 ALTER TABLE `llx_paiementfourn` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_paiementfourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementfourn_facturefourn` +-- + +DROP TABLE IF EXISTS `llx_paiementfourn_facturefourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementfourn_facturefourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_paiementfourn` int(11) DEFAULT NULL, + `fk_facturefourn` int(11) DEFAULT NULL, + `amount` double DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_paiementfourn_facturefourn` (`fk_paiementfourn`,`fk_facturefourn`), + KEY `idx_paiementfourn_facturefourn_fk_facture` (`fk_facturefourn`), + KEY `idx_paiementfourn_facturefourn_fk_paiement` (`fk_paiementfourn`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementfourn_facturefourn` +-- + +LOCK TABLES `llx_paiementfourn_facturefourn` WRITE; +/*!40000 ALTER TABLE `llx_paiementfourn_facturefourn` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_paiementfourn_facturefourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_pos_cash` +-- + +DROP TABLE IF EXISTS `llx_pos_cash`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_pos_cash` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `code` varchar(3) DEFAULT NULL, + `name` varchar(30) DEFAULT NULL, + `tactil` tinyint(4) NOT NULL DEFAULT '0', + `fk_paycash` int(11) DEFAULT NULL, + `fk_modepaycash` int(11) DEFAULT NULL, + `fk_paybank` int(11) DEFAULT NULL, + `fk_modepaybank` int(11) DEFAULT NULL, + `fk_warehouse` int(11) DEFAULT NULL, + `fk_device` int(11) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `is_used` tinyint(4) DEFAULT '0', + `fk_user_u` int(11) DEFAULT NULL, + `fk_user_c` int(11) DEFAULT NULL, + `fk_user_m` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `datea` datetime DEFAULT NULL, + `is_closed` tinyint(4) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_pos_cash` +-- + +LOCK TABLES `llx_pos_cash` WRITE; +/*!40000 ALTER TABLE `llx_pos_cash` DISABLE KEYS */; +INSERT INTO `llx_pos_cash` VALUES (1,1,'aaa','aaa',0,3,1,1,1,1,NULL,1,0,0,1,NULL,'2013-01-19 18:18:39','2013-01-19 18:18:39',0); +/*!40000 ALTER TABLE `llx_pos_cash` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_pos_control_cash` +-- + +DROP TABLE IF EXISTS `llx_pos_control_cash`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_pos_control_cash` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_cash` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `date_c` datetime DEFAULT NULL, + `type_control` tinyint(4) DEFAULT '0', + `amount_teor` double(24,8) DEFAULT NULL, + `amount_real` double(24,8) DEFAULT NULL, + `amount_diff` double(24,8) DEFAULT NULL, + `amount_mov_out` double(24,8) DEFAULT NULL, + `amount_mov_int` double(24,8) DEFAULT NULL, + `amount_next_day` double(24,8) DEFAULT NULL, + `comment` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_pos_control_cash` +-- + +LOCK TABLES `llx_pos_control_cash` WRITE; +/*!40000 ALTER TABLE `llx_pos_control_cash` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_pos_control_cash` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_pos_facture` +-- + +DROP TABLE IF EXISTS `llx_pos_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_pos_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_cash` int(11) NOT NULL, + `fk_facture` int(11) NOT NULL, + `fk_control_cash` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_pos_facture` +-- + +LOCK TABLES `llx_pos_facture` WRITE; +/*!40000 ALTER TABLE `llx_pos_facture` DISABLE KEYS */; +INSERT INTO `llx_pos_facture` VALUES (1,1,148,NULL),(2,1,149,NULL),(3,1,150,NULL),(4,1,151,NULL); +/*!40000 ALTER TABLE `llx_pos_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_pos_moviments` +-- + +DROP TABLE IF EXISTS `llx_pos_moviments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_pos_moviments` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_cash` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `date_m` datetime DEFAULT NULL, + `amount` double(24,8) DEFAULT NULL, + `type` tinyint(4) DEFAULT NULL, + `comment` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_pos_moviments` +-- + +LOCK TABLES `llx_pos_moviments` WRITE; +/*!40000 ALTER TABLE `llx_pos_moviments` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_pos_moviments` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_pos_ticketdet` +-- + +DROP TABLE IF EXISTS `llx_pos_ticketdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_pos_ticketdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_ticket` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `fk_remise_except` int(11) DEFAULT NULL, + `subprice` double(24,8) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT NULL, + `total_tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_code_ventilation` int(11) NOT NULL DEFAULT '0', + `fk_export_compta` int(11) NOT NULL DEFAULT '0', + `rang` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fk_remise_except` (`fk_remise_except`,`fk_ticket`), + KEY `idx_ticketdet_fk_ticket` (`fk_ticket`), + KEY `idx_ticketdet_fk_product` (`fk_product`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_pos_ticketdet` +-- + +LOCK TABLES `llx_pos_ticketdet` WRITE; +/*!40000 ALTER TABLE `llx_pos_ticketdet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_pos_ticketdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_bons` +-- + +DROP TABLE IF EXISTS `llx_prelevement_bons`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_bons` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(12) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `statut` smallint(6) DEFAULT '0', + `credite` smallint(6) DEFAULT '0', + `note` text, + `date_trans` datetime DEFAULT NULL, + `method_trans` smallint(6) DEFAULT NULL, + `fk_user_trans` int(11) DEFAULT NULL, + `date_credit` datetime DEFAULT NULL, + `fk_user_credit` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_prelevement_bons_ref` (`ref`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_bons` +-- + +LOCK TABLES `llx_prelevement_bons` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_bons` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_prelevement_bons` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_facture` +-- + +DROP TABLE IF EXISTS `llx_prelevement_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_prelevement_lignes` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_prelevement_facture_fk_prelevement_lignes` (`fk_prelevement_lignes`), + CONSTRAINT `fk_prelevement_facture_fk_prelevement_lignes` FOREIGN KEY (`fk_prelevement_lignes`) REFERENCES `llx_prelevement_lignes` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_facture` +-- + +LOCK TABLES `llx_prelevement_facture` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_facture` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_prelevement_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_facture_demande` +-- + +DROP TABLE IF EXISTS `llx_prelevement_facture_demande`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_facture_demande` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `amount` double NOT NULL, + `date_demande` datetime NOT NULL, + `traite` smallint(6) DEFAULT '0', + `date_traite` datetime DEFAULT NULL, + `fk_prelevement_bons` int(11) DEFAULT NULL, + `fk_user_demande` int(11) NOT NULL, + `code_banque` varchar(7) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_facture_demande` +-- + +LOCK TABLES `llx_prelevement_facture_demande` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_facture_demande` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_prelevement_facture_demande` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_lignes` +-- + +DROP TABLE IF EXISTS `llx_prelevement_lignes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_lignes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prelevement_bons` int(11) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `statut` smallint(6) DEFAULT '0', + `client_nom` varchar(255) DEFAULT NULL, + `amount` double DEFAULT '0', + `code_banque` varchar(7) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`), + KEY `idx_prelevement_lignes_fk_prelevement_bons` (`fk_prelevement_bons`), + CONSTRAINT `fk_prelevement_lignes_fk_prelevement_bons` FOREIGN KEY (`fk_prelevement_bons`) REFERENCES `llx_prelevement_bons` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_lignes` +-- + +LOCK TABLES `llx_prelevement_lignes` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_lignes` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_prelevement_lignes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_rejet` +-- + +DROP TABLE IF EXISTS `llx_prelevement_rejet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_rejet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prelevement_lignes` int(11) DEFAULT NULL, + `date_rejet` datetime DEFAULT NULL, + `motif` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_creation` int(11) DEFAULT NULL, + `note` text, + `afacturer` tinyint(4) DEFAULT '0', + `fk_facture` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_rejet` +-- + +LOCK TABLES `llx_prelevement_rejet` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_rejet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_prelevement_rejet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_printer_ipp` +-- + +DROP TABLE IF EXISTS `llx_printer_ipp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_printer_ipp` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `printer_name` text NOT NULL, + `printer_location` text NOT NULL, + `printer_uri` varchar(256) NOT NULL, + `copy` int(11) NOT NULL DEFAULT '1', + `module` varchar(16) NOT NULL, + `login` varchar(32) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_printer_ipp` +-- + +LOCK TABLES `llx_printer_ipp` WRITE; +/*!40000 ALTER TABLE `llx_printer_ipp` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_printer_ipp` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product` +-- + +DROP TABLE IF EXISTS `llx_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `virtual` tinyint(4) NOT NULL DEFAULT '0', + `fk_parent` int(11) DEFAULT '0', + `ref` varchar(128) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `label` varchar(255) NOT NULL, + `description` text, + `note` text, + `customcode` varchar(32) DEFAULT NULL, + `fk_country` int(11) DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `price_min` double(24,8) DEFAULT '0.00000000', + `price_min_ttc` double(24,8) DEFAULT '0.00000000', + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `fk_user_author` int(11) DEFAULT NULL, + `tosell` tinyint(4) DEFAULT '1', + `tobuy` tinyint(4) DEFAULT '1', + `fk_product_type` int(11) DEFAULT '0', + `duration` varchar(6) DEFAULT NULL, + `seuil_stock_alerte` int(11) DEFAULT '0', + `barcode` varchar(255) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT '0', + `accountancy_code_sell` varchar(15) DEFAULT NULL, + `accountancy_code_buy` varchar(15) DEFAULT NULL, + `partnumber` varchar(32) DEFAULT NULL, + `weight` float DEFAULT NULL, + `weight_units` tinyint(4) DEFAULT NULL, + `length` float DEFAULT NULL, + `length_units` tinyint(4) DEFAULT NULL, + `surface` float DEFAULT NULL, + `surface_units` tinyint(4) DEFAULT NULL, + `volume` float DEFAULT NULL, + `volume_units` tinyint(4) DEFAULT NULL, + `stock` int(11) DEFAULT NULL, + `pmp` double(24,8) NOT NULL DEFAULT '0.00000000', + `canvas` varchar(32) DEFAULT 'default@product', + `finished` tinyint(4) DEFAULT NULL, + `hidden` tinyint(4) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `desiredstock` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_ref` (`ref`,`entity`), + KEY `idx_product_label` (`label`), + KEY `idx_product_barcode` (`barcode`), + KEY `idx_product_import_key` (`import_key`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product` +-- + +LOCK TABLES `llx_product` WRITE; +/*!40000 ALTER TABLE `llx_product` DISABLE KEYS */; +INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PIDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0); +/*!40000 ALTER TABLE `llx_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_association` +-- + +DROP TABLE IF EXISTS `llx_product_association`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_association` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_pere` int(11) NOT NULL DEFAULT '0', + `fk_product_fils` int(11) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_association` (`fk_product_pere`,`fk_product_fils`), + KEY `idx_product_association` (`fk_product_fils`), + KEY `idx_product_association_fils` (`fk_product_fils`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_association` +-- + +LOCK TABLES `llx_product_association` WRITE; +/*!40000 ALTER TABLE `llx_product_association` DISABLE KEYS */; +INSERT INTO `llx_product_association` VALUES (1,4,1,2),(2,5,1,1); +/*!40000 ALTER TABLE `llx_product_association` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_extrafields` +-- + +DROP TABLE IF EXISTS `llx_product_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_product_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_extrafields` +-- + +LOCK TABLES `llx_product_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_product_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_fournisseur_price` +-- + +DROP TABLE IF EXISTS `llx_product_fournisseur_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_fournisseur_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `ref_fourn` varchar(30) DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `quantity` double DEFAULT NULL, + `remise_percent` double NOT NULL DEFAULT '0', + `remise` double NOT NULL DEFAULT '0', + `unitprice` double(24,8) DEFAULT '0.00000000', + `charges` double(24,8) DEFAULT '0.00000000', + `unitcharges` double(24,8) DEFAULT '0.00000000', + `tva_tx` double(6,3) NOT NULL DEFAULT '0.000', + `info_bits` int(11) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_fournisseur_price_ref` (`ref_fourn`,`fk_soc`,`quantity`,`entity`), + KEY `idx_product_fournisseur_price_fk_user` (`fk_user`), + KEY `idx_product_fourn_price_fk_product` (`fk_product`,`entity`), + KEY `idx_product_fourn_price_fk_soc` (`fk_soc`,`entity`), + CONSTRAINT `fk_product_fournisseur_price_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_product_fournisseur_price_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_fournisseur_price` +-- + +LOCK TABLES `llx_product_fournisseur_price` WRITE; +/*!40000 ALTER TABLE `llx_product_fournisseur_price` DISABLE KEYS */; +INSERT INTO `llx_product_fournisseur_price` VALUES (1,'2010-07-11 18:45:42','2012-12-08 13:11:08',4,1,'ABCD',NULL,10.00000000,1,0,0,10.00000000,0.00000000,0.00000000,0.000,0,1,NULL,1); +/*!40000 ALTER TABLE `llx_product_fournisseur_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_fournisseur_price_log` +-- + +DROP TABLE IF EXISTS `llx_product_fournisseur_price_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_fournisseur_price_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `fk_product_fournisseur` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `quantity` double DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_fournisseur_price_log` +-- + +LOCK TABLES `llx_product_fournisseur_price_log` WRITE; +/*!40000 ALTER TABLE `llx_product_fournisseur_price_log` DISABLE KEYS */; +INSERT INTO `llx_product_fournisseur_price_log` VALUES (1,'2010-07-11 18:45:42',1,10.00000000,1,1); +/*!40000 ALTER TABLE `llx_product_fournisseur_price_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_lang` +-- + +DROP TABLE IF EXISTS `llx_product_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_lang` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL DEFAULT '0', + `lang` varchar(5) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `description` text, + `note` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_lang` (`fk_product`,`lang`), + CONSTRAINT `fk_product_lang_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_lang` +-- + +LOCK TABLES `llx_product_lang` WRITE; +/*!40000 ALTER TABLE `llx_product_lang` DISABLE KEYS */; +INSERT INTO `llx_product_lang` VALUES (1,1,'en_US','Pink dress','A beatifull pink dress',''),(2,2,'en_US','Product P1','',''),(3,3,'en_US','Service S1','',''),(4,4,'fr_FR','Decapsuleur','',''),(5,5,'en_US','aaaa','cccc','bbbb'),(6,6,'en_US','aaaa','cccc','bbbb'),(7,7,'en_US','aaaa','cccc','bbbb'),(8,8,'en_US','aaaa','cccc','bbbb'),(9,11,'fr_FR','hfghf','',''),(10,2,'fr_FR','Product P1','',''); +/*!40000 ALTER TABLE `llx_product_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_price` +-- + +DROP TABLE IF EXISTS `llx_product_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `date_price` datetime NOT NULL, + `price_level` smallint(6) DEFAULT '1', + `price` double(24,8) DEFAULT NULL, + `price_ttc` double(24,8) DEFAULT NULL, + `price_min` double(24,8) DEFAULT NULL, + `price_min_ttc` double(24,8) DEFAULT NULL, + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) NOT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `fk_user_author` int(11) DEFAULT NULL, + `tosell` tinyint(4) DEFAULT '1', + `price_by_qty` int(11) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_price` +-- + +LOCK TABLES `llx_product_price` WRITE; +/*!40000 ALTER TABLE `llx_product_price` DISABLE KEYS */; +INSERT INTO `llx_product_price` VALUES (1,1,'2010-07-08 12:33:17',1,'2010-07-08 14:33:17',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,0,NULL),(2,1,'2010-07-08 22:30:01',2,'2010-07-09 00:30:01',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,0,NULL),(3,1,'2010-07-08 22:30:25',3,'2010-07-09 00:30:25',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,0,NULL),(4,1,'2010-07-10 12:44:06',4,'2010-07-10 14:44:06',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,0,NULL),(5,1,'2011-07-20 21:11:38',5,'2011-07-20 23:11:38',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,0,NULL),(6,1,'2011-07-27 17:02:59',5,'2011-07-27 19:02:59',1,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,0,NULL),(7,1,'2011-07-29 20:16:44',6,'2011-07-29 22:16:44',1,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,NULL),(8,1,'2011-07-29 20:31:21',7,'2011-07-29 22:31:21',1,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,NULL),(9,1,'2011-07-29 20:46:54',8,'2011-07-29 22:46:54',1,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,NULL),(10,1,'2011-07-31 22:34:27',4,'2011-08-01 00:34:27',1,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,0,NULL),(12,1,'2013-01-13 19:24:59',11,'2013-01-13 20:24:59',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,0,NULL),(13,1,'2013-03-12 09:30:24',1,'2013-03-12 10:30:24',1,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,0,NULL); +/*!40000 ALTER TABLE `llx_product_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_price_by_qty` +-- + +DROP TABLE IF EXISTS `llx_product_price_by_qty`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_price_by_qty` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_price` int(11) NOT NULL, + `date_price` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `remise_percent` double NOT NULL DEFAULT '0', + `remise` double NOT NULL DEFAULT '0', + `qty_min` double DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_price_by_qty_level` (`fk_product_price`,`qty_min`), + KEY `idx_product_price_by_qty_fk_product_price` (`fk_product_price`), + CONSTRAINT `fk_product_price_by_qty_fk_product_price` FOREIGN KEY (`fk_product_price`) REFERENCES `llx_product_price` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_price_by_qty` +-- + +LOCK TABLES `llx_product_price_by_qty` WRITE; +/*!40000 ALTER TABLE `llx_product_price_by_qty` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_price_by_qty` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_stock` +-- + +DROP TABLE IF EXISTS `llx_product_stock`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_stock` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `reel` double DEFAULT NULL, + `pmp` double(24,8) NOT NULL DEFAULT '0.00000000', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_stock` (`fk_product`,`fk_entrepot`), + KEY `idx_product_stock_fk_product` (`fk_product`), + KEY `idx_product_stock_fk_entrepot` (`fk_entrepot`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_stock` +-- + +LOCK TABLES `llx_product_stock` WRITE; +/*!40000 ALTER TABLE `llx_product_stock` DISABLE KEYS */; +INSERT INTO `llx_product_stock` VALUES (1,'2010-07-08 22:43:51',2,2,1000,0.00000000,NULL),(3,'2010-07-10 23:02:20',4,2,1000,0.00000000,NULL),(4,'2013-01-19 17:22:48',4,1,1,10.00000000,NULL),(5,'2013-01-19 17:22:48',1,1,2,0.00000000,NULL),(6,'2013-01-19 17:22:48',11,1,-1,0.00000000,NULL),(7,'2013-01-19 17:31:58',2,1,-2,0.00000000,NULL); +/*!40000 ALTER TABLE `llx_product_stock` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_subproduct` +-- + +DROP TABLE IF EXISTS `llx_product_subproduct`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_subproduct` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL, + `fk_product_subproduct` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `fk_product` (`fk_product`,`fk_product_subproduct`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_subproduct` +-- + +LOCK TABLES `llx_product_subproduct` WRITE; +/*!40000 ALTER TABLE `llx_product_subproduct` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_subproduct` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet` +-- + +DROP TABLE IF EXISTS `llx_projet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `datec` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dateo` date DEFAULT NULL, + `datee` date DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `description` text, + `fk_user_creat` int(11) NOT NULL, + `public` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_projet_ref` (`ref`,`entity`), + KEY `idx_projet_fk_soc` (`fk_soc`), + CONSTRAINT `fk_projet_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet` +-- + +LOCK TABLES `llx_projet` WRITE; +/*!40000 ALTER TABLE `llx_projet` DISABLE KEYS */; +INSERT INTO `llx_projet` VALUES (1,NULL,'2010-07-09','2010-07-11 13:28:28','2010-07-09',NULL,'PROJ1',1,'Project One','',1,0,1,NULL,NULL,'baleine'),(2,NULL,'2010-07-09','2010-07-08 22:49:56','2010-07-09',NULL,'PROJ2',1,'Project Two','',1,0,0,NULL,NULL,NULL),(3,1,'2010-07-09','2010-07-08 22:50:19','2010-07-09',NULL,'PROJABC',1,'Project to create ABC company','',1,0,0,NULL,NULL,NULL),(4,NULL,'2010-07-09','2010-07-08 22:50:49','2010-07-09',NULL,'PROJSHARED',1,'The Global project','',1,1,1,NULL,NULL,NULL),(5,NULL,'2010-07-11','2010-07-11 14:22:49','2010-07-11','2011-07-14','RMLL',1,'Projet gestion RMLL 2011','',1,1,1,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_projet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_projet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_projet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_extrafields` +-- + +LOCK TABLES `llx_projet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_projet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_projet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task` +-- + +DROP TABLE IF EXISTS `llx_projet_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(50) DEFAULT NULL, + `fk_projet` int(11) NOT NULL, + `fk_task_parent` int(11) NOT NULL DEFAULT '0', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dateo` datetime DEFAULT NULL, + `datee` datetime DEFAULT NULL, + `datev` datetime DEFAULT NULL, + `label` varchar(255) NOT NULL, + `description` text, + `duration_effective` double NOT NULL DEFAULT '0', + `planned_workload` double NOT NULL DEFAULT '0', + `progress` int(11) DEFAULT '0', + `priority` int(11) DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `note_private` text, + `note_public` text, + `rang` int(11) DEFAULT '0', + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_projet_task_fk_projet` (`fk_projet`), + KEY `idx_projet_task_fk_user_creat` (`fk_user_creat`), + KEY `idx_projet_task_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_projet_task_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_projet_task_fk_user_creat` FOREIGN KEY (`fk_user_creat`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_projet_task_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task` +-- + +LOCK TABLES `llx_projet_task` WRITE; +/*!40000 ALTER TABLE `llx_projet_task` DISABLE KEYS */; +INSERT INTO `llx_projet_task` VALUES (1,'1',1,0,'2010-07-11 15:15:55','2013-09-08 23:06:14','2010-07-11 12:00:00',NULL,NULL,'Work on module','',25920000,0,0,0,1,NULL,0,NULL,NULL,0,NULL),(2,'2',5,0,'2010-07-11 16:23:53','2013-09-08 23:06:14','2010-07-11 12:00:00','2011-07-14 12:00:00',NULL,'Heberger site RMLL','',0,0,0,0,1,NULL,0,NULL,NULL,0,NULL); +/*!40000 ALTER TABLE `llx_projet_task` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task_extrafields` +-- + +DROP TABLE IF EXISTS `llx_projet_task_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_projet_task_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task_extrafields` +-- + +LOCK TABLES `llx_projet_task_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_projet_task_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_projet_task_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task_time` +-- + +DROP TABLE IF EXISTS `llx_projet_task_time`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task_time` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_task` int(11) NOT NULL, + `task_date` date DEFAULT NULL, + `task_duration` double DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task_time` +-- + +LOCK TABLES `llx_projet_task_time` WRITE; +/*!40000 ALTER TABLE `llx_projet_task_time` DISABLE KEYS */; +INSERT INTO `llx_projet_task_time` VALUES (1,1,'2010-07-11',25920000,1,''); +/*!40000 ALTER TABLE `llx_projet_task_time` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal` +-- + +DROP TABLE IF EXISTS `llx_propal`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `ref_client` varchar(255) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `datep` date DEFAULT NULL, + `fin_validite` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `price` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(2) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `fk_delivery_address` int(11) DEFAULT NULL, + `fk_input_reason` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_propal_ref` (`ref`,`entity`), + KEY `idx_propal_fk_soc` (`fk_soc`), + KEY `idx_propal_fk_user_author` (`fk_user_author`), + KEY `idx_propal_fk_user_valid` (`fk_user_valid`), + KEY `idx_propal_fk_user_cloture` (`fk_user_cloture`), + KEY `idx_propal_fk_projet` (`fk_projet`), + KEY `idx_propal_fk_account` (`fk_account`), + KEY `idx_propal_fk_currency` (`fk_currency`), + CONSTRAINT `fk_propal_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_propal_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_propal_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_propal_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_propal_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal` +-- + +LOCK TABLES `llx_propal` WRITE; +/*!40000 ALTER TABLE `llx_propal` DISABLE KEYS */; +INSERT INTO `llx_propal` VALUES (1,2,NULL,'2012-12-08 13:11:07','PR1007-0001',1,NULL,NULL,'','2010-07-09 01:33:49','2010-07-09','2010-07-24 12:00:00','2011-08-08 14:24:18',NULL,1,1,NULL,1,0,NULL,NULL,0,30.00000000,3.84000000,0.00000000,0.00000000,33.84000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,NULL),(2,1,NULL,'2012-12-08 13:11:07','PR1007-0002',1,NULL,NULL,'','2010-07-10 02:11:44','2010-07-10','2010-07-25 12:00:00','2010-07-10 02:12:55','2011-07-20 15:23:12',1,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,1,'','','azur',NULL,NULL,NULL,0,NULL,NULL),(3,4,NULL,'2012-12-08 13:11:07','PR1007-0003',1,NULL,NULL,'','2010-07-18 11:35:11','2010-07-18','2010-08-02 12:00:00','2010-07-18 11:36:18','2011-07-20 15:21:15',1,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,NULL),(4,17,NULL,'2012-12-08 13:11:07','PR1108-0004',1,NULL,NULL,'','2011-08-04 23:36:23','2011-08-05','2011-08-20 12:00:00','2011-08-08 14:24:24',NULL,1,1,NULL,1,0,NULL,NULL,0,30.00000000,5.88000000,0.00000000,0.00000000,35.88000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL),(5,19,NULL,'2013-02-17 14:39:56','PR1302-0005',1,NULL,NULL,'','2013-02-17 15:39:56','2013-02-17','2013-03-04 12:00:00',NULL,NULL,1,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL),(6,19,NULL,'2013-02-17 14:40:12','PR1302-0006',1,NULL,NULL,'','2013-02-17 15:40:12','2013-02-17','2013-03-04 12:00:00',NULL,NULL,1,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL),(7,19,NULL,'2013-02-17 14:41:15','PR1302-0007',1,NULL,NULL,'','2013-02-17 15:41:15','2013-02-17','2013-03-04 12:00:00',NULL,NULL,1,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL),(8,19,NULL,'2013-02-17 14:43:39','PR1302-0008',1,NULL,NULL,'','2013-02-17 15:43:39','2013-02-17','2013-03-04 12:00:00',NULL,NULL,1,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL),(9,19,NULL,'2013-02-17 15:22:14','PR1302-0009',1,NULL,NULL,'','2013-02-17 15:53:01','2013-02-17','2013-03-04 12:00:00','2013-02-17 16:22:10','2013-02-17 16:22:14',1,1,1,2,0,NULL,NULL,0,60.00000000,11.76000000,0.00000000,0.00000000,71.76000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL),(11,18,NULL,'2013-02-17 15:28:22','PR1302-0010',1,NULL,NULL,'gfdf','2013-02-17 16:27:18','2013-02-17','2013-03-04 12:00:00','2013-02-17 16:27:29','2013-02-17 16:28:22',1,1,1,2,0,NULL,NULL,0,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL),(12,23,NULL,'2013-03-08 09:02:31','PR1303-0011',1,NULL,NULL,'fdfs','2013-03-08 10:00:23','2013-03-08','2013-03-23 12:00:00','2013-03-08 10:02:21','2013-03-08 10:02:31',1,1,1,2,0,NULL,NULL,0,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,NULL,NULL,1,0,'','','azur',NULL,0,NULL,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_propal` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal_extrafields` +-- + +DROP TABLE IF EXISTS `llx_propal_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_propal_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal_extrafields` +-- + +LOCK TABLES `llx_propal_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_propal_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propal_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propaldet` +-- + +DROP TABLE IF EXISTS `llx_propaldet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propaldet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_propal` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_propaldet_fk_propal` (`fk_propal`), + KEY `idx_propaldet_fk_product` (`fk_product`), + CONSTRAINT `fk_propaldet_fk_propal` FOREIGN KEY (`fk_propal`) REFERENCES `llx_propal` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propaldet` +-- + +LOCK TABLES `llx_propaldet` WRITE; +/*!40000 ALTER TABLE `llx_propaldet` DISABLE KEYS */; +INSERT INTO `llx_propaldet` VALUES (1,1,NULL,NULL,NULL,'Une machine à café',NULL,12.500,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.25000000,0.00000000,0.00000000,11.25000000,0,NULL,NULL,0,NULL,0.00000000,0,1),(2,2,NULL,NULL,NULL,'Product 1',NULL,0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1),(3,2,NULL,2,NULL,'',NULL,0.000,0.000,'',0.000,'',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2),(4,3,NULL,NULL,NULL,'A new marvelous product',NULL,0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1),(5,1,NULL,5,NULL,'cccc',NULL,19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,2),(11,1,NULL,4,NULL,'',NULL,0.000,0.000,'',0.000,'',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3),(12,1,NULL,4,NULL,'',NULL,0.000,0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4),(13,1,NULL,4,NULL,'',NULL,12.500,0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,5),(19,4,NULL,NULL,NULL,'bvbcvbcvbcbcbcb',NULL,19.600,0.000,'',0.000,'',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1),(20,4,NULL,NULL,NULL,'ghjhgjghjgh',NULL,19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,2),(21,4,NULL,NULL,NULL,'ghjghjhgjg',NULL,19.600,0.000,'',0.000,'',2,0,0,10,10.00000000,20.00000000,3.92000000,0.00000000,0.00000000,23.92000000,1,NULL,NULL,0,NULL,0.00000000,0,3),(22,9,NULL,NULL,NULL,'gdfg',NULL,19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,0,0.00000000,0,1),(23,9,NULL,NULL,NULL,'gfdgd',NULL,19.600,0.000,'',0.000,'',1,0,0,NULL,50.00000000,50.00000000,9.80000000,0.00000000,0.00000000,59.80000000,1,NULL,NULL,0,0,0.00000000,0,2),(24,11,NULL,NULL,NULL,'gfdg',NULL,19.600,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,0,0.00000000,0,1),(25,12,NULL,NULL,NULL,'fdsfs',NULL,0.000,0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,0,0.00000000,0,1),(26,12,NULL,NULL,NULL,'fsdfsf',NULL,0.000,0.000,'',0.000,'',1,0,0,NULL,-5.00000000,-5.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,0,NULL,NULL,0,0,0.00000000,0,2); +/*!40000 ALTER TABLE `llx_propaldet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propaldet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_propaldet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propaldet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_propaldet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propaldet_extrafields` +-- + +LOCK TABLES `llx_propaldet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_propaldet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propaldet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_rights_def` +-- + +DROP TABLE IF EXISTS `llx_rights_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_rights_def` ( + `id` int(11) NOT NULL DEFAULT '0', + `libelle` varchar(255) DEFAULT NULL, + `module` varchar(64) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `perms` varchar(50) DEFAULT NULL, + `subperms` varchar(50) DEFAULT NULL, + `type` varchar(1) DEFAULT NULL, + `bydefault` tinyint(4) DEFAULT '0', + PRIMARY KEY (`id`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_rights_def` +-- + +LOCK TABLES `llx_rights_def` WRITE; +/*!40000 ALTER TABLE `llx_rights_def` DISABLE KEYS */; +INSERT INTO `llx_rights_def` VALUES (11,'Lire les factures','facture',1,'lire',NULL,'a',1),(11,'Lire les factures','facture',2,'lire',NULL,'a',1),(12,'Creer/modifier les factures','facture',1,'creer',NULL,'a',0),(12,'Creer/modifier les factures','facture',2,'creer',NULL,'a',0),(13,'Dévalider les factures','facture',1,'invoice_advance','unvalidate','a',0),(13,'Dévalider les factures','facture',2,'invoice_advance','unvalidate','a',0),(14,'Valider les factures','facture',1,'valider',NULL,'a',0),(14,'Valider les factures','facture',2,'valider',NULL,'a',0),(15,'Envoyer les factures par mail','facture',1,'invoice_advance','send','a',0),(15,'Envoyer les factures par mail','facture',2,'invoice_advance','send','a',0),(16,'Emettre des paiements sur les factures','facture',1,'paiement',NULL,'a',0),(16,'Emettre des paiements sur les factures','facture',2,'paiement',NULL,'a',0),(19,'Supprimer les factures','facture',1,'supprimer',NULL,'a',0),(19,'Supprimer les factures','facture',2,'supprimer',NULL,'a',0),(21,'Lire les propositions commerciales','propale',1,'lire',NULL,'r',1),(21,'Lire les propositions commerciales','propale',2,'lire',NULL,'r',1),(22,'Creer/modifier les propositions commerciales','propale',1,'creer',NULL,'w',0),(22,'Creer/modifier les propositions commerciales','propale',2,'creer',NULL,'w',0),(24,'Valider les propositions commerciales','propale',1,'valider',NULL,'d',0),(24,'Valider les propositions commerciales','propale',2,'valider',NULL,'d',0),(25,'Envoyer les propositions commerciales aux clients','propale',1,'propal_advance','send','d',0),(25,'Envoyer les propositions commerciales aux clients','propale',2,'propal_advance','send','d',0),(26,'Cloturer les propositions commerciales','propale',1,'cloturer',NULL,'d',0),(26,'Cloturer les propositions commerciales','propale',2,'cloturer',NULL,'d',0),(27,'Supprimer les propositions commerciales','propale',1,'supprimer',NULL,'d',0),(27,'Supprimer les propositions commerciales','propale',2,'supprimer',NULL,'d',0),(28,'Exporter les propositions commerciales et attributs','propale',1,'export',NULL,'r',0),(28,'Exporter les propositions commerciales et attributs','propale',2,'export',NULL,'r',0),(31,'Lire les produits','produit',1,'lire',NULL,'r',1),(31,'Lire les produits','produit',2,'lire',NULL,'r',1),(32,'Creer/modifier les produits','produit',1,'creer',NULL,'w',0),(32,'Creer/modifier les produits','produit',2,'creer',NULL,'w',0),(34,'Supprimer les produits','produit',1,'supprimer',NULL,'d',0),(34,'Supprimer les produits','produit',2,'supprimer',NULL,'d',0),(38,'Exporter les produits','produit',1,'export',NULL,'r',0),(38,'Exporter les produits','produit',2,'export',NULL,'r',0),(41,'Lire les projets et taches (partagés ou dont je suis contact)','projet',1,'lire',NULL,'r',1),(42,'Creer/modifier les projets et taches (partagés ou dont je suis contact)','projet',1,'creer',NULL,'w',0),(44,'Supprimer les projets et taches (partagés ou dont je suis contact)','projet',1,'supprimer',NULL,'d',0),(61,'Lire les fiches d\'intervention','ficheinter',1,'lire',NULL,'r',1),(62,'Creer/modifier les fiches d\'intervention','ficheinter',1,'creer',NULL,'w',0),(64,'Supprimer les fiches d\'intervention','ficheinter',1,'supprimer',NULL,'d',0),(67,'Exporter les fiches interventions','ficheinter',1,'export',NULL,'r',0),(68,'Envoyer les fiches d\'intervention par courriel','ficheinter',1,'ficheinter_advance','send','r',0),(71,'Read members\' card','adherent',1,'lire',NULL,'r',1),(72,'Create/modify members (need also user module permissions if member linked to a user)','adherent',1,'creer',NULL,'w',1),(74,'Remove members','adherent',1,'supprimer',NULL,'d',1),(75,'Setup types and attributes of members','adherent',1,'configurer',NULL,'w',1),(76,'Export members','adherent',1,'export',NULL,'r',0),(78,'Read subscriptions','adherent',1,'cotisation','lire','r',1),(79,'Create/modify/remove subscriptions','adherent',1,'cotisation','creer','w',1),(81,'Lire les commandes clients','commande',1,'lire',NULL,'r',1),(82,'Creer/modifier les commandes clients','commande',1,'creer',NULL,'w',0),(84,'Valider les commandes clients','commande',1,'valider',NULL,'d',0),(86,'Envoyer les commandes clients','commande',1,'order_advance','send','d',0),(87,'Cloturer les commandes clients','commande',1,'cloturer',NULL,'d',0),(88,'Annuler les commandes clients','commande',1,'annuler',NULL,'d',0),(89,'Supprimer les commandes clients','commande',1,'supprimer',NULL,'d',0),(91,'Lire les charges','tax',1,'charges','lire','r',1),(91,'Lire les charges','tax',2,'charges','lire','r',1),(92,'Creer/modifier les charges','tax',1,'charges','creer','w',0),(92,'Creer/modifier les charges','tax',2,'charges','creer','w',0),(93,'Supprimer les charges','tax',1,'charges','supprimer','d',0),(93,'Supprimer les charges','tax',2,'charges','supprimer','d',0),(94,'Exporter les charges','tax',1,'charges','export','r',0),(94,'Exporter les charges','tax',2,'charges','export','r',0),(95,'Lire CA, bilans, resultats','compta',1,'resultat','lire','r',1),(96,'Parametrer la ventilation','compta',1,'ventilation','parametrer','r',0),(97,'Lire les ventilations de factures','compta',1,'ventilation','lire','r',1),(98,'Ventiler les lignes de factures','compta',1,'ventilation','creer','r',0),(101,'Lire les expeditions','expedition',1,'lire',NULL,'r',1),(102,'Creer modifier les expeditions','expedition',1,'creer',NULL,'w',0),(104,'Valider les expeditions','expedition',1,'valider',NULL,'d',0),(105,'Envoyer les expeditions aux clients','expedition',1,'shipping_advance','send','d',0),(106,'Exporter les expeditions','expedition',1,'shipment','export','r',0),(109,'Supprimer les expeditions','expedition',1,'supprimer',NULL,'d',0),(111,'Lire les comptes bancaires','banque',1,'lire',NULL,'r',1),(111,'Lire les comptes bancaires','banque',2,'lire',NULL,'r',1),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',1,'modifier',NULL,'w',0),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',2,'modifier',NULL,'w',0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',1,'configurer',NULL,'a',0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',2,'configurer',NULL,'a',0),(114,'Rapprocher les ecritures bancaires','banque',1,'consolidate',NULL,'w',0),(114,'Rapprocher les ecritures bancaires','banque',2,'consolidate',NULL,'w',0),(115,'Exporter transactions et releves','banque',1,'export',NULL,'r',0),(115,'Exporter transactions et releves','banque',2,'export',NULL,'r',0),(116,'Virements entre comptes','banque',1,'transfer',NULL,'w',0),(116,'Virements entre comptes','banque',2,'transfer',NULL,'w',0),(117,'Gerer les envois de cheques','banque',1,'cheque',NULL,'w',0),(117,'Gerer les envois de cheques','banque',2,'cheque',NULL,'w',0),(121,'Lire les societes','societe',1,'lire',NULL,'r',1),(121,'Lire les societes','societe',2,'lire',NULL,'r',1),(122,'Creer modifier les societes','societe',1,'creer',NULL,'w',0),(122,'Creer modifier les societes','societe',2,'creer',NULL,'w',0),(125,'Supprimer les societes','societe',1,'supprimer',NULL,'d',0),(125,'Supprimer les societes','societe',2,'supprimer',NULL,'d',0),(126,'Exporter les societes','societe',1,'export',NULL,'r',0),(126,'Exporter les societes','societe',2,'export',NULL,'r',0),(141,'Lire tous les projets et taches (y compris prives qui ne me sont pas affectes)','projet',1,'all','lire','r',0),(142,'Creer/modifier tous les projets et taches (y compris prives qui ne me sont pas affectes)','projet',1,'all','creer','w',0),(144,'Supprimer tous les projets et taches (y compris prives qui ne me sont pas affectes)','projet',1,'all','supprimer','d',0),(151,'Read withdrawals','prelevement',1,'bons','lire','r',1),(152,'Create/modify a withdrawals','prelevement',1,'bons','creer','w',0),(153,'Send withdrawals to bank','prelevement',1,'bons','send','a',0),(154,'credit/refuse withdrawals','prelevement',1,'bons','credit','a',0),(161,'Lire les contrats','contrat',1,'lire',NULL,'r',1),(162,'Creer / modifier les contrats','contrat',1,'creer',NULL,'w',0),(163,'Activer un service d\'un contrat','contrat',1,'activer',NULL,'w',0),(164,'Desactiver un service d\'un contrat','contrat',1,'desactiver',NULL,'w',0),(165,'Supprimer un contrat','contrat',1,'supprimer',NULL,'d',0),(171,'Lire les deplacements','deplacement',1,'lire',NULL,'r',1),(172,'Creer/modifier les deplacements','deplacement',1,'creer',NULL,'w',0),(173,'Supprimer les deplacements','deplacement',1,'supprimer',NULL,'d',0),(178,'Exporter les deplacements','deplacement',1,'export',NULL,'d',0),(221,'Consulter les mailings','mailing',1,'lire',NULL,'r',1),(221,'Consulter les mailings','mailing',2,'lire',NULL,'r',1),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',1,'creer',NULL,'w',1),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',2,'creer',NULL,'w',0),(223,'Valider les mailings (permet leur envoi)','mailing',1,'valider',NULL,'w',0),(223,'Valider les mailings (permet leur envoi)','mailing',2,'valider',NULL,'w',0),(229,'Supprimer les mailings)','mailing',1,'supprimer',NULL,'d',1),(229,'Supprimer les mailings','mailing',2,'supprimer',NULL,'d',0),(237,'View recipients and info','mailing',1,'mailing_advance','recipient','r',0),(237,'View recipients and info','mailing',2,'mailing_advance','recipient','r',0),(238,'Manually send mailings','mailing',1,'mailing_advance','send','w',0),(238,'Manually send mailings','mailing',2,'mailing_advance','send','w',0),(239,'Delete mailings after validation and/or sent','mailing',1,'mailing_advance','delete','d',0),(239,'Delete mailings after validation and/or sent','mailing',2,'mailing_advance','delete','d',0),(241,'Lire les categories','categorie',1,'lire',NULL,'r',1),(242,'Creer/modifier les categories','categorie',1,'creer',NULL,'w',1),(243,'Supprimer les categories','categorie',1,'supprimer',NULL,'d',1),(251,'Consulter les autres utilisateurs','user',1,'user','lire','r',0),(252,'Consulter les permissions des autres utilisateurs','user',1,'user_advance','readperms','r',0),(253,'Creer/modifier utilisateurs internes et externes','user',1,'user','creer','w',0),(254,'Creer/modifier utilisateurs externes seulement','user',1,'user_advance','write','w',0),(255,'Modifier le mot de passe des autres utilisateurs','user',1,'user','password','w',0),(256,'Supprimer ou desactiver les autres utilisateurs','user',1,'user','supprimer','d',0),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',1,'client','voir','r',1),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',2,'client','voir','r',1),(281,'Lire les contacts','societe',1,'contact','lire','r',1),(281,'Lire les contacts','societe',2,'contact','lire','r',1),(282,'Creer modifier les contacts','societe',1,'contact','creer','w',0),(282,'Creer modifier les contacts','societe',2,'contact','creer','w',0),(283,'Supprimer les contacts','societe',1,'contact','supprimer','d',0),(283,'Supprimer les contacts','societe',2,'contact','supprimer','d',0),(286,'Exporter les contacts','societe',1,'contact','export','d',0),(286,'Exporter les contacts','societe',2,'contact','export','d',0),(331,'Lire les bookmarks','bookmark',1,'lire',NULL,'r',1),(332,'Creer/modifier les bookmarks','bookmark',1,'creer',NULL,'r',0),(333,'Supprimer les bookmarks','bookmark',1,'supprimer',NULL,'r',0),(341,'Consulter ses propres permissions','user',1,'self_advance','readperms','r',1),(342,'Creer/modifier ses propres infos utilisateur','user',1,'self','creer','w',1),(343,'Modifier son propre mot de passe','user',1,'self','password','w',1),(344,'Modifier ses propres permissions','user',1,'self_advance','writeperms','w',1),(351,'Consulter les groupes','user',1,'group_advance','read','r',0),(352,'Consulter les permissions des groupes','user',1,'group_advance','readperms','r',0),(353,'Creer/modifier les groupes et leurs permissions','user',1,'group_advance','write','w',0),(354,'Supprimer ou desactiver les groupes','user',1,'group_advance','delete','d',0),(358,'Exporter les utilisateurs','user',1,'user','export','r',0),(531,'Lire les services','service',1,'lire',NULL,'r',1),(532,'Creer/modifier les services','service',1,'creer',NULL,'w',0),(534,'Supprimer les services','service',1,'supprimer',NULL,'d',0),(538,'Exporter les services','service',1,'export',NULL,'r',0),(700,'Lire les dons','don',1,'lire',NULL,'r',1),(701,'Creer/modifier les dons','don',1,'creer',NULL,'w',0),(701,'Lire les dons','don',2,'lire',NULL,'r',1),(702,'Supprimer les dons','don',1,'supprimer',NULL,'d',0),(702,'Creer/modifier les dons','don',2,'creer',NULL,'w',0),(703,'Supprimer les dons','don',1,'supprimer',NULL,'d',0),(703,'Supprimer les dons','don',2,'supprimer',NULL,'d',0),(1001,'Lire les stocks','stock',1,'lire',NULL,'r',1),(1002,'Creer/Modifier les stocks','stock',1,'creer',NULL,'w',1),(1003,'Supprimer les stocks','stock',1,'supprimer',NULL,'d',1),(1004,'Lire mouvements de stocks','stock',1,'mouvement','lire','r',1),(1005,'Creer/modifier mouvements de stocks','stock',1,'mouvement','creer','w',1),(1101,'Lire les bons de livraison','expedition',1,'livraison','lire','r',1),(1102,'Creer modifier les bons de livraison','expedition',1,'livraison','creer','w',0),(1104,'Valider les bons de livraison','expedition',1,'livraison','valider','d',0),(1109,'Supprimer les bons de livraison','expedition',1,'livraison','supprimer','d',0),(1181,'Consulter les fournisseurs','fournisseur',1,'lire',NULL,'r',1),(1182,'Consulter les commandes fournisseur','fournisseur',1,'commande','lire','r',1),(1183,'Creer une commande fournisseur','fournisseur',1,'commande','creer','w',0),(1184,'Valider une commande fournisseur','fournisseur',1,'commande','valider','w',0),(1185,'Approuver une commande fournisseur','fournisseur',1,'commande','approuver','w',0),(1186,'Commander une commande fournisseur','fournisseur',1,'commande','commander','w',0),(1187,'Receptionner une commande fournisseur','fournisseur',1,'commande','receptionner','d',0),(1188,'Supprimer une commande fournisseur','fournisseur',1,'commande','supprimer','d',0),(1201,'Lire les exports','export',1,'lire',NULL,'r',1),(1202,'Creer/modifier un export','export',1,'creer',NULL,'w',1),(1231,'Consulter les factures fournisseur','fournisseur',1,'facture','lire','r',1),(1232,'Creer une facture fournisseur','fournisseur',1,'facture','creer','w',0),(1233,'Valider une facture fournisseur','fournisseur',1,'facture','valider','w',0),(1234,'Supprimer une facture fournisseur','fournisseur',1,'facture','supprimer','d',0),(1235,'Envoyer les factures par mail','fournisseur',1,'supplier_invoice_advance','send','a',0),(1236,'Exporter les factures fournisseurs, attributs et reglements','fournisseur',1,'facture','export','r',0),(1237,'Exporter les commande fournisseurs, attributs','fournisseur',1,'commande','export','r',0),(1251,'Run mass imports of external data (data load)','import',1,'run',NULL,'r',0),(1321,'Exporter les factures clients, attributs et reglements','facture',1,'facture','export','r',0),(1321,'Exporter les factures clients, attributs et reglements','facture',2,'facture','export','r',0),(1421,'Exporter les commandes clients et attributs','commande',1,'commande','export','r',0),(2401,'Read actions/tasks linked to his account','agenda',1,'myactions','read','r',1),(2401,'Read actions/tasks linked to his account','agenda',2,'myactions','read','r',1),(2402,'Create/modify actions/tasks linked to his account','agenda',1,'myactions','create','w',0),(2402,'Create/modify actions/tasks linked to his account','agenda',2,'myactions','create','w',0),(2403,'Delete actions/tasks linked to his account','agenda',1,'myactions','delete','w',0),(2403,'Delete actions/tasks linked to his account','agenda',2,'myactions','delete','w',0),(2411,'Read actions/tasks of others','agenda',1,'allactions','read','r',0),(2411,'Read actions/tasks of others','agenda',2,'allactions','read','r',0),(2412,'Create/modify actions/tasks of others','agenda',1,'allactions','create','w',0),(2412,'Create/modify actions/tasks of others','agenda',2,'allactions','create','w',0),(2413,'Delete actions/tasks of others','agenda',1,'allactions','delete','w',0),(2413,'Delete actions/tasks of others','agenda',2,'allactions','delete','w',0),(2414,'Export actions/tasks of others','agenda',1,'export',NULL,'w',0),(2501,'Consulter/Télécharger les documents','ecm',1,'read',NULL,'r',1),(2503,'Soumettre ou supprimer des documents','ecm',1,'upload',NULL,'w',1),(2515,'Administrer les rubriques de documents','ecm',1,'setup',NULL,'w',1),(20001,'Créer / Modifier / Lire ses demandes de congés payés','holiday',1,'write',NULL,'w',1),(20001,'Créer / Modifier / Lire ses demandes de congés payés','holiday',2,'write',NULL,'w',1),(20002,'Lire / Modifier toutes les demandes de congés payés','holiday',1,'lire_tous',NULL,'w',0),(20002,'Lire / Modifier toutes les demandes de congés payés','holiday',2,'lire_tous',NULL,'w',0),(20003,'Supprimer des demandes de congés payés','holiday',1,'delete',NULL,'w',0),(20003,'Supprimer des demandes de congés payés','holiday',2,'delete',NULL,'w',0),(20004,'Définir les congés payés des utilisateurs','holiday',1,'define_holiday',NULL,'w',0),(20004,'Définir les congés payés des utilisateurs','holiday',2,'define_holiday',NULL,'w',0),(20005,'Voir les logs de modification des congés payés','holiday',1,'view_log',NULL,'w',0),(20005,'Voir les logs de modification des congés payés','holiday',2,'view_log',NULL,'w',0),(20006,'Accéder au rapport mensuel des congés payés','holiday',1,'month_report',NULL,'w',0),(20006,'Accéder au rapport mensuel des congés payés','holiday',2,'month_report',NULL,'w',0),(23001,'Read cron jobs','cron',1,'read',NULL,'w',1),(23002,'Create cron Jobs','cron',1,'create',NULL,'w',0),(23003,'Delete cron Jobs','cron',1,'delete',NULL,'w',0),(23004,'Execute cron Jobs','cron',1,'execute',NULL,'w',0),(50101,'Use point of sale','cashdesk',1,'use',NULL,'a',1),(101201,'Read/Browse directories and files from the file manager','filemanager',1,'read',NULL,'r',1),(101202,'Can manage directories or files (upload/edit/delete) from the file manager','filemanager',1,'create',NULL,'w',0),(101250,'Read surveys','opensurvey',1,'survey','read','r',0),(101250,'Read surveys','opensurvey',2,'survey','read','r',0),(101251,'Create/modify surveys','opensurvey',1,'survey','write','w',0),(101251,'Create/modify surveys','opensurvey',2,'survey','write','w',0),(400051,'Use POS','pos',2,'frontend',NULL,'a',1),(400052,'Use Backend','pos',2,'backend',NULL,'a',1),(400053,'Make Transfers','pos',2,'transfer',NULL,'a',1),(400055,'Stats','pos',2,'stats',NULL,'a',1); +/*!40000 ALTER TABLE `llx_rights_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe` +-- + +DROP TABLE IF EXISTS `llx_societe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `statut` tinyint(4) DEFAULT '0', + `parent` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `datea` datetime DEFAULT NULL, + `nom` varchar(60) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `ref_int` varchar(60) DEFAULT NULL, + `code_client` varchar(24) DEFAULT NULL, + `code_fournisseur` varchar(24) DEFAULT NULL, + `code_compta` varchar(24) DEFAULT NULL, + `code_compta_fournisseur` varchar(24) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_departement` int(11) DEFAULT '0', + `fk_pays` int(11) DEFAULT '0', + `phone` varchar(20) DEFAULT NULL, + `fax` varchar(20) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `email` varchar(128) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `fk_effectif` int(11) DEFAULT '0', + `fk_typent` int(11) DEFAULT '0', + `fk_forme_juridique` int(11) DEFAULT '0', + `fk_currency` int(11) DEFAULT '0', + `siren` varchar(128) DEFAULT NULL, + `siret` varchar(128) DEFAULT NULL, + `ape` varchar(128) DEFAULT NULL, + `idprof4` varchar(128) DEFAULT NULL, + `tva_intra` varchar(20) DEFAULT NULL, + `capital` double DEFAULT NULL, + `fk_stcomm` int(11) NOT NULL, + `note_private` text, + `note_public` text, + `prefix_comm` varchar(5) DEFAULT NULL, + `client` tinyint(4) DEFAULT '0', + `fournisseur` tinyint(4) DEFAULT '0', + `supplier_account` varchar(32) DEFAULT NULL, + `fk_prospectlevel` varchar(12) DEFAULT NULL, + `customer_bad` tinyint(4) DEFAULT '0', + `customer_rate` double DEFAULT '0', + `supplier_rate` double DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `remise_client` double DEFAULT '0', + `mode_reglement` tinyint(4) DEFAULT NULL, + `cond_reglement` tinyint(4) DEFAULT NULL, + `mode_reglement_supplier` int(11) DEFAULT NULL, + `outstanding_limit` double(24,8) DEFAULT NULL, + `cond_reglement_supplier` int(11) DEFAULT NULL, + `tva_assuj` tinyint(4) DEFAULT '1', + `localtax1_assuj` tinyint(4) DEFAULT '0', + `localtax2_assuj` tinyint(4) DEFAULT '0', + `barcode` varchar(255) DEFAULT NULL, + `price_level` int(11) DEFAULT NULL, + `default_lang` varchar(6) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `status` tinyint(4) DEFAULT '1', + `logo` varchar(255) DEFAULT NULL, + `idprof5` varchar(128) DEFAULT NULL, + `idprof6` varchar(128) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_prefix_comm` (`prefix_comm`,`entity`), + UNIQUE KEY `uk_societe_code_client` (`code_client`,`entity`), + KEY `idx_societe_user_creat` (`fk_user_creat`), + KEY `idx_societe_user_modif` (`fk_user_modif`) +) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe` +-- + +LOCK TABLES `llx_societe` WRITE; +/*!40000 ALTER TABLE `llx_societe` DISABLE KEYS */; +INSERT INTO `llx_societe` VALUES (1,0,NULL,'2012-12-19 14:47:50','2010-07-08 14:21:44','2012-12-19 15:47:49','ABC and Co',1,NULL,NULL,'CU1212-0007','SU1212-0005','7050','6050','1 alalah road',NULL,'Delhi',0,4,NULL,NULL,NULL,NULL,NULL,NULL,4,NULL,0,'','','','','',5000,1,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,1,0,NULL,NULL,'en_IN',NULL,NULL,1,NULL,'','',0),(2,0,NULL,'2011-07-31 22:35:08','2010-07-08 14:23:48','2011-08-01 00:35:08','Belin SARL',1,NULL,NULL,'CU1108-0001','SU1108-0001',NULL,NULL,'11 rue de la paix.','75000','Paris',0,117,NULL,NULL,'dolibarr.fr',NULL,NULL,NULL,3,NULL,0,'123456789','','ACE14','','',10000,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'fr_FR',NULL,NULL,1,NULL,NULL,NULL,0),(3,0,NULL,'2010-07-08 20:42:12','2010-07-08 22:42:12','2010-07-08 22:42:12','Spanish Comp',1,NULL,NULL,'SPANISHCOMP',NULL,NULL,NULL,'1 via mallere',NULL,'Madrid',123,4,NULL,NULL,NULL,NULL,NULL,3,4,408,0,'','','','','',10000,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'es_AR',NULL,NULL,1,NULL,NULL,NULL,0),(4,0,NULL,'2013-03-03 23:09:48','2010-07-08 22:48:18','2013-03-04 00:08:04','Prospector Vaalen',1,NULL,NULL,'CU1303-0014',NULL,NULL,NULL,'',NULL,'Bruxelles',103,2,NULL,NULL,NULL,NULL,NULL,3,4,201,0,'12345678','','','','',0,0,NULL,NULL,NULL,3,0,NULL,'PL_LOW',0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,0,0,NULL,NULL,NULL,NULL,NULL,1,NULL,'','',0),(5,0,NULL,'2010-07-08 21:37:56','2010-07-08 23:22:57','2010-07-08 23:37:56','NoCountry Co',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,0,193,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,0,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(6,0,NULL,'2010-07-08 22:25:06','2010-07-09 00:15:09','2010-07-09 00:25:06','Swiss customer supplier',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,'Genevia',0,6,NULL,NULL,NULL,'abademail@aa.com',NULL,2,2,601,0,'','','','','',56000,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(7,0,NULL,'2013-02-12 16:06:20','2010-07-09 01:24:26','2013-02-12 17:06:20','Generic customer',1,NULL,NULL,'CU1302-0011',NULL,NULL,NULL,'',NULL,NULL,0,7,NULL,NULL,NULL,'ttt@ttt.com',NULL,NULL,8,NULL,0,'','','','','',0,0,'Generic customer to use for Point Of Sale module.
',NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,'','',0),(8,0,NULL,'2010-07-10 12:54:27','2010-07-10 14:54:27','2010-07-10 14:54:27','Client salon',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,0,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(9,0,NULL,'2010-07-10 12:55:11','2010-07-10 14:54:44','2010-07-10 14:55:11','Client salon invidivdu',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,8,NULL,0,'','','','','',0,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(10,0,NULL,'2012-12-08 16:38:30','2010-07-10 15:13:08','2012-12-08 17:38:30','Smith Vick',1,NULL,NULL,'CU1212-0005',NULL,NULL,NULL,'',NULL,NULL,0,102,NULL,NULL,NULL,'vsmith@email.com',NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,'','',0),(11,0,NULL,'2010-07-11 12:35:22','2010-07-10 18:35:57','2010-07-10 18:36:24','Mon client',1,NULL,NULL,NULL,NULL,'7051',NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,3,0,NULL,'PL_LOW',0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(12,0,NULL,'2013-02-20 19:07:21','2010-07-11 16:18:08','2013-02-20 20:07:21','Dupont Alain',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,'toto@aa.com',NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,'','',0),(13,0,NULL,'2010-07-11 15:13:20','2010-07-11 17:13:20','2010-07-11 17:13:20','Vendeur de chips',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,0,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(15,0,NULL,'2011-08-01 00:31:24','2011-08-01 02:31:24','2011-08-01 02:31:24','mmm',1,NULL,NULL,'CU1108-0002','SU1108-0002',NULL,NULL,'','78180','mmm',0,31,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(16,0,NULL,'2011-08-01 00:42:21','2011-08-01 02:31:43','2011-08-01 02:42:21','ppp',1,NULL,NULL,'CU1108-0003','SU1108-0003',NULL,NULL,'','78180','mmm',103,2,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(17,0,NULL,'2011-08-04 21:24:24','2011-08-01 02:41:26','2011-08-04 23:24:24','FFF SARL',1,NULL,NULL,'CU1108-0004','SU1108-0004',NULL,NULL,'The French Company',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,1,3,NULL,0,'','','','','',0,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,0),(18,0,NULL,'2013-01-12 13:38:32','2012-12-09 20:14:42','2013-01-12 14:38:32','doe john',1,NULL,NULL,'CU1212-0006',NULL,NULL,NULL,'',NULL,NULL,0,1,'111','2222',NULL,'johndoe@email.com',NULL,NULL,101,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,0,0,NULL,NULL,NULL,NULL,NULL,1,NULL,'','',0),(19,0,NULL,'2013-03-16 12:52:02','2013-01-12 12:23:05','2013-03-16 13:52:02','aaa',1,NULL,NULL,'CU1301-0008',NULL,NULL,NULL,'fdgfd','gggfd','fgfgfd',0,4,'gggh','0101',NULL,NULL,NULL,NULL,101,NULL,0,'','','10/10/2010','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'en_US','patient@cabinetmed',NULL,1,NULL,'','',0),(20,0,NULL,'2013-01-12 11:52:20','2013-01-12 12:52:20','2013-01-12 12:52:20','pppoo',1,NULL,NULL,'CU1301-0009',NULL,NULL,NULL,'pppoo',NULL,NULL,0,4,NULL,NULL,NULL,NULL,NULL,NULL,101,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'en_US','patient@cabinetmed',NULL,1,NULL,'','',0),(21,0,NULL,'2013-01-23 15:56:58','2013-01-23 16:56:58','2013-01-23 16:56:58','pa',1,NULL,NULL,'CU1301-0010',NULL,NULL,NULL,'',NULL,NULL,0,81,NULL,NULL,NULL,NULL,NULL,NULL,101,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'en_US','patient@cabinetmed',NULL,1,NULL,'','',0),(22,0,NULL,'2013-02-26 21:57:58','2013-02-26 22:57:50','2013-02-26 22:57:58','pppp',1,NULL,NULL,'CU1302-0012',NULL,NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,101,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'fr_FR','patient@cabinetmed',NULL,1,NULL,'','',0),(23,0,NULL,'2013-02-26 21:58:13','2013-02-26 22:58:13','2013-02-26 22:58:13','ttttt',1,NULL,NULL,'CU1302-0013','SU1302-0006',NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,101,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'fr_FR',NULL,NULL,1,NULL,'','',0),(24,0,NULL,'2013-03-09 15:33:39','2013-03-06 17:13:59','2013-03-09 16:33:39','smith smith',1,NULL,NULL,'CU1303-0015',NULL,'411E123',NULL,'',NULL,NULL,0,11,NULL,NULL,NULL,'smith@email.com',NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,'','',0),(25,0,NULL,'2013-03-10 14:47:37','2013-03-10 15:47:37','2013-03-10 15:47:37','jlmkjlkj',1,NULL,NULL,'CU1303-0016','SU1303-0007',NULL,NULL,'',NULL,NULL,0,117,NULL,NULL,NULL,NULL,NULL,NULL,101,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'en_US',NULL,NULL,1,NULL,'','',0),(26,0,NULL,'2013-03-10 14:57:32','2013-03-10 15:57:32','2013-03-10 15:57:32','iiii',1,NULL,NULL,'CU1303-0017','SU1303-0008',NULL,NULL,'',NULL,NULL,290,117,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,'','','','','',0,0,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,1,0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'en_US',NULL,NULL,1,NULL,'','',0); +/*!40000 ALTER TABLE `llx_societe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_address` +-- + +DROP TABLE IF EXISTS `llx_societe_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_address` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `fk_soc` int(11) DEFAULT '0', + `name` varchar(60) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `phone` varchar(20) DEFAULT NULL, + `fax` varchar(20) DEFAULT NULL, + `note` text, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_address` +-- + +LOCK TABLES `llx_societe_address` WRITE; +/*!40000 ALTER TABLE `llx_societe_address` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_address` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_commerciaux` +-- + +DROP TABLE IF EXISTS `llx_societe_commerciaux`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_commerciaux` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_commerciaux` (`fk_soc`,`fk_user`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_commerciaux` +-- + +LOCK TABLES `llx_societe_commerciaux` WRITE; +/*!40000 ALTER TABLE `llx_societe_commerciaux` DISABLE KEYS */; +INSERT INTO `llx_societe_commerciaux` VALUES (1,2,2),(2,3,2),(3,15,1),(4,16,1),(5,17,1),(6,19,1),(8,19,3),(7,20,1),(9,21,1),(10,23,1),(11,25,1),(12,26,1); +/*!40000 ALTER TABLE `llx_societe_commerciaux` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_extrafields` +-- + +DROP TABLE IF EXISTS `llx_societe_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `jjjj` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_societe_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_extrafields` +-- + +LOCK TABLES `llx_societe_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_societe_extrafields` DISABLE KEYS */; +INSERT INTO `llx_societe_extrafields` VALUES (1,'2011-06-22 16:23:01',40,'kkkk',NULL),(2,'2011-06-22 16:23:16',41,'jjj',NULL),(4,'2011-06-23 07:40:40',39,'lll',NULL),(12,'2011-06-29 13:03:12',42,NULL,NULL),(14,'2011-07-02 01:24:03',57,NULL,NULL),(16,'2011-07-02 14:11:29',60,NULL,NULL),(17,'2011-07-18 10:26:55',35,NULL,NULL),(18,'2011-07-31 22:35:08',2,NULL,NULL),(19,'2011-08-01 00:31:24',15,NULL,NULL),(22,'2011-08-01 00:42:21',16,NULL,NULL),(27,'2011-08-04 21:24:24',17,NULL,NULL),(28,'2012-12-08 16:38:30',10,NULL,NULL),(30,'2012-12-19 14:47:50',1,NULL,NULL),(31,'2013-01-12 13:38:32',18,NULL,NULL),(33,'2013-02-12 16:06:20',7,NULL,NULL),(34,'2013-02-20 19:07:21',12,'jjj',NULL),(36,'2013-02-26 21:57:58',22,'jjj',NULL),(37,'2013-02-26 21:58:13',23,NULL,NULL),(44,'2013-03-03 23:08:04',4,'jjj',NULL),(45,'2013-03-09 15:33:39',24,'jjj',NULL),(46,'2013-03-10 14:47:37',25,NULL,NULL),(47,'2013-03-10 14:57:32',26,NULL,NULL),(48,'2013-03-16 12:52:02',19,'jjj',NULL); +/*!40000 ALTER TABLE `llx_societe_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_log` +-- + +DROP TABLE IF EXISTS `llx_societe_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `datel` datetime DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_statut` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `author` varchar(30) DEFAULT NULL, + `label` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_log` +-- + +LOCK TABLES `llx_societe_log` WRITE; +/*!40000 ALTER TABLE `llx_societe_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_prices` +-- + +DROP TABLE IF EXISTS `llx_societe_prices`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_prices` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT '0', + `tms` timestamp NULL DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `price_level` tinyint(4) DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_prices` +-- + +LOCK TABLES `llx_societe_prices` WRITE; +/*!40000 ALTER TABLE `llx_societe_prices` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_prices` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_remise` +-- + +DROP TABLE IF EXISTS `llx_societe_remise`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_remise` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `remise_client` double(6,3) NOT NULL DEFAULT '0.000', + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_remise` +-- + +LOCK TABLES `llx_societe_remise` WRITE; +/*!40000 ALTER TABLE `llx_societe_remise` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_remise` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_remise_except` +-- + +DROP TABLE IF EXISTS `llx_societe_remise_except`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_remise_except` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `amount_ht` double(24,8) NOT NULL, + `amount_tva` double(24,8) NOT NULL DEFAULT '0.00000000', + `amount_ttc` double(24,8) NOT NULL DEFAULT '0.00000000', + `tva_tx` double(6,3) NOT NULL DEFAULT '0.000', + `fk_user` int(11) NOT NULL, + `fk_facture_line` int(11) DEFAULT NULL, + `fk_facture` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `description` varchar(255) NOT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_societe_remise_except_fk_user` (`fk_user`), + KEY `idx_societe_remise_except_fk_soc` (`fk_soc`), + KEY `idx_societe_remise_except_fk_facture_line` (`fk_facture_line`), + KEY `idx_societe_remise_except_fk_facture` (`fk_facture`), + KEY `idx_societe_remise_except_fk_facture_source` (`fk_facture_source`), + CONSTRAINT `fk_societe_remise_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_facture_line` FOREIGN KEY (`fk_facture_line`) REFERENCES `llx_facturedet` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_facture_source` FOREIGN KEY (`fk_facture_source`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_remise_except` +-- + +LOCK TABLES `llx_societe_remise_except` WRITE; +/*!40000 ALTER TABLE `llx_societe_remise_except` DISABLE KEYS */; +INSERT INTO `llx_societe_remise_except` VALUES (1,23,'2013-03-08 10:02:54',5.00000000,0.00000000,5.00000000,0.000,1,775,NULL,NULL,'fsdfsf'),(2,19,'2013-03-19 09:36:15',10.00000000,1.25000000,11.25000000,12.500,1,1019,NULL,NULL,'hfghgf'); +/*!40000 ALTER TABLE `llx_societe_remise_except` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_rib` +-- + +DROP TABLE IF EXISTS `llx_societe_rib`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_rib` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `bank` varchar(255) DEFAULT NULL, + `code_banque` varchar(7) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(20) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` text, + `default_rib` tinyint(4) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_rib` +-- + +LOCK TABLES `llx_societe_rib` WRITE; +/*!40000 ALTER TABLE `llx_societe_rib` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_rib` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_socpeople` +-- + +DROP TABLE IF EXISTS `llx_socpeople`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_socpeople` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `civilite` varchar(6) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(10) DEFAULT NULL, + `town` text, + `fk_departement` int(11) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `birthday` date DEFAULT NULL, + `poste` varchar(80) DEFAULT NULL, + `phone` varchar(30) DEFAULT NULL, + `phone_perso` varchar(30) DEFAULT NULL, + `phone_mobile` varchar(30) DEFAULT NULL, + `fax` varchar(30) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `jabberid` varchar(255) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `priv` smallint(6) NOT NULL DEFAULT '0', + `no_email` smallint(6) NOT NULL DEFAULT '0', + `fk_user_creat` int(11) DEFAULT '0', + `fk_user_modif` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `default_lang` varchar(6) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `statut` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + KEY `idx_socpeople_fk_soc` (`fk_soc`), + KEY `idx_socpeople_fk_user_creat` (`fk_user_creat`), + CONSTRAINT `fk_socpeople_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_socpeople_user_creat_user_rowid` FOREIGN KEY (`fk_user_creat`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_socpeople` +-- + +LOCK TABLES `llx_socpeople` WRITE; +/*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2010-07-08 20:45:28',1,1,NULL,'MR','Samira','Aljoun','','','',297,117,'2010-07-08','Project leader','','','','','','',NULL,0,0,1,1,'Met during a congress at Dubai',NULL,NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2010-07-08 20:59:35',NULL,1,NULL,'MR','Freeman','Private','','','',NULL,11,NULL,'','','','','','','',NULL,1,0,1,1,'This is a private contact',NULL,NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(5,'2010-07-10 14:54:44','2010-07-10 12:54:44',9,1,NULL,'','Client salon invidivdu','','','','',NULL,NULL,NULL,'','','','','','','',NULL,0,0,1,1,'',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2011-08-01 00:41:26',17,1,NULL,'','aaa','','aaa','','',289,117,NULL,'','','','','','','',NULL,0,0,1,1,'',NULL,NULL,NULL,NULL,1),(7,'2013-02-12 17:05:57','2013-03-08 01:45:08',7,1,NULL,'','aaa','','','','',289,117,NULL,'','','','','','aaa@aaa.com','',NULL,0,0,1,1,'',NULL,NULL,NULL,NULL,1),(8,'2013-03-08 02:45:31','2013-03-08 01:45:31',7,1,NULL,'','kkkk','','','','',290,117,NULL,'','','','','','ttt@ttt.com','',NULL,0,0,1,1,'',NULL,NULL,NULL,NULL,1),(10,'2013-03-08 02:48:23','2013-03-08 01:48:23',7,1,NULL,'','fff','','','','',290,117,NULL,'','','','','','ttt@ttt.com','',NULL,0,0,1,1,'',NULL,NULL,NULL,NULL,1),(11,'2013-03-08 02:48:54','2013-03-08 01:48:54',7,1,NULL,'','iii','','','','',294,117,NULL,'','','','','','ttt@ttt.com','',NULL,0,0,1,1,'',NULL,NULL,NULL,NULL,1); +/*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_socpeople_extrafields` +-- + +DROP TABLE IF EXISTS `llx_socpeople_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_socpeople_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_socpeople_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_socpeople_extrafields` +-- + +LOCK TABLES `llx_socpeople_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_socpeople_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_socpeople_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_stock_mouvement` +-- + +DROP TABLE IF EXISTS `llx_stock_mouvement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_stock_mouvement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datem` datetime DEFAULT NULL, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `value` double DEFAULT NULL, + `price` float(13,4) DEFAULT '0.0000', + `type_mouvement` smallint(6) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `label` varchar(128) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_stock_mouvement_fk_product` (`fk_product`), + KEY `idx_stock_mouvement_fk_entrepot` (`fk_entrepot`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_stock_mouvement` +-- + +LOCK TABLES `llx_stock_mouvement` WRITE; +/*!40000 ALTER TABLE `llx_stock_mouvement` DISABLE KEYS */; +INSERT INTO `llx_stock_mouvement` VALUES (1,'2010-07-08 22:43:51','2010-07-09 00:43:51',2,2,1000,0.0000,0,1,'Correct stock'),(3,'2010-07-10 22:56:18','2010-07-11 00:56:18',4,2,500,0.0000,0,1,'Init'),(4,'2010-07-10 23:02:20','2010-07-11 01:02:20',4,2,500,0.0000,0,1,''),(5,'2010-07-11 16:49:44','2010-07-11 18:49:44',4,1,2,10.0000,3,1,''),(6,'2010-07-11 16:49:44','2010-07-11 18:49:44',1,1,4,0.0000,3,1,''),(7,'2013-01-19 17:22:48','2013-01-19 18:22:48',11,1,-1,0.0000,2,1,'Facture créée dans DoliPOS'),(8,'2013-01-19 17:22:48','2013-01-19 18:22:48',4,1,-1,5.0000,2,1,'Facture créée dans DoliPOS'),(9,'2013-01-19 17:22:48','2013-01-19 18:22:48',1,1,-2,0.0000,2,1,'Facture créée dans DoliPOS'),(10,'2013-01-19 17:31:10','2013-01-19 18:31:10',2,1,-1,0.0000,2,1,'Facture créée dans DoliPOS'),(11,'2013-01-19 17:31:58','2013-01-19 18:31:58',2,1,-1,0.0000,2,1,'Facture créée dans DoliPOS'); +/*!40000 ALTER TABLE `llx_stock_mouvement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_submitew_message` +-- + +DROP TABLE IF EXISTS `llx_submitew_message`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_submitew_message` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `statut` smallint(6) DEFAULT '0', + `label` varchar(60) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `title` varchar(60) DEFAULT NULL, + `body_short` text, + `body_long` text, + `url` varchar(255) DEFAULT NULL, + `cible` varchar(60) DEFAULT NULL, + `nbemail` int(11) DEFAULT NULL, + `email_from` varchar(160) DEFAULT NULL, + `email_replyto` varchar(160) DEFAULT NULL, + `email_errorsto` varchar(160) DEFAULT NULL, + `tag` varchar(128) DEFAULT NULL, + `date_creat` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_appro` datetime DEFAULT NULL, + `date_envoi` datetime DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_appro` int(11) DEFAULT NULL, + `joined_file1` varchar(255) DEFAULT NULL, + `joined_file2` varchar(255) DEFAULT NULL, + `joined_file3` varchar(255) DEFAULT NULL, + `joined_file4` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_submitew_message` +-- + +LOCK TABLES `llx_submitew_message` WRITE; +/*!40000 ALTER TABLE `llx_submitew_message` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_submitew_message` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_submitew_targets` +-- + +DROP TABLE IF EXISTS `llx_submitew_targets`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_submitew_targets` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(64) NOT NULL, + `targetcode` varchar(16) NOT NULL, + `langcode` varchar(5) DEFAULT 'en_US', + `url` varchar(250) DEFAULT NULL, + `login` varchar(128) DEFAULT NULL, + `pass` varchar(128) DEFAULT NULL, + `comment` varchar(250) DEFAULT NULL, + `position` int(11) DEFAULT '0', + `titlelength` int(11) DEFAULT '32', + `descshortlength` int(11) DEFAULT '256', + `desclonglength` int(11) DEFAULT '2000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_submitewtargets` (`label`,`langcode`) +) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_submitew_targets` +-- + +LOCK TABLES `llx_submitew_targets` WRITE; +/*!40000 ALTER TABLE `llx_submitew_targets` DISABLE KEYS */; +INSERT INTO `llx_submitew_targets` VALUES (17,'hhho','email','fr_FR','',NULL,NULL,NULL,0,0,-1,0),(34,'pppp','facebook','fr_FR',NULL,'eldy','ld101010-fk',NULL,0,-1,-1,-1),(35,'hfghfgh','web','de_DE','http://wwww','ffffmmm','null',NULL,0,-1,-1,-1),(37,'llll','linkedin','fr_FR','',NULL,NULL,NULL,0,32,256,2000),(55,'fff','dig','fr_FR',NULL,'hfgh','hfghgf',NULL,0,-1,-1,-1),(56,'aaaaaaa','linkedin','da_DK',NULL,'aa','aaa',NULL,0,32,256,2000),(57,'ddd','dig','en_US',NULL,'dd',NULL,NULL,0,32,256,2000),(59,'dddff','dig','en_US',NULL,NULL,NULL,NULL,0,32,256,2000),(68,'dddffe','dig','en_US',NULL,NULL,NULL,NULL,0,32,256,2000),(70,'dddffef','dig','en_US','http://www.dig.com',NULL,NULL,NULL,0,32,256,2000),(71,'ffff','dig','en_US','http://www.dig.com',NULL,NULL,NULL,0,32,256,2000); +/*!40000 ALTER TABLE `llx_submitew_targets` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_submitew_targets_params` +-- + +DROP TABLE IF EXISTS `llx_submitew_targets_params`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_submitew_targets_params` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_target` int(11) NOT NULL, + `paramkey` varchar(16) NOT NULL, + `paramvalue` varchar(128) DEFAULT '', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_submitewtargets_fk_target` (`fk_target`), + UNIQUE KEY `uk_submitewtargets_params` (`fk_target`,`paramkey`,`paramvalue`), + CONSTRAINT `fk_submitewtargets_fk_target` FOREIGN KEY (`fk_target`) REFERENCES `llx_submitew_targets` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_submitew_targets_params` +-- + +LOCK TABLES `llx_submitew_targets_params` WRITE; +/*!40000 ALTER TABLE `llx_submitew_targets_params` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_submitew_targets_params` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_texts` +-- + +DROP TABLE IF EXISTS `llx_texts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_texts` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `module` varchar(32) DEFAULT NULL, + `typemodele` varchar(32) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `private` smallint(6) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `title` varchar(128) DEFAULT NULL, + `filename` varchar(128) DEFAULT NULL, + `content` text, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_texts` +-- + +LOCK TABLES `llx_texts` WRITE; +/*!40000 ALTER TABLE `llx_texts` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_texts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_tva` +-- + +DROP TABLE IF EXISTS `llx_tva`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_tva` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_tva` +-- + +LOCK TABLES `llx_tva` WRITE; +/*!40000 ALTER TABLE `llx_tva` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_tva` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_update_modules` +-- + +DROP TABLE IF EXISTS `llx_update_modules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_update_modules` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `modulekey` varchar(24) DEFAULT NULL, + `datekey` date DEFAULT NULL, + `versionkey` double DEFAULT NULL, + `lastrequestdate` datetime DEFAULT NULL, + `email` varchar(128) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_update_modules` +-- + +LOCK TABLES `llx_update_modules` WRITE; +/*!40000 ALTER TABLE `llx_update_modules` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_update_modules` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user` +-- + +DROP TABLE IF EXISTS `llx_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `login` varchar(24) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `civilite` varchar(6) DEFAULT NULL, + `ref_ext` varchar(50) DEFAULT NULL, + `ref_int` varchar(50) DEFAULT NULL, + `pass` varchar(32) DEFAULT NULL, + `pass_crypted` varchar(128) DEFAULT NULL, + `pass_temp` varchar(32) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `job` varchar(128) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `office_phone` varchar(20) DEFAULT NULL, + `office_fax` varchar(20) DEFAULT NULL, + `user_mobile` varchar(20) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `signature` text, + `admin` smallint(6) DEFAULT '0', + `webcal_login` varchar(25) DEFAULT NULL, + `phenix_login` varchar(25) DEFAULT NULL, + `phenix_pass` varchar(128) DEFAULT NULL, + `module_comm` smallint(6) DEFAULT '1', + `module_compta` smallint(6) DEFAULT '1', + `fk_societe` int(11) DEFAULT NULL, + `fk_socpeople` int(11) DEFAULT NULL, + `fk_member` int(11) DEFAULT NULL, + `note` text, + `datelastlogin` datetime DEFAULT NULL, + `datepreviouslogin` datetime DEFAULT NULL, + `egroupware_id` int(11) DEFAULT NULL, + `ldap_sid` varchar(255) DEFAULT NULL, + `statut` tinyint(4) DEFAULT '1', + `photo` varchar(255) DEFAULT NULL, + `lang` varchar(6) DEFAULT NULL, + `openid` varchar(255) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_state` int(11) DEFAULT '0', + `fk_country` int(11) DEFAULT '0', + `color` varchar(6) DEFAULT NULL, + `accountancy_code` varchar(24) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_login` (`login`,`entity`), + UNIQUE KEY `uk_user_fk_socpeople` (`fk_socpeople`), + UNIQUE KEY `uk_user_fk_member` (`fk_member`), + KEY `uk_user_fk_societe` (`fk_societe`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user` +-- + +LOCK TABLES `llx_user` WRITE; +/*!40000 ALTER TABLE `llx_user` DISABLE KEYS */; +INSERT INTO `llx_user` VALUES (1,'2010-07-08 13:20:11','2012-12-12 17:54:10','admin',0,NULL,NULL,NULL,'admin','21232f297a57a5a743894a0e4a801fc3',NULL,'SuperAdminName','Firstname','',NULL,'','','','bidon@destailleur.fr','',1,'','','',1,1,NULL,NULL,NULL,'','2014-04-05 16:19:30','2013-11-07 01:01:51',NULL,'',1,'01.jpg',NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(2,'2010-07-08 13:54:48','2010-07-08 11:54:48','demo',1,NULL,NULL,NULL,'demo','fe01ce2a7fbac8fafaed7c982a04e229',NULL,'John','Doe',NULL,NULL,'09123123','','','johndoe@mycompany.com',NULL,0,'','','',1,1,NULL,NULL,NULL,'','2013-03-24 16:30:29','2010-07-08 14:12:02',NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(3,'2010-07-11 16:18:59','2013-02-20 19:07:21','adupont',1,NULL,NULL,NULL,'adupont','00856ab2bbb748aa29aa335a6e3a2407',NULL,'Dupont','Alain','',NULL,'','','','toto@aa.com','',0,'','','',1,1,NULL,NULL,2,'','2012-12-21 17:38:55',NULL,NULL,'',1,NULL,NULL,NULL,2,NULL,NULL,NULL,0,0,NULL,NULL),(4,'2013-01-23 17:52:27','2013-02-20 19:48:01','aaa',1,NULL,NULL,NULL,'aaa','47bce5c74f589f4867dbd57e9ca9f808',NULL,'aaa','','',NULL,'','','','','',0,'','','',1,1,17,6,NULL,'','2013-02-25 10:18:41','2013-01-23 17:53:20',NULL,'',1,NULL,NULL,NULL,5,NULL,NULL,NULL,0,0,NULL,NULL),(5,'2013-01-23 17:52:37','2013-01-23 16:52:37','bbb',0,NULL,NULL,NULL,'bbb','08f8e0260c64418510cefb2b06eee5cd',NULL,'bbb','','',NULL,'','','','','',1,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(6,'2013-02-16 20:22:40','2013-02-16 19:22:40','aaab',2,NULL,NULL,NULL,'aaab','4c189b020ceb022e0ecc42482802e2b8',NULL,'aaab','','',NULL,'','','','','',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(7,'2013-02-16 20:48:15','2013-02-16 19:48:15','zzz',2,NULL,NULL,NULL,'zzz','f3abb86bd34cf4d52698f14c0da1dc60',NULL,'zzz','','',NULL,'','','','','',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(9,'2013-02-16 20:50:07','2013-03-24 16:10:14','zzzg',2,NULL,NULL,NULL,'jc28fg4h','93d789524fd223cf05eecea3f59cbe86',NULL,'zzzg','','',NULL,'','','','','fsdkkfsdf
\r\nfsdfsd
\r\nfsdfs',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,5,'','','',NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_alert` +-- + +DROP TABLE IF EXISTS `llx_user_alert`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_alert` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `type` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_alert` +-- + +LOCK TABLES `llx_user_alert` WRITE; +/*!40000 ALTER TABLE `llx_user_alert` DISABLE KEYS */; +INSERT INTO `llx_user_alert` VALUES (1,1,1,1); +/*!40000 ALTER TABLE `llx_user_alert` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_clicktodial` +-- + +DROP TABLE IF EXISTS `llx_user_clicktodial`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_clicktodial` ( + `fk_user` int(11) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `login` varchar(32) DEFAULT NULL, + `pass` varchar(64) DEFAULT NULL, + `poste` varchar(20) DEFAULT NULL, + PRIMARY KEY (`fk_user`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_clicktodial` +-- + +LOCK TABLES `llx_user_clicktodial` WRITE; +/*!40000 ALTER TABLE `llx_user_clicktodial` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_clicktodial` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_extrafields` +-- + +DROP TABLE IF EXISTS `llx_user_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_user_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_extrafields` +-- + +LOCK TABLES `llx_user_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_user_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_param` +-- + +DROP TABLE IF EXISTS `llx_user_param`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_param` ( + `fk_user` int(11) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `param` varchar(64) NOT NULL, + `value` varchar(255) NOT NULL, + UNIQUE KEY `uk_user_param` (`fk_user`,`param`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_param` +-- + +LOCK TABLES `llx_user_param` WRITE; +/*!40000 ALTER TABLE `llx_user_param` DISABLE KEYS */; +INSERT INTO `llx_user_param` VALUES (1,1,'MAIN_BOXES_0','1'),(1,1,'MAIN_THEME','eldy'),(1,3,'THEME_ELDY_ENABLE_PERSONALIZED','1'),(1,1,'THEME_ELDY_RGB','ded0ed'),(1,3,'THEME_ELDY_RGB','d0ddc3'); +/*!40000 ALTER TABLE `llx_user_param` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_rights` +-- + +DROP TABLE IF EXISTS `llx_user_rights`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_rights` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL, + `fk_id` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_rights` (`fk_user`,`fk_id`), + CONSTRAINT `fk_user_rights_fk_user_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=13202 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_rights` +-- + +LOCK TABLES `llx_user_rights` WRITE; +/*!40000 ALTER TABLE `llx_user_rights` DISABLE KEYS */; +INSERT INTO `llx_user_rights` VALUES (11425,1,11),(11401,1,12),(11406,1,13),(11411,1,14),(11416,1,15),(11421,1,16),(11427,1,19),(9726,1,21),(9700,1,22),(9706,1,24),(9711,1,25),(9716,1,26),(9722,1,27),(9728,1,28),(9978,1,31),(9968,1,32),(9974,1,34),(1910,1,36),(9980,1,38),(7184,1,61),(7181,1,62),(7183,1,64),(7185,1,67),(7186,1,68),(1678,1,71),(1673,1,72),(1675,1,74),(1679,1,75),(1677,1,76),(1681,1,78),(1682,1,79),(11389,1,81),(11372,1,82),(11376,1,84),(11379,1,86),(11382,1,87),(11386,1,88),(11390,1,89),(9796,1,91),(10097,1,95),(10099,1,96),(10103,1,97),(10104,1,98),(7139,1,101),(7134,1,102),(7136,1,104),(7137,1,105),(7138,1,106),(7140,1,109),(10229,1,111),(10201,1,112),(10207,1,113),(10213,1,114),(10219,1,115),(10225,1,116),(10231,1,117),(11323,1,121),(11313,1,122),(11319,1,125),(11325,1,126),(2307,1,151),(2304,1,152),(2306,1,153),(2308,1,154),(10092,1,161),(10093,1,162),(10094,1,163),(10095,1,164),(10096,1,165),(1585,1,170),(11541,1,171),(11534,1,172),(11538,1,173),(11542,1,178),(10000,1,221),(9990,1,222),(9996,1,223),(10002,1,229),(10007,1,237),(10011,1,238),(10015,1,239),(1686,1,241),(1685,1,242),(1687,1,243),(11527,1,251),(11489,1,252),(11492,1,253),(11495,1,254),(11498,1,255),(11502,1,256),(1617,1,258),(11330,1,262),(11349,1,281),(11339,1,282),(11345,1,283),(11351,1,286),(1763,1,331),(1762,1,332),(1764,1,333),(11505,1,341),(11507,1,342),(11509,1,343),(11511,1,344),(11523,1,351),(11516,1,352),(11520,1,353),(11524,1,354),(11528,1,358),(11365,1,531),(11358,1,532),(11362,1,534),(1625,1,536),(11366,1,538),(11557,1,700),(11547,1,701),(11553,1,702),(11559,1,703),(1755,1,1001),(1754,1,1002),(1756,1,1003),(1758,1,1004),(1759,1,1005),(7146,1,1101),(7143,1,1102),(7145,1,1104),(7147,1,1109),(11435,1,1181),(11483,1,1182),(11440,1,1183),(11444,1,1184),(11448,1,1185),(11452,1,1186),(11456,1,1187),(11460,1,1188),(1578,1,1201),(1579,1,1202),(11479,1,1231),(11466,1,1232),(11470,1,1233),(11474,1,1234),(11477,1,1235),(11480,1,1236),(11484,1,1237),(1736,1,1251),(11432,1,1321),(11393,1,1421),(8190,1,1791),(8187,1,1792),(8191,1,1793),(11283,1,2401),(11279,1,2402),(11285,1,2403),(11299,1,2411),(11295,1,2412),(11301,1,2413),(11305,1,2414),(1618,1,2500),(11569,1,2501),(11566,1,2503),(11570,1,2515),(9610,1,5001),(9611,1,5002),(8155,1,20001),(8159,1,20002),(8163,1,20003),(8167,1,20004),(8171,1,20005),(8175,1,20006),(10345,1,23001),(10338,1,23002),(10342,1,23003),(10346,1,23004),(7701,1,50101),(4984,1,50401),(4983,1,50402),(4985,1,50403),(4987,1,50411),(4988,1,50412),(4989,1,50415),(3564,1,100700),(3565,1,100701),(9596,1,101051),(9598,1,101052),(9600,1,101053),(9604,1,101060),(9605,1,101061),(7177,1,101201),(7178,1,101202),(10353,1,101250),(10355,1,101251),(8980,1,101261),(8981,1,101262),(7616,1,101331),(10030,1,101701),(10031,1,101702),(3582,1,102000),(3583,1,102001),(9819,1,400051),(9823,1,400052),(9827,1,400053),(9831,1,400055),(132,2,11),(133,2,12),(134,2,13),(135,2,14),(136,2,16),(137,2,19),(138,2,21),(139,2,22),(140,2,24),(141,2,25),(142,2,26),(143,2,27),(10359,2,31),(145,2,32),(10361,2,34),(146,2,36),(147,2,41),(148,2,42),(149,2,44),(150,2,61),(151,2,62),(152,2,64),(153,2,71),(154,2,72),(155,2,74),(156,2,75),(157,2,78),(158,2,79),(159,2,81),(160,2,82),(161,2,84),(162,2,86),(163,2,87),(164,2,88),(165,2,89),(166,2,91),(167,2,92),(168,2,93),(2475,2,95),(2476,2,96),(2477,2,97),(2478,2,98),(169,2,101),(170,2,102),(171,2,104),(172,2,109),(173,2,111),(174,2,112),(175,2,113),(176,2,114),(177,2,116),(178,2,117),(179,2,121),(180,2,122),(181,2,125),(182,2,141),(183,2,142),(184,2,144),(2479,2,151),(2480,2,152),(2481,2,153),(2482,2,154),(185,2,161),(186,2,162),(187,2,163),(188,2,164),(189,2,165),(190,2,170),(2471,2,171),(192,2,172),(2472,2,173),(193,2,221),(194,2,222),(195,2,229),(196,2,241),(197,2,242),(198,2,243),(199,2,251),(201,2,262),(202,2,281),(203,2,282),(204,2,283),(205,2,331),(2483,2,531),(207,2,532),(2484,2,534),(208,2,536),(2473,2,700),(210,2,701),(211,2,702),(2474,2,703),(212,2,1001),(213,2,1002),(214,2,1003),(215,2,1004),(216,2,1005),(217,2,1101),(218,2,1102),(219,2,1104),(220,2,1109),(221,2,1181),(222,2,1182),(223,2,1183),(224,2,1184),(225,2,1185),(226,2,1186),(227,2,1187),(228,2,1188),(229,2,1201),(230,2,1202),(231,2,1231),(232,2,1232),(233,2,1233),(234,2,1234),(235,2,1421),(236,2,2401),(237,2,2402),(238,2,2403),(239,2,2411),(240,2,2412),(241,2,2413),(242,2,2500),(2470,2,2501),(243,2,2515),(10363,2,20001),(10364,2,20002),(10365,2,20003),(10366,2,20004),(10367,2,20005),(10368,2,20006),(10362,2,50101),(10372,2,101250),(1807,3,11),(1808,3,31),(1809,3,36),(1810,3,41),(1811,3,61),(1812,3,71),(1813,3,72),(1814,3,74),(1815,3,75),(1816,3,78),(1817,3,79),(1818,3,91),(1819,3,95),(1820,3,97),(1821,3,111),(1822,3,121),(1823,3,122),(1824,3,125),(1825,3,161),(1826,3,170),(1827,3,171),(1828,3,172),(1829,3,221),(1830,3,222),(1831,3,229),(1832,3,241),(1833,3,242),(1834,3,243),(1835,3,251),(1836,3,255),(1837,3,256),(1838,3,262),(1839,3,281),(1840,3,282),(1841,3,283),(1842,3,331),(1843,3,531),(1844,3,536),(1845,3,700),(1846,3,1001),(1847,3,1002),(1848,3,1003),(1849,3,1004),(1850,3,1005),(1851,3,1181),(1852,3,1182),(1853,3,1201),(1854,3,1202),(1855,3,1231),(1856,3,2401),(1857,3,2402),(1858,3,2403),(1859,3,2411),(1860,3,2412),(1861,3,2413),(1862,3,2500),(1863,3,2515),(8026,4,11),(8027,4,21),(8028,4,31),(8029,4,41),(8030,4,61),(8031,4,71),(8032,4,72),(8033,4,74),(8034,4,75),(8035,4,78),(8036,4,79),(8037,4,81),(8038,4,91),(8039,4,95),(8040,4,97),(8041,4,101),(8042,4,111),(8043,4,121),(8044,4,151),(8045,4,161),(8046,4,171),(8047,4,221),(8048,4,222),(8049,4,229),(8050,4,241),(8051,4,242),(8052,4,243),(8146,4,251),(8147,4,253),(8053,4,262),(8054,4,281),(8055,4,331),(8056,4,341),(8057,4,342),(8058,4,343),(8059,4,344),(8060,4,531),(8061,4,700),(8062,4,1001),(8063,4,1002),(8064,4,1003),(8065,4,1004),(8066,4,1005),(8067,4,1101),(8068,4,1181),(8069,4,1182),(8070,4,1201),(8071,4,1202),(8072,4,1231),(8073,4,2401),(8074,4,2501),(8075,4,2503),(8076,4,2515),(8077,4,20001),(8078,4,50101),(8079,4,101201),(8080,4,101261),(8081,4,102000),(8082,4,400051),(8083,4,400052),(8084,4,400053),(8085,4,400055),(11428,5,11),(11404,5,12),(11408,5,13),(11414,5,14),(11418,5,15),(11424,5,16),(11430,5,19),(9729,5,21),(9703,5,22),(9709,5,24),(9713,5,25),(9719,5,26),(9725,5,27),(9731,5,28),(9981,5,31),(9971,5,32),(9977,5,34),(9983,5,38),(8089,5,41),(8090,5,61),(8091,5,71),(8092,5,72),(8093,5,74),(8094,5,75),(8095,5,78),(8096,5,79),(11391,5,81),(11374,5,82),(11378,5,84),(11380,5,86),(11384,5,87),(11388,5,88),(11392,5,89),(9799,5,91),(9789,5,92),(9795,5,93),(9801,5,94),(10098,5,95),(10100,5,96),(10105,5,97),(10106,5,98),(8101,5,101),(10232,5,111),(10204,5,112),(10210,5,113),(10216,5,114),(10222,5,115),(10228,5,116),(10234,5,117),(11326,5,121),(11316,5,122),(11322,5,125),(11328,5,126),(8104,5,151),(8105,5,161),(11543,5,171),(11536,5,172),(11540,5,173),(11544,5,178),(10003,5,221),(9993,5,222),(9999,5,223),(10005,5,229),(10009,5,237),(10013,5,238),(10017,5,239),(8110,5,241),(8111,5,242),(8112,5,243),(11529,5,251),(11490,5,252),(11494,5,253),(11496,5,254),(11500,5,255),(11504,5,256),(11332,5,262),(11352,5,281),(11342,5,282),(11348,5,283),(11354,5,286),(8115,5,331),(11506,5,341),(11508,5,342),(11510,5,343),(11512,5,344),(11525,5,351),(11518,5,352),(11522,5,353),(11526,5,354),(11530,5,358),(11367,5,531),(11360,5,532),(11364,5,534),(11368,5,538),(11560,5,700),(11550,5,701),(11556,5,702),(11562,5,703),(8122,5,1001),(8123,5,1002),(8124,5,1003),(8125,5,1004),(8126,5,1005),(8127,5,1101),(11436,5,1181),(11485,5,1182),(11442,5,1183),(11446,5,1184),(11450,5,1185),(11454,5,1186),(11458,5,1187),(11462,5,1188),(8130,5,1201),(8131,5,1202),(11481,5,1231),(11468,5,1232),(11472,5,1233),(11476,5,1234),(11478,5,1235),(11482,5,1236),(11486,5,1237),(11434,5,1321),(11394,5,1421),(8192,5,1791),(8189,5,1792),(8193,5,1793),(11286,5,2401),(11282,5,2402),(11288,5,2403),(11302,5,2411),(11298,5,2412),(11304,5,2413),(11306,5,2414),(11571,5,2501),(11568,5,2503),(11572,5,2515),(9612,5,5001),(9613,5,5002),(8157,5,20001),(8161,5,20002),(8165,5,20003),(8169,5,20004),(8173,5,20005),(8177,5,20006),(10347,5,23001),(10340,5,23002),(10344,5,23003),(10348,5,23004),(8138,5,50101),(9597,5,101051),(9599,5,101052),(9601,5,101053),(9606,5,101060),(9607,5,101061),(8139,5,101201),(10356,5,101250),(10358,5,101251),(8982,5,101261),(8983,5,101262),(10032,5,101701),(10033,5,101702),(8141,5,102000),(9821,5,400051),(9825,5,400052),(9829,5,400053),(9833,5,400055),(8194,6,11),(8195,6,21),(8196,6,31),(8197,6,41),(8198,6,61),(8199,6,71),(8200,6,72),(8201,6,74),(8202,6,75),(8203,6,78),(8204,6,79),(8205,6,81),(8206,6,91),(8207,6,95),(8208,6,97),(8209,6,101),(8210,6,111),(8211,6,121),(8212,6,151),(8213,6,161),(8214,6,171),(8215,6,221),(8216,6,222),(8217,6,229),(8218,6,241),(8219,6,242),(8220,6,243),(8221,6,262),(8222,6,281),(8223,6,331),(8224,6,341),(8225,6,342),(8226,6,343),(8227,6,344),(8228,6,531),(8229,6,700),(8230,6,1001),(8231,6,1002),(8232,6,1003),(8233,6,1004),(8234,6,1005),(8235,6,1101),(8236,6,1181),(8237,6,1182),(8238,6,1201),(8239,6,1202),(8240,6,1231),(8241,6,1791),(8242,6,2401),(8243,6,2501),(8244,6,2503),(8245,6,2515),(8246,6,5001),(8247,6,20001),(8248,6,50101),(8249,6,101201),(8250,6,101261),(8251,6,102000),(8252,6,400051),(8253,6,400052),(8254,6,400053),(8255,6,400055),(8256,7,11),(8257,7,21),(8258,7,31),(8259,7,41),(8260,7,61),(8261,7,71),(8262,7,72),(8263,7,74),(8264,7,75),(8265,7,78),(8266,7,79),(8267,7,81),(8268,7,91),(8269,7,95),(8270,7,97),(8271,7,101),(8272,7,111),(8273,7,121),(8274,7,151),(8275,7,161),(8276,7,171),(8277,7,221),(8278,7,222),(8279,7,229),(8280,7,241),(8281,7,242),(8282,7,243),(8283,7,262),(8284,7,281),(8285,7,331),(8286,7,341),(8287,7,342),(8288,7,343),(8289,7,344),(8290,7,531),(8291,7,700),(8292,7,1001),(8293,7,1002),(8294,7,1003),(8295,7,1004),(8296,7,1005),(8297,7,1101),(8298,7,1181),(8299,7,1182),(8300,7,1201),(8301,7,1202),(8302,7,1231),(8303,7,1791),(8304,7,2401),(8305,7,2501),(8306,7,2503),(8307,7,2515),(8308,7,5001),(8309,7,20001),(8310,7,50101),(8311,7,101201),(8312,7,101261),(8313,7,102000),(8314,7,400051),(8315,7,400052),(8316,7,400053),(8317,7,400055),(8318,9,11),(8319,9,21),(8320,9,31),(8321,9,41),(8322,9,61),(8323,9,71),(8324,9,72),(8325,9,74),(8326,9,75),(8327,9,78),(8328,9,79),(8329,9,81),(8330,9,91),(8331,9,95),(8332,9,97),(8333,9,101),(8334,9,111),(8335,9,121),(8336,9,151),(8337,9,161),(8338,9,171),(8339,9,221),(8340,9,222),(8341,9,229),(8342,9,241),(8343,9,242),(8344,9,243),(8345,9,262),(8346,9,281),(8347,9,331),(8348,9,341),(8349,9,342),(8350,9,343),(8351,9,344),(8352,9,531),(8353,9,700),(8354,9,1001),(8355,9,1002),(8356,9,1003),(8357,9,1004),(8358,9,1005),(8359,9,1101),(8360,9,1181),(8361,9,1182),(8362,9,1201),(8363,9,1202),(8364,9,1231),(8365,9,1791),(8366,9,2401),(8367,9,2501),(8368,9,2503),(8369,9,2515),(8370,9,5001),(8371,9,20001),(8372,9,50101),(8373,9,101201),(8374,9,101261),(8375,9,102000),(8376,9,400051),(8377,9,400052),(8378,9,400053),(8379,9,400055); +/*!40000 ALTER TABLE `llx_user_rights` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup` +-- + +DROP TABLE IF EXISTS `llx_usergroup`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `note` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_name` (`nom`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup` +-- + +LOCK TABLES `llx_usergroup` WRITE; +/*!40000 ALTER TABLE `llx_usergroup` DISABLE KEYS */; +INSERT INTO `llx_usergroup` VALUES (1,'ggg',1,'2013-01-16 20:48:08','2013-01-16 19:48:08','ggg'); +/*!40000 ALTER TABLE `llx_usergroup` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_rights` +-- + +DROP TABLE IF EXISTS `llx_usergroup_rights`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_rights` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_usergroup` int(11) NOT NULL, + `fk_id` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `fk_usergroup` (`fk_usergroup`,`fk_id`), + CONSTRAINT `fk_usergroup_rights_fk_usergroup` FOREIGN KEY (`fk_usergroup`) REFERENCES `llx_usergroup` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_rights` +-- + +LOCK TABLES `llx_usergroup_rights` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_rights` DISABLE KEYS */; +INSERT INTO `llx_usergroup_rights` VALUES (1,1,2401),(2,1,2402),(3,1,2403),(4,1,2411),(5,1,2412),(6,1,2413); +/*!40000 ALTER TABLE `llx_usergroup_rights` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_user` +-- + +DROP TABLE IF EXISTS `llx_usergroup_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_user` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_user` int(11) NOT NULL, + `fk_usergroup` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_user` (`entity`,`fk_user`,`fk_usergroup`), + KEY `fk_usergroup_user_fk_user` (`fk_user`), + KEY `fk_usergroup_user_fk_usergroup` (`fk_usergroup`), + CONSTRAINT `fk_usergroup_user_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_usergroup_user_fk_usergroup` FOREIGN KEY (`fk_usergroup`) REFERENCES `llx_usergroup` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_user` +-- + +LOCK TABLES `llx_usergroup_user` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_user` DISABLE KEYS */; +INSERT INTO `llx_usergroup_user` VALUES (1,1,1,1); +/*!40000 ALTER TABLE `llx_usergroup_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ventilation_achat` +-- + +DROP TABLE IF EXISTS `llx_ventilation_achat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ventilation_achat` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_code_ventilation` int(11) DEFAULT NULL, + `fk_facture` int(11) DEFAULT NULL, + `fk_facture_fourn_det` int(11) DEFAULT NULL, + `ventilation` varchar(255) DEFAULT NULL, + `qty` double DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ventilation_achat` +-- + +LOCK TABLES `llx_ventilation_achat` WRITE; +/*!40000 ALTER TABLE `llx_ventilation_achat` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_ventilation_achat` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2014-04-05 16:31:13 diff --git a/dev/initdata/savedemo.sh b/dev/initdata/savedemo.sh index dc1141f504b..5426a6e6391 100755 --- a/dev/initdata/savedemo.sh +++ b/dev/initdata/savedemo.sh @@ -171,12 +171,14 @@ export list=" --ignore-table=$base.llx_abonne_extrafields --ignore-table=$base.llx_abonne_type --ignore-table=$base.llx_abonnement + --ignore-table=$base.llx_bootstrap --ignore-table=$base.llx_bt_namemap --ignore-table=$base.llx_bt_speedlimit --ignore-table=$base.llx_bt_summary --ignore-table=$base.llx_bt_timestamps --ignore-table=$base.llx_bt_webseedfiles --ignore-table=$base.llx_dolicloud_customers + --ignore-table=$base.llx_dolicloud_stats --ignore-table=$base.llx_c_dolicloud_plans --ignore-table=$base.llx_cabinetmed_c_banques --ignore-table=$base.llx_cabinetmed_c_ccam @@ -189,9 +191,15 @@ export list=" --ignore-table=$base.llx_cabinetmed_motifcons --ignore-table=$base.llx_cabinetmed_patient --ignore-table=$base.llx_cabinetmed_societe + --ignore-table=$base.llx_fournisseur_ca + --ignore-table=$base.llx_google_maps + --ignore-table=$base.llx_pos_paiement_ticket + --ignore-table=$base.llx_pos_places + --ignore-table=$base.llx_pos_ticket --ignore-table=$base.llx_publi_c_contact_list --ignore-table=$base.llx_publi_c_dnd_list - --ignore-table=$base.llx_publi_c_method_list + --ignore-table=$base.llx_publi_c_method_list + --ignore-table=$base.llx_ultimatepdf " echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile" mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile diff --git a/dev/iso-normes/countries_iso-3166_en.txt b/dev/iso-normes/countries_iso-3166_en.txt index 06e4befe2bd..b953435d1c9 100644 --- a/dev/iso-normes/countries_iso-3166_en.txt +++ b/dev/iso-normes/countries_iso-3166_en.txt @@ -10,7 +10,7 @@ # ISO-3166 alpha 3: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3 AFGHANISTAN;AF -LAND ISLANDS;AX +ÅLAND ISLANDS;AX ALBANIA;AL ALGERIA;DZ AMERICAN SAMOA;AS @@ -62,7 +62,7 @@ CONGO;CG CONGO, THE DEMOCRATIC REPUBLIC OF THE;CD COOK ISLANDS;CK COSTA RICA;CR -CTE D'IVOIRE;CI +CÔTE D'IVOIRE;CI CROATIA;HR CUBA;CU CYPRUS;CY @@ -192,7 +192,7 @@ REUNION;RE ROMANIA;RO RUSSIAN FEDERATION;RU RWANDA;RW -SAINT BARTHLEMY;BL +SAINT BARTHÉLEMY;BL SAINT HELENA;SH SAINT KITTS AND NEVIS;KN SAINT LUCIA;LC diff --git a/dev/iso-normes/countries_iso-3166_fr.txt b/dev/iso-normes/countries_iso-3166_fr.txt index d43cf816321..578c0f0effe 100644 --- a/dev/iso-normes/countries_iso-3166_fr.txt +++ b/dev/iso-normes/countries_iso-3166_fr.txt @@ -11,118 +11,118 @@ AFGHANISTAN;AF AFRIQUE DU SUD;ZA -LAND, LES;AX +ÅLAND, ÎLES;AX ALBANIE;AL -ALGRIE;DZ +ALGÉRIE;DZ ALLEMAGNE;DE ANDORRE;AD ANGOLA;AO ANGUILLA;AI ANTARCTIQUE;AQ ANTIGUA-ET-BARBUDA;AG -ANTILLES NERLANDAISES;AN +ANTILLES NÉERLANDAISES;AN ARABIE SAOUDITE;SA ARGENTINE;AR -ARMNIE;AM +ARMÉNIE;AM ARUBA;AW AUSTRALIE;AU AUTRICHE;AT -AZERBADJAN;AZ +AZERBAÏDJAN;AZ BAHAMAS;BS -BAHREN;BH +BAHREÏN;BH BANGLADESH;BD BARBADE;BB -BLARUS;BY +BÉLARUS;BY BELGIQUE;BE BELIZE;BZ -BNIN;BJ +BÉNIN;BJ BERMUDES;BM BHOUTAN;BT BOLIVIE;BO -BOSNIE-HERZGOVINE;BA +BOSNIE-HERZÉGOVINE;BA BOTSWANA;BW -BOUVET, LE;BV -BRSIL;BR -BRUNI DARUSSALAM;BN +BOUVET, ÎLE;BV +BRÉSIL;BR +BRUNÉI DARUSSALAM;BN BULGARIE;BG BURKINA FASO;BF BURUNDI;BI -CAMANES, LES;KY +CAÏMANES, ÎLES;KY CAMBODGE;KH CAMEROUN;CM CANADA;CA CAP-VERT;CV -CENTRAFRICAINE, RPUBLIQUE;CF +CENTRAFRICAINE, RÉPUBLIQUE;CF CHILI;CL CHINE;CN -CHRISTMAS, LE;CX +CHRISTMAS, ÎLE;CX CHYPRE;CY -COCOS (KEELING), LES;CC +COCOS (KEELING), ÎLES;CC COLOMBIE;CO COMORES;KM CONGO;CG -CONGO, LA RPUBLIQUE DMOCRATIQUE DU;CD -COOK, LES;CK -CORE, RPUBLIQUE DE;KR -CORE, RPUBLIQUE POPULAIRE DMOCRATIQUE DE;KP +CONGO, LA RÉPUBLIQUE DÉMOCRATIQUE DU;CD +COOK, ÎLES;CK +CORÉE, RÉPUBLIQUE DE;KR +CORÉE, RÉPUBLIQUE POPULAIRE DÉMOCRATIQUE DE;KP COSTA RICA;CR -CTE D'IVOIRE;CI +CÔTE D'IVOIRE;CI CROATIE;HR CUBA;CU DANEMARK;DK DJIBOUTI;DJ -DOMINICAINE, RPUBLIQUE;DO +DOMINICAINE, RÉPUBLIQUE;DO DOMINIQUE;DM -GYPTE;EG +ÉGYPTE;EG EL SALVADOR;SV -MIRATS ARABES UNIS;AE -QUATEUR;EC -RYTHRE;ER +ÉMIRATS ARABES UNIS;AE +ÉQUATEUR;EC +ÉRYTHRÉE;ER ESPAGNE;ES ESTONIE;EE -TATS-UNIS;US -THIOPIE;ET -FALKLAND, LES (MALVINAS);FK -FRO, LES;FO +ÉTATS-UNIS;US +ÉTHIOPIE;ET +FALKLAND, ÎLES (MALVINAS);FK +FÉROÉ, ÎLES;FO FIDJI;FJ FINLANDE;FI FRANCE;FR GABON;GA GAMBIE;GM -GORGIE;GE -GORGIE DU SUD ET LES LES SANDWICH DU SUD;GS +GÉORGIE;GE +GÉORGIE DU SUD ET LES ÎLES SANDWICH DU SUD;GS GHANA;GH GIBRALTAR;GI -GRCE;GR +GRÈCE;GR GRENADE;GD GROENLAND;GL GUADELOUPE;GP GUAM;GU GUATEMALA;GT GUERNESEY;GG -GUINE;GN -GUINE-BISSAU;GW -GUINE QUATORIALE;GQ +GUINÉE;GN +GUINÉE-BISSAU;GW +GUINÉE ÉQUATORIALE;GQ GUYANA;GY -GUYANE FRANAISE;GF -HATI;HT -HEARD, LE ET MCDONALD, LES;HM +GUYANE FRANÇAISE;GF +HAÏTI;HT +HEARD, ÎLE ET MCDONALD, ÎLES;HM HONDURAS;HN HONG-KONG;HK HONGRIE;HU -LE DE MAN;IM -LES MINEURES LOIGNES DES TATS-UNIS;UM -LES VIERGES BRITANNIQUES;VG -LES VIERGES DES TATS-UNIS;VI +ÎLE DE MAN;IM +ÎLES MINEURES ÉLOIGNÉES DES ÉTATS-UNIS;UM +ÎLES VIERGES BRITANNIQUES;VG +ÎLES VIERGES DES ÉTATS-UNIS;VI INDE;IN -INDONSIE;ID -IRAN, RPUBLIQUE ISLAMIQUE D';IR +INDONÉSIE;ID +IRAN, RÉPUBLIQUE ISLAMIQUE D';IR IRAQ;IQ IRLANDE;IE ISLANDE;IS -ISRAL;IL +ISRAËL;IL ITALIE;IT -JAMAQUE;JM +JAMAÏQUE;JM JAPON;JP JERSEY;JE JORDANIE;JO @@ -130,120 +130,120 @@ KAZAKHSTAN;KZ KENYA;KE KIRGHIZISTAN;KG KIRIBATI;KI -KOWET;KW -LAO, RPUBLIQUE DMOCRATIQUE POPULAIRE;LA +KOWEÏT;KW +LAO, RÉPUBLIQUE DÉMOCRATIQUE POPULAIRE;LA LESOTHO;LS LETTONIE;LV LIBAN;LB -LIBRIA;LR +LIBÉRIA;LR LIBYENNE, JAMAHIRIYA ARABE;LY LIECHTENSTEIN;LI LITUANIE;LT LUXEMBOURG;LU MACAO;MO -MACDOINE, L'EX-RPUBLIQUE YOUGOSLAVE DE;MK +MACÉDOINE, L'EX-RÉPUBLIQUE YOUGOSLAVE DE;MK MADAGASCAR;MG MALAISIE;MY MALAWI;MW MALDIVES;MV MALI;ML MALTE;MT -MARIANNES DU NORD, LES;MP +MARIANNES DU NORD, ÎLES;MP MAROC;MA -MARSHALL, LES;MH +MARSHALL, ÎLES;MH MARTINIQUE;MQ MAURICE;MU MAURITANIE;MR MAYOTTE;YT MEXIQUE;MX -MICRONSIE, TATS FDRS DE;FM -MOLDOVA, RPUBLIQUE DE;MD +MICRONÉSIE, ÉTATS FÉDÉRÉS DE;FM +MOLDOVA, RÉPUBLIQUE DE;MD MONACO;MC MONGOLIE;MN -MONTNGRO;ME +MONTÉNÉGRO;ME MONTSERRAT;MS MOZAMBIQUE;MZ MYANMAR;MM NAMIBIE;NA NAURU;NR -NPAL;NP +NÉPAL;NP NICARAGUA;NI NIGER;NE -NIGRIA;NG -NIU;NU -NORFOLK, LE;NF -NORVGE;NO -NOUVELLE-CALDONIE;NC -NOUVELLE-ZLANDE;NZ -OCAN INDIEN, TERRITOIRE BRITANNIQUE DE L';IO +NIGÉRIA;NG +NIUÉ;NU +NORFOLK, ÎLE;NF +NORVÈGE;NO +NOUVELLE-CALÉDONIE;NC +NOUVELLE-ZÉLANDE;NZ +OCÉAN INDIEN, TERRITOIRE BRITANNIQUE DE L';IO OMAN;OM OUGANDA;UG -OUZBKISTAN;UZ +OUZBÉKISTAN;UZ PAKISTAN;PK PALAOS;PW -PALESTINIEN OCCUP, TERRITOIRE;PS +PALESTINIEN OCCUPÉ, TERRITOIRE;PS PANAMA;PA -PAPOUASIE-NOUVELLE-GUINE;PG +PAPOUASIE-NOUVELLE-GUINÉE;PG PARAGUAY;PY PAYS-BAS;NL -PROU;PE +PÉROU;PE PHILIPPINES;PH PITCAIRN;PN POLOGNE;PL -POLYNSIE FRANAISE;PF +POLYNÉSIE FRANÇAISE;PF PORTO RICO;PR PORTUGAL;PT QATAR;QA -RUNION;RE +RÉUNION;RE ROUMANIE;RO ROYAUME-UNI;GB -RUSSIE, FDRATION DE;RU +RUSSIE, FÉDÉRATION DE;RU RWANDA;RW SAHARA OCCIDENTAL;EH -SAINT-BARTHLEMY;BL -SAINTE-HLNE;SH +SAINT-BARTHÉLEMY;BL +SAINTE-HÉLÈNE;SH SAINTE-LUCIE;LC SAINT-KITTS-ET-NEVIS;KN SAINT-MARIN;SM SAINT-MARTIN;MF SAINT-PIERRE-ET-MIQUELON;PM -SAINT-SIGE (TAT DE LA CIT DU VATICAN);VA +SAINT-SIÈGE (ÉTAT DE LA CITÉ DU VATICAN);VA SAINT-VINCENT-ET-LES GRENADINES;VC -SALOMON, LES;SB +SALOMON, ÎLES;SB SAMOA;WS -SAMOA AMRICAINES;AS -SAO TOM-ET-PRINCIPE;ST -SNGAL;SN +SAMOA AMÉRICAINES;AS +SAO TOMÉ-ET-PRINCIPE;ST +SÉNÉGAL;SN SERBIE;RS SEYCHELLES;SC SIERRA LEONE;SL SINGAPOUR;SG SLOVAQUIE;SK -SLOVNIE;SI +SLOVÉNIE;SI SOMALIE;SO SOUDAN;SD SRI LANKA;LK -SUDE;SE +SUÈDE;SE SUISSE;CH SURINAME;SR -SVALBARD ET LE JAN MAYEN;SJ +SVALBARD ET ÎLE JAN MAYEN;SJ SWAZILAND;SZ -SYRIENNE, RPUBLIQUE ARABE;SY +SYRIENNE, RÉPUBLIQUE ARABE;SY TADJIKISTAN;TJ -TAWAN, PROVINCE DE CHINE;TW -TANZANIE, RPUBLIQUE-UNIE DE;TZ +TAÏWAN, PROVINCE DE CHINE;TW +TANZANIE, RÉPUBLIQUE-UNIE DE;TZ TCHAD;TD -TCHQUE, RPUBLIQUE;CZ -TERRES AUSTRALES FRANAISES;TF -THALANDE;TH +TCHÈQUE, RÉPUBLIQUE;CZ +TERRES AUSTRALES FRANÇAISES;TF +THAÏLANDE;TH TIMOR-LESTE;TL TOGO;TG TOKELAU;TK TONGA;TO -TRINIT-ET-TOBAGO;TT +TRINITÉ-ET-TOBAGO;TT TUNISIE;TN -TURKMNISTAN;TM -TURKS ET CAQUES, LES;TC +TURKMÉNISTAN;TM +TURKS ET CAÏQUES, ÎLES;TC TURQUIE;TR TUVALU;TV UKRAINE;UA @@ -252,6 +252,6 @@ VANUATU;VU VENEZUELA;VE VIET NAM;VN WALLIS ET FUTUNA;WF -YMEN;YE +YÉMEN;YE ZAMBIE;ZM ZIMBABWE;ZW \ No newline at end of file diff --git a/dev/iso-normes/currencies_iso-4217.txt b/dev/iso-normes/currencies_iso-4217.txt index 6c0a13feff3..bc392b72e9c 100644 --- a/dev/iso-normes/currencies_iso-4217.txt +++ b/dev/iso-normes/currencies_iso-4217.txt @@ -135,7 +135,7 @@ SKK,Slovak Koruna,2 SLL,Sierra Leone Leone,2 SOS,Somali Shilling,2 SRD,Surinam Dollar,2 -STD,So Tome and Principe Dobra,2 +STD,São Tome and Principe Dobra,2 SVC,El Salvador Colon,2 SYP,Syrian Pound,2 SZL,Swaziland Lilangeni,2 diff --git a/dev/iso-normes/locales.txt b/dev/iso-normes/locales.txt index 676427e2da3..cb39e45ec0d 100644 --- a/dev/iso-normes/locales.txt +++ b/dev/iso-normes/locales.txt @@ -1,2 +1,9 @@ -See page http://demo.icu-project.org/icu-bin/locexp?d_=fr +For languages: +http://demo.icu-project.org/icu-bin/locexp?d_=fr + +For format number: +http://en.wikipedia.org/wiki/Decimal_mark + +For date format: +http://en.wikipedia.org/wiki/Date_format_by_country \ No newline at end of file diff --git a/dev/iso-normes/vat_number_names.txt b/dev/iso-normes/vat_number_names.txt new file mode 100644 index 00000000000..23fce59ed3b --- /dev/null +++ b/dev/iso-normes/vat_number_names.txt @@ -0,0 +1 @@ +http://en.wikipedia.org/wiki/VAT_identification_number \ No newline at end of file diff --git a/dev/resize_window.sh b/dev/resize_window.sh index a26acd796de..0ac7c908ef5 100755 --- a/dev/resize_window.sh +++ b/dev/resize_window.sh @@ -8,7 +8,7 @@ # Syntax if [ "x$1" = "x" ] then - echo "resize_windows.sh (list|0x99999999)" + echo "resize_windows.sh (list|0x99999999) [1280 1024]" fi # To list all windows @@ -20,7 +20,19 @@ fi # To resize a specific window if [ "x$1" != "xlist" -a "x$1" != "x" ] then - wmctrl -i -r $1 -e 0,0,0,1280,1024 - echo Size of windows $1 modified + if [ "x$2" = "x" ] + then + width=1280 + else + width=$2 + fi + if [ "x$3" = "x" ] + then + height=1024 + else + height=$3 + fi + wmctrl -i -r $1 -e 0,0,0,$width,$height + echo Size of windows $1 modified to $width x $height fi diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 17fa97ec523..b57124da396 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -77,7 +77,7 @@ class modMyModule extends DolibarrModules // 'login' => 0, // Set this to 1 if module has its own login method directory (core/login) // 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions) // 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus) - // 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme) + // 'theme' => 0, // Set this to 1 if module has its own theme directory (theme) // 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl) // 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode) // 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx) @@ -97,8 +97,10 @@ class modMyModule extends DolibarrModules $this->config_page_url = array("mysetuppage.php@mymodule"); // Dependencies + $this->hidden = false; // A condition to hide module $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array(); // List of modules id this module is in conflict with $this->phpmin = array(5,0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module $this->langfiles = array("mylangfile@mymodule"); @@ -242,7 +244,7 @@ class modMyModule extends DolibarrModules { $sql = array(); - $result=$this->load_tables(); + $result=$this->_load_tables('/mymodule/sql/'); return $this->_init($sql, $options); } @@ -262,19 +264,6 @@ class modMyModule extends DolibarrModules return $this->_remove($sql, $options); } - - /** - * Create tables, keys and data required by module - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys - * and create data commands must be stored in directory /mymodule/sql/ - * This function is called by this->init - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return $this->_load_tables('/mymodule/sql/'); - } } -?> +?> \ No newline at end of file diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 9a0bbbd23c7..32c610aff96 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -37,12 +37,10 @@ // Change this following line to use the correct relative path (../, ../../, etc) $res=0; -if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; -if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; -if (! $res && file_exists("../../../main.inc.php")) $res=@include '../../../main.inc.php'; +if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory +if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only -if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only if (! $res) die("Include of main fails"); // Change this following line to use the correct relative path from htdocs dol_include_once('/module/class/skeleton_class.class.php'); diff --git a/dev/skeletons/skeleton_script.php b/dev/skeletons/skeleton_script.php index 083e7ef680b..4f8eb20cb6b 100644 --- a/dev/skeletons/skeleton_script.php +++ b/dev/skeletons/skeleton_script.php @@ -31,10 +31,10 @@ $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; + exit(-1); } -// Init global variables +// Global variables $version='1.0'; $error=0; @@ -57,10 +57,10 @@ if (! $result > 0) { dol_print_error('',$user->error); exit; } $user->getrights(); -print "***** ".$script_file." (".$version.") *****\n"; +print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; if (! isset($argv[1])) { // Check parameters print "Usage: ".$script_file." param1 param2 ...\n"; - exit; + exit(-1); } print '--- start'."\n"; print 'Argument 1='.$argv[1]."\n"; @@ -163,5 +163,5 @@ else $db->close(); // Close $db database opened handler -return $error; -?> +exit($error); +?> \ No newline at end of file diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 06b458811ab..288cda7101d 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -154,14 +154,14 @@ class autoTranslator if (isset($this->_translatedFiles[$file]) && count($this->_translatedFiles[$file])>0) { $fp = fopen($destPath, 'a'); - fwrite($fp, "\r\n"); - fwrite($fp, "\r\n"); - fwrite($fp, "// START - Lines generated via autotranslator.php tool (".$this->_time.").\r\n"); - fwrite($fp, "// Reference language: ".$this->_refLang." -> ".$my_destlang."\r\n"); + fwrite($fp, "\n"); + fwrite($fp, "\n"); + fwrite($fp, "// START - Lines generated via autotranslator.php tool (".$this->_time.").\n"); + fwrite($fp, "// Reference language: ".$this->_refLang." -> ".$my_destlang."\n"); foreach( $this->_translatedFiles[$file] as $line) { - fwrite($fp, $line . "\r\n"); + fwrite($fp, $line . "\n"); } - fwrite($fp, "// STOP - Lines generated via autotranslator.php tool (".$this->_time_end.").\r\n"); + fwrite($fp, "// STOP - Lines generated via autotranslator.php tool (".$this->_time_end.").\n"); fclose($fp); } return; @@ -177,11 +177,11 @@ class autoTranslator private function createTranslationFile($path,$my_destlang) { $fp = fopen($path, 'w+'); - fwrite($fp, "/*\r\n"); - fwrite($fp, " * Language code: {$my_destlang}\r\n"); - fwrite($fp, " * Automatic generated via autotranslator.php tool\r\n"); - fwrite($fp, " * Generation date " . $this->_time. "\r\n"); - fwrite($fp, " */\r\n"); + fwrite($fp, "/*\n"); + fwrite($fp, " * Language code: {$my_destlang}\n"); + fwrite($fp, " * Automatic generated via autotranslator.php tool\n"); + fwrite($fp, " * Generation date " . $this->_time. "\n"); + fwrite($fp, " */\n"); fclose($fp); return; } diff --git a/dev/translation/txpull.sh b/dev/translation/txpull.sh new file mode 100755 index 00000000000..0521f68c3b9 --- /dev/null +++ b/dev/translation/txpull.sh @@ -0,0 +1,32 @@ +#!/bin/sh +#------------------------------------------------------ +# Script to pull language files to Transifex +# +# Laurent Destailleur - eldy@users.sourceforge.net +#------------------------------------------------------ +# Usage: txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] +#------------------------------------------------------ + +# Syntax +if [ "x$1" = "x" ] +then + echo "This pull remote transifex files to local dir." + echo "Note: If you pull a language file (not source), file will be skipped if local file is newer." + echo " Using -f will overwrite local file (does not work with 'all')." + echo "Usage: txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]" + exit +fi + + +if [ "x$1" = "xall" ] +then + for fic in ar_SA bg_BG ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE fa_IR fi_FI fr_FR he_IL hu_HU is_IS it_IT ja_JP ko_KR lv_LV nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sv_SE tr_TR uz_UZ vi_VN zh_CN zh_TW + do + echo "tx pull -l $fic $2 $3" + tx pull -l $fic $2 $3 + done +else + echo "tx pull -l $1 $2 $3 $4" + tx pull -l $1 $2 $3 $4 +fi + diff --git a/dev/translation/txpush.sh b/dev/translation/txpush.sh new file mode 100755 index 00000000000..8a21b0d970c --- /dev/null +++ b/dev/translation/txpush.sh @@ -0,0 +1,37 @@ +#!/bin/sh +#------------------------------------------------------ +# Script to push language files to Transifex +# +# Laurent Destailleur - eldy@users.sourceforge.net +#------------------------------------------------------ +# Usage: txpush.sh (source|all|xx_XX) [-r dolibarr.file] [-f] +#------------------------------------------------------ + +# Syntax +if [ "x$1" = "x" ] +then + echo "This push local files to transifex." + echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer." + echo " Using -f will overwrite translation but not memory." + echo "Usage: txpush.sh (source|all|xx_XX) [-r dolibarr.file] [-f] [--no-interactive]" + exit +fi + + +if [ "x$1" = "xall" ] +then + for fic in ar_SA bg_BG ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE fa_IR fi_FI fr_FR he_IL hu_HU is_IS it_IT ja_JP ko_KR lv_LV nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sv_SE tr_TR uz_UZ vi_VN zh_CN zh_TW + do + echo "tx push --skip -t -l $fic $2 $3" + tx push --skip -t -l $fic $2 $3 + done +else +if [ "x$1" = "xsource" ] +then + echo "tx push -s $2 $3" + tx push -s $2 $3 +else + echo "tx push --skip -t -l $1 $2 $3 $4" + tx push --skip -t -l $1 $2 $3 $4 +fi +fi diff --git a/doc/images/dolibarr_screenshot1_300x188.png b/doc/images/dolibarr_screenshot1_300x188.png new file mode 100644 index 00000000000..51c949ee67e Binary files /dev/null and b/doc/images/dolibarr_screenshot1_300x188.png differ diff --git a/doc/images/dolibarr_screenshot1_640x400.png b/doc/images/dolibarr_screenshot1_640x400.png new file mode 100644 index 00000000000..9ed384263ad Binary files /dev/null and b/doc/images/dolibarr_screenshot1_640x400.png differ diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 71f6cbb52ad..6534ac09ac3 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -102,6 +102,8 @@ if ($action == 'unset') * View */ +$form = new Form($db); + $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; llxHeader('',$langs->trans("MembersSetup"),$help_url); @@ -127,23 +129,19 @@ print ''.$langs->trans("Value").''; print ''.$langs->trans("Action").''; print "\n"; $var=true; -$form = new Form($db); // Login/Pass required for members -if ($conf->global->MAIN_FEATURES_LEVEL > 0) -{ - $var=!$var; - print '
'; - print ''; - print ''; - print ''; - print ''.$langs->trans("AdherentLoginRequired").''; - print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1); - print ''; - print ''; - print "\n"; - print '
'; -} +$var=!$var; +print '
'; +print ''; +print ''; +print ''; +print ''.$langs->trans("AdherentLoginRequired").''; +print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1); +print ''; +print ''; +print "\n"; +print '
'; // Mail required for members $var=!$var; @@ -297,4 +295,4 @@ dol_fiche_end(); llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 34420ee0121..25139697955 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -50,7 +50,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index ce2787752a7..5fdd9ff2a39 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 2d577270677..99aa24abcd0 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -17,14 +17,13 @@ */ /** - * \file htdocs/contact/canvas/actions_adherentcard_common.class.php - * \ingroup thirdparty + * \file htdocs/adherents/canvas/actions_adherentcard_common.class.php + * \ingroup adherent * \brief Fichier de la classe Adherent card controller (common) */ /** - * \class ActionsAdherentCardCommon - * \brief Classe permettant la gestion des adherents par defaut + * Class to maage members using default canvas */ abstract class ActionsAdherentCardCommon { diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index cf5ed660a32..3aeb77d8832 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -368,7 +368,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ $vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription); } //print xx".$vattouse." - ".$mysoc." - ".$customer;exit; - $result=$invoice->addline($invoice->id,$label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1); + $result=$invoice->addline($label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1); if ($result <= 0) { $errmsg=$invoice->error; @@ -528,7 +528,7 @@ if ($rowid) print ''.$langs->trans("UserTitle").''.$object->getCivilityLabel().' '; print ''; - // Name + // Lastname print ''.$langs->trans("Lastname").''.$object->lastname.' '; print ''; @@ -536,6 +536,9 @@ if ($rowid) print ''.$langs->trans("Firstname").''.$object->firstname.' '; print ''; + // EMail + print ''.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).''; + // Status print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; @@ -697,7 +700,7 @@ if ($rowid) { $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ""; $cotisationstatic->ref=$objp->crowid; $cotisationstatic->id=$objp->crowid; print ''.$cotisationstatic->getNomUrl(1).''; @@ -810,7 +813,8 @@ if ($rowid) $name = $object->getFullName($langs); if (! empty($name)) { - if ($object->societe) $name.=' ('.$object->societe.')'; + if ($object->morphy == 'mor' && ! empty($object->societe)) $name=$object->societe.' ('.$name.')'; + else if ($object->societe) $name.=' ('.$object->societe.')'; } else { @@ -820,8 +824,7 @@ if ($rowid) // Create a form array $formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); - if ($ret == 'html') print '
'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index e60a76bd936..ab964100c04 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -107,8 +107,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg '%MONTH%'=>$month, '%DAY%'=>$day, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, - '%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/", - '%SOCIETE%'=>$objp->company + '%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/" ); complete_substitutions_array($substitutionarray, $langs); @@ -204,7 +203,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg dol_print_error($db); } - if (! $mesg) + if (! $mesg) { $db->close(); exit; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 61ee312d61f..f82f3005514 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -27,8 +27,6 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -67,6 +65,7 @@ class Adherent extends CommonObject var $country; var $email; + var $skype; var $phone; var $phone_perso; var $phone_mobile; @@ -268,6 +267,9 @@ class Adherent extends CommonObject $now=dol_now(); + // Clean parameters + $this->import_key = trim($this->import_key); + // Check parameters if (! empty($conf->global->ADHERENT_MAIL_REQUIRED) && ! isValidEMail($this->email)) { @@ -289,7 +291,7 @@ class Adherent extends CommonObject // Insert member $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent"; - $sql.= " (datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity)"; + $sql.= " (datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity,import_key)"; $sql.= " VALUES ("; $sql.= " '".$this->db->idate($this->datec)."'"; $sql.= ", ".($this->login?"'".$this->db->escape($this->login)."'":"null"); @@ -297,6 +299,7 @@ class Adherent extends CommonObject $sql.= ", null, null, '".$this->morphy."'"; $sql.= ", '".$this->typeid."'"; $sql.= ", ".$conf->entity; + $sql.= ", ".(! empty($this->import_key) ? "'".$this->import_key."'":"null"); $sql.= ")"; dol_syslog(get_class($this)."::create sql=".$sql); @@ -428,6 +431,7 @@ class Adherent extends CommonObject $sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null"); $sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null"); $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_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null"); @@ -524,6 +528,7 @@ class Adherent extends CommonObject $luser->societe_id=$this->societe; $luser->email=$this->email; + $luser->skype=$this->skype; $luser->office_phone=$this->phone; $luser->user_mobile=$this->phone_mobile; @@ -562,7 +567,8 @@ class Adherent extends CommonObject $lthirdparty->zip=$this->zip; $lthirdparty->town=$this->town; $lthirdparty->email=$this->email; - $lthirdparty->tel=$this->phone; + $lthirdparty->skype=$this->skype; + $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; $lthirdparty->country_id=$this->country_id; @@ -1000,6 +1006,36 @@ class Adherent extends CommonObject } } + /** + * Method to load member from its name + * + * @param string $firstname Firstname + * @param string $lastname Lastname + * @return void + */ + function fetch_name($firstname,$lastname) + { + global $conf; + + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; + $sql.= " WHERE firstname='".$this->db->escape($firstname)."'"; + $sql.= " AND lastname='".$this->db->escape($lastname)."'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + $this->fetch($obj->rowid); + } + } + else + { + dol_print_error($this->db); + } + } /** * Load member from database @@ -1007,14 +1043,15 @@ class Adherent extends CommonObject * @param int $rowid Id of object to load * @param string $ref To load member from its ref * @param int $fk_soc To load member from its link to third party + * @param int $ref_ext External reference * @return int >0 if OK, 0 if not found, <0 if KO */ - function fetch($rowid,$ref='',$fk_soc='') + function fetch($rowid,$ref='',$fk_soc='',$ref_ext='') { global $langs; $sql = "SELECT d.rowid, d.ref_ext, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; - $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; + $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,"; $sql.= " d.tms as datem,"; @@ -1038,6 +1075,10 @@ class Adherent extends CommonObject if ($ref) $sql.= " AND d.rowid='".$ref."'"; elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'"; } + elseif ($ref_ext) + { + $sql.= " AND d.ref_ext='".$this->db->escape($ref_ext)."'"; + } dol_syslog(get_class($this)."::fetch sql=".$sql); $resql=$this->db->query($sql); @@ -1078,6 +1119,7 @@ class Adherent extends CommonObject $this->phone_perso = $obj->phone_perso; $this->phone_mobile = $obj->phone_mobile; $this->email = $obj->email; + $this->skype = $obj->skype; $this->photo = $obj->photo; $this->statut = $obj->statut; @@ -1101,12 +1143,10 @@ class Adherent extends CommonObject // Retreive all extrafield for thirdparty // fetch optionals attributes and labels - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - if (count($extralabels)>0) { - $this->fetch_optionals($this->id,$extralabels); - } + $this->fetch_optionals($this->id,$extralabels); // Load other properties $result=$this->fetch_subscriptions(); @@ -1140,6 +1180,8 @@ class Adherent extends CommonObject { global $langs; + require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; + $sql = "SELECT c.rowid, c.fk_adherent, c.cotisation, c.note, c.fk_bank,"; $sql.= " c.tms as datem,"; $sql.= " c.datec as datec,"; @@ -1209,6 +1251,8 @@ class Adherent extends CommonObject { global $conf,$langs,$user; + require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; + $error=0; // Clean parameters @@ -1300,7 +1344,7 @@ class Adherent extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $sql.= " statut = 1"; - $sql.= ", datevalid = ".$this->db->idate($now); + $sql.= ", datevalid = '".$this->db->idate($now)."'"; $sql.= ", fk_user_valid=".$user->id; $sql.= " WHERE rowid = ".$this->id; @@ -1380,8 +1424,7 @@ class Adherent extends CommonObject /** - * Fonction qui ajoute l'adherent aux abonnements automatiques mailing-list, spip, etc. - * TODO Move this into member creation trigger (trigger of mailmanspip module) + * Function to add member into external tools mailing-list, spip, etc. * * @return int <0 if KO, >0 if OK */ @@ -1400,7 +1443,7 @@ class Adherent extends CommonObject $result=$mailmanspip->add_to_mailman($this); if ($result < 0) { - $this->error=$mailmanspip->error; + if (! empty($mailmanspip->error)) $this->errors[]=$mailmanspip->error; $err+=1; } foreach ($mailmanspip->mladded_ko as $tmplist => $tmpemail) @@ -1421,7 +1464,7 @@ class Adherent extends CommonObject $result=$mailmanspip->add_to_spip($this); if ($result < 0) { - $this->error=$mailmanspip->error; + $this->errors[]=$mailmanspip->error; $err+=1; } } @@ -1437,8 +1480,7 @@ class Adherent extends CommonObject /** - * Fonction qui supprime l'adherent des abonnements automatiques mailing-list, spip, etc. - * TODO Move this into member deletion trigger (trigger of mailmanspip module) + * Function to delete a member from external tools like mailing-list, spip, etc. * * @return int <0 if KO, >0 if OK */ @@ -1457,7 +1499,7 @@ class Adherent extends CommonObject $result=$mailmanspip->del_to_mailman($this); if ($result < 0) { - $this->error=$mailmanspip->error; + if (! empty($mailmanspip->error)) $this->errors[]=$mailmanspip->error; $err+=1; } @@ -1478,6 +1520,7 @@ class Adherent extends CommonObject $result=$mailmanspip->del_to_spip($this); if ($result < 0) { + $this->errors[]=$mailmanspip->error; $err+=1; } } @@ -1502,7 +1545,7 @@ class Adherent extends CommonObject { global $langs; $langs->load("dict"); - + $code=(! empty($this->civilite_id)?$this->civilite_id:(! empty($this->civility_id)?$this->civility_id:'')); if (empty($code)) return ''; return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); @@ -1663,6 +1706,7 @@ class Adherent extends CommonObject { $this->nb["members"]=$obj->nb; } + $this->db->free($resql); return 1; } else @@ -1743,6 +1787,7 @@ class Adherent extends CommonObject $this->country = 'France'; $this->morphy = 1; $this->email = 'specimen@specimen.com'; + $this->skype = 'tom.hanson'; $this->phone = '0999999999'; $this->phone_perso = '0999999998'; $this->phone_mobile = '0999999997'; @@ -1814,6 +1859,7 @@ class Adherent extends CommonObject if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town; if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email; + if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype; if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; 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; diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php index 2efa3d20d39..012a3b60bd0 100644 --- a/htdocs/adherents/class/cotisation.class.php +++ b/htdocs/adherents/class/cotisation.class.php @@ -96,9 +96,9 @@ class Cotisation extends CommonObject /** - * Fonction qui permet de recuperer une cotisation + * Method to load a subscription * - * @param int $rowid Id cotisation + * @param int $rowid Id subscription * @return int <0 if KO, =0 if not found, >0 if OK */ function fetch($rowid) @@ -111,7 +111,7 @@ class Cotisation extends CommonObject $sql.=" FROM ".MAIN_DB_PREFIX."cotisation"; $sql.=" WHERE rowid=".$rowid; - dol_syslog("Cotisation::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -166,7 +166,7 @@ class Cotisation extends CommonObject $sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null'); $sql .= " WHERE rowid = ".$this->id; - dol_syslog("Cotisation::update sql=".$sql); + dol_syslog(get_class($this)."::update sql=".$sql); $resql = $this->db->query($sql); if ($resql) { @@ -181,7 +181,7 @@ class Cotisation extends CommonObject { $this->db->rollback(); $this->error=$this->db->error(); - dol_syslog("Cotisation::update ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); return -1; } } @@ -205,7 +205,7 @@ class Cotisation extends CommonObject $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."cotisation WHERE rowid = ".$this->id; - dol_syslog("Cotisation::delete sql=".$sql); + dol_syslog(get_class($this)."::delete sql=".$sql); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index 13167439704..330bedf4862 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -138,7 +138,7 @@ if ($result) print "
"; print ''; } - print ""; + print ""; // Ref print ''.$cotisation->getNomUrl(1).''; @@ -171,7 +171,6 @@ if ($result) { print ''; print ''; - $form = new Form($db); $form->select_comptes('','accountid',0,'',1); print '
'; $form->select_types_paiements('','paymenttypeid'); diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 3df950ad187..a95063e9d64 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -60,47 +61,31 @@ 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); +$result=$object->fetch($id); +if ($result < 0) +{ + dol_print_error($db); + exit; +} /* * Actions */ -// Envoie fichier -if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - dol_add_file_process($upload_dir,0,1,'userfile'); -} - -// Suppression fichier -if ($action == 'confirm_deletefile' && $confirm == 'yes') -{ - $langs->load("other"); - $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; -} +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; /* * View */ -$form = new Form($db); -$object=new Adherent($db); -$membert=new AdherentType($db); llxHeader(); if ($id > 0) { - $result=$object->fetch($id); $result=$membert->fetch($object->typeid); if ($result > 0) { @@ -180,24 +165,10 @@ if ($id > 0) print '
'; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '
'; - } - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/adherents/document.php?id='.$object->id,'',0,0,$user->rights->adherent->creer,50,$object); - - - // List of document - $formfile->list_of_documents($filearray,$object,'member','', 0, get_exdir($object->id,2,0,1).'/'.$object->id.'/'); - + $modulepart = 'member'; + $permission = $user->rights->adherent->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; print "

"; } else diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index bca9710c2c7..99a89ff0d1e 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -285,6 +285,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->phone_perso = trim($_POST["phone_perso"]); $object->phone_mobile= trim($_POST["phone_mobile"]); $object->email = trim($_POST["email"]); + $object->skype = trim($_POST["skype"]); $object->birth = $birthdate; $object->typeid = $_POST["typeid"]; @@ -320,6 +321,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $result=$object->update($user,0,$nosyncuser,$nosyncuserpass); if ($result >= 0 && ! count($object->errors)) { + // Logo/Photo save $dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1).'/photos'; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if ($file_OK) @@ -360,35 +362,21 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $errmsgs[] = "ErrorBadImageFormat"; } } - - // Rajoute l'utilisateur dans les divers abonnements (mailman, spip, etc...) - if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) + else { - if ($object->oldcopy->email != $object->email) // If email has changed we delete mailman subscription for old email + switch($_FILES['photo']['error']) { - if ($object->oldcopy->del_to_abo() < 0) - { - if (! empty($object->oldcopy->error)) setEventMessage($langs->trans("ErrorFailedToRemoveToMailmanList").': '.$object->oldcopy->error, 'errors'); - setEventMessage($object->oldcopy->errors, 'errors'); - } - else - { - setEventMessage($object->oldcopy->mesgs,'mesgs'); - } - } - // We add subscription if new email or new type (new type may means more mailing-list to subscribe) - if ($object->add_to_abo() < 0) - { - if (! empty($object->error)) setEventMessage($langs->trans("ErrorFailedToAddToMailmanList").': '.$object->error, 'errors'); - setEventMessage($object->errors, 'errors'); - } - else - { - setEventMessage($object->mesgs, 'mesgs'); + case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini + case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form + $errors[] = "ErrorFileSizeTooLarge"; + break; + case 3: //uploaded file was only partially uploaded + $errors[] = "ErrorFilePartiallyUploaded"; + break; } } - $rowid=$object->id; + $rowid=$object->id; $action=''; if (! empty($backtopage)) @@ -440,6 +428,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $phone=$_POST["phone"]; $phone_perso=$_POST["phone_perso"]; $phone_mobile=$_POST["phone_mobile"]; + $skype=$_POST["member_skype"]; $email=$_POST["member_email"]; $login=$_POST["member_login"]; $pass=$_POST["password"]; @@ -464,6 +453,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $object->phone = $phone; $object->phone_perso = $phone_perso; $object->phone_mobile= $phone_mobile; + $object->skype = $skype; $object->email = $email; $object->login = $login; $object->pass = $pass; @@ -602,15 +592,6 @@ if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == $errmsg.=$object->error; } } - - // Add user to other systems (mailman, spip, etc...) - // TODO Move this into trigger on validate action - if (! $error && $object->add_to_abo() < 0) - { - $langs->load("errors"); - $error++; - $errmsg.= $langs->trans("ErrorFailedToAddToMailmanList").': '.$object->error." ".join(',',$object->errors)."
\n"; - } } else { @@ -649,13 +630,6 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_resign') { $errmsg.=$object->error; } - - // supprime l'utilisateur des divers abonnements .. - if ($object->del_to_abo() < 0) - { - // error - $errmsg.=$langs->trans("FaildToRemoveFromMailmanList").': '.$object->error."
\n"; - } } else { @@ -698,7 +672,7 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm /* * View -*/ + */ $form = new Form($db); $formcompany = new FormCompany($db); @@ -736,7 +710,7 @@ else /* */ /* ************************************************************************** */ $object->canvas=$canvas; - $object->state_id = GETPOST('departement_id', 'int'); + $object->state_id = GETPOST('state_id', 'int'); // We set country_id, country_code and country for the selected country $object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id; @@ -831,6 +805,9 @@ else print ''.$langs->trans("Firstname").''; print ''; + // EMail + print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').''; + // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { @@ -884,8 +861,11 @@ else // Tel mobile print ''.$langs->trans("PhoneMobile").''; - // EMail - print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").''; + } // Birthday print "".$langs->trans("Birthday")."\n"; @@ -1078,6 +1058,9 @@ else print ''.$langs->trans("Firstname").'firstname).'">'; print ''; + // EMail + print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'email).'">'; + // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { @@ -1120,8 +1103,11 @@ else // Tel mobile print ''.$langs->trans("PhoneMobile").'phone_mobile).'">'; - // EMail - print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'email).'">'; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").'skype).'">'; + } // Birthday print "".$langs->trans("Birthday")."\n"; @@ -1237,8 +1223,7 @@ else if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); } - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); - if ($ret == 'html') print '
'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); } // Confirm create third party @@ -1257,8 +1242,7 @@ else // Create a form array $formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); - if ($ret == 'html') print '
'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } // Confirm validate member @@ -1288,10 +1272,10 @@ else // Cree un tableau formulaire $formquestion=array(); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false)); - if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { + if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_MAILMAN)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); } - if (! empty($conf->global->ADHERENT_USE_SPIP)) { + if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1); @@ -1331,8 +1315,7 @@ else $formquestion=array(); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false')); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); - $ret=$form->form_confirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); - if ($ret == 'html') print '
'; + print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); } // Confirm remove member @@ -1340,31 +1323,29 @@ else { $formquestion=array(); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); - $ret=$form->form_confirm("fiche.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1); - if ($ret == 'html') print '
'; + print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1); } /* * Confirm add in spip - */ + */ if ($action == 'add_spip') { - $ret=$form->form_confirm("fiche.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip'); - if ($ret == 'html') print '
'; + print $form->formconfirm("fiche.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip'); } /* * Confirm removed from spip - */ + */ if ($action == 'del_spip') { - $ret=$form->form_confirm("fiche.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip'); - if ($ret == 'html') print '
'; + print $form->formconfirm("fiche.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip'); } $rowspan=17; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; + if (! empty($conf->skype->enabled)) $rowspan++; print ''; @@ -1404,13 +1385,16 @@ else print ''; print ''; - // Name + // Lastname print ''; print ''; // Firstname print ''; + // EMail + print ''; + // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { @@ -1444,8 +1428,11 @@ else // Tel mobile print ''; - // EMail - print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } // Birthday print ''; diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index ba322457eea..8f8bfbfb413 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -291,8 +291,7 @@ if ($rowid && $action != 'edit') //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text=$langs->trans("ConfirmDeleteSubscription"); if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1); - if ($ret == 'html') print '
'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1); } print ''; diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index fd10d0e14de..59ed0b36e84 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -135,15 +135,15 @@ print ''; print ''; print "\n"; $var=false; -print ""; +print ""; print ''; -print ""; +print ""; print ''; -print ""; +print ""; print ''; @@ -338,7 +338,7 @@ print "\n"; foreach ($AdherentType as $key => $adhtype) { $var=!$var; - print ""; + print ""; print ''; print ''; print ''; @@ -402,7 +402,7 @@ krsort($Total); foreach ($Total as $key=>$value) { $var=!$var; - print ""; + print ""; print ""; print ""; print ""; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index d4beb3ecdd9..3a34403425f 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2013 Raphaël Doursenaud * * This program is free software; you can redistribute it and/or modify @@ -183,16 +183,17 @@ if ($resql) if ($type > 0) { $membertype=new AdherentType($db); - $result=$membertype->fetch($_REQUEST["type"]); + $result=$membertype->fetch(GETPOST("type")); $titre.=" (".$membertype->libelle.")"; } $param=""; - if (isset($_GET["statut"])) $param.="&statut=".$statut; + if ($statut != "") $param.="&statut=".$statut; if ($search_nom) $param.="&search_nom=".$search_nom; if ($search_login) $param.="&search_login=".$search_login; if ($search_email) $param.="&search_email=".$search_email; if ($filter) $param.="&filter=".$filter; + if ($type > 0) $param.="&type=".$type; print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); if ($sall) @@ -200,7 +201,7 @@ if ($resql) 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; } - print ''; + print ''; print "
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("SearchAMember").'
'; print $langs->trans("Ref").':'; print '
'; print $langs->trans("Name").':'; print '
'; print $langs->trans("Other").':'; print '
'.$adhtype->getNomUrl(1, dol_size(32)).''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'
$key".$Number[$key]."".price($value)."
"; // Filter on categories @@ -256,9 +257,9 @@ if ($resql) print ''; print ''; print "\n"; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index d92447434d4..9b9a466dbdd 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * * 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 +19,7 @@ /** * \file htdocs/adherents/note.php * \ingroup member - * \brief Fiche de notes sur un adherent + * \brief Tabe for note of a member */ require '../main.inc.php'; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 7b3260aa920..33cc80b4b93 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -149,7 +149,7 @@ print '
'; // Show filter box /*print ''; print '
 '; - print ''; + print ''; print '  '; - print ''; + print ''; print '
'; -print ''; +print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("Filter").'
'.$langs->trans("Member").''; $filter='s.client in (1,2,3)'; print $form->select_company($id,'memberid',$filter,1); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index d221619acf4..7dd82f9a6a5 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -233,7 +233,6 @@ if (! $rowid && $action != 'create' && $action != 'edit') /* ************************************************************************** */ if ($action == 'create') { - $form = new Form($db); $adht = new AdherentType($db); print_fiche_titre($langs->trans("NewMemberType")); @@ -620,8 +619,6 @@ if ($rowid > 0) if ($action == 'edit') { - $form = new Form($db); - $adht = new AdherentType($db); $adht->id = $rowid; $adht->fetch($rowid); diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php index fc6c83b3561..d960b60516c 100644 --- a/htdocs/admin/accounting.php +++ b/htdocs/admin/accounting.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2012 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -48,11 +48,11 @@ if ($action == 'setcomptamode') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -67,11 +67,11 @@ if ($action == 'setchart') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -88,11 +88,11 @@ if ($action == 'update' || $action == 'add') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -255,8 +255,6 @@ if ($num) print "
\n"; } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 4e53a709d20..76541401924 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -84,13 +84,13 @@ if ($action == "save" && empty($cancel)) if (! $error) { - $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); + $db->commit(); } else { - $db->rollback(); - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); + $db->rollback(); } } @@ -161,8 +161,9 @@ if (! empty($triggers)) if ($module == 'order_supplier' || $module == 'invoice_supplier') $module = 'fournisseur'; if ($module == 'shipping') $module = 'expedition_bon'; if ($module == 'member') $module = 'adherent'; + if ($module == 'project') $module = 'projet'; //print 'module='.$module.'
'; - if ($conf->$module->enabled) + if (! empty($conf->$module->enabled)) { $var=!$var; print ''; @@ -188,8 +189,6 @@ dol_fiche_end(); print "
"; -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index a7763893bb5..64f793cc761 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -56,7 +56,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 3e917ce03fc..ac105cf3fba 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2014 Juanjo Menent * * 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 @@ -28,9 +28,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -if (!$user->admin) - accessforbidden(); +if (!$user->admin) accessforbidden(); $langs->load("agenda"); $langs->load("admin"); @@ -62,12 +62,12 @@ if ($actionsave) // Save agendas while ($i <= $MAXAGENDA) { - $name=trim(GETPOST('agenda_ext_name'.$i),'alpha'); + $name=trim(GETPOST('agenda_ext_name'.$i,'alpha')); $src=trim(GETPOST('agenda_ext_src'.$i,'alpha')); $color=trim(GETPOST('agenda_ext_color'.$i,'alpha')); if ($color=='-1') $color=''; - if (! empty($src) && ! preg_match('/^(http\s*|ftp\s*):/', $src)) + if (! empty($src) && ! dol_is_url($src)) { setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); $error++; @@ -75,7 +75,7 @@ if ($actionsave) break; } - //print 'color='.$color; + //print '-name='.$name.'-color='.$color; $res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; $res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0,'',$conf->entity); @@ -97,12 +97,12 @@ if ($actionsave) if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - if (empty($errorsaved)) $mesg = "".$langs->trans("Error").""; + if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors'); } } @@ -217,17 +217,13 @@ print ''; print '
'; print '
'; - -print "trans("Save")."\">"; +print "trans("Save")."\">"; print "
"; print "\n"; dol_fiche_end(); -dol_htmloutput_mesg($mesg); - - llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 66ffa91b883..8476a1508cd 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -1,7 +1,7 @@ * Copyright (C) 2011 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -127,8 +127,6 @@ dol_fiche_end(); print "
"; -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 2aa5992b5af..bbfa52c24de 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012 Juanjo Menent +/* Copyright (C) 2008-2013 Laurent Destailleur + * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -48,8 +48,9 @@ if ($actionsave) $i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')),'chaine',0,'',$conf->entity); $i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_PAST_DELAY',trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')),'chaine',0,'',$conf->entity); $i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'AGENDA_EXPORT_FIX_TZ',trim(GETPOST('AGENDA_EXPORT_FIX_TZ','alpha')),'chaine',0,'',$conf->entity); - if ($i >= 3) + if ($i >= 4) { $db->commit(); setEventMessage($langs->trans("SetupSaved")); @@ -117,6 +118,24 @@ print ""; print ''; +print '
'; + +print ""; + +print ""; +print '"; +print ""; +print ""; +print ""; +print '"; +print ""; +print ""; + +print '
'.$langs->trans("Parameter")."".$langs->trans("Value")."
'.$langs->trans("FixTZ").""; +print ''; +print '   '.$langs->trans("FillThisOnlyIfRequired"); +print "
'; + print '
'; print "trans("Save")."\">"; print "
"; @@ -155,7 +174,6 @@ $message=$langs->trans("AgendaUrlOptions1",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions2",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions3",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login); print info_admin($message); if (! empty($conf->use_javascript_ajax)) diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 9fc80d8b3f7..0fcf52b888a 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -54,11 +54,11 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -193,8 +193,6 @@ while ($i < $nbofbank) print ''."\n"; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index e54fd7a9cf1..ebc5e46946c 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2004 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -79,14 +79,14 @@ if($action && $action!='setcoder') { if (! $res > 0) $error++; - if (! $error) + if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; - } + setEventMessage($langs->trans("Error"),'errors'); + } } /* @@ -289,8 +289,8 @@ if (! isset($_SERVER['WINDIR'])) print ''; } -// Module produits -if (! empty($conf->societe->enabled)) +// Module products +if (! empty($conf->product->enabled)) { $var=!$var; print "
"; @@ -307,8 +307,8 @@ if (! empty($conf->societe->enabled)) print '
'; } -// Module produits -if (! empty($conf->product->enabled)) +// Module thirdparty +if (! empty($conf->societe->enabled)) { $var=!$var; print "
"; @@ -329,8 +329,6 @@ print ''; print "
"; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 31d313b84e9..5c2c8176842 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -57,7 +57,7 @@ if ($action == 'add') $db->begin(); - // Initialize distinctfkuser with all already existing values of fk_user (user that use a personalized view of boxes for pos) + // Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos") $distinctfkuser=array(); if (! $error) { @@ -85,14 +85,31 @@ if ($action == 'add') } } + $distinctfkuser['0']='0'; // Add entry for fk_user = 0. We must use string as key and val + foreach($distinctfkuser as $fk_user) { - if (! $error && $fk_user != 0) // We will add fk_user = 0 later. + if (! $error && $fk_user != '') { + $nbboxonleft=$nbboxonright=0; + $sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".GETPOST("pos","alpha")." AND fk_user = ".$fk_user." AND entity = ".$conf->entity; + dol_syslog("boxes.php activate box sql=".$sql); + $resql = $db->query($sql); + if ($resql) + { + while($obj = $db->fetch_object($resql)) + { + $boxorder=$obj->box_order; + if (preg_match('/A/',$boxorder)) $nbboxonleft++; + if (preg_match('/B/',$boxorder)) $nbboxonright++; + } + } + else dol_print_error($db); + $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes ("; $sql.= "box_id, position, box_order, fk_user, entity"; $sql.= ") values ("; - $sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', ".$fk_user.", ".$conf->entity; + $sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity; $sql.= ")"; dol_syslog("boxes.php activate box sql=".$sql); @@ -105,24 +122,6 @@ if ($action == 'add') } } - // If value 0 was not included, we add it. - if (! $error) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes ("; - $sql.= "box_id, position, box_order, fk_user, entity"; - $sql.= ") values ("; - $sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', 0, ".$conf->entity; - $sql.= ")"; - - dol_syslog("boxes.php activate box sql=".$sql); - $resql = $db->query($sql); - if (! $resql) - { - $errmesg=$db->lasterror(); - $error++; - } - } - if (! $error) { header("Location: boxes.php"); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 41a3f02838d..80428160e80 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -41,11 +41,11 @@ if ($action == 'setvalue' && $user->admin) $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity); if ($result >= 0) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -128,9 +128,6 @@ if (! empty($conf->global->CLICKTODIAL_URL)) } } -dol_htmloutput_mesg($mesg); - - llxFooter(); $db->close(); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index a8c7f2ee2e7..e24800d18f2 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand * Copyright (C) 2013 Florian Henry * @@ -64,11 +64,11 @@ if ($action == 'updateMask') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -106,19 +106,19 @@ else if ($action == 'specimen') } else { - $mesg=''.$module->error.''; + setEventMessage($module->error,'errors'); dol_syslog($module->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } // Activate a model -else if ($action == 'set') +if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } @@ -167,11 +167,11 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -185,11 +185,11 @@ else if ($action == 'set_COMMANDE_FREE_TEXT') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } else if ($action=='setModuleOptions') { @@ -200,14 +200,6 @@ else if ($action=='setModuleOptions') { $conf->global->COMMANDE_ADDON_PDF_ODT_PATH = GETPOST('value1'); } } -else if ($action=='setModuleOptions') { - if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) - { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent - $conf->global->COMMANDE_ADDON_PDF_ODT_PATH = GETPOST('value1'); - } -} /* @@ -240,7 +232,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("ShortInfo").''; print ''."\n"; clearstatcache(); @@ -264,14 +256,14 @@ foreach ($dirmodels as $reldir) require_once $dir.$file.'.php'; - $module = new $file; + $module = new $file($db); + + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->isEnabled()) { - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; print ''.$module->nom."\n"; print $module->info(); @@ -323,7 +315,7 @@ foreach ($dirmodels as $reldir) print $form->textwithpicto('',$htmltooltip,1,0); print ''; - print ''; + print "\n"; } } } @@ -331,17 +323,16 @@ foreach ($dirmodels as $reldir) } } } - -print '
'; +print "
\n"; /* * Document templates generators */ + print_titre($langs->trans("OrdersModelModule")); // Load array def with activated templates -$type='order'; $def = array(); $sql = "SELECT nom"; $sql.= " FROM ".MAIN_DB_PREFIX."document_model"; @@ -371,7 +362,8 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status")."\n"; print ''.$langs->trans("Default")."\n"; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); @@ -539,8 +531,6 @@ print ''; print '
'; -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 0b1f6f41d25..26611da68ee 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -41,8 +41,7 @@ $langs->load("companies"); if (! $user->admin) accessforbidden(); -$message=''; - +$error=0; /* * Actions @@ -122,18 +121,21 @@ if ( ($action == 'update' && empty($_POST["cancel"])) } else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) { + $error++; $langs->load("errors"); $tmparray=explode(':',$result); - $message .= '
'.$langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]).'
'; + setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors'); } else { - $message .= '
'.$langs->trans("ErrorFailedToSaveFile").'
'; + $error++; + setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors'); } } else { - $message .= '
'.$langs->trans("ErrorOnlyPngJpgSupported").'
'; + $error++; + setEventMessage($langs->trans("ErrorOnlyPngJpgSupported"),'errors'); } } } @@ -157,7 +159,7 @@ if ( ($action == 'update' && empty($_POST["cancel"])) dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity); - if ($action != 'updateedit' && ! $message) + if ($action != 'updateedit' && ! $error) { header("Location: ".$_SERVER["PHP_SELF"]); exit; @@ -198,13 +200,15 @@ if ($action == 'addthumb') } else { - $message .= '
'.$langs->trans("ErrorImageFormatNotSupported").'
'; + $error++; + setEventMessage($langs->trans("ErrorImageFormatNotSupported"),'errors'); dol_syslog($langs->transnoentities("ErrorImageFormatNotSupported"),LOG_WARNING); } } else { - $message .= '
'.$langs->trans("ErrorFileDoesNotExists",$_GET["file"]).'
'; + $error++; + setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors'); dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); } } @@ -288,14 +292,14 @@ if ($action == 'edit' || $action == 'updateedit') // Country $var=!$var; - print ''.$langs->trans("Country").''; + print ''.$langs->trans("Country").''; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation print $form->select_country($mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''."\n"; $var=!$var; - print ''.$langs->trans("State").''; + print ''.$langs->trans("State").''; $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); print ''."\n"; @@ -557,9 +561,9 @@ if ($action == 'edit' || $action == 'updateedit') print ' '; print "\n"; $var=true; - $var=!$var; - print ""; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; print ''; print ""; print ""; @@ -591,7 +595,8 @@ if ($action == 'edit' || $action == 'updateedit') $var=true; $var=!$var; - print ""; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; print ''; print ''; print ''; print ''; -print ''; +print ''; print ''."\n"; clearstatcache(); @@ -348,6 +319,11 @@ foreach ($dirmodels as $reldir) $filebis = $file."/".$file.".modules.php"; $classname = "mod_facture_".$file; } + // Check if there is a filter on country + preg_match('/\-(.*)_(.*)$/',$classname,$reg); + if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue; + + $classname = preg_replace('/\-.*$/','',$classname); if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') { // Chargement de la classe de numerotation @@ -363,7 +339,7 @@ foreach ($dirmodels as $reldir) { $var = !$var; print ''; print ''; print ''; print ''; -print ''; +print ''; +print ''; print "\n"; clearstatcache(); @@ -638,7 +646,7 @@ if (! empty($conf->banque->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE clos = 0"; $sql.= " AND courant = 1"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity IN (".getEntity('bank_account', 1).")"; $resql=$db->query($sql); if ($resql) { @@ -683,7 +691,7 @@ $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE clos = 0"; $sql.= " AND courant = 1"; -$sql.= " AND entity = ".$conf->entity; +$sql.= " AND entity IN (".getEntity('bank_account', 1).")"; $var=True; $resql=$db->query($sql); if ($resql) @@ -780,9 +788,6 @@ print "
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
'; print ""; print ""; @@ -628,8 +633,6 @@ else * Show parameters */ - dol_htmloutput_mesg($message); - // Actions buttons //print '
'; //print ''.$langs->trans("Modify").''; @@ -939,7 +942,7 @@ else $var=true; $var=!$var; - print "
"; + print ""; print '
".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."
'; print ""; print ""; @@ -972,7 +975,7 @@ else $var=true; $var=!$var; - print ""; + print ""; print ''; } diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php index 0176436c928..bb54f0ead67 100644 --- a/htdocs/admin/dons.php +++ b/htdocs/admin/dons.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -65,13 +65,13 @@ if ($action == 'specimen') } else { - $mesg='
'.$obj->error.'
'; + setEventMessage($obj->error,'errors'); dol_syslog($obj->error, LOG_ERR); } } else { - $mesg='
'.$langs->trans("ErrorModuleNotFound").'
'; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -160,13 +160,13 @@ else dol_print_error($db); } -print '
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
'; print ""; print ""; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index c30af26f1c0..a2abb070c3a 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -52,11 +52,11 @@ if ($action == 'setcomptamode') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -74,11 +74,11 @@ if ($action == 'update' || $action == 'add') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -148,7 +148,7 @@ print "
\n"; // Cas des autres parametres COMPTA_* $list=array('COMPTA_PRODUCT_BUY_ACCOUNT','COMPTA_PRODUCT_SOLD_ACCOUNT','COMPTA_SERVICE_BUY_ACCOUNT','COMPTA_SERVICE_SOLD_ACCOUNT', -'COMPTA_VAT_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER' +'COMPTA_VAT_ACCOUNT','COMPTA_VAT_BUY_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER' ); /*$sql = "SELECT rowid, name, value, type, note"; @@ -214,8 +214,6 @@ if ($num) print "
".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."
\n"; } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index d9be768461f..de10a5b8e4f 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -87,7 +87,7 @@ $h++; if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; - $head[$h][1] = $langs->trans("Sending"); + $head[$h][1] = $langs->trans("Shipment"); $h++; } diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index a2838ae7fe9..ae4b9eb35dd 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -41,10 +42,6 @@ $consts=GETPOST('const'); $constname=GETPOST('constname','alpha'); $constvalue=GETPOST('constvalue'); $constnote=GETPOST('constnote','alpha'); -$consttype=(GETPOST('consttype','alpha')?GETPOST('consttype','alpha'):'chaine'); - -$typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine'); -$mesg=''; @@ -52,26 +49,30 @@ $mesg=''; * Actions */ -if ($action == 'add') +if ($action == 'add' || (GETPOST('add') && $action != 'update')) { $error=0; if (empty($constname)) { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")),'errors'); $error++; } if ($constvalue == '') { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")),'errors'); $error++; } if (! $error) { - if (dolibarr_set_const($db, $constname, $constvalue, $typeconst[$consttype], 1, $constnote, $entity) >= 0) + if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0) { setEventMessage($langs->trans("RecordSaved")); + $action=""; + $constname=""; + $constvalue=""; + $constnote=""; } else { @@ -143,6 +144,8 @@ if ($action == 'delete') * View */ +$form = new Form($db); + llxHeader('',$langs->trans("OtherSetup")); // Add logic to show/hide buttons @@ -174,7 +177,9 @@ print_fiche_titre($langs->trans("OtherSetup"),'','setup'); print $langs->trans("ConstDesc")."
\n"; print "
\n"; -dol_htmloutput_mesg($mesg); +print 'entity) && $debug)?'?debug=1':'').'" method="POST">'; +print ''; +print ''; print ''; print ''; @@ -186,21 +191,15 @@ print ''; print "\n"; -$form = new Form($db); - - // Line to add new record $var=false; print "\n"; -print ''; -print ''; -print ''; -print ''."\n"; +print ''."\n"; print ''; // Limit to superadmin if (! empty($conf->multicompany->enabled) && !$user->entity) @@ -208,22 +207,17 @@ if (! empty($conf->multicompany->enabled) && !$user->entity) print ''; + print '\n"; print ''; -print ''; -print "\n"; - -print 'entity) && $debug)?'?debug=1':'').'" method="POST">'; -print ''; -print ''; // Show constants $sql = "SELECT"; @@ -253,21 +247,20 @@ if ($result) $var=!$var; print "\n"; - print ''; - print ''; - print ''; print ''."\n"; // Value print ''; // Note - print ''; + print ''; // Entity limit to superadmin @@ -276,13 +269,14 @@ if ($result) print ''; + print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; clearstatcache(); -$dir = "../core/modules/contract/"; -$handle = opendir($dir); -if (is_resource($handle)) +foreach ($dirmodels as $reldir) { - $var=true; + $dir = dol_buildpath($reldir."core/modules/contract/"); - while (($file = readdir($handle))!==false) - { - if (substr($file, 0, 13) == 'mod_contract_' && substr($file, dol_strlen($file)-3, 3) == 'php') - { - $file = substr($file, 0, dol_strlen($file)-4); + if (is_dir($dir)) + { + $handle = opendir($dir); + if (is_resource($handle)) + { + $var=true; - require_once DOL_DOCUMENT_ROOT ."/core/modules/contract/".$file.'.php'; + while (($file = readdir($handle))!==false) + { + if (substr($file, 0, 13) == 'mod_contract_' && substr($file, dol_strlen($file)-3, 3) == 'php') + { + $file = substr($file, 0, dol_strlen($file)-4); - $module = new $file; + require_once $dir.$file.'.php'; - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $module = new $file($db); - if ($module->isEnabled()) - { - $var=!$var; - print '\n"; - print ''; + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - // Show example of numbering model - print ''."\n"; + if ($module->isEnabled()) + { + $var=!$var; + print ''; - print ''; + // Show example of numbering model + print ''."\n"; - $contract=new Contrat($db); - $contract->initAsSpecimen(); + print ''; - // Info - $htmltooltip=''; - $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$contract); - if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval - { - $htmltooltip.=''.$langs->trans("NextValue").': '; - if ($nextval) - { - $htmltooltip.=$nextval.'
'; - } - else - { - $htmltooltip.=$langs->trans($module->error).'
'; - } - } + $contract=new Contrat($db); + $contract->initAsSpecimen(); - print ''; + // Info + $htmltooltip=''; + $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval=$module->getNextValue($mysoc,$contract); + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { + $htmltooltip.=''.$langs->trans("NextValue").': '; + if ($nextval) + { + $htmltooltip.=$nextval.'
'; + } + else + { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } - print ''; - } - } - } - closedir($handle); + print ''; + + print ''; + } + } + } + closedir($handle); + } + } } print '
'.$langs->trans("Action").'
'; -print ''; +print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; } else { + print ''; print ''; } -print ''; -print ''; +print ''; print "
'.$obj->name.''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; } else { + print ''; print ''; } - print ''; if ($conf->use_javascript_ajax) { print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 24a4ba180c2..b059fa34bec 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -25,6 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; $langs->load("admin"); $langs->load("errors"); @@ -34,6 +35,8 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); +$scandir = GETPOST('scandir','alpha'); +$type='contrat'; if (empty($conf->global->CONTRACT_ADDON)) { @@ -53,36 +56,145 @@ if ($action == 'updateMask') if (! $res > 0) $error++; - if (! $error) + if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } -if ($action == 'setmod') +else if ($action == 'specimen') // For contract { - dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity); + $modele= GETPOST('module','alpha'); + + $contract = new Contrat($db); + $contract->initAsSpecimen(); + + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach($dirmodels as $reldir) + { + $file=dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php",0); + if (file_exists($file)) + { + $filefound=1; + $classname = "pdf_".$modele; + break; + } + } + + if ($filefound) + { + require_once $file; + + $module = new $classname($db); + + if ($module->write_file($contract,$langs) > 0) + { + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf"); + return; + } + else + { + setEventMessage($obj->error,'errors'); + dol_syslog($obj->error, LOG_ERR); + } + } + else + { + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); + } } -/* - // constants of magre model - if ($action == 'updateMatrice') dolibarr_set_const($db, "CONTRACT_NUM_MATRICE",$_POST["matrice"],'chaine',0,'',$conf->entity); - if ($action == 'updatePrefix') dolibarr_set_const($db, "CONTRACT_NUM_PREFIX",$_POST["prefix"],'chaine',0,'',$conf->entity); - if ($action == 'setOffset') dolibarr_set_const($db, "CONTRACT_NUM_DELTA",$_POST["offset"],'chaine',0,'',$conf->entity); - if ($action == 'setNumRestart') dolibarr_set_const($db, "CONTRACT_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"],'chaine',0,'',$conf->entity); - */ +// Activate a model +else if ($action == 'set') +{ + $ret = addDocumentModel($value, $type, $label, $scandir); +} + +else if ($action == 'del') +{ + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + if ($conf->global->CONTRACT_ADDON_PDF == "$value") dolibarr_del_const($db, 'CONTRACT_ADDON_PDF',$conf->entity); + } +} + +// Set default model +else if ($action == 'setdoc') +{ + if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->CONTRACT_ADDON_PDF = $value; + } + + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } +} + +else if ($action == 'setmod') +{ + // TODO Verifier si module numerotation choisi peut etre active + // par appel methode canBeActivated + + dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity); +} + +else if ($action == 'set_CONTRACT_FREE_TEXT') +{ + $freetext= GETPOST('CONTRACT_FREE_TEXT','alpha'); + $res = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } +} + +else if ($action == 'set_CONTRACT_DRAFT_WATERMARK') +{ + $draft= GETPOST('CONTRACT_DRAFT_WATERMARK','alpha'); + + $res = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } +} /* * View */ +$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + llxHeader(); -$dir=DOL_DOCUMENT_ROOT."/core/modules/contract/"; $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; @@ -90,15 +202,9 @@ print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup'); print "
"; -$h = 0; +$head=contract_admin_prepare_head(); -$head[$h][0] = DOL_URL_ROOT."/admin/contract.php"; -$head[$h][1] = $langs->trans("Contracts"); -$head[$h][2] = 'Contract'; -$hselected=$h; -$h++; - -dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); +dol_fiche_head($head, 'contract', $langs->trans("ModuleSetup")); /* * Contracts Numbering model @@ -112,94 +218,302 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").'
'.$module->nom."'; - print $module->info(); - print ''; - $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } - elseif ($tmp=='NotConfigured') print $langs->trans($tmp); - else print $tmp; - print '
'.$module->nom."\n"; + print $module->info(); + print ''; - if ($conf->global->CONTRACT_ADDON == "$file") - { - print img_picto($langs->trans("Activated"),'switch_on'); - } - else - { - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Disabled"),'switch_off'); - print ''; - } - print ''; + $tmp=$module->getExample(); + if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + elseif ($tmp=='NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
'; + if ($conf->global->CONTRACT_ADDON == "$file") + { + print img_picto($langs->trans("Activated"),'switch_on'); + } + else + { + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; + } + print ''; - print $form->textwithpicto('',$htmltooltip,1,0); - print '
'; + print $form->textwithpicto('',$htmltooltip,1,0); + print '

'; -dol_htmloutput_mesg($mesg); +/* + * Documents models for Contracts + */ + +print_titre($langs->trans("TemplatePDFContracts")); + +// Defini tableau def des modeles +$type='contrat'; +$def = array(); +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = '".$type."'"; +$sql.= " AND entity = ".$conf->entity; +$resql=$db->query($sql); +if ($resql) +{ + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } +} +else +{ + dol_print_error($db); +} + + +print ''; +print ''; +print ''; +print ''; +print '\n"; +print '\n"; +print ''; +print ''; +print "\n"; + +clearstatcache(); + +$var=true; +foreach ($dirmodels as $reldir) +{ + foreach (array('','/doc') as $valdir) + { + $dir = dol_buildpath($reldir."core/modules/contract".$valdir); + + if (is_dir($dir)) + { + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); + + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + { + + if (file_exists($dir.'/'.$file)) + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); + + require_once $dir.'/'.$file; + $module = new $classname($db); + + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + + if ($modulequalified) + { + $var = !$var; + print ''; + + // Active + if (in_array($name, $def)) + { + print ''; + } + else + { + print '"; + } + + // Defaut + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + if ($module->type == 'pdf') + { + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + + + print ''; + + // Preview + print ''; + + print "\n"; + } + } + } + } + } + } + } +} + +print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
'; + print (empty($module->name)?$name:$module->name); + print "\n"; + if (method_exists($module,'info')) print $module->info($langs); + else print $module->description; + print ''."\n"; + print ''; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; + print ''."\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print "'; + if ($conf->global->CONTRACT_ADDON_PDF == $name) + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print ''; + if ($module->type == 'pdf') + { + print ''.img_object($langs->trans("Preview"),'contract').''; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"),'generic'); + } + print '
'; +print "
"; + +/* + * Other options + * + */ + +print_titre($langs->trans("OtherOptions")); +print ''; +print ''; +print ''; +print ''; +print "\n"; +print "\n"; +$var=true; + +$var=! $var; +print ''; +print ''; +print ''; +print '\n"; +print ''; + +//Use draft Watermark +$var=!$var; +print ""; +print ''; +print ""; +print '\n"; +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $langs->trans("FreeLegalTextOnContracts").' ('.$langs->trans("AddCRIfTooLong").')
'; +print ''; +print '
'; +print ''; +print "
'; +print $langs->trans("WatermarkOnDraftContractCards").'
'; +print ''; +print '
'; +print ''; +print "
'; + +print '
'; $db->close(); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 41142550572..e16240bf251 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -107,7 +107,7 @@ if ($action == 'update') { foreach($delays as $delay) { - if (GETPOST($delay['code'])) + if (GETPOST($delay['code']) != '') { dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity); } @@ -123,15 +123,16 @@ if ($action == 'update') * View */ +$form = new Form($db); + llxHeader(); print_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"),'','setup'); print $langs->transnoentities("DelaysOfToleranceDesc",img_warning()); -print " ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; +print " ".$langs->trans("OnlyActiveElementsAreShown",DOL_URL_ROOT.'/admin/modules.php')."
\n"; print "
\n"; -$form = new Form($db); $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; if ($action == 'edit') diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index c3dd24db957..62e78ae95e2 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2013 Marcos García @@ -404,7 +404,6 @@ if ($id == 10) ); if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) $localtax_typeList["7"]= $langs->trans("Yes").' ('.$langs->trans("Type")." 7)"; //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype } -$msg=''; // Actions ajout ou modification d'une entree dans un dictionnaire de donnee @@ -443,23 +442,22 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible'; if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder'; - $msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'
'; + setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors'); } } // Other checks if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { $ok=0; - $msg.= $langs->transnoentities('ErrorReservedTypeSystemSystemAuto').'
'; + setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors'); } if (isset($_POST["code"])) { if ($_POST["code"]=='0') { $ok=0; - $msg.= $langs->transnoentities('ErrorCodeCantContainZero').'
'; + setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors'); } - // FIXME regresion if code with not in numeric base - /*if (!is_numeric($_POST['code'])) + /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base { $ok = 0; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; @@ -467,7 +465,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } if (isset($_POST["country"]) && $_POST["country"]=='0') { $ok=0; - $msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'
'; + setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors'); } // Clean some parameters @@ -524,14 +522,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $result = $db->query($sql); if ($result) // Add is ok { - //$oldid=$id; - //$_POST=array('id'=>$oldid); // Clean $_POST array, we keep only - //$_GET["id"]=$_POST["id"]; // Force affichage dictionnaire en cours d'edition + $_POST=array('id'=>$id); // Clean $_POST array, we keep only } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $msg=$langs->transnoentities("ErrorRecordAlreadyExists").'
'; + setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors'); } else { dol_print_error($db); @@ -575,11 +571,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $resql = $db->query($sql); if (! $resql) { - $msg=$db->error(); + setEventMessage($db->error(),'errors'); } } - - if ($msg) $msg='
'.$msg.'
'; //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } @@ -601,7 +595,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete { if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') { - $msg='
'.$langs->transnoentities("ErrorRecordIsUsedByChild").'
'; + setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors'); } else { @@ -680,8 +674,7 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); - if ($ret == 'html') print '
'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } /* @@ -689,7 +682,6 @@ if ($action == 'delete') */ if ($id) { - dol_htmloutput_mesg($msg); // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; @@ -1324,9 +1316,9 @@ function fieldList($fieldlist,$obj='',$tabname='') $size=''; if ($fieldlist[$field]=='libelle') $size='size="32" '; if ($fieldlist[$field]=='tracking') $size='size="92" '; - if ($fieldlist[$field]=='accountancy_code') $size='size="15" '; - if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" '; - if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" '; + if ($fieldlist[$field]=='accountancy_code') $size='size="10" '; + if ($fieldlist[$field]=='accountancy_code_sell') $size='size="10" '; + if ($fieldlist[$field]=='accountancy_code_buy') $size='size="10" '; print ''; print '
'; +print '
'; print ''; print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; clearstatcache(); @@ -206,20 +206,20 @@ if (is_resource($handle)) print "'; } else { print ""; } diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index f4b00ddef5c..9523bf38abc 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -1,5 +1,6 @@ + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -60,7 +61,7 @@ if ($action == "save") } $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } @@ -116,10 +117,6 @@ print "\n"; print ''; - -dol_htmloutput_mesg($mesg); - - $db->close(); llxFooter(); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 4fff86e2c3a..fbc03faf37d 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -76,7 +76,7 @@ else if ($action == 'set_SHIPPING_FREE_TEXT') $freetext=GETPOST('SHIPPING_FREE_TEXT','alpha'); $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); - if ($res < 0) + if ($res > 0) setEventMessage($langs->trans("SetupSaved")); else setEventMessage($langs->trans("Error"), 'errors'); @@ -87,7 +87,7 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') $draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha'); $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); - if ($res < 0) + if ($res > 0) setEventMessage($langs->trans("SetupSaved")); else setEventMessage($langs->trans("Error"), 'errors'); @@ -105,11 +105,11 @@ else if ($action == 'specimen') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/expedition/doc/pdf_expedition_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/expedition/doc/pdf_".$modele.".modules.php",0); if (file_exists($file)) { $filefound=1; - $classname = "pdf_expedition_".$modele; + $classname = "pdf_".$modele; break; } } @@ -175,6 +175,14 @@ else if ($action == 'setmodel') { dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); } +else if ($action=='setModuleOptions') { + if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->EXPEDITION_ADDON_PDF_ODT_PATH = GETPOST('value1'); + } +} /* @@ -202,7 +210,7 @@ $head[$h][1] = $langs->trans("Setup"); $h++; $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; -$head[$h][1] = $langs->trans("Sending"); +$head[$h][1] = $langs->trans("Shipment"); $hselected=$h; $h++; @@ -217,7 +225,7 @@ dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* * Expedition numbering model - */ + */ print_titre($langs->trans("SendingsNumberingModules")); @@ -227,7 +235,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; clearstatcache(); @@ -252,13 +260,13 @@ foreach ($dirmodels as $reldir) require_once $dir.$file.'.php'; $module = new $file; - + if ($module->isEnabled()) { // Show modules according to features level if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - + $var=!$var; print '\n"; print ''; print ''; print ''; print ''; -print ''; +print ''; +print ''; print "\n"; clearstatcache(); @@ -369,75 +378,115 @@ clearstatcache(); $var=true; foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/expedition/doc/"); + foreach (array('','/doc') as $valdir) + { + $dir = dol_buildpath($reldir."core/modules/expedition".$valdir); - if (is_dir($dir)) - { - $handle=opendir($dir); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,15) == 'pdf_expedition_') - { - $name = substr($file, 15, dol_strlen($file) - 27); - $classname = substr($file, 0, dol_strlen($file) - 12); + if (is_dir($dir)) + { + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); - $var=!$var; - print ''; + if (file_exists($dir.'/'.$file)) + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - // Active - if (in_array($name, $def)) - { - print ""; - } - else - { - print ""; - } + require_once $dir.'/'.$file; + $module = new $classname($db); - // Default - print "'; + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - print ''; + if ($modulequalified) + { + $var = !$var; + print ''; - print ''; - } - } - closedir($handle); - } - } + // Active + if (in_array($name, $def)) + { + print ''; + } + else + { + print '"; + } + + // Defaut + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + if ($module->type == 'pdf') + { + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + + print ''; + + // Preview + print ''; + + print "\n"; + } + } + } + } + } + } + } } print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Activated").''.$langs->trans("Default").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").'
\n"; if ($conf->global->DON_ADDON_MODEL == $name) { - print img_picto($langs->trans("Enabled"),'on'); + print img_picto($langs->trans("Enabled"),'switch_on'); } else { print ' '; print ''; - print ''.img_picto($langs->trans("Enabled"),'on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print "'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").'
'.$module->nom."'; @@ -268,8 +276,8 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { - $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; @@ -361,7 +369,8 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
'; - print $name; - print "\n"; - require_once $dir.$file; - $module = new $classname(); + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + { - print $module->description; - print '\n"; - print ''; - print img_picto($langs->trans("Activated"),'switch_on'); - print ''; - print "\n"; - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - print ""; - if ($conf->global->EXPEDITION_ADDON_PDF == $name) - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; - $link='scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; - print $form->textwithpicto('     '.$link,$htmltooltip,-1,0); - print '
'; + print (empty($module->name)?$name:$module->name); + print "\n"; + if (method_exists($module,'info')) print $module->info($langs); + else print $module->description; + print '
'."\n"; + print ''; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; + print ''."\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print "'; + if ($conf->global->EXPEDITION_ADDON_PDF == $name) + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print ''; + if ($module->type == 'pdf') + { + print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"),'generic'); + } + print '
'; @@ -487,4 +536,4 @@ print '
'; llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index ac2d89c1169..e9d21ba2969 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2013 Juanjo Menent * * 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 @@ -40,6 +40,9 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scandir','alpha'); +$type='invoice'; /* @@ -49,21 +52,27 @@ $value = GETPOST('value','alpha'); if ($action == 'updateMask') { $maskconstinvoice=GETPOST('maskconstinvoice','alpha'); + $maskconstreplacement=GETPOST('maskconstreplacement','alpha'); $maskconstcredit=GETPOST('maskconstcredit','alpha'); + $maskconstdeposit=GETPOST('maskconstdeposit','alpha'); $maskinvoice=GETPOST('maskinvoice','alpha'); + $maskreplacement=GETPOST('maskreplacement','alpha'); $maskcredit=GETPOST('maskcredit','alpha'); + $maskdeposit=GETPOST('maskdeposit','alpha'); if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity); + if ($maskconstreplacement) $res = dolibarr_set_const($db,$maskconstreplacement,$maskreplacement,'chaine',0,'',$conf->entity); if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity); + if ($maskconstdeposit) $res = dolibarr_set_const($db,$maskconstdeposit,$maskdeposit,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -101,13 +110,13 @@ if ($action == 'specimen') } else { - $mesg=''.$module->error.''; + setEventMessage($module->error,'errors'); dol_syslog($module->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -129,86 +138,48 @@ if ($action == 'setModuleOptions') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='invoice'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - if ($db->query($sql)) - { - - } + $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { - $type='invoice'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$db->escape($value)."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - - if ($db->query($sql)) - { + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity); - } + } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); - - if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) - { - $conf->global->FACTURE_ADDON_PDF = $value; - } - - // On active le modele - $type='invoice'; - - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - dol_syslog("Delete from model table ".$sql_del); - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$value."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$scandir."'":"null"); - $sql.= ")"; - dol_syslog("Insert into model table ".$sql); - $result2=$db->query($sql); - if ($result1 && $result2) - { - $db->commit(); - } - else - { - dol_syslog("Error ".$db->lasterror(), LOG_ERR); - $db->rollback(); - } + if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->FACTURE_ADDON_PDF = $value; + } + + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -228,11 +199,11 @@ if ($action == 'setribchq') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -246,11 +217,11 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -264,11 +235,11 @@ if ($action == 'set_FACTURE_FREE_TEXT') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -282,11 +253,11 @@ if ($action == 'setforcedate') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -321,7 +292,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").'
'; - echo preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file)); + echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); print "\n"; print $module->info(); @@ -410,6 +386,22 @@ foreach ($dirmodels as $reldir) $htmltooltip.=$langs->trans($module->error).'
'; } } + // Example for remplacement + $facture->type=1; + $nextval=$module->getNextValue($mysoc,$facture); + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { + $htmltooltip.=$langs->trans("NextValueForReplacements").': '; + if ($nextval) + { + $htmltooltip.=$nextval.'
'; + } + else + { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } + // Example for credit invoice $facture->type=2; $nextval=$module->getNextValue($mysoc,$facture); @@ -417,6 +409,21 @@ foreach ($dirmodels as $reldir) { $htmltooltip.=$langs->trans("NextValueForCreditNotes").': '; if ($nextval) + { + $htmltooltip.=$nextval.'
'; + } + else + { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } + // Example for deposit invoice + $facture->type=3; + $nextval=$module->getNextValue($mysoc,$facture); + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { + $htmltooltip.=$langs->trans("NextValueForDeposit").': '; + if ($nextval) { $htmltooltip.=$nextval; } @@ -486,7 +493,8 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
\n"; //dol_fiche_end(); -dol_htmloutput_mesg($mesg); - - llxFooter(); $db->close(); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 57bc089c6a5..e968798c9ce 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-20113 Juanjo Menent * * 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 +94,7 @@ if (GETPOST('save','alpha')) { $res=dolibarr_set_const($db, "FCKEDITOR_TEST", GETPOST('formtestfield'),'chaine',0,'',$conf->entity); - if ($res > 0) $mesg=$langs->trans("RecordModifiedSuccessfully"); + if ($res > 0) setEventMessage($langs->trans("RecordModifiedSuccessfully")); } @@ -151,8 +151,6 @@ else print ''."\n"; - dol_htmloutput_mesg($mesg); - print '
'."\n"; print_fiche_titre($langs->trans("TestSubmitForm"),'',''); print '
'."\n"; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 95b2bffffb5..da00762040a 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -30,6 +30,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $langs->load("admin"); @@ -59,11 +60,11 @@ if ($action == 'updateMask') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -101,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter } else { - $mesg=''.$obj->error.''; + setEventMessage($obj->error,'errors'); dol_syslog($obj->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -162,11 +163,11 @@ else if ($action == 'set_FICHINTER_FREE_TEXT') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -180,11 +181,28 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); + } +} + +elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') +{ + $val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha'); + $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on'),'bool',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); } } @@ -202,17 +220,10 @@ $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup'); -print "
"; -$h = 0; +$head=fichinter_admin_prepare_head(); -$head[$h][0] = DOL_URL_ROOT."/admin/fichinter.php"; -$head[$h][1] = $langs->trans("Interventions"); -$head[$h][2] = 'Ficheinter'; -$hselected=$h; -$h++; - -dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); +dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), 0, 'intervention'); // Interventions numbering model @@ -224,7 +235,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("ShortInfo").''; print "\n"; clearstatcache(); @@ -345,7 +356,8 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status")."\n"; print ''.$langs->trans("Default")."\n"; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); @@ -364,13 +376,16 @@ foreach ($dirmodels as $reldir) { if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') { + $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); - $var=!$var; + require_once $dir.'/'.$file; + $module = new $classname($db); print ''; - echo "$name"; + print (empty($module->name)?$name:$module->name); print "\n"; require_once $dir.$file; $module = new $classname($db); @@ -416,8 +431,13 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); print ''; + print $form->textwithpicto('',$htmltooltip,-1,0); + print ''; + + // Preview $link=''.img_object($langs->trans("Preview"),'intervention').''; - print $form->textwithpicto('     '.$link,$htmltooltip,-1,0); + print ''; + print $link; print ''; print ''; @@ -468,6 +488,22 @@ print ''; print ''; print "\n"; + +// print products on fichinter +$var=! $var; +print ''; +print ''; +print ''; +print ''; +print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')'; +print 'global->FICHINTER_PRINT_PRODUCTS) + print 'checked="checked" '; +print '/>'; +print ''; +print ''; +print "\n"; + print ''; @@ -475,8 +511,6 @@ print ''; print '
'; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 308d45f18f7..3222c1ccd92 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -46,7 +46,7 @@ if ($action == 'set') if (! $gimcdf && ! file_exists($gimcdf)) { - $mesg='
'.$langs->trans("ErrorFileNotFound",$gimcdf).'
'; + setEventMessage($langs->trans("ErrorFileNotFound",$gimcdf),'errors'); $error++; } @@ -56,18 +56,17 @@ if ($action == 'set') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } } - /* * View */ @@ -85,6 +84,13 @@ $geoip=''; if (! empty($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE)) { $geoip=new DolGeoIP('country',$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE); + //if ($geoip->error) print dol_htmloutput_errors($geoip->errorlabel,'',1); + if ($geoip->gi == 'NOGI') $geointernal=true; + else $geointernal=false; +} +else +{ + if (function_exists('geoip_country_code_by_name')) $geointernal=true; } // Mode @@ -102,6 +108,8 @@ print "\n"; $var=!$var; print ''.$langs->trans("PathToGeoIPMaxmindCountryDataFile").''; print ''; + +if ($geointernal) print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).'
'; print ''; if ($geoip) $version=$geoip->getVersion(); if ($version) @@ -147,8 +155,6 @@ if ($geoip) $geoip->close(); } -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close(); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index de852a3cc15..86e87ac56d4 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -45,10 +45,10 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area -$searchform=array("MAIN_SEARCHFORM_SOCIETE","MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE","MAIN_SEARCHFORM_ADHERENT"); -$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_ADHERENT); -$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"),$langs->trans("Members")); -$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module310Name'); +$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT"); +$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT); +$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"),$langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')',$langs->trans("Members")); +$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name'); if ($action == 'update') @@ -67,6 +67,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT",$_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 940396718b9..47a05684223 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -18,7 +18,7 @@ /** * \file htdocs/admin/index.php - * \brief Page d'accueil de l'espace administration/configuration + * \brief Home page of setup area */ require '../main.inc.php'; @@ -28,7 +28,8 @@ $langs->load("companies"); if (!$user->admin) accessforbidden(); -$mesg=''; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('homesetup')); /* @@ -43,18 +44,36 @@ $form = new Form($db); print_fiche_titre($langs->trans("SetupArea"),'','setup'); -if ($mesg) print $mesg.'
'; + +if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) +{ + $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('//i','
',$conf->global->MAIN_MOTD_SETUPPAGE); + if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) + { + $i=0; + while (preg_match('/__\(([a-zA-Z|@]+)\)__/i',$conf->global->MAIN_MOTD_SETUPPAGE,$reg) && $i < 100) + { + $tmp=explode('|',$reg[1]); + if (! empty($tmp[1])) $langs->load($tmp[1]); + $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/__\('.preg_quote($reg[1]).'\)__/i',$langs->trans($tmp[0]),$conf->global->MAIN_MOTD_SETUPPAGE); + $i++; + } + + print "\n\n"; + print '
'; + print dol_htmlentitiesbr($conf->global->MAIN_MOTD_SETUPPAGE); + print '

'; + print "\n\n"; + } +} print $langs->trans("SetupDescription1").' '; print $langs->trans("AreaForAdminOnly").' '; - - -//print "
"; -//print "
"; print $langs->trans("SetupDescription2")."

"; print '
'; -//print '
'; + +// Show info setup company if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit')); if (! empty($setupcompanynotcomplete)) @@ -66,9 +85,10 @@ if (! empty($setupcompanynotcomplete)) print '
'; print '
'; print '
'; -//print '
'; + +// Show info setup module print img_picto('','puce').' '.$langs->trans("SetupDescription4",DOL_URL_ROOT.'/admin/modules.php?mainmenu=home'); -if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->global->MAIN_MINNB_MODULE)) // If only user module enabled +if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled { $langs->load("errors"); $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete")); @@ -77,13 +97,20 @@ if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->g print '
'; print '
'; print '
'; -//print '
'; -print $langs->trans("SetupDescription5")."
"; -//print '
'; -print "
"; +print '
'; -// Show logo -print '
'; +// Add hook to add information +$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +print $hookmanager->resPrint; +if (empty($reshook)) +{ + // Show into other + print $langs->trans("SetupDescription5")."
"; + print "
"; + + // Show logo + print '
'; +} llxFooter(); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 58faff42ef1..7dc5650f761 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -60,15 +60,15 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE',GETPOST("activecontact"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE',GETPOST("activemembers"),'chaine',0,'',$conf->entity)) $error++; - if (! $error) - { - $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; - } - else - { - $db->rollback(); - dol_print_error($db); + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + dol_print_error($db); } } @@ -89,7 +89,7 @@ $head = ldap_prepare_head(); // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - $mesg.='
'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'
'; ; + setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); } dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup")); @@ -323,8 +323,6 @@ if (function_exists("ldap_connect")) } } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 96382bdaa59..a25fe2c13c7 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -61,6 +61,7 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE',GETPOST("fieldhomephone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; @@ -72,23 +73,23 @@ if ($action == 'setvalue' && $user->admin) $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS',$valkey,'chaine',0,'',$conf->entity)) $error++; - - if (! $error) - { - $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; - } - else - { - $db->rollback(); - dol_print_error($db); + + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + dol_print_error($db); } } /* - * Visu + * View */ llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); @@ -101,7 +102,7 @@ $head = ldap_prepare_head(); // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - $mesg.='
'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'
'; ; + setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); } dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup")); @@ -214,6 +215,14 @@ print ''.$langs->trans("LDAPFieldMobileExample").''; print 'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked="checked"':'').">"; print ''; +// Skype +$var=!$var; +print ''.$langs->trans("LDAPFieldSkype").''; +print ''; +print ''.$langs->trans("LDAPFieldSkypeExample").''; +print 'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked="checked"':'').">"; +print ''; + // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; @@ -328,8 +337,6 @@ if (function_exists("ldap_connect")) } } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index bc5d815e305..49b1973eb07 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -64,16 +64,16 @@ if ($action == 'setvalue' && $user->admin) $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS',$valkey,'chaine',0,'',$conf->entity)) $error++; - - if (! $error) - { - $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; - } - else - { - $db->rollback(); - dol_print_error($db); + + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + dol_print_error($db); } } @@ -93,7 +93,7 @@ $head = ldap_prepare_head(); // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - $mesg.='
'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'
'; ; + setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); } dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup")); @@ -253,8 +253,6 @@ if (function_exists("ldap_connect")) } } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 2b3194b9cad..f437163b22f 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2008 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -65,6 +65,7 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO',GETPOST("fieldphoneperso"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; @@ -87,15 +88,15 @@ if ($action == 'setvalue' && $user->admin) if ($key) $valkey=$conf->global->$key; if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$valkey,'chaine',0,'',$conf->entity)) $error++; - if (! $error) - { - $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; - } - else - { - $db->rollback(); - dol_print_error($db); + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + dol_print_error($db); } } @@ -115,7 +116,7 @@ $head = ldap_prepare_head(); // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - $mesg.='
'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'
'; ; + setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); } dol_fiche_head($head, 'members', $langs->trans("LDAPSetup")); @@ -255,6 +256,14 @@ print ''.$langs->trans("LDAPFieldMobileExample").''; print ' '; print ''; +// Skype +$var=!$var; +print ''.$langs->trans("LDAPFieldSkype").''; +print ''; +print ''.$langs->trans("LDAPFieldSkypeExample").''; +print ' '; +print ''; + // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; @@ -436,8 +445,6 @@ if (function_exists("ldap_connect")) } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 7e084474208..647cccf7ab8 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -63,6 +63,7 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++; @@ -74,15 +75,15 @@ if ($action == 'setvalue' && $user->admin) if ($key) $valkey=$conf->global->$key; if (! dolibarr_set_const($db, 'LDAP_KEY_USERS',$valkey,'chaine',0,'',$conf->entity)) $error++; - if (! $error) - { - $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; - } - else - { - $db->rollback(); - dol_print_error($db); + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + dol_print_error($db); } } @@ -102,7 +103,7 @@ $head = ldap_prepare_head(); // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - $mesg.='
'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'
'; ; + setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); } dol_fiche_head($head, 'users', $langs->trans("LDAPSetup")); @@ -240,6 +241,14 @@ print ''.$langs->trans("LDAPFieldMobileExample").''; print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked="checked"':'').">"; print ''; +// Skype +$var=!$var; +print ''.$langs->trans("LDAPFieldSkype").''; +print ''; +print ''.$langs->trans("LDAPFieldSkypeExample").''; +print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked="checked"':'').">"; +print ''; + // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; @@ -383,6 +392,7 @@ if (function_exists("ldap_connect")) $conf->global->LDAP_FIELD_PASSWORD_CRYPTED, $conf->global->LDAP_FIELD_PHONE, $conf->global->LDAP_FIELD_FAX, + $conf->global->LDAP_FIELD_SKYPE, $conf->global->LDAP_FIELD_MOBILE, $conf->global->LDAP_FIELD_MAIL, $conf->global->LDAP_FIELD_TITLE, @@ -440,8 +450,6 @@ if (function_exists("ldap_connect")) } } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 9bee4befa03..56602508777 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -56,13 +56,13 @@ if ($action == 'updateMask') if (! $res > 0) $error++; - if (! $error) + if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -73,13 +73,13 @@ if ($action == 'set_DELIVERY_FREE_TEXT') if (! $res > 0) $error++; - if (! $error) + if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -117,13 +117,13 @@ if ($action == 'specimen') } else { - $mesg=''.$module->error.''; + setEventMessage($module->error,'errors'); dol_syslog($module->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -192,7 +192,7 @@ $h++; if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; - $head[$h][1] = $langs->trans("Sending"); + $head[$h][1] = $langs->trans("Shipment"); $h++; } @@ -207,16 +207,16 @@ dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* * Livraison numbering model */ - + print_titre($langs->trans("DeliveryOrderNumberingModules")); print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; -print ''; +print ''; print ''."\n"; clearstatcache(); @@ -240,13 +240,13 @@ foreach ($dirmodels as $reldir) require_once $dir.$file.'.php'; $module = new $file; - + if ($module->isEnabled()) { // Show modules according to features level if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - + $var=!$var; print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").'
'.$module->nom."\n"; print $module->info(); @@ -255,8 +255,8 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { - $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; @@ -315,7 +315,7 @@ print '
'; print '
'; print_titre($langs->trans("DeliveryOrderModel")); -// Defini tableau def de modele +// Defini tableau def de modele $type="delivery"; $def = array(); @@ -347,7 +347,8 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status").''; print ''.$langs->trans("Default").''; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); @@ -457,8 +458,6 @@ print ''; print ''; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 6074272ddc8..3c9c2f5ad93 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -1,7 +1,7 @@ - * Copyright (C) 2005-2012 Laurent Destailleur - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -40,15 +40,6 @@ $action = GETPOST('action','alpha'); * Actions */ -if ($action == 'setMAILING_EMAIL_UNSUBSCRIBE') -{ - $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",1,'chaine',0,'',$conf->entity); -} -if ($action == 'unsetMAILING_EMAIL_UNSUBSCRIBE') -{ - $res=dolibarr_del_const($db, "MAILING_EMAIL_UNSUBSCRIBE"); -} - if ($action == 'setvalue') { $db->begin(); @@ -62,34 +53,20 @@ if ($action == 'setvalue') if (! $res > 0) $error++; $res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - if ($checkread=='on') - { - $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",1,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - } - else if ($checkread=='off') - { - $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",0,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - } - //Create temporary encryption key if nedded - if (($conf->global->MAILING_EMAIL_UNSUBSCRIBE==1) && (empty($checkread_key))) - { - $checkread_key=getRandomPassword(true); - } + // Create temporary encryption key if nedded $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - - if (! $error) + + if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -113,9 +90,6 @@ $h++; dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); -dol_htmloutput_mesg($mesg); - - if (! empty($conf->use_javascript_ajax)) { print "\n".''; form_constantes($constantes,1); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index fc47a6b607e..ec3faca6625 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -1,6 +1,7 @@ * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -46,7 +47,6 @@ $substitutionarrayfortest=array( complete_substitutions_array($substitutionarrayfortest, $langs); $action=GETPOST('action'); -$message=''; /* @@ -126,14 +126,6 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) if ($_POST['removedfilehtml'] || $action='sendhtml') $action='testhtml'; } -/* - * Cancel - */ -if (($action == 'send' || $action == 'sendhtml') && GETPOST('cancel')) -{ - $message=''; -} - /* * Send mail */ @@ -141,9 +133,6 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE { $error=0; - - - $email_from=''; if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' '; if (! empty($_POST["frommail"])) $email_from.='<'.$_POST["frommail"].'>'; @@ -172,13 +161,13 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE if (empty($_POST["frommail"])) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")),'errors'); $action='test'; $error++; } if (empty($sendto)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")),'errors'); $action='test'; $error++; } @@ -212,11 +201,11 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE if ($result) { - $message='
'.$langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)).'
'; + setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2))); } else { - $message='
'.$langs->trans("ResultKo").'
'.$mailfile->error.' '.$result.'
'; + setEventMessage($langs->trans("ResultKo").'
'.$mailfile->error.' '.$result,'errors'); } $action=''; @@ -253,8 +242,6 @@ print_fiche_titre($langs->trans("EMailsSetup"),'','setup'); print $langs->trans("EMailsDesc")."
\n"; print "
\n"; -dol_htmloutput_mesg($message); - // List of sending methods $listofmethods=array(); $listofmethods['mail']='PHP mail function'; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index fa30f472a5c..3b1e3a00384 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -251,8 +251,7 @@ if ($action == 'delete') $result = $db->query($sql); $obj = $db->fetch_object($result); - $ret=$form->form_confirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete"); - if ($ret == 'html') print '
'; + print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete"); } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index f8d8e0e0e05..2ce81f966f1 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent @@ -66,6 +66,8 @@ if ($action == 'reset' && $user->admin) * View */ +$form = new Form($db); + $_SESSION["mode"]=$mode; $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; @@ -134,45 +136,57 @@ foreach ($modulesdir as $dir) try { $res=include_once $dir.$file; - $objMod = new $modName($db); - $modNameLoaded[$modName]=$dir; + if (class_exists($modName)) + { + try { + $objMod = new $modName($db); + $modNameLoaded[$modName]=$dir; - if ($objMod->numero > 0) - { - $j = $objMod->numero; - } - else - { - $j = 1000 + $i; - } + if ($objMod->numero > 0) + { + $j = $objMod->numero; + } + else + { + $j = 1000 + $i; + } - $modulequalified=1; + $modulequalified=1; - // We discard modules according to features level (PS: if module is activated we always show it) - $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); - if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0; - if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; - // We discard modules according to property disabled - if (! empty($objMod->hidden)) $modulequalified=false; + // We discard modules according to features level (PS: if module is activated we always show it) + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); + if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0; + if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; + // We discard modules according to property disabled + if (! empty($objMod->hidden)) $modulequalified=false; - // Define array $categ with categ with at least one qualified module - if ($modulequalified) - { - $modules[$i] = $objMod; - $filename[$i]= $modName; - $orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number - $special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown'; - if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev'; - - //print "x".$modName." ".$orders[$i]." ".$special."\n
"; - if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories - else $categ[$special]=1; - $dirmod[$i] = $dir; - $j++; - $i++; - } - else dol_syslog("Module ".get_class($objMod)." not qualified"); - } + // Define array $categ with categ with at least one qualified module + if ($modulequalified) + { + $modules[$i] = $objMod; + $filename[$i]= $modName; + $orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number + $dirmod[$i] = $dir; + // Set categ[$i] + $special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown'; + if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev'; + if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories + else $categ[$special]=1; + $j++; + $i++; + } + else dol_syslog("Module ".get_class($objMod)." not qualified"); + } + catch(Exception $e) + { + dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); + } + } + else + { + print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; + } + } catch(Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); @@ -252,7 +266,6 @@ if (! empty($categ[$categidx])) $categidx='expdev'; if (! empty($categ[$categidx])) { - $form = new Form($db); $categidx='expdev'; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); @@ -277,17 +290,16 @@ $var=true; if ($mode != 'marketplace') { print "\n"; - //print "\n"; + + /* print ''."\n"; - //print " \n"; print " \n"; print " \n"; print " \n"; - //print " \n"; - print " \n"; - print " \n"; + print ' '."\n"; + print ' '."\n"; print "\n"; - + */ // Show list of modules @@ -337,139 +349,160 @@ if ($mode != 'marketplace') // Print a separator if we change family //print ""; //if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) { - if ($family!=$oldfamily) { - print ''."\n '."\n"; + print '\n\n"; + print "\n"; + print ''."\n"; + print "\n"; $atleastoneforfamily=0; //print ""; } - $atleastoneforfamily++; + $atleastoneforfamily++; - if ($family!=$oldfamily) - { - $familytext=empty($familylib[$family])?$family:$familylib[$family]; - //print $familytext; - $oldfamily=$family; - } + if ($family!=$oldfamily) + { + $familytext=empty($familylib[$family])?$family:$familylib[$family]; + //print $familytext; + $oldfamily=$family; + } - $var=!$var; + $var=!$var; - //print "\n\n"; - print '\n"; + //print "\n\n"; + print '\n"; - // Picto - print ' '; + // Picto + print ' '; - // Name - print '\n"; + // Name + print '\n"; - // Desc - print "\n"; + // Desc + print '\n"; - // Version - print "\n"; + // Version + print '\n"; - // Activate/Disable and Setup (2 columns) - if (! empty($conf->global->$const_name)) - { - $disableSetup = 0; + // Activate/Disable and Setup (2 columns) + if (! empty($conf->global->$const_name)) // If module is activated + { + $disableSetup = 0; - print "'."\n"; - // Module actif - if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) - { - print $langs->trans("Required"); - if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; - print ''."\n"; - } - else - { - print ''; - print img_picto($langs->trans("Activated"),'switch_on'); - print ''."\n"; - } + if (! empty($objMod->config_page_url) && !$disableSetup) + { + if (is_array($objMod->config_page_url)) + { + print ' \n"; + } + else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) + { + print ''; + } + else + { + print ''; + } + } + else + { + print ""; + } - if (! empty($objMod->config_page_url) && !$disableSetup) - { - if (is_array($objMod->config_page_url)) - { - print ' \n"; - } - else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) - { - print ''; - } - else - { - print ''; - } - } - else - { - print ""; - } + } + else // Module not activated + { + print '\n "; + } - } - else - { - print "\n \n"; - } - - print "\n"; + print "\n"; } print "
".$langs->trans("Family")."".$langs->trans("Module")."".$langs->trans("Description")."".$langs->trans("Version")."".$langs->trans("DbVersion")."".$langs->trans("Status")."".$langs->trans("SetupShort")."'.$langs->trans("Status").''.$langs->trans("SetupShort").'
xx".$oldfamily."-".$family."-".$atleastoneforfamily."
"; + if ($family!=$oldfamily) + { + print '
'; $familytext=empty($familylib[$family])?$family:$familylib[$family]; print $familytext; - print "
'.$langs->trans("SetupShort").'
yy".$oldfamily."-".$family."-".$atleastoneforfamily."
'; - $alttext=''; - //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); - //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); - if (! empty($objMod->picto)) - { - if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1); - else print img_object($alttext,$objMod->picto,' width="14px"'); - } - else - { - print img_object($alttext,'generic'); - } - print ''; + $alttext=''; + //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); + //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); + if (! empty($objMod->picto)) + { + if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1); + else print img_object($alttext,$objMod->picto,' width="14px"'); + } + else + { + print img_object($alttext,'generic'); + } + print ''.$objMod->getName(); - print "'.$objMod->getName(); + print ""; - print nl2br($objMod->getDesc()); - print "'; + print nl2br($objMod->getDesc()); + print ""; - print $objMod->getVersion(); - print "'; + $version=$objMod->getVersion(); + $dirofmodule=$dirmod[$key]; + if ($objMod->isCoreOrExternalModule() == 'external') + { + $text=$langs->trans("ExternalModule",$dirofmodule); + if (! empty($objMod->editor_name) && $objMod->editor_name != 'dolibarr') $text.=' - '.$objMod->editor_name; + if (! empty($objMod->editor_web) && $objMod->editor_web != 'www.dolibarr.org') $text.=' - '.$objMod->editor_web; + print $form->textwithpicto($version, $text, 1, 'help'); + } + else print $version; + print ""; + print ''; + if (! empty($objMod->disabled)) + { + print $langs->trans("Disabled"); + } + else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) + { + print $langs->trans("Required"); + if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; + } + else + { + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; + } + print ''; + $i=0; + foreach ($objMod->config_page_url as $page) + { + $urlpage=$page; + if ($i++) + { + print ''.img_picto(ucfirst($page),"setup").' '; + // print ''.ucfirst($page).' '; + } + else + { + if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs)) + { + print ''.img_picto($langs->trans("Setup"),"setup").' '; + } + else + { + print ''.img_picto($langs->trans("Setup"),"setup").' '; + } + } + } + print "'.img_picto($langs->trans("Setup"),"setup").''.img_picto($langs->trans("Setup"),"setup").' '; - $i=0; - foreach ($objMod->config_page_url as $page) - { - $urlpage=$page; - if ($i++) - { - print ''.img_picto(ucfirst($page),"setup").' '; - // print ''.ucfirst($page).' '; - } - else - { - if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs)) - { - print ''.img_picto($langs->trans("Setup"),"setup").' '; - } - else - { - print ''.img_picto($langs->trans("Setup"),"setup").' '; - } - } - } - print "'.img_picto($langs->trans("Setup"),"setup").''.img_picto($langs->trans("Setup"),"setup").' '; + if (! empty($objMod->always_enabled)) + { + // Ne devrait pas arriver. + } + else if (! empty($objMod->disabled)) + { + print $langs->trans("Disabled"); + } + else + { + // Module non actif + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print "\n"; + } + print " "; - - if (! empty($objMod->always_enabled)) - { - // Ne devrait pas arriver. - } - - // Module non actif - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); - print " 
\n"; @@ -501,7 +534,7 @@ dol_fiche_end(); // Show warning about external users -if ($mode != 'marketplace') print showModulesExludedForExternal($modules).'
'."\n"; +if ($mode != 'marketplace') print '
'.showModulesExludedForExternal($modules).'

'."\n"; llxFooter(); diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 51a9f9b7728..659fcfb829f 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -46,12 +47,12 @@ if ($action == 'setvalue' && $user->admin) { $result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM",$_POST["email_from"],'chaine',0,'',$conf->entity); if ($result >= 0) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); } } @@ -126,8 +127,6 @@ foreach($listofnotifiedevents as $notifiedevent) } print ''; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 7e748cdbc4a..88e3705c4e7 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -57,7 +57,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php new file mode 100644 index 00000000000..23e6166d1a4 --- /dev/null +++ b/htdocs/admin/orderdet_extrafields.php @@ -0,0 +1,160 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Florian Henry + * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013 Florian Henry + * + * 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 . + */ + +/** + * \file htdocs/admin/orderdet_extrafields.php + * \ingroup order + * \brief Page to setup extra fields of order + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + + +if (!$user->admin) + accessforbidden(); + +$langs->load("admin"); +$langs->load("other"); +$langs->load("orders"); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); +$elementtype='commandedet'; //Must be the $table_element of the class that manage extrafield + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + + + +/* + * View + */ + +$textobject=$langs->transnoentitiesnoconv("Orders"); + +llxHeader('',$langs->trans("OrdersSetup")); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup'); +print "
\n"; + +$head = order_admin_prepare_head(null); + +dol_fiche_head($head, 'attributeslines', $langs->trans("ModuleSetup"), 0, 'order'); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print '
'; + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; +} + +print "
'.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
"; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel */ +/* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
"; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
"; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/admin/osc-languages.php b/htdocs/admin/osc-languages.php index 0d6df08a8b7..83446034f0d 100644 --- a/htdocs/admin/osc-languages.php +++ b/htdocs/admin/osc-languages.php @@ -72,7 +72,7 @@ if ($resql) while ($i < $num) { $objp = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; print "$objp->languages_id\n"; print "$objp->name\n"; print "$objp->code\n"; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 0c87c347e5c..c2d2aa69d61 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * * 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,15 +76,15 @@ if ($action == "set") else $error++; if (! $error) - { - $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $db->rollback(); - $mesg = "".$langs->trans("Error").""; - } + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == "addnotif") @@ -165,12 +165,16 @@ print '
'; +dol_fiche_end(); + print '
'; + /* * Notifications */ +/* Disable this, there is no trigger with elementtype 'withdraw' if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); @@ -242,43 +246,43 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print ''; print ''; + + // List of current notifications for objet_type='withdraw' + $sql = "SELECT u.lastname, u.firstname,"; + $sql.= " nd.rowid, ad.code, ad.label"; + $sql.= " FROM ".MAIN_DB_PREFIX."user as u,"; + $sql.= " ".MAIN_DB_PREFIX."notify_def as nd,"; + $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad"; + $sql.= " WHERE u.rowid = nd.fk_user"; + $sql.= " AND nd.fk_action = ad.rowid"; + $sql.= " AND u.entity IN (0,".$conf->entity.")"; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + $var = false; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; + + print ""; + print ''.dolGetFirstLastname($obj->firstname,$obj->lastname).''; + $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); + print ''.$label.''; + print 'rowid.'">'.img_delete().''; + print ''; + $i++; + } + $db->free($resql); + } + + print ''; + print ''; } -// List of current notifications for objet_type='withdraw' -$sql = "SELECT u.lastname, u.firstname,"; -$sql.= " nd.rowid, ad.code, ad.label"; -$sql.= " FROM ".MAIN_DB_PREFIX."user as u,"; -$sql.= " ".MAIN_DB_PREFIX."notify_def as nd,"; -$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad"; -$sql.= " WHERE u.rowid = nd.fk_user"; -$sql.= " AND nd.fk_action = ad.rowid"; -$sql.= " AND u.entity IN (0,".$conf->entity.")"; - -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - $i = 0; - $var = false; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - print ""; - print ''.dolGetFirstLastname($obj->firstname,$obj->lastname).''; - $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); - print ''.$label.''; - print 'rowid.'">'.img_delete().''; - print ''; - $i++; - } - $db->free($resql); -} - -print ''; -print ''; - -dol_htmloutput_mesg($mesg); +*/ $db->close(); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 13f9eb32f46..de01582048d 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -48,7 +48,7 @@ $type='propal'; /* * Actions */ - +$error=0; if ($action == 'updateMask') { $maskconstpropal=GETPOST('maskconstpropal','alpha'); @@ -58,13 +58,13 @@ if ($action == 'updateMask') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == 'specimen') @@ -101,13 +101,13 @@ if ($action == 'specimen') } else { - $mesg=''.$module->error.''; + setEventMessage($module->error,'errors'); dol_syslog($module->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -120,13 +120,13 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == 'set_PROPALE_FREE_TEXT') @@ -138,13 +138,13 @@ if ($action == 'set_PROPALE_FREE_TEXT') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == 'setdefaultduration') @@ -154,13 +154,13 @@ if ($action == 'setdefaultduration') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) @@ -183,18 +183,17 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } - - +// Activate a model if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); @@ -262,9 +261,9 @@ print ''; print ''; print '\n"; print '\n"; -print '\n"; +print '\n"; print ''; -print ''; +print ''; print ''."\n"; clearstatcache(); @@ -359,16 +358,16 @@ print "
'.$langs->trans("Name")."'.$langs->trans("Description")."'.$langs->trans("Example")."'.$langs->trans("Example")."'.$langs->trans("Status").''.$langs->trans("Infos").''.$langs->trans("ShortInfo").'

\n"; /* - * Modeles de documents + * Document templates generators */ print_titre($langs->trans("ProposalsPDFModules")); -// Defini tableau def de modele propal +// Load array def with activated templates $def = array(); $sql = "SELECT nom"; $sql.= " FROM ".MAIN_DB_PREFIX."document_model"; -$sql.= " WHERE type = 'propal'"; +$sql.= " WHERE type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) @@ -390,11 +389,11 @@ else print "\n"; print "\n"; -print " \n"; +print " \n"; print " \n"; print '\n"; print '\n"; -print ''; +print ''; print ''; print "\n"; @@ -602,8 +601,6 @@ print "\n"; print "\n \n \n\n"; print "
".$langs->trans("Name")."".$langs->trans("Name")."".$langs->trans("Description")."'.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("Infos").''.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
".$langs->trans("PathDirectory")."".$conf->propal->dir_output."
\n
"; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 5fe56bafaea..a292ae75e11 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2011-2013 Laurent Destailleur + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -43,12 +44,12 @@ if (GETPOST("action") == 'set_proxy') { if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) { - $mesg='
'.$langs->trans("ErrorValueMustBeInteger").'
'; + setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors'); $error++; } if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) { - $mesg='
'.$langs->trans("ErrorValueMustBeInteger").'
'; + setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors'); $error++; } @@ -67,7 +68,7 @@ if (GETPOST("action") == 'set_proxy') if (! $error) { - $mesg='
'.$langs->trans("RecordModifiedSuccessfully").'
'; + setEventMessage($langs->trans("RecordModifiedSuccessfully")); } } @@ -195,16 +196,13 @@ print ''; print ''; -dol_fiche_end(); - -print '
'; +print '
'; print ''; print '
'; -print '
'; +print ''; - -dol_htmloutput_mesg($mesg); +dol_fiche_end(); $db->close(); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 83d2d5f8947..bacf1c0cebb 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -37,9 +38,6 @@ if (!$user->admin) accessforbidden(); // Allow/Disallow change to clear passwords once passwords are crypted $allow_disable_encryption=true; -$mesg = ''; - - /* * Actions */ @@ -135,7 +133,7 @@ if ($action == 'activate_encryptdbpassconf') } else { - $mesg='
'.$langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)).'
'; + setEventMessage($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)),'warnings'); } } else if ($action == 'disable_encryptdbpassconf') @@ -150,7 +148,7 @@ else if ($action == 'disable_encryptdbpassconf') } else { - $mesg='
'.$langs->trans('InstrucToClearPass',$dolibarr_main_db_pass).'
'; + setEventMessage($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass),'warnings'); } } @@ -179,8 +177,6 @@ llxHeader('',$langs->trans("Passwords")); print_fiche_titre($langs->trans("SecuritySetup"),'','setup'); -dol_htmloutput_mesg($mesg); - print $langs->trans("GeneratedPasswordDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index b78a201b9d1..6afc12949d6 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -82,27 +83,27 @@ else if (preg_match('/del_(.*)/',$action,$reg)) else if ($action == 'MAIN_SESSION_TIMEOUT') { if (! dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + else setEventMessage($langs->trans("RecordModifiedSuccessfully")); } else if ($action == 'MAIN_UPLOAD_DOC') { if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + else setEventMessage($langs->trans("RecordModifiedSuccessfully")); } else if ($action == 'MAIN_UMASK') { if (! dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + else setEventMessage($langs->trans("RecordModifiedSuccessfully")); } else if ($action == 'MAIN_ANTIVIRUS_COMMAND') { if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + else setEventMessage($langs->trans("RecordModifiedSuccessfully")); } else if ($action == 'MAIN_ANTIVIRUS_PARAM') { if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + else setEventMessage($langs->trans("RecordModifiedSuccessfully")); } // Delete file @@ -326,7 +327,7 @@ dol_fiche_end(); // Form to test upload print '
'; $formfile=new FormFile($db); -$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1); +$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, '', '', 1, '', 0); // List of document $filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1); diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index a91b8aa2ebd..bdab2164888 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -1,6 +1,7 @@ * Copyright (C) 2009 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * * 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,25 +88,25 @@ if ($action == 'send' && ! $_POST['cancel']) if (! empty($formsms->error)) { - $message='
'.$formsms->error.'
'; + setEventMessage($formsms->error,'errors'); $action='test'; $error++; } if (empty($body)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Message")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Message")),'errors'); $action='test'; $error++; } if (empty($smsfrom) || ! str_replace('+','',$smsfrom)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsFrom")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsFrom")),'errors'); $action='test'; $error++; } if (empty($sendto) || ! str_replace('+','',$sendto)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsTo")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsTo")),'errors'); $action='test'; $error++; } @@ -122,11 +123,11 @@ if ($action == 'send' && ! $_POST['cancel']) if ($result) { - $message='
'.$langs->trans("SmsSuccessfulySent",$smsfrom,$sendto).'
'; + setEventMessage($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto)); } else { - $message='
'.$langs->trans("ResultKo").'
'.$smsfile->error.' '.$result.'
'; + setEventMessage($langs->trans("ResultKo"),'errors'); } $action=''; @@ -151,8 +152,6 @@ print_fiche_titre($langs->trans("SmsSetup"),'','setup'); print $langs->trans("SmsDesc")."
\n"; print "
\n"; -dol_htmloutput_mesg($message); - // List of sending methods $listofmethods=(is_array($conf->modules_parts['sms'])?$conf->modules_parts['sms']:array()); asort($listofmethods); diff --git a/htdocs/adherents/admin/spip.php b/htdocs/admin/spip.php similarity index 93% rename from htdocs/adherents/admin/spip.php rename to htdocs/admin/spip.php index 9bbb95c2697..30966f8bfbf 100644 --- a/htdocs/adherents/admin/spip.php +++ b/htdocs/admin/spip.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -22,14 +22,15 @@ */ /** - * \file htdocs/adherents/admin/spip.php + * \file htdocs/admin/spip.php * \ingroup mailmanspip * \brief Page to setup the module MailmanSpip (SPIP) */ -require '../../main.inc.php'; +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->load("admin"); $langs->load("members"); @@ -69,11 +70,11 @@ if ($action == 'update' || $action == 'add') if (! $error) { - $mesg = '
'.$langs->trans("SetupSaved").'
'; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = '
'.$langs->trans("Error").'
'; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -116,9 +117,6 @@ $head = mailmanspip_admin_prepare_head(); dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); - -dol_htmloutput_mesg($mesg); - /* * Spip */ diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 3733973bb2a..067da1dd91e 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -2,9 +2,9 @@ /* Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2008-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2013 Philippe Grand - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry * * 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 @@ -73,6 +73,11 @@ if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL' if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", GETPOST('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER','alpha'),'chaine',0,'',$conf->entity); } +if($action == 'USE_VIRTUAL_STOCK') { + $db->begin(); + $res = dolibarr_set_const($db, "USE_VIRTUAL_STOCK", GETPOST('USE_VIRTUAL_STOCK','alpha'),'chaine',0,'',$conf->entity); +} + if($action) { if (! $res > 0) $error++; @@ -80,15 +85,16 @@ if($action) if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } + /* * View */ @@ -243,7 +249,25 @@ if (! empty($conf->fournisseur->enabled)) print ''; -dol_htmloutput_mesg($mesg); +print '
'; +print ''; +print ''; +print " \n"; +print " \n"; +print ''."\n"; +$var = !$var; +print ""; +print ''; +print '\n"; +print "\n"; +print '
".$langs->trans("RuleForStockReplenishment")." 
'.$langs->trans("UseVirtualStock").''; +print "
"; +print ''; +print ""; +print $form->selectyesno("USE_VIRTUAL_STOCK",$conf->global->USE_VIRTUAL_STOCK,1); +print ''; +print '
'; +print "
'; $db->close(); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 5e6dfae8587..6ee60ddfb33 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -61,14 +61,14 @@ if ($action == 'updateMask') if (! $res > 0) $error++; - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == 'specimen') // For invoices @@ -106,13 +106,13 @@ if ($action == 'specimen') // For invoices } else { - $mesg=''.$module->error.''; + setEventMessage($module->error,'errors'); dol_syslog($module->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -172,14 +172,14 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') if (! $res > 0) $error++; - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } @@ -213,7 +213,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; -print ''.$langs->trans("Info").''; +print ''.$langs->trans("ShortInfo").''; print "\n"; clearstatcache(); @@ -346,7 +346,8 @@ print ''.$langs->trans("Name").''."\n"; print ''.$langs->trans("Description").''."\n"; print ''.$langs->trans("Status").''."\n"; print ''.$langs->trans("Default").''."\n"; -print ''.$langs->trans("Info").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print ''."\n"; clearstatcache(); @@ -371,9 +372,14 @@ foreach ($dirmodels as $reldir) $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); + require_once $dir.'/'.$file; + $module = new $classname($db, new FactureFournisseur($db)); + $var=!$var; print "\n"; - print "".$name."\n"; + print ""; + print (empty($module->name)?$name:$module->name); + print "\n"; print "\n"; require_once $dir.$file; $module = new $classname($db,$specimenthirdparty); @@ -457,17 +463,15 @@ print "\n"; print '
'; print ''; -print ''; +print ''; print ''; print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')
'; -print ''; +print ''; print ''; print ''; print "\n"; print '
'; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); ?> diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 48bc14f1245..bac30ddfbdd 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -42,6 +42,7 @@ accessforbidden(); $type=GETPOST('type', 'alpha'); $value=GETPOST('value', 'alpha'); +$label = GETPOST('label','alpha'); $action=GETPOST('action', 'alpha'); $specimenthirdparty=new Societe($db); @@ -61,14 +62,14 @@ if ($action == 'updateMask') if (! $res > 0) $error++; - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } else if ($action == 'specimen') // For orders @@ -106,13 +107,13 @@ else if ($action == 'specimen') // For orders } else { - $mesg=''.$module->error.''; + setEventMessage($module->error,'errors'); dol_syslog($module->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -172,14 +173,14 @@ else if ($action == 'set_SUPPLIER_ORDER_FREE_TEXT') if (! $res > 0) $error++; - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } @@ -213,7 +214,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; -print ''.$langs->trans("Info").''; +print ''.$langs->trans("ShortInfo").''; print "\n"; clearstatcache(); @@ -344,7 +345,8 @@ print ''.$langs->trans("Name").''."\n"; print ''.$langs->trans("Description").''."\n"; print ''.$langs->trans("Status").''."\n"; print ''.$langs->trans("Default").''."\n"; -print ''.$langs->trans("Info").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print ''."\n"; clearstatcache(); @@ -366,9 +368,14 @@ foreach ($dirmodels as $reldir) $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); + require_once $dir.'/'.$file; + $module = new $classname($db, new CommandeFournisseur($db)); + $var=!$var; print "\n"; - print "".$name."\n"; + print ""; + print (empty($module->name)?$name:$module->name); + print "\n"; print "\n"; require_once $dir.$file; $module = new $classname($db,$specimenthirdparty); @@ -461,8 +468,6 @@ print '' print "\n"; print ''; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); ?> diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 8f9865981f5..fdf9e95af56 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Florian Henry * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -49,7 +50,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='commande_fournisseur'; //Must be the $table_element of the class that manage extrafield +$elementtype='facture_fourn'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); @@ -58,7 +59,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 9aa7770f820..fea9656f146 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -57,7 +57,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index f42f846e9d6..3dae4273319 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -31,7 +32,7 @@ if (!$user->admin) accessforbidden(); $langs->load("admin"); $langs->load("other"); -$error=0; $mesg=''; +$error=0; $action = GETPOST("action"); $syslogModules = array(); @@ -110,12 +111,12 @@ if ($action == 'set') if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - if (empty($mesg)) $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -129,12 +130,12 @@ if ($action == 'setlevel') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); } } @@ -249,8 +250,6 @@ print ''; print ''; print "\n"; -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close(); diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 1f1d80eb043..48b690a7198 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -105,6 +105,11 @@ $url='http://wiki.dolibarr.org/index.php/Subscribe'; if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Adh%C3%A9rer'; if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Subscribirse'; print '
  • '.$langs->trans("SubscribeToFoundation").'
  • '; + +print '
  • FaceBook
  • '; +print '
  • Twitter
  • '; +print '
  • Google Plus page
  • '; + print ''; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 681b108e1b8..3386e3aa135 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -183,7 +183,6 @@ foreach($configfileparameters as $key) print ""; if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey}); else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); - else if ($newkey == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT_ALT'); else print ${$newkey}; if ($newkey == 'dolibarr_main_url_root' && $newkey != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; print ""; diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 7e82bab5e3f..eb638b68711 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -103,7 +103,7 @@ else { $obj = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''.$obj->Name.''; print ''.$obj->Engine.''; @@ -156,7 +156,7 @@ else { $row = $db->fetch_row($resql); $var=!$var; - print ""; + print ""; print ''.$row[0].''; print ''.$row[1].''; print ''.$row[2].''; diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 211731d4332..4bd9ed2d053 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * @@ -48,7 +48,7 @@ print ''.$langs->trans("Version").''.get print ''.$langs->trans("DatabaseServer").''.$conf->db->host.''."\n"; print ''.$langs->trans("DatabasePort").''.(empty($conf->db->port)?$langs->trans("Default"):$conf->db->port).''."\n"; print ''.$langs->trans("DatabaseName").''.$conf->db->name.''."\n"; -print ''.$langs->trans("DriverType").''.$conf->db->type .''."\n"; +print ''.$langs->trans("DriverType").''.$conf->db->type . ($db->getDriverInfo() ? ' ('.$db->getDriverInfo().')':'').''."\n"; print ''.$langs->trans("User").''.$conf->db->user.''."\n"; print ''.$langs->trans("Password").''.preg_replace('/./i','*',$dolibarr_main_db_pass).''."\n"; print ''.$langs->trans("DBStoringCharset").''.$db->getDefaultCharacterSetDatabase().''."\n"; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index f5eaaaa4ea4..fe182c2e73e 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -112,7 +112,7 @@ else { $row = $db->fetch_row($resql); $var=!$var; - print ""; + print ""; print "$row[0]"; print "$row[1]"; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 9b83acc0bbd..675638bf000 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -154,7 +154,8 @@ $var=!$var; print '  => price(1234.56)'.price(1234.56).''."\n"; // Timezone $txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).'
    '."\n"; -$txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php +$txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''."
    \n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php +$txt.=$langs->trans("YouCanEditPHPTZ"); $var=!$var; print ''.$langs->trans("CurrentTimeZone").''; // Timezone server PHP $a=getServerTimeZoneInt('now'); @@ -176,13 +177,20 @@ $var=!$var; print '  => dol_get_first_day(1970,1,false)'.dol_get_first_day(1970,1,false).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')'; $var=!$var; print '  => dol_get_first_day(1970,1,true)'.dol_get_first_day(1970,1,true).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')'; -// Parent company -/* -$var=!$var; -print ''.$langs->trans("CompanyTZ").''.$langs->trans("FeatureNotYetAvailable").''."\n"; -$var=!$var; -print '  => '.$langs->trans("CompanyHour").''.$langs->trans("FeatureNotYetAvailable").''."\n"; -*/ +// Database timezone +if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') +{ + $var=!$var; + print ''.$langs->trans("MySQLTimeZone").' (database)'; // Timezone server base + $sql="SHOW VARIABLES where variable_name = 'system_time_zone'"; + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + print $form->textwithtooltip($obj->Value,$langs->trans('TZHasNoEffect'),2,1,img_info('')); + } + print ''."\n"; +} // Client $var=!$var; $tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst']; @@ -301,7 +309,6 @@ foreach($configfileparameters as $key => $value) print ""; if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey}); else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); - else if ($newkey == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT_ALT'); else print ${$newkey}; if ($newkey == 'dolibarr_main_url_root' && $newkey != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; print ""; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 0baed9e53bc..a4cc4fefc11 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -74,15 +74,27 @@ foreach($modulesdir as $dir) else { // File to load - include_once $dir.$file; - - $objMod = new $modName($db); - - $modules[$objMod->numero]=$objMod; - $modules_names[$objMod->numero]=$objMod->name; - $modules_files[$objMod->numero]=$file; - $modules_fullpath[$file]=$dir.$file; - $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; + $res=include_once $dir.$file; + if (class_exists($modName)) + { + try { + $objMod = new $modName($db); + + $modules[$objMod->numero]=$objMod; + $modules_names[$objMod->numero]=$objMod->name; + $modules_files[$objMod->numero]=$file; + $modules_fullpath[$file]=$dir.$file; + $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; + } + catch(Exception $e) + { + dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); + } + } + else + { + print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
    "; + } } } } @@ -106,7 +118,7 @@ foreach($sortorder as $numero=>$name) $idperms=""; $var=!$var; // Module - print ""; + print ""; $alt=$name.' - '.$modules_files[$numero]; if (! empty($picto[$numero])) { diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php new file mode 100644 index 00000000000..124fc7d35bd --- /dev/null +++ b/htdocs/admin/system/perf.php @@ -0,0 +1,478 @@ + + * + * 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 . + */ + +/** + * \file htdocs/admin/system/perf.php + * \brief Page to show Performance information + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + +$langs->load("admin"); +$langs->load("install"); +$langs->load("other"); + +if (! $user->admin) + accessforbidden(); + +if (GETPOST('action') == 'donothing') +{ + exit; +} + + +/* + * View + */ + +$form=new Form($db); +$nowstring=dol_print_date(dol_now(),'dayhourlog'); + +llxHeader(); + +print_fiche_titre($langs->trans("PerfDolibarr"),'','setup'); + +print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' ('.$langs->trans("Reload").')
    '; + +// XDebug +print '
    '; +print ''.$langs->trans("XDebug").': '; +$test=!function_exists('xdebug_is_enabled'); +if ($test) print img_picto('','tick.png').' '.$langs->trans("NotInstalled"); +else +{ + print img_picto('','warning').' '.$langs->trans("XDebugInstalled"); + print ' '.$langs->trans("MoreInformation").' XDebug admin page'; +} +print '
    '; + +// Applicative cache +print '
    '; +print ''.$langs->trans("ApplicativeCache").': '; +$test=!empty($conf->memcached->enabled); +if ($test) +{ + if (!empty($conf->global->MEMCACHED_SERVER)) + { + print img_picto('','tick.png').' '.$langs->trans("MemcachedAvailableAndSetup"); + print ' '.$langs->trans("MoreInformation").' Memcached module admin page'; + } + else + { + print img_picto('','warning').' '.$langs->trans("MemcachedModuleAvailableButNotSetup"); + } +} +else print img_picto('','warning').' '.$langs->trans("MemcachedNotAvailable"); +print '
    '; + +// OPCode cache +print '
    '; +print ''.$langs->trans("OPCodeCache").': '; +$foundcache=0; +$test=function_exists('xcache_info'); +if (! $foundcache && $test) +{ + $foundcache++; + print img_picto('','tick.png').' '.$langs->trans("XCacheInstalled"); + print ' '.$langs->trans("MoreInformation").' Xcache admin page'; +} +$test=function_exists('eaccelerator_info'); +if (! $foundcache && $test) +{ + $foundcache++; + print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled"); +} +$test=function_exists('apc_cache_info'); +if (! $foundcache && $test) +{ + //var_dump(apc_cache_info()); + if (ini_get('apc.enabled')) + { + $foundcache++; + print img_picto('','tick.png').' '.$langs->trans("APCInstalled"); + } + else + { + print img_picto('','warning').' '.$langs->trans("APCCacheInstalledButDisabled"); + } +} +if (! $foundcache) print $langs->trans("NoOPCodeCacheFound"); +print '
    '; + +// HTTPCacheStaticResources +print ''; + + +print '
    '; +print ''.$langs->trans("HTTPCacheStaticResources").' - '; +print $langs->trans("CacheByServer").':
    '; +// No cahce on PHP +//print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'php (.php)').'
    '; +//print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeNotCached",'php (.php)').'
    '; +// Cache on rest +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCached",'css (.css)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCached",'css (.css)').'
    '; +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCached",'css (.css.php)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCached",'css (.css.php)').'
    '; +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCached",'img (.png)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCached",'img (.png)').'
    '; +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCached",'javascript (.js)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCached",'javascript (.js)').'
    '; +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCached",'javascript (.js.php)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCached",'javascript (.js.php)').'
    '; +print '
    '; +print ''.$langs->trans("HTTPCacheStaticResources").' - '; +print $langs->trans("CacheByClient").':
    '; +print $langs->trans("TestNotPossibleWithCurrentBrowsers").'
    '; + + +// Compressions +print '
    '; +print ''.$langs->trans("CompressionOfResources").': '; +//$tmp=getURLContent(DOL_URL_ROOT.'/index.php','GET');var_dump($tmp); +print '
    '; +// on PHP +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'php (.php)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'php (.php)').'
    '; +// on rest +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'css (.css)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'css (.css)').'
    '; +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'css (.css.php)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'css (.css.php)').'
    '; +//print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'img (.png)').'
    '; +//print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'img (.png)').'
    '; +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'javascript (.js)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'javascript (.js)').'
    '; +print '
    '.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'javascript (.js.php)').'
    '; +print '
    '.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'javascript (.js.php)').'
    '; + +// Database driver +print '
    '; +print ''.$langs->trans("DriverType").': '; +print '
    '; +if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') +{ + $test=($conf->db->type == 'mysqli'); + if ($test) + { + print img_picto('','tick.png').' '.$langs->trans("YouUseBestDriver",$conf->db->type); + } + else + { + print img_picto('','warning.png').' '.$langs->trans("YouDoNotUseBestDriver",$conf->db->type,'mysqli'); + } + print '
    '; +} + +// Product search +print '
    '; +print ''.$langs->trans("SearchOptim").': '; +print '
    '; +$tab = array(); +$sql = "SELECT COUNT(*) as nb"; +$sql.= " FROM ".MAIN_DB_PREFIX."product as p"; +$resql=$db->query($sql); +if ($resql) +{ + $limitforoptim=10000; + $num=$db->num_rows($resql); + $obj=$db->fetch_object($resql); + $nb=$obj->nb; + if ($nb > $limitforoptim) + { + if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) + { + print img_picto('','warning.png').' '.$langs->trans("YouHaveXProductUseSearchOptim",$nb); + } + else + { + print img_picto('','tick.png').' '.$langs->trans("YouHaveXProductAndSearchOptimOn",$nb); + } + } + else + { + print img_picto('','tick.png').' '.$langs->trans("NbOfProductIsLowerThanNoPb",$nb); + } + print '
    '; + $db->free($resql); +} + +// Browser +print '
    '; +print ''.$langs->trans("Browser").':
    '; +if (! in_array($conf->browser->name, array('chrome','opera','safari','firefox'))) +{ + print img_picto('','warning.png').' '.$langs->trans("BrowserIsKO",$conf->browser->name); +} +else +{ + print img_picto('','tick.png').' '.$langs->trans("BrowserIsOK",$conf->browser->name); +} +print '
    '; + +// Database statistics update +/* +print '
    '; +print ''.$langs->trans("DatabaseStatistics").': '; +print '
    '; +*/ + + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index d95c9574707..b3b833557f6 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.php @@ -56,7 +56,7 @@ if (function_exists('socket_create')) print 'XDEBUG_PORT: '.$port."
    \n"; print "
    \n"; $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - if (empty($socket)) die('Unable to preapre a socket'); + if (empty($socket)) die('Unable to prepare a socket'); //socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port); //socket_listen($sock); //$client = socket_accept($sock); diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index c5d19eb9109..92e047b4a08 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -82,12 +82,12 @@ if ($action == 'settaxmode') if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } @@ -208,8 +208,6 @@ else print ''; } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 63ef6376df7..847b20783b2 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -50,7 +50,7 @@ if (! $user->admin) if ($action == 'delete') { - $file=$conf->admin->dir_output.'/backup/'.GETPOST('urlfile'); + $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); @@ -359,9 +359,9 @@ print $langs->trans("BackupDescY").'

    '; - - -
    : +
    +trans("Destination"); ?> +:
    - +
    " id="buttonGo" />

    diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 8dbd7a1912e..4e85a4d3096 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -58,7 +58,7 @@ if ($file && ! $what) if ($action == 'delete') { - $file=$conf->admin->dir_output.'/backup/'.GETPOST('urlfile'); + $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); @@ -451,46 +451,53 @@ function backup_tables($outputfile, $tables='*') //fwrite($handle,"/*!40101 SET character_set_client = utf8 */;\n"); $resqldrop=$db->query('SHOW CREATE TABLE '.$table); $row2 = $db->fetch_row($resqldrop); - fwrite($handle,$row2[1].";\n"); - //fwrite($handle,"/*!40101 SET character_set_client = @saved_cs_client */;\n\n"); - - - // Dumping the data (locking the table and disabling the keys check while doing the process) - fwrite($handle, "\n--\n-- Dumping data for table `".$table."`\n--\n"); - if (!GETPOST("nobin_nolocks")) fwrite($handle, "LOCK TABLES `".$table."` WRITE;\n"); // Lock the table before inserting data (when the data will be imported back) - if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n"); - - $sql='SELECT * FROM '.$table; - $result = $db->query($sql); - $num_fields = $db->num_rows($result); - while($row = $db->fetch_row($result)) { - // For each row of data we print a line of INSERT - fwrite($handle,'INSERT '.$delayed.$ignore.'INTO `'.$table.'` VALUES ('); - $columns = count($row); - for($j=0; $j<$columns; $j++) { - // Processing each columns of the row to ensure that we correctly save the value (eg: add quotes for string - in fact we add quotes for everything, it's easier) - if ($row[$j] == null and !is_string($row[$j])) { - // IMPORTANT: if the field is NULL we set it NULL - $row[$j] = 'NULL'; - } elseif(is_string($row[$j]) and $row[$j] == '') { - // if it's an empty string, we set it as an empty string - $row[$j] = "''"; - } elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0) - // if it's a number, we return it as-is - $row[$j] = $row[$j]; - } else { // else for all other cases we escape the value and put quotes around - $row[$j] = addslashes($row[$j]); - $row[$j] = preg_replace("#\n#", "\\n", $row[$j]); - $row[$j] = "'".$row[$j]."'"; - } - } - fwrite($handle,implode(',', $row).");\n"); + if (empty($row2[1])) + { + fwrite($handle, "\n-- WARNING: Show create table ".$table." return empy string when it should not.\n"); } - if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` ENABLE KEYS;\n"); // Enabling back the keys/index checking - if (!GETPOST("nobin_nolocks")) fwrite($handle, "UNLOCK TABLES;\n"); // Unlocking the table - fwrite($handle,"\n\n\n"); - } + else + { + fwrite($handle,$row2[1].";\n"); + //fwrite($handle,"/*!40101 SET character_set_client = @saved_cs_client */;\n\n"); + // Dumping the data (locking the table and disabling the keys check while doing the process) + fwrite($handle, "\n--\n-- Dumping data for table `".$table."`\n--\n"); + if (!GETPOST("nobin_nolocks")) fwrite($handle, "LOCK TABLES `".$table."` WRITE;\n"); // Lock the table before inserting data (when the data will be imported back) + if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n"); + + $sql='SELECT * FROM '.$table; + $result = $db->query($sql); + $num_fields = $db->num_rows($result); + while($row = $db->fetch_row($result)) + { + // For each row of data we print a line of INSERT + fwrite($handle,'INSERT '.$delayed.$ignore.'INTO `'.$table.'` VALUES ('); + $columns = count($row); + for($j=0; $j<$columns; $j++) { + // Processing each columns of the row to ensure that we correctly save the value (eg: add quotes for string - in fact we add quotes for everything, it's easier) + if ($row[$j] == null and !is_string($row[$j])) { + // IMPORTANT: if the field is NULL we set it NULL + $row[$j] = 'NULL'; + } elseif(is_string($row[$j]) and $row[$j] == '') { + // if it's an empty string, we set it as an empty string + $row[$j] = "''"; + } elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0) + // if it's a number, we return it as-is + $row[$j] = $row[$j]; + } else { // else for all other cases we escape the value and put quotes around + $row[$j] = addslashes($row[$j]); + $row[$j] = preg_replace("#\n#", "\\n", $row[$j]); + $row[$j] = "'".$row[$j]."'"; + } + } + fwrite($handle,implode(',', $row).");\n"); + } + if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` ENABLE KEYS;\n"); // Enabling back the keys/index checking + if (!GETPOST("nobin_nolocks")) fwrite($handle, "UNLOCK TABLES;\n"); // Unlocking the table + fwrite($handle,"\n\n\n"); + } + } + /* Backup Procedure structure*/ /* $result = $db->query('SHOW PROCEDURE STATUS'); diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php index 9dc1aef46b2..955d02b50f9 100644 --- a/htdocs/admin/tools/index.php +++ b/htdocs/admin/tools/index.php @@ -35,13 +35,13 @@ if (! $user->admin) * View */ +$form = new Form($db); + $title=$langs->trans("SystemToolsArea"); if (GETPOST('leftmenu') == 'modulesadmintools') $title=$langs->trans("ModulesSystemTools"); llxHeader(array(),$title); -$form = new Form($db); - print_fiche_titre($title,'','setup'); print $langs->trans("SystemToolsAreaDesc").'
    '; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 5347b709410..d733182f054 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -150,8 +150,7 @@ if ($result) if ($action == 'purge') { $formquestion=array(); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1); } print ''; @@ -189,7 +188,7 @@ if ($result) print ''; print ''; print "\n"; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 780e4427078..5f12b6c150f 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -116,14 +116,12 @@ print '
    '; if ($action == 'purge') { $formquestion=array(); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2); } else if ($action == 'lock') { $formquestion=array(); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1); } if ($savehandler == 'files') @@ -145,7 +143,7 @@ if ($savehandler == 'files') { $var=!$var; - print ""; + print ""; // Login print ''; diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 3aae9b0f009..29e4c96b6c3 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -75,7 +75,7 @@ if (GETPOST('action','alpha')=='install') $result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'],$newfile,1,0,$_FILES['fileinstall']['error']); if ($result > 0) { - $documentrootalt=DOL_DOCUMENT_ROOT_ALT; + $documentrootalt=DOL_DOCUMENT_ROOT.'/extensions'; $result=dol_uncompress($newfile,$documentrootalt); if (! empty($result['error'])) { @@ -95,7 +95,7 @@ if (GETPOST('action','alpha')=='install') * View */ -$dirins=DOL_DOCUMENT_ROOT_ALT; +$dirins=DOL_DOCUMENT_ROOT.'/extensions'; $dirins_ok=(is_dir($dirins)); $wikihelp='EN:Installation_-_Upgrade|FR:Installation_-_Mise_à_jour|ES:Instalación_-_Actualización'; @@ -141,7 +141,7 @@ print ''.$langs->trans("StepNb",3).': '; print $langs->trans("UnpackPackageInDolibarrRoot",$dolibarrroot).'
    '; if (! empty($conf->global->MAIN_ONLINE_INSTALL_MODULE)) { - if ($dirins_ok && $dirins != 'DOL_DOCUMENT_ROOT_ALT') + if ($dirins_ok) { print ''; print ''; @@ -151,8 +151,8 @@ if (! empty($conf->global->MAIN_ONLINE_INSTALL_MODULE)) } else { - $message=info_admin($langs->trans("NotExistsDirect").$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); - print $message; + $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); + print '
    '.$message.'
    '; } } else diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 980bd9ef4bb..2b930b8afc1 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2013 Laurent Destailleur * * 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 diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index cc666f4c35b..f0ceb6dedea 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -70,7 +70,21 @@ if (preg_match('/del_(.*)/',$action,$reg)) dol_print_error($db); } } +//Set hide closed customer into combox or select +if ($action == 'sethideinactiveuser') +{ + $status = GETPOST('status','alpha'); + if (dolibarr_set_const($db, "USER_HIDE_INACTIVE_IN_COMBOBOX",$status,'chaine',0,'',$conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} /* * View @@ -121,6 +135,27 @@ else } print ''; +/* +// USER_USE_SEARCH_TO_SELECT +$var=!$var; +print ""; +print ''; +print ''; +if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) +{ + print ''; +} +else +{ + print ''; +} +print ''; +*/ + print '
    '; - print ''; + print ''; print '
    '.$sessionentry['login'].'
    '.$langs->trans("HideClosedUserComboBox").' '; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print '
    '; dol_fiche_end(); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index b46f7b39cc3..cea1690b818 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -80,7 +80,10 @@ $workflowcodes=array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'), 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'), 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'), + // For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card. 'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), + 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), + ); if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow'])) diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php index c3634b6c726..c322360fb4a 100644 --- a/htdocs/bookmarks/liste.php +++ b/htdocs/bookmarks/liste.php @@ -103,7 +103,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; // Id print ''; diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php index feaf7d2068e..31d7bf3e81e 100644 --- a/htdocs/boutique/client/fiche.php +++ b/htdocs/boutique/client/fiche.php @@ -80,7 +80,7 @@ if ($id > 0) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print 'Fiche '; diff --git a/htdocs/boutique/client/index.php b/htdocs/boutique/client/index.php index 8b67d4311f5..82eb9ef4bb0 100644 --- a/htdocs/boutique/client/index.php +++ b/htdocs/boutique/client/index.php @@ -70,7 +70,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''.$objp->customers_firstname."\n"; print ''.$objp->customers_lastname."\n"; print "$objp->customers_email_address\n"; diff --git a/htdocs/boutique/commande/ca.php b/htdocs/boutique/commande/ca.php index c8f170af15c..b5f4bab9e1c 100644 --- a/htdocs/boutique/commande/ca.php +++ b/htdocs/boutique/commande/ca.php @@ -66,7 +66,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print 'Somme des commandes'; print ''.price($objp->value).''; @@ -94,7 +94,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print 'Somme des frais de port'; print ''.price($objp->value).''; $i++; diff --git a/htdocs/boutique/commande/class/boutiquecommande.class.php b/htdocs/boutique/commande/class/boutiquecommande.class.php index bf1e2fd7fd1..62528c21b70 100644 --- a/htdocs/boutique/commande/class/boutiquecommande.class.php +++ b/htdocs/boutique/commande/class/boutiquecommande.class.php @@ -27,8 +27,7 @@ include_once DOL_DOCUMENT_ROOT.'/boutique/commande/class/boutiquecommande.class. /** - * \class BoutiqueCommande - * \brief Classe permettant la gestion des commandes OSC + * Class to manage orders OSC */ class BoutiqueCommande { diff --git a/htdocs/boutique/commande/fiche.php b/htdocs/boutique/commande/fiche.php index e7f0e83537f..e00f9007940 100644 --- a/htdocs/boutique/commande/fiche.php +++ b/htdocs/boutique/commande/fiche.php @@ -86,7 +86,7 @@ if ($id > 0) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''; print 'Fiche livre'; diff --git a/htdocs/boutique/commande/index.php b/htdocs/boutique/commande/index.php index 382ecba6600..c5d166cf4e4 100644 --- a/htdocs/boutique/commande/index.php +++ b/htdocs/boutique/commande/index.php @@ -69,7 +69,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print 'Fiche '; print $objp->orders_id .""; diff --git a/htdocs/boutique/critiques/bestproduct.php b/htdocs/boutique/critiques/bestproduct.php index 45e3fba2a88..556c1926979 100644 --- a/htdocs/boutique/critiques/bestproduct.php +++ b/htdocs/boutique/critiques/bestproduct.php @@ -74,7 +74,7 @@ if ($resql) while ($i < $num) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''.$objp->products_model.''; print ''.$objp->rat."\n"; print ''.$objp->products_quantity."\n"; diff --git a/htdocs/boutique/critiques/index.php b/htdocs/boutique/critiques/index.php index fd6bdb528f4..186756f6e42 100644 --- a/htdocs/boutique/critiques/index.php +++ b/htdocs/boutique/critiques/index.php @@ -70,7 +70,7 @@ if ($resql) { while ($i < $num) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print "".substr($objp->products_name, 0, 30)."\n"; print ''.substr($objp->reviews_text, 0, 40)." ...\n"; print "$objp->reviews_rating\n"; diff --git a/htdocs/boutique/index.php b/htdocs/boutique/index.php index 0e791515f09..91301c69dec 100644 --- a/htdocs/boutique/index.php +++ b/htdocs/boutique/index.php @@ -70,7 +70,7 @@ if ($result) { $objp = $dbosc->fetch_object($result); $var=!$var; - print ""; + print ""; print ''.$objp->mois.''; print ''.price($objp->value).''; diff --git a/htdocs/boutique/notification/index.php b/htdocs/boutique/notification/index.php index 62fbe0ce597..3a27326e1fb 100644 --- a/htdocs/boutique/notification/index.php +++ b/htdocs/boutique/notification/index.php @@ -70,7 +70,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print "rowid\">$objp->customers_firstname $objp->customers_lastname\n"; print ''.$objp->products_name.""; print "\n"; diff --git a/htdocs/boutique/notification/produits.php b/htdocs/boutique/notification/produits.php index 18f66b696e7..eb897497540 100644 --- a/htdocs/boutique/notification/produits.php +++ b/htdocs/boutique/notification/produits.php @@ -71,7 +71,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''.$objp->products_name.""; print ''.$objp->nb.''; diff --git a/htdocs/boutique/produits/index.php b/htdocs/boutique/produits/index.php index 71dd2bd8d53..f8bae975445 100644 --- a/htdocs/boutique/produits/index.php +++ b/htdocs/boutique/produits/index.php @@ -67,7 +67,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''.$objp->customers_firstname."\n"; print ''.$objp->customers_lastname."\n"; print "$objp->customers_email_address\n"; diff --git a/htdocs/boutique/produits/osc-liste.php b/htdocs/boutique/produits/osc-liste.php index 84084bfde7a..ef1369dd503 100644 --- a/htdocs/boutique/produits/osc-liste.php +++ b/htdocs/boutique/produits/osc-liste.php @@ -81,7 +81,7 @@ if ($resql) { $objp = $dbosc->fetch_object($resql); $var=!$var; - print ""; + print ""; print "$objp->products_id\n"; print "$objp->products_model\n"; print "$objp->products_name\n"; diff --git a/htdocs/boutique/promotion/index.php b/htdocs/boutique/promotion/index.php index f70b793cd64..7cbba5c5014 100644 --- a/htdocs/boutique/promotion/index.php +++ b/htdocs/boutique/promotion/index.php @@ -82,7 +82,7 @@ if ($resql) $objp = $dbosc->fetch_object($i); $var=!$var; - print ""; + print ""; print ''.$objp->products_model.""; print ''.$objp->products_name.""; diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest new file mode 100644 index 00000000000..34782a02141 --- /dev/null +++ b/htdocs/cache.manifest @@ -0,0 +1,41 @@ +CACHE MANIFEST +# version 2013-05-21 13:30:21 +# Note: If this file is dynamic, it must return MIME text/cache-manifest +# Note: Order of CACHE, NETWORK and FALLBACK section does not change behaviour +" Note: + + +# Files listed under CACHE will be ALWAYS cached after they are loaded. +# And they will be always used from Cache after (even after refresh). +CACHE: +theme/dolibarr_logo.png +support/ +support/index.php +support/online.php + +support/background.png +support/default.css +support/dolibarr_logo2.png +support/headbg.jpg +support/helpcenter.png +support/internet.png +support/mail.png +support/pagemaster.png +support/redstar.png +support/sparkangels.png +support/star.png +support/who.png + + +# The NETWORK section contains the path to a folder to ensure that requests +# to load resources will use internet. +# CACHE has priority on NETWORK, so usage is useless +NETWORK: +/ + +# The FALLBACK section contains entries that provide a backup strategy. +# If the browser is unable to retrieve the original content, the fallback resource will be used. +# In the example above, we display a static image in case the dynamic one is unavailable. +FALLBACK: +#/ public/offline.php +#theme/amarok/img/* theme/eldy/img/ diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 91700e328df..217b184f1d9 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -103,7 +103,8 @@ print "\n"; $var=!$var; print ''.$langs->trans("CashDeskThirdPartyForSell").''; print ''; -print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); +//print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); +print $form->select_thirdparty($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',0,array(),1); print ''; if (! empty($conf->banque->enabled)) { diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index 9ac041bc811..578d8fed6a2 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -55,11 +55,8 @@ p { /* ------------------- Menu ------------------- */ .menu_principal { - margin: 0 auto; - margin-left: 15px; - margin-bottom: 20px; - margin-right: 20px; - font-size: 14px; + margin: 0 20px 20px 15px; + font-size: 14px; width: 735px; height: 84px; background: #CCCCCC; @@ -77,9 +74,8 @@ p { .menu { margin: 0; - padding: 0; - list-style-type: none; - padding-top: 10px; + list-style-type: none; + padding: 10px 0 0; } .menu li { @@ -143,9 +139,8 @@ p { } p.titre { - margin: 0; - margin-bottom: 20px; - text-align: center; + margin: 0 0 20px; + text-align: center; font-weight: bold; font-size: 1.4em; color: #5ca64d; @@ -153,11 +148,10 @@ p.titre { } .cadre_article { - margin: 0 auto; - width: 180px; + width: 180px; text-align: center; - margin-bottom: 10px; - padding-bottom: 10px; + margin: 0 auto 10px; + padding-bottom: 10px; border-bottom: 1px solid #eee; } @@ -205,10 +199,9 @@ p.titre { } .formulaire_login table { - margin: 0 auto; - padding-left: 60px; - margin-bottom: 20px; - background: url('../img/login.png') bottom left no-repeat; + padding-left: 60px; + margin: 0 auto 20px; + background: url('../img/login.png') bottom left no-repeat; } .formulaire_login table tr { @@ -430,9 +423,8 @@ background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, /* Titre */ .err_titre { font-weight: bold; - margin: 0; - margin-bottom: 10px; - padding: 0; + margin: 0 0 10px; + padding: 0; } /* Description */ @@ -454,9 +446,8 @@ background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, /* Titre */ .msg_titre { font-weight: bold; - margin: 0; - margin-bottom: 10px; - padding: 0; + margin: 0 0 10px; + padding: 0; } /* Description */ diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index d8979d5e1c3..fe4171de72e 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -106,7 +106,7 @@ if (! empty($conf->stock->enabled)) print ''; $disabled=0; if (! empty($conf->global->CASHDESK_ID_WAREHOUSE)) $disabled=1; // If a particular stock is defined, we disable choice - print $formproduct->selectWarehouses(GETPOST('warehouseid')?GETPOST('warehouseid'):$conf->global->CASHDESK_ID_WAREHOUSE,'warehouseid','',!$disabled,$disabled); + print $formproduct->selectWarehouses((GETPOST('warehouseid')?GETPOST('warehouseid'):(empty($conf->global->CASHDESK_ID_WAREHOUSE)?'ifone':$conf->global->CASHDESK_ID_WAREHOUSE)),'warehouseid','',!$disabled,$disabled); //print ''; print ''; print "\n"; diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 94ec87edea0..9f7e0332046 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -65,6 +65,21 @@ if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && exit; } +// If stock decrease on bill validation, check user has stock edit permissions +if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! empty($username)) +{ + $testuser=new User($db); + $testuser->fetch(0,$username); + $testuser->getrights('stock'); + if (empty($testuser->rights->stock->creer)) + { + $retour=$langs->trans("UserNeedPermissionToEditStockToUsePos"); + header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid.'&bankid_cash='.$bankid_cash.'&bankid_cheque='.$bankid_cheque.'&bankid_cb='.$bankid_cb); + exit; + } +} + + /* if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) && empty($conf_fkaccount_cheque) && empty($conf_fkaccount_cb))) { diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 0ee03559391..2fac2e2a16a 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -62,14 +62,14 @@ else $remise = $tab[$i]['remise']; - echo ('

    '.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price2num($tab[$i]['total_ht'], 'MT').' '.$conf->currency.' '.$langs->trans("HT").' ('.price2num($tab[$i]['total_ttc'], 'MT').' '.$conf->currency.' '.$langs->trans("TTC").')

    '."\n"); + echo ('

    '.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price(price2num($tab[$i]['total_ht'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT").' ('.price(price2num($tab[$i]['total_ttc'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC").')

    '."\n"); echo ('
    '."\n"); } } $obj_facturation->calculTotaux(); $total_ttc = $obj_facturation->prixTotalTtc(); -echo ('

    '.$langs->trans("Total").' : '.price2num($total_ttc, 'MT').' '.$conf->currency.'

    '."\n"); +echo ('

    '.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'

    '."\n"); ?>
    diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php index cae461fe7fc..54e82c3ded7 100644 --- a/htdocs/cashdesk/tpl/ticket.tpl.php +++ b/htdocs/cashdesk/tpl/ticket.tpl.php @@ -132,7 +132,7 @@ print $object->ref; for($i=0;$i < $tab_size;$i++) { $remise = $tab[$i]['remise']; - echo (''.$tab[$i]['ref'].''.$tab[$i]['label'].''.$tab[$i]['qte'].''.$tab[$i]['remise_percent'].''.price2num($tab[$i]['total_ht'],'MT').' '.$conf->currency.''."\n"); + echo (''.$tab[$i]['ref'].''.$tab[$i]['label'].''.$tab[$i]['qte'].''.$tab[$i]['remise_percent'].''.price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency).''."\n"); } ?> @@ -140,9 +140,9 @@ print $object->ref; \n"; -echo '\n"; -echo '\n"; +echo '\n"; +echo '\n"; +echo '\n"; ?>
    '.$langs->trans("TotalHT").''.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."
    '.$langs->trans("TotalVAT").''.price2num($obj_facturation->montantTva(),'MT')." ".$conf->currency."
    '.$langs->trans("TotalTTC").''.price2num($obj_facturation->prixTotalTtc(),'MT')." ".$conf->currency."
    '.$langs->trans("TotalHT").''.price(price2num($obj_facturation->prixTotalHt(),'MT'),'',$langs,0,-1,-1,$conf->currency)."
    '.$langs->trans("TotalVAT").''.price(price2num($obj_facturation->montantTva(),'MT'),'',$langs,0,-1,-1,$conf->currency)."
    '.$langs->trans("TotalTTC").''.price(price2num($obj_facturation->prixTotalTtc(),'MT'),'',$langs,0,-1,-1,$conf->currency)."
    diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php index 6fdf7952207..2542993b314 100644 --- a/htdocs/cashdesk/tpl/validation1.tpl.php +++ b/htdocs/cashdesk/tpl/validation1.tpl.php @@ -26,12 +26,12 @@ $langs->load("main"); - + montantTva() ) { - echo (''); + echo (''); } else @@ -41,7 +41,7 @@ $langs->load("main"); } ?> - + '); + echo (''); } // Affichage du montant rendu (reglement en especes) if ( $obj_facturation->montantRendu() ) { - echo (''); + echo (''); } diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index d2b55deccde..ffaa01b7a94 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -207,7 +207,7 @@ switch ($action) $invoice->total_ht=$obj_facturation->prixTotalHt(); $invoice->total_tva=$obj_facturation->montantTva(); $invoice->total_ttc=$obj_facturation->prixTotalTtc(); - $invoice->note=$note; + $invoice->note_private=$note; $invoice->cond_reglement_id=$cond_reglement_id; $invoice->mode_reglement_id=$mode_reglement_id; //print "c=".$invoice->cond_reglement_id." m=".$invoice->mode_reglement_id; exit; diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php new file mode 100644 index 00000000000..b762e1b1fcc --- /dev/null +++ b/htdocs/categories/admin/categorie.php @@ -0,0 +1,121 @@ + + * Copyright (C) 2013 Florian Henry + * + * 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 . + */ + +/** + * \file htdocs/categories/admin/categorie.php + * \ingroup categories + * \brief Categorie admin pages + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; + + +if (!$user->admin) +accessforbidden(); + +$langs->load("cateogries"); + +$action=GETPOST("action"); + +/* + * Actions + */ +if (preg_match('/set_(.*)/',$action,$reg)) +{ + $code=$reg[1]; + if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + setEventMessage($db->lasterror(),'errors'); + } +} + +if (preg_match('/del_(.*)/',$action,$reg)) +{ + $code=$reg[1]; + if (dolibarr_del_const($db, $code, $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + setEventMessage($db->lasterror(),'errors'); + } +} + + + +/* + * View + */ + +llxHeader('',$langs->trans("CategoriesSetup")); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("CategoriesSetup"),'','setup'); + + +$head=categoriesadmin_prepare_head(); + +dol_fiche_head($head, 'setup', $langs->trans("Security")); + + +print '
    trans("Invoice"); ?>numInvoice(); ?>
    trans("TotalHT"); ?>prixTotalHt(),'MT').' '.$conf->currency; ?>
    trans("TotalHT"); ?>prixTotalHt(),'MT'),0,$langs,0,0,-1,$conf->currency); ?>
    '.$langs->trans("VAT").''.price2num($obj_facturation->montantTva(),'MT').' '.$conf->currency.'
    '.$langs->trans("VAT").''.price(price2num($obj_facturation->montantTva(),'MT'),0,$langs,0,0,-1,$conf->currency).'
    trans("TotalTTC"); ?> prixTotalTtc(),'MT').' '.$conf->currency; ?>
    trans("TotalTTC"); ?> prixTotalTtc(),'MT'),0,$langs,0,0,-1,$conf->currency); ?>
    trans("PaymentMode"); ?> getSetPaymentMode()) @@ -85,14 +85,14 @@ $langs->load("main"); } else { - echo ('
    '.$langs->trans("Received").''.price2num($obj_facturation->montantEncaisse(),'MT').' '.$conf->currency.'
    '.$langs->trans("Received").''.price(price2num($obj_facturation->montantEncaisse(),'MT'),0,$langs,0,0,-1,$conf->currency).'
    '.$langs->trans("Change").''.price2num($obj_facturation->montantRendu(),'MT').' '.$conf->currency.'
    '.$langs->trans("Change").''.price(price2num($obj_facturation->montantRendu(),'MT'),0,$langs,0,0,-1,$conf->currency).'
    '; +print ''; +print ''; +print ''; +print ''."\n"; +print ''; + +$var=true; +$form = new Form($db); + +// Mail required for members +$var=!$var; +print ''; +print ''; +print ''; + +print ''; + +print '
    '.$langs->trans("Description").' '.$langs->trans("Value").'
    '.$langs->trans("CategorieRecursiv").' '; +if ($conf->use_javascript_ajax) +{ + print ajax_constantonoff('CATEGORIE_RECURSIV_ADD'); +} +else +{ + if($conf->global->CATEGORIE_RECURSIV_ADD == 0) + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + else if($conf->global->CATEGORIE_RECURSIV_ADD == 1) + { + print ''.img_picto($langs->trans("Enabled"),'on').''; + } +} +print '
    '; + +$db->close(); +llxFooter(); \ No newline at end of file diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 2d33607c092..1750097b120 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -2,9 +2,10 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2005 Brice Davoleau * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Florian Henry * * 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 @@ -36,7 +37,6 @@ $socid = GETPOST('socid','int'); $id = GETPOST('id','int'); $ref = GETPOST('ref'); $type = GETPOST('type'); -$mesg = GETPOST('mesg'); $removecat = GETPOST('removecat','int'); $parent=GETPOST('parent','int'); @@ -79,6 +79,13 @@ if ($id || $ref) $dbtablename = 'adherent'; $fieldid = ! empty($ref)?'ref':'rowid'; } + elseif ($type == 4) { + $elementtype = 'societe'; + $objecttype = 'contact'; + $objectid = isset($id)?$id:(isset($ref)?$ref:''); + $dbtablename = 'socpeople&societe'; + $fieldid = ! empty($ref)?'ref':'rowid'; + } } // Security check @@ -111,7 +118,8 @@ if (empty($reshook)) } if ($type==1 && $user->rights->societe->creer) { - $object = new Societe($db); + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; + $object = new Fournisseur($db); $result = $object->fetch($objectid); $elementtype = 'fournisseur'; } @@ -128,12 +136,24 @@ if (empty($reshook)) $result = $object->fetch($objectid); $elementtype = 'member'; } + if ($type == 4 && $user->rights->societe->creer) + { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $object = new Contact($db); + $result = $object->fetch($objectid); + $elementtype = 'contact'; + } $cat = new Categorie($db); $result=$cat->fetch($removecat); $result=$cat->del_type($object,$elementtype); + if ($result < 0) + { + setEventMessage($cat->error,'errors'); + setEventMessage($cat->errors,'errors'); + } } - + // Add object into a category if ($parent > 0) { @@ -146,7 +166,8 @@ if (empty($reshook)) } if ($type==1 && $user->rights->societe->creer) { - $object = new Societe($db); + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; + $object = new Fournisseur($db); $result = $object->fetch($objectid); $elementtype = 'fournisseur'; } @@ -163,18 +184,32 @@ if (empty($reshook)) $result = $object->fetch($objectid); $elementtype = 'member'; } + if ($type == 4 && $user->rights->societe->creer) + { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $object = new Contact($db); + $result = $object->fetch($objectid); + $elementtype = 'contact'; + } $cat = new Categorie($db); $result=$cat->fetch($parent); $result=$cat->add_type($object,$elementtype); if ($result >= 0) { - $mesg='
    '.$langs->trans("WasAddedSuccessfully",$cat->label).'
    '; + setEventMessage($langs->trans("WasAddedSuccessfully",$cat->label)); } else { - if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') $mesg='
    '.$langs->trans("ObjectAlreadyLinkedToCategory").'
    '; - else $mesg=$langs->trans("Error").' '.$cat->error; + if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings'); + } + else + { + setEventMessage($cat->error,'errors'); + setEventMessage($cat->errors,'errors'); + } } } } @@ -272,7 +307,7 @@ if ($socid) print ''; // Phone - print ''.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').''; + print ''.$langs->trans('Phone').''.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').''; print ''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').''; // Assujeti a TVA ou pas @@ -286,13 +321,11 @@ if ($socid) dol_fiche_end(); - dol_htmloutput_mesg($mesg); - - if ($soc->client) formCategory($db,$soc,2,$socid); + if ($soc->client) formCategory($db,$soc,2,$socid,$user->rights->societe->creer); if ($soc->client && $soc->fournisseur) print '

    '; - if ($soc->fournisseur) formCategory($db,$soc,1,$socid); + if ($soc->fournisseur) formCategory($db,$soc,1,$socid,$user->rights->societe->creer); } else if ($id || $ref) { @@ -301,12 +334,12 @@ else if ($id || $ref) $langs->load("products"); /* - * Fiche categorie de produit + * Category card for product */ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - // Produit + // Product $product = new Product($db); $result = $product->fetch($id, $ref); @@ -346,9 +379,7 @@ else if ($id || $ref) dol_fiche_end(); - dol_htmloutput_mesg($mesg); - - formCategory($db,$product,0); + formCategory($db,$product,0,$socid,($user->rights->produit->creer || $user->rights->service->creer)); } if ($type == 3) @@ -356,7 +387,7 @@ else if ($id || $ref) $langs->load("members"); /* - * Fiche categorie d'adherent + * Category card for member */ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; @@ -427,23 +458,168 @@ else if ($id || $ref) dol_fiche_end(); - dol_htmloutput_mesg($mesg); + formCategory($db,$member,3,0,$user->rights->adherent->creer); + } + if ($type == 4) + { + $langs->load("contact"); - formCategory($db,$member,3); + /* + * Category card for contact + */ + require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + + // Produit + $object = new Contact($db); + $result = $object->fetch($id, $ref); + $object->fetch_thirdparty(); + + llxHeader("","",$langs->trans("Contact")); + + + $head=contact_prepare_head($object, $user); + $titre=$langs->trans("ContactsAddresses"); + $picto='contact'; + dol_fiche_head($head, 'category', $titre,0,$picto); + + $rowspan=5; + if (! empty($conf->societe->enabled)) $rowspan++; + + print ''; + + // Ref + print ''; + print ''; + + // Name + print ''; + print ''; + + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + print ''; + } + + // Civility + print ''; + + // Role + print ''; + + // Address + print ''; + + // Zip/Town + print ''; + + // Country + print ''; + + // State + if (empty($conf->global->SOCIETE_DISABLE_STATE)) + { + print ''; + } + + // Phone + print ''; + print ''; + + print ''; + print ''; + + // Email + print ''; + if (! empty($conf->mailing->enabled)) + { + $langs->load("mails"); + print ''; + print ''; + } + else + { + print ''; + } + print ''; + + // Instant message and no email + print ''; + if (!empty($conf->mailing->enabled)) + { + print ''; + } + else + { + print ''; + } + print ''; + + print ''; + + // Note Public + print ''; + + // Note Private + print ''; + + // Other attributes + $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print $object->showOptionals($extrafields); + } + + print '
    '.$langs->trans("Ref").''; + print $form->showrefnav($object,'rowid'); + print '
    '.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
    '.$langs->trans("Company").''; + if (!empty($object->thirdparty->id)) + { + print $object->thirdparty->getNomUrl(1); + } + else + { + print $langs->trans("ContactNotLinkedToCompany"); + } + print '
    '.$langs->trans("UserTitle").''; + print $object->getCivilityLabel(); + print '
    '.$langs->trans("PostOrFunction").''.$object->poste.'
    '.$langs->trans("Address").''; + dol_print_address($object->address,'gmap','contact',$object->id); + print '
    '.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print $object->zip; + if ($object->zip) print ' '; + print $object->town.'
    '.$langs->trans("Country").''; + $img=picto_from_langcode($object->country_code); + if ($img) print $img.' '; + print $object->country; + print '
    '.$langs->trans('State').''.$object->state.'
    '.$langs->trans("PhonePro").''.dol_print_phone($object->phone_pro,$object->country_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("PhonePerso").''.dol_print_phone($object->phone_perso,$object->country_code,$object->id,$object->socid,'AC_TEL').'
    '.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("Fax").''.dol_print_phone($object->fax,$object->country_code,$object->id,$object->socid,'AC_FAX').'
    '.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').''.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().' 
    '.$langs->trans("IM").''.$object->jabberid.''.$langs->trans("No_Email").''.yn($object->no_email).' 
    '.$langs->trans("ContactVisibility").''; + print $object->LibPubPriv($object->priv); + print '
    '.$langs->trans("NotePublic").''; + print nl2br($object->note_public); + print '
    '.$langs->trans("NotePrivate").''; + print nl2br($object->note_private); + print '
    '; + + dol_fiche_end(); + + formCategory($db,$object,4,$socid, $user->rights->societe->creer); } } /** - * Function to output a HTML select for a category + * Function to output a form to add object into a category * - * @param DoliDb $db Database handler - * @param Object $object Object we want to see categories it can be classified into - * @param int $typeid Type of category (0, 1, 2, 3) - * @param int $socid Id thirdparty + * @param DoliDb $db Database handler + * @param Object $object Object we want to see categories it can be classified into + * @param int $typeid Type of category (0, 1, 2, 3) + * @param int $socid Id thirdparty + * @param string $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify' * @return int 0 */ -function formCategory($db,$object,$typeid,$socid=0) +function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) { global $user,$langs,$form,$bc; @@ -451,34 +627,39 @@ function formCategory($db,$object,$typeid,$socid=0) if ($typeid == 1) $title = $langs->trans("SuppliersCategoriesShort"); if ($typeid == 2) $title = $langs->trans("CustomersProspectsCategoriesShort"); if ($typeid == 3) $title = $langs->trans("MembersCategoriesShort"); + if ($typeid == 4) $title = $langs->trans("ContactCategoriesShort"); - // Formulaire ajout dans une categorie print '
    '; print_fiche_titre($title,'',''); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if ($user->rights->categorie->creer) + + // Form to add record into a category + if ($showclassifyform) { - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; - print $langs->trans("ClassifyInCategory").'  '; - print $form->select_all_categories($typeid); - print ''; - print ''; - print 'id.'&type='.$typeid).'">'; - print $langs->trans("CreateCat").' '; - print img_picto($langs->trans("Create"),'filenew'); - print ""; - print '
    '; + print ''; + if ($user->rights->categorie->creer) + { + print ''; + } + print ''; + print '
    '; + print $langs->trans("ClassifyInCategory").'  '; + print $form->select_all_categories($typeid,'auto'); + print ''; + print ''; + print 'id.'&type='.$typeid).'">'; + print $langs->trans("CreateCat").' '; + print img_picto($langs->trans("Create"),'filenew'); + print ""; + print '
    '; + print ''; + print '
    '; } - print ''; - print ''; - print ''; - print '
    '; $c = new Categorie($db); @@ -490,6 +671,7 @@ function formCategory($db,$object,$typeid,$socid=0) if ($typeid == 1) $title=$langs->trans("CompanyIsInSuppliersCategories"); if ($typeid == 2) $title=$langs->trans("CompanyIsInCustomersCategories"); if ($typeid == 3) $title=$langs->trans("MemberIsInCategories"); + if ($typeid == 4) $title=$langs->trans("ContactIsInCategories"); print "\n"; print ''; print ''; @@ -517,6 +699,7 @@ function formCategory($db,$object,$typeid,$socid=0) if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($typeid == 4) $permission=$user->rights->societe->creer; if ($permission) { print ""; @@ -544,6 +727,7 @@ function formCategory($db,$object,$typeid,$socid=0) if ($typeid == 1) $title=$langs->trans("CompanyHasNoCategory"); if ($typeid == 2) $title=$langs->trans("CompanyHasNoCategory"); if ($typeid == 3) $title=$langs->trans("MemberHasNoCategory"); + if ($typeid == 4) $title=$langs->trans("ContactHasNoCategory"); print $title; print "
    "; } @@ -552,5 +736,6 @@ function formCategory($db,$object,$typeid,$socid=0) llxFooter(); + $db->close(); ?> diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index a49ad862cac..b7e2ed030ab 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -5,7 +5,8 @@ * Copyright (C) 2006-2012 Regis Houssin * Copyright (C) 2006-2012 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -29,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; /** @@ -44,7 +46,7 @@ class Categorie var $label; var $description; var $socid; - var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member + var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member, 4=Contact var $import_key; var $cats=array(); // Tableau en memoire des categories @@ -294,7 +296,7 @@ class Categorie if (! $error) { $sql = "UPDATE ".MAIN_DB_PREFIX."categorie"; - $sql.= " SET fk_parent = ".$this->fk_parent; + $sql.= " SET fk_parent = ".$this->fk_parent; $sql.= " WHERE fk_parent = ".$this->id; if (!$this->db->query($sql)) @@ -348,6 +350,17 @@ class Categorie $error++; } } + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact"; + $sql .= " WHERE fk_categorie = ".$this->id; + if (!$this->db->query($sql)) + { + $this->error=$this->db->lasterror(); + dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); + $error++; + } + } // Delete category if (! $error) @@ -387,22 +400,82 @@ class Categorie * Link an object to the category * * @param Object $obj Object to link to category - * @param string $type Type of category - * @return int 1 : OK, -1 : erreur SQL, -2 : id non renseign, -3 : Already linked + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') + * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked */ function add_type($obj,$type) { - if ($this->id == -1) - { - return -2; - } + global $user,$langs,$conf; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".($type=='fournisseur'?'societe':$type).")"; + $error=0; + + if ($this->id == -1) return -2; + + // For backward compatibility + if ($type == 'company') $type='societe'; + if ($type == 'customer') $type='societe'; + if ($type == 'supplier') $type='fournisseur'; + + $column_name=$type; + if ($type=='contact') $column_name='socpeople'; + if ($type=='fournisseur') $column_name='societe'; + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$column_name.")"; $sql .= " VALUES (".$this->id.", ".$obj->id.")"; + dol_syslog(get_class($this).'::add_type sql='.$sql); if ($this->db->query($sql)) { - return 1; + if (! empty($conf->global->CATEGORIE_RECURSIV_ADD)) + { + $sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie'; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::add_type sql=".$sql); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql) > 0) + { + $objparent = $this->db->fetch_object($resql); + + if (!empty($objparent->fk_parent)) + { + $cat = new Categorie($this->db); + $cat->id=$objparent->fk_parent; + $result=$cat->add_type($obj, $type); + if ($result < 0) + { + $this->error=$cat->error; + $error++; + } + } + } + } + else + { + $error++; + $this->error=$this->db->lasterror(); + } + + if ($error) + { + return -1; + } + } + + // Save object we want to link category to into category instance to provide information to trigger + $this->linkto=$obj; + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('CATEGORY_LINK',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; $this->error=$interface->error; } + // Fin appel triggers + + if (! $error) return 1; + else return -2; } else { @@ -413,7 +486,7 @@ class Categorie } else { - $this->error=$this->db->error().' sql='.$sql; + $this->error=$this->db->lasterror(); } return -1; } @@ -423,35 +496,59 @@ class Categorie * Delete object from category * * @param Object $obj Object - * @param string $type Type + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') * @return int 1 if OK, -1 if KO */ function del_type($obj,$type) { + global $user,$langs,$conf; + + $error=0; + + // For backward compatibility + if ($type == 'company') $type='societe'; + if ($type == 'customer') $type='societe'; + if ($type == 'supplier') $type='fournisseur'; + + $column_name=$type; + if ($type=='contact') $column_name='socpeople'; + if ($type=='fournisseur') $column_name='societe'; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".$type; $sql .= " WHERE fk_categorie = ".$this->id; - $sql .= " AND fk_".($type=='fournisseur'?'societe':$type)." = ".$obj->id; + $sql .= " AND fk_".$column_name." = ".$obj->id; dol_syslog(get_class($this).'::del_type sql='.$sql); if ($this->db->query($sql)) { - return 1; + // Save object we want to unlink category off into category instance to provide information to trigger + $this->unlinkoff=$obj; + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('CATEGORY_UNLINK',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + + if (! $error) return 1; + else return -2; } else { - $this->error=$this->db->error().' sql='.$sql; + $this->error=$this->db->lasterror(); return -1; } } /** - * Return list of contents of a category + * Return list of id of elements having this category * * @param string $field Field name for select in table. Full field name will be fk_field. * @param string $classname PHP Class of object to store entity * @param string $category_table Table name for select in table. Full table name will be PREFIX_categorie_table. * @param string $object_table Table name for select in table. Full table name will be PREFIX_table. - * @return void + * @return mixed -1 if KO, array of instance of object if OK */ function get_type($field,$classname,$category_table='',$object_table='') { @@ -488,6 +585,49 @@ class Categorie } } + /** + * check for the presence of an object in a category + * + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') + * @param int $object_id id of the object to search + * @return int number of occurrences + */ + function containsObject($type, $object_id) + { + $field = ''; $classname = ''; $category_table = ''; $object_table = ''; + if ($type == 'product') { + $field = 'product'; + } + if ($type == 'customer') { + $field = 'societe'; + } + if ($type == 'supplier') { + $field = 'societe'; + $category_table = 'fournisseur'; + } + if ($type == 'member') { + $field = 'member'; + $category_table = ''; + } + if ($type == 'contact') { + $field = 'socpeople'; + $category_table = 'contact'; + } + if (empty($category_table)) { + $category_table = $field; + } + $sql = "SELECT COUNT(*) as nb FROM " . MAIN_DB_PREFIX . "categorie_" . $category_table; + $sql .= " WHERE fk_categorie = " . $this->id . " AND fk_" . $field . " = " . $object_id; + dol_syslog(get_class($this)."::containsObject sql=".$sql); + $resql = $this->db->query($sql); + if ($resql) { + return $this->db->fetch_object($resql)->nb; + } else { + $this->error=$this->db->error().' sql='.$sql; + dol_syslog(get_class($this)."::containsObject ".$this->error, LOG_ERR); + return -1; + } + } /** * Return childs of a category @@ -536,7 +676,7 @@ class Categorie $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " WHERE fk_parent != 0"; $sql.= " AND entity IN (".getEntity('category',1).")"; - + dol_syslog(get_class($this)."::load_motherof sql=".$sql); $resql = $this->db->query($sql); if ($resql) @@ -971,36 +1111,44 @@ class Categorie } /** - * Return list of categories linked to element of type $type with id $typeid + * Return list of categories linked to element of id $id and type $typeid * - * @param int $id Id of element - * @param int $typeid Type id of link (0,1,2,3...) - * @return array List of category objects + * @param int $id Id of element + * @param int $typeid Type of link (0 or 'product', 1 or 'supplier', 2 or 'customer', 3 or 'member', ...) + * @param string $mode 'object'=Get array of categories, 'label'=Get array of category labels + * @return mixed Array of category objects or < 0 if KO */ - function containing($id,$typeid) + function containing($id,$typeid,$mode='object') { - $cats = array (); + $cats = array(); $table=''; $type=''; - if ($typeid == 0) { $table='product'; $type='product'; } - if ($typeid == 1) { $table='societe'; $type='fournisseur'; } - if ($typeid == 2) { $table='societe'; $type='societe'; } - if ($typeid == 3) { $table='member'; $type='member'; } + if ($typeid == 0 || $typeid == 'product') { $typeid=0; $table='product'; $type='product'; } + else if ($typeid == 1 || $typeid == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; } + else if ($typeid == 2 || $typeid == 'customer') { $typeid=2; $table='societe'; $type='societe'; } + else if ($typeid == 3 || $typeid == 'member') { $typeid=3; $table='member'; $type='member'; } + else if ($typeid == 4 || $typeid == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; } - $sql = "SELECT ct.fk_categorie"; - $sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON ct.fk_categorie = c.rowid"; - $sql.= " WHERE ct.fk_".$table." = ".$id." AND c.type = ".$typeid; + $sql = "SELECT ct.fk_categorie, c.label"; + $sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c"; + $sql.= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".$table." = ".$id." AND c.type = ".$typeid; $sql.= " AND c.entity IN (".getEntity('category',1).")"; + dol_syslog(get_class($this).'::containing sql='.$sql); $res = $this->db->query($sql); if ($res) { - while ($rec = $this->db->fetch_array($res)) + while ($obj = $this->db->fetch_object($res)) { - $cat = new Categorie($this->db); - $cat->fetch($rec['fk_categorie']); - $cats[] = $cat; + if ($mode == 'label') + { + $cats[] = $obj->label; + } + else { + $cat = new Categorie($this->db); + $cat->fetch($obj->fk_categorie); + $cats[] = $cat; + } } return $cats; diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index c97d023f5b8..d43c4df9a3d 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2013 Florian Henry * * 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 @@ if ($origin) if ($type == 1) $idSupplierOrigin = $origin; if ($type == 2) $idCompanyOrigin = $origin; if ($type == 3) $idMemberOrigin = $origin; + if ($type == 4) $idContactOrigin = $origin; } if ($catorigin && $type == 0) $idCatOrigin = $catorigin; @@ -98,6 +100,11 @@ if ($action == 'add' && $user->rights->categorie->creer) header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCatOrigin.'&type='.$type); exit; } + else if ($idContactOrigin) + { + header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type); + exit; + } else { header("Location: ".DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); @@ -170,6 +177,11 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCatOrigin.'&mesg='.urlencode($langs->trans("CatCreated"))); exit; } + else if ($idContactOrigin) + { + header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&mesg='.urlencode($langs->trans("CatCreated"))); + exit; + } header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$result.'&type='.$type); exit; @@ -181,9 +193,10 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr * View */ -llxHeader("","",$langs->trans("Categories")); $form = new Form($db); +llxHeader("","",$langs->trans("Categories")); + if ($user->rights->categorie->creer) { /* diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index bd293f9febb..0e512cdfcf7 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -50,6 +50,7 @@ if ($type == 0) $title=$langs->trans("ProductsCategoriesArea"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoriesArea"); elseif ($type == 2) $title=$langs->trans("CustomersCategoriesArea"); elseif ($type == 3) $title=$langs->trans("MembersCategoriesArea"); +elseif ($type == 4) $title=$langs->trans("ContactsCategoriesArea"); else $title=$langs->trans("CategoriesArea"); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 8a98ff44c01..1a71005ab8e 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -94,6 +94,7 @@ if ($object->id) elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); + elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort"); $head = categories_prepare_head($object,$type); dol_fiche_head($head, 'photos', $title, 0, 'category'); @@ -103,8 +104,7 @@ if ($object->id) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); } print($mesg); @@ -209,7 +209,7 @@ if ($object->id) { // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type,$langs->trans("AddPhoto"),1); + $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type, $langs->trans("AddPhoto"), 1, '', $user->rights->categorie->creer, 50, $object, '', false, '', 0); } // Affiche photos diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 3cdb5d516f1..7aa9aa0b964 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -72,25 +72,32 @@ if ($id > 0 && $removeelem > 0) $result = $tmpobject->fetch($removeelem); $elementtype = 'product'; } - if ($type==1 && $user->rights->societe->creer) + else if ($type==1 && $user->rights->societe->creer) { $tmpobject = new Societe($db); $result = $tmpobject->fetch($removeelem); $elementtype = 'fournisseur'; } - if ($type==2 && $user->rights->societe->creer) + else if ($type==2 && $user->rights->societe->creer) { $tmpobject = new Societe($db); $result = $tmpobject->fetch($removeelem); $elementtype = 'societe'; } - if ($type == 3 && $user->rights->adherent->creer) + else if ($type == 3 && $user->rights->adherent->creer) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $tmpobject = new Adherent($db); $result = $tmpobject->fetch($removeelem); $elementtype = 'member'; } + else if ($type == 4 && $user->rights->societe->creer) { + + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $tmpobject = new Contact($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'contact'; + } $result=$object->del_type($tmpobject,$elementtype); if ($result < 0) dol_print_error('',$object->error); @@ -125,6 +132,7 @@ if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); +elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort"); else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); @@ -136,8 +144,7 @@ dol_fiche_head($head, 'card', $title, 0, 'category'); */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete'); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete'); } print '
    '.$title.':
    '; @@ -358,6 +365,8 @@ if($object->type == 2) $var=true; foreach ($socs as $key => $soc) { + if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself + $i++; $var=!$var; print "\t\n"; @@ -444,6 +453,59 @@ if ($object->type == 3) } } +//Categorie contact +if($object->type == 4) +{ + $contacts = $object->get_type("socpeople","Contact",'contact',"socpeople"); + if ($contacts < 0) + { + dol_print_error(); + } + else + { + print "
    "; + print '
    '."\n"; + print '\n"; + + if (count($contacts) > 0) + { + $i = 0; + $var=true; + foreach ($contacts as $key => $contact) + { + $i++; + $var=!$var; + print "\t\n"; + print '\n"; + // Link to delete from category + print ''; + print "\n"; + } + } + else + { + print ""; + } + print "
    '.$langs->trans("Contact")."
    '; + print $contact->getNomUrl(1,'category'); + print "'; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($typeid == 4) $permission=$user->rights->societe->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print '
    ".$langs->trans("ThisCategoryHasNoContact")."
    \n"; + } +} + llxFooter(); $db->close(); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f4bb4542843..10082062d06 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -40,12 +40,11 @@ class ActionComm extends CommonObject var $id; var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) - var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) + var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required). With defautl setup, should be AC_OTH_AUTO or AC_OTH var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) - var $code; + var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) var $label; - var $date; var $datec; // Date creation record (datec) var $datem; // Date modification record (tms) var $author; // Object user that create action @@ -53,14 +52,13 @@ class ActionComm extends CommonObject var $datep; // Date action start (datep) var $datef; // Date action end (datep2) - var $dateend; // ?? var $durationp = -1; // -1=Unkown duration var $fulldayevent = 0; // 1=Event on full day var $punctual = 1; // Milestone var $percentage; // Percentage var $location; // Location var $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) - var $priority; // Free text ('' By default) + var $priority; // Small int (0 By default) var $note; // Description var $usertodo; // Object user that must do action @@ -118,16 +116,16 @@ class ActionComm extends CommonObject $this->location=dol_trunc(trim($this->location),128); $this->note=dol_htmlcleanlastbr(trim($this->note)); if (empty($this->percentage)) $this->percentage = 0; - if (empty($this->priority)) $this->priority = 0; + if (empty($this->priority) || ! is_numeric($this->priority)) $this->priority = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0; if (empty($this->punctual)) $this->punctual = 0; if (empty($this->transparency)) $this->transparency = 0; if ($this->percentage > 100) $this->percentage = 100; - if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; + //if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; if (! empty($this->datep) && ! empty($this->datef)) $this->durationp=($this->datef - $this->datep); - if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date); + //if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date); if (! empty($this->datep) && ! empty($this->datef) && $this->datep > $this->datef) $this->datef=$this->datep; - if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; + //if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; if (! isset($this->fk_project) || $this->fk_project < 0) $this->fk_project = 0; if ($this->elementtype=='facture') $this->elementtype='invoice'; if ($this->elementtype=='commande') $this->elementtype='order'; @@ -440,15 +438,15 @@ class ActionComm extends CommonObject $this->label=trim($this->label); $this->note=trim($this->note); if (empty($this->percentage)) $this->percentage = 0; - if (empty($this->priority)) $this->priority = 0; + if (empty($this->priority) || ! is_numeric($this->priority)) $this->priority = 0; if (empty($this->transparency)) $this->transparency = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0; if ($this->percentage > 100) $this->percentage = 100; - if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; + //if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); - if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); + //if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep; - if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date; + //if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date; if ($this->fk_project < 0) $this->fk_project = 0; // Check parameters @@ -460,15 +458,12 @@ class ActionComm extends CommonObject $this->db->begin(); - //print 'eeea'.$this->datep.'-'.(strval($this->datep) != '').'-'.$this->db->idate($this->datep); $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; $sql.= " SET percent = '".$this->percentage."'"; if ($this->fk_action > 0) $sql.= ", fk_action = '".$this->fk_action."'"; $sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null"); $sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null'); - //$sql.= ", datea = ".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null'); - //$sql.= ", datea2 = ".(strval($this->dateend)!='' ? "'".$this->db->idate($this->dateend)."'" : 'null'); $sql.= ", note = ".($this->note ? "'".$this->db->escape($this->note)."'":"null"); $sql.= ", fk_soc =". ($this->societe->id > 0 ? "'".$this->societe->id."'":"null"); $sql.= ", fk_project =". ($this->fk_project > 0 ? "'".$this->fk_project."'":"null"); @@ -616,6 +611,7 @@ class ActionComm extends CommonObject $resql=$this->db->query($sql); if ($resql) { + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; @@ -828,7 +824,8 @@ class ActionComm extends CommonObject require_once (DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php"); require_once (DOL_DOCUMENT_ROOT ."/core/lib/date.lib.php"); - + require_once (DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php"); + dol_syslog(get_class($this)."::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG); // Check parameters @@ -891,7 +888,7 @@ class ActionComm extends CommonObject $sql.= " AND a.entity = ".$conf->entity; foreach ($filters as $key => $value) { - if ($key == 'notolderthan') $sql.=" AND a.datep >= '".$this->db->idate($now-($value*24*60*60))."'"; + if ($key == 'notolderthan' && $value != '') $sql.=" AND a.datep >= '".$this->db->idate($now-($value*24*60*60))."'"; if ($key == 'year') $sql.=" AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($value,1))."' AND '".$this->db->idate(dol_get_last_day($value,12))."'"; if ($key == 'id') $sql.=" AND a.id=".(is_numeric($value)?$value:0); if ($key == 'idfrom') $sql.=" AND a.id >= ".(is_numeric($value)?$value:0); @@ -938,6 +935,7 @@ class ActionComm extends CommonObject if ($resql) { // Note: Output of sql request is encoded in $conf->file->character_set_client + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $qualified=true; @@ -946,8 +944,8 @@ class ActionComm extends CommonObject $event=array(); $event['uid']='dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"]; $event['type']=$type; - $datestart=$this->db->jdate($obj->datep); - $dateend=$this->db->jdate($obj->datep2); + $datestart=$this->db->jdate($obj->datep)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); + $dateend=$this->db->jdate($obj->datep2)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); $duration=$obj->durationp; $event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":""); $event['desc']=$obj->note; @@ -966,8 +964,8 @@ class ActionComm extends CommonObject //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current $url=$urlwithroot.'/comm/action/fiche.php?id='.$obj->id; $event['url']=$url; - $event['created']=$this->db->jdate($obj->datec); - $event['modified']=$this->db->jdate($obj->datem); + $event['created']=$this->db->jdate($obj->datec)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); + $event['modified']=$this->db->jdate($obj->datem)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); if ($qualified && $datestart) { @@ -1014,10 +1012,11 @@ class ActionComm extends CommonObject if ($result >= 0) { - if (rename($outputfiletmp,$outputfile)) $result=1; + if (dol_move($outputfiletmp,$outputfile,0,1)) $result=1; else { - dol_syslog(get_class($this)."::build_exportfile failed to rename ".$outputfiletmp." to ".$outputfile, LOG_ERR); + $this->error='Failed to rename '.$outputfiletmp.' into '.$outputfile; + dol_syslog(get_class($this)."::build_exportfile ".$this->error, LOG_ERR); dol_delete_file($outputfiletmp,0,1); $result=-1; } @@ -1065,7 +1064,7 @@ class ActionComm extends CommonObject $this->percentage=0; $this->location='Location'; $this->transparency=0; - $this->priority='Priority X'; + $this->priority=1; $this->note = 'Note'; } diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index e9fe439e75c..c05887ec47f 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -78,14 +78,14 @@ class CActionComm $this->libelle = $obj->libelle; $this->active = $obj->active; + $this->db->free($resql); return 1; } else { + $this->db->free($resql); return 0; } - - $this->db->free($resql); } else { diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 4dc47cdc395..ae1abb6ea08 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -56,14 +56,13 @@ class ICal { $this->file = $file; $file_text=''; - + $tmparray=file($file); if (is_array($tmparray)) { $file_text = join("", $tmparray); //load file - $file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text); + $file_text = preg_replace("/[\r\n]{1,} /","",$file_text); } - return $file_text; // return all text } @@ -115,6 +114,7 @@ class ICal { // get Key and Value VCALENDAR:Begin -> Key = VCALENDAR, Value = begin list($key, $value) = $this->retun_key_value($text); + //var_dump($text.' -> '.$key.' - '.$value); switch ($text) // search special string { @@ -165,6 +165,8 @@ class ICal } } } + + //var_dump($this->cal); return $this->cal; } @@ -236,6 +238,7 @@ class ICal */ function retun_key_value($text) { + /* preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches); if (empty($matches)) @@ -246,8 +249,8 @@ class ICal { $matches = array_splice($matches, 1, 2); return $matches; - } - + }*/ + return explode(':',$text,2); } /** @@ -270,7 +273,7 @@ class ICal * Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) * * @param string $ical_date String date - * @return timestamp + * @return int */ function ical_date_to_unix($ical_date) { @@ -395,4 +398,4 @@ class ICal return $this->cal; } } -?> \ No newline at end of file +?> diff --git a/htdocs/comm/action/contact.php b/htdocs/comm/action/contact.php index 619b6cf6b09..642842ac568 100644 --- a/htdocs/comm/action/contact.php +++ b/htdocs/comm/action/contact.php @@ -265,7 +265,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Ligne ajout pour contact interne - print ""; + print ""; print ''; print img_object('','user').' '.$langs->trans("Users"); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index ea5c7c4735b..972858a808f 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005 Simon TOSSER + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -40,8 +41,9 @@ $langs->load("commercial"); $langs->load("other"); $langs->load("bills"); -$objectid = GETPOST('id','int'); -$action=GETPOST('action','alpha'); +$objectid = GETPOST('id', 'int'); +$action=GETPOST('action', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); // Security check $socid = GETPOST('socid','int'); @@ -53,16 +55,16 @@ if ($user->societe_id > 0) } $result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id'); -$act = new ActionComm($db); +$object = new ActionComm($db); if ($objectid > 0) { - $ret = $act->fetch($objectid); + $ret = $object->fetch($objectid); if ($ret > 0) { $company=new Societe($db); - $company->fetch($act->societe->id); - $act->societe=$company; // For backward compatibility - $act->thirdparty=$company; + $company->fetch($object->societe->id); + $object->societe=$company; // For backward compatibility + $object->thirdparty=$company; } } @@ -77,28 +79,14 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; +$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); +$modulepart='contract'; + /* - * Action envoie fichier + * Actions */ -if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) -{ - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); - dol_add_file_process($upload_dir,0,1,'userfile'); -} - -/* - * Efface fichier - */ -if ($action == 'delete') -{ - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); - $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file,0,0,0,$act); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - $action=''; -} +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; /* @@ -111,17 +99,15 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -if ($act->id > 0) +if ($object->id > 0) { - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); - $author=new User($db); - $author->fetch($act->author->id); - $act->author=$author; + $author->fetch($object->author->id); + $object->author=$author; - if ($act->contact->id) $act->fetch_contact($act->contact->id); + if ($object->contact->id) $object->fetch_contact($object->contact->id); - $head=actions_prepare_head($act); + $head=actions_prepare_head($object); dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); // Affichage fiche action en mode visu @@ -131,53 +117,53 @@ if ($act->id > 0) // Ref print ''.$langs->trans("Ref").''; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); + print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); print ''; // Type if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''.$langs->trans("Type").''.$act->type.''; + print ''.$langs->trans("Type").''.$object->type.''; } // Title - print ''.$langs->trans("Title").''.$act->label.''; + print ''.$langs->trans("Title").''.$object->label.''; // Full day event - print ''.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).''; + print ''.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent).''; // Date start print ''.$langs->trans("DateActionStart").''; - if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); - else print dol_print_date($act->datep,'day'); - if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); + if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); + else print dol_print_date($object->datep,'day'); + if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); print ''; print ''."\n"; print '
    '; print ''; print ''; - print ''; - print ''; - print ''; - //print ''; + print ''; + print ''; + print ''; + //print ''; print img_picto($langs->trans("ViewCal"),'object_calendar').' '; print '
    '."\n"; print '
    '; print ''; print ''; - print ''; - print ''; - print ''; - //print ''; + print ''; + print ''; + print ''; + //print ''; print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; print '
    '."\n"; print '
    '; print ''; print ''; - print ''; - print ''; - print ''; - //print ''; + print ''; + print ''; + print ''; + //print ''; print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; print '
    '."\n"; print ''; @@ -185,43 +171,43 @@ if ($act->id > 0) // Date end print ''.$langs->trans("DateActionEnd").''; - if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); - else print dol_print_date($act->datef,'day'); - if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); + if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour'); + else print dol_print_date($object->datef,'day'); + if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); print ''; // Status - print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); + print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $object->getLibStatut(4); print ''; // Location - print ''.$langs->trans("Location").''.$act->location.''; + print ''.$langs->trans("Location").''.$object->location.''; print '

    '; // Third party - Contact - print ''; print ''; print ''; } // Priority - print ''; @@ -268,19 +254,14 @@ if ($act->id > 0) print ''; - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); - - - // List of document - $param='&id='.$act->id; - $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); + $modulepart = 'actions'; + $permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { - print $langs->trans("UnkownError"); + print $langs->trans("ErrorUnknown"); } $db->close(); diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index b9770c8c1a3..d67b810e536 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -3,7 +3,8 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2013 Florian Henry * * 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 @@ -27,14 +28,16 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("companies"); @@ -48,12 +51,15 @@ $action=GETPOST('action','alpha'); $cancel=GETPOST('cancel','alpha'); $backtopage=GETPOST('backtopage','alpha'); $contactid=GETPOST('contactid','int'); +$origin=GETPOST('origin','alpha'); +$originid=GETPOST('originid','int'); // Security check $socid = GETPOST('socid','int'); $id = GETPOST('id','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id'); +if ($user->societe_id && $socid) $result = restrictedArea($user,'societe',$socid); $error=GETPOST("error"); $mesg=''; @@ -110,14 +116,14 @@ if ($action == 'add_action') { $error++; $action = 'create'; - $mesg='
    '.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'
    '; + $mesg='
    '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'
    '; } if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label')) { $error++; $action = 'create'; - $mesg='
    '.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'
    '; + $mesg='
    '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")).'
    '; } // Initialisation objet cactioncomm @@ -125,7 +131,7 @@ if ($action == 'add_action') { $error++; $action = 'create'; - $mesg='
    '.$langs->trans("ErrorFieldRequired",$langs->trans("Type")).'
    '; + $mesg='
    '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'
    '; } else { @@ -140,6 +146,8 @@ if ($action == 'add_action') $actioncomm->location = GETPOST("location"); $actioncomm->transparency = (GETPOST("transparency")=='on'?1:0); $actioncomm->label = trim(GETPOST('label')); + $actioncomm->fk_element = GETPOST("fk_element"); + $actioncomm->elementtype = GETPOST("elementtype"); if (! GETPOST('label')) { if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs)) @@ -159,7 +167,7 @@ if ($action == 'add_action') $actioncomm->datep = $datep; $actioncomm->datef = $datef; $actioncomm->percentage = $percentage; - $actioncomm->duree=((GETPOST('dureehour') * 60) + GETPOST('dureemin')) * 60; + $actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60; $usertodo=new User($db); if ($_POST["affectedto"] > 0) @@ -184,7 +192,7 @@ if ($action == 'add_action') } // Special for module webcal and phenix - // FIXME external modules + // TODO external modules if (! empty($conf->webcalendar->enabled) && GETPOST('add_webcal') == 'on') $actioncomm->use_webcal=1; if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1; @@ -253,8 +261,8 @@ if ($action == 'add_action') { $db->rollback(); $langs->load("errors"); - $error=$langs->trans($actioncomm->error); - setEventMessage($error,'errors'); + if (! empty($actioncomm->error)) setEventMessage($langs->trans($actioncomm->error), 'errors'); + if (count($actioncomm->errors)) setEventMessage($actioncomm->errors, 'errors'); $action = 'create'; } } @@ -325,7 +333,8 @@ if ($action == 'update') $actioncomm->fk_project = $_POST["projectid"]; $actioncomm->note = $_POST["note"]; $actioncomm->pnote = $_POST["note"]; - + $actioncomm->fk_element = $_POST["fk_element"]; + $actioncomm->elementtype = $_POST["elementtype"]; if (! $datef && $percentage == 100) { $error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")); @@ -509,7 +518,7 @@ if ($action == 'create') if (GETPOST("afaire") == 1) $percent=0; else if (GETPOST("afaire") == 2) $percent=100; } - print $htmlactions->form_select_status_action('formaction',$percent,1,'complete'); + $htmlactions->form_select_status_action('formaction',$percent,1,'complete'); print ''; // Location @@ -529,13 +538,13 @@ if ($action == 'create') // Busy print '
    '; // Realised by if ($conf->global->AGENDA_ENABLE_DONEBY) { - print ''; } @@ -555,38 +564,46 @@ if ($action == 'create') } else { + + $events=array(); + $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); //For external user force the company to user company if (!empty($user->societe_id)) { - print $form->select_company($user->societe_id,'socid','',1,1); + print $form->select_company($user->societe_id,'socid','',1,1,0,$events); } else { - print $form->select_company('','socid','',1,1); + print $form->select_company('','socid','',1,1,0,$events); } } print ''; - // If company is forced, we propose contacts (may be contact is also forced) - if (GETPOST("contactid") > 0 || GETPOST('socid','int') > 0) - { - print ''; - } + print ''; + // Project if (! empty($conf->projet->enabled)) { + $formproject=new FormProjets($db); + // Projet associe - $langs->load("project"); + $langs->load("projects"); print ''; } + if(!empty($origin) && !empty($originid)) + { + print ''; + print ''; + } if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',GETPOST("datep"),$reg)) { @@ -594,7 +611,7 @@ if ($action == 'create') } // Priority - print ''; @@ -605,8 +622,9 @@ if ($action == 'create') $doleditor->Create(); print ''; + // Other attributes - $parameters=array(); + $parameters=array('id'=>$actioncomm->id); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$actioncomm,$action); // Note that $action and $object may have been modified by hook @@ -679,8 +697,7 @@ if ($id > 0) // Confirmation suppression action if ($action == 'delete') { - $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1); - if ($ret == 'html') print '
    '; + print $form->formconfirm("fiche.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1); } if ($action == 'edit') @@ -756,7 +773,7 @@ if ($id > 0) // Status print ''; // Location @@ -791,23 +808,28 @@ if ($id > 0) { print ''; print ''; // Contact print ''; } // Project if (! empty($conf->projet->enabled)) { + + $formproject=new FormProjets($db); + // Projet associe $langs->load("project"); print ''; - print ''; + print ''; } // Description @@ -836,11 +859,11 @@ if ($id > 0) print ''; // Other attributes - $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$act->id); $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 $actioncomm->showOptionals($extrafields,'edit'); + print $act->showOptionals($extrafields,'edit'); } @@ -962,7 +985,7 @@ if ($id > 0) { if ($act->societe->fetch($act->societe->id)) { - print "
    ".dol_print_phone($act->societe->tel); + print "
    ".dol_print_phone($act->societe->phone); } } print ''; @@ -1007,8 +1030,9 @@ if ($id > 0) // Object linked if (! empty($act->fk_element) && ! empty($act->elementtype)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ''; - print ''; + print ''; } // Description @@ -1017,7 +1041,7 @@ if ($id > 0) print ''; // Other attributes - $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$act->id); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook print '
    '.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); - if ($act->societe->id && $act->type_code == 'AC_TEL') + print '
    '.$langs->trans("ActionOnCompany").''.($object->societe->id?$object->societe->getNomUrl(1):$langs->trans("None")); + if ($object->societe->id && $object->type_code == 'AC_TEL') { - if ($act->societe->fetch($act->societe->id)) + if ($object->societe->fetch($object->societe->id)) { - print "
    ".dol_print_phone($act->societe->tel); + print "
    ".dol_print_phone($object->societe->phone); } } print '
    '.$langs->trans("Contact").''; - if ($act->contact->id > 0) + if ($object->contact->id > 0) { - print $act->contact->getNomUrl(1); - if ($act->contact->id && $act->type_code == 'AC_TEL') + print $object->contact->getNomUrl(1); + if ($object->contact->id && $object->type_code == 'AC_TEL') { - if ($act->contact->fetch($act->contact->id)) + if ($object->contact->fetch($object->contact->id)) { - print "
    ".dol_print_phone($act->contact->phone_pro); + print "
    ".dol_print_phone($object->contact->phone_pro); } } } @@ -236,18 +222,18 @@ if ($act->id > 0) if (! empty($conf->projet->enabled)) { print '
    '.$langs->trans("Project").''; - if ($act->fk_project) + if ($object->fk_project) { $project=new Project($db); - $project->fetch($act->fk_project); + $project->fetch($object->fk_project); print $project->getNomUrl(1); } print '
    '.$langs->trans("Priority").''; - print ($act->priority?$act->priority:''); + print '
    '.$langs->trans("Priority").''; + print ($object->priority?$object->priority:''); print '
    '.$langs->trans("Busy").''; - print ''; + print 'transparency?' checked="checked"':'').'>'; print '
    '.$langs->trans("ActionDoneBy").''; + print '
    '.$langs->trans("ActionDoneBy").''; $form->select_users(GETPOST("doneby")?GETPOST("doneby"):(! empty($actioncomm->userdone->id) && $percent==100?$actioncomm->userdone->id:0),'doneby',1); print '
    '.$langs->trans("ActionOnContact").''; - $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); - print '
    '.$langs->trans("ActionOnContact").''; + $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); + print '
    '.$langs->trans("Project").''; - $numproject=select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); + + $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); if ($numproject==0) { print '   '.$langs->trans("AddProject").''; } print '
    '.$langs->trans("Priority").''; + print '
    '.$langs->trans("Priority").''; print ''; print '
    '.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; - print $htmlactions->form_select_status_action('formaction',$percent,1); + $htmlactions->form_select_status_action('formaction',$percent,1); print '
    '.$langs->trans("ActionOnCompany").''; - print $form->select_company($act->societe->id,'socid','',1,1); + $events=array(); + $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + print $form->select_company($act->societe->id,'socid','',1,1,0,$events); print ''.$langs->trans("Contact").''; - print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1); + $form->select_contacts($act->societe->id, $act->contact->id,'contactid',1); print '
    '.$langs->trans("Project").''; - $numprojet=select_projects($act->societe->id,$act->fk_project,'projectid'); + $numprojet=$formproject->select_projects($act->societe->id,$act->fk_project,'projectid'); if ($numprojet==0) { print '   '.$langs->trans("AddProject").''; @@ -823,8 +845,9 @@ if ($id > 0) // Object linked if (! empty($act->fk_element) && ! empty($act->elementtype)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print '
    '.$langs->trans("LinkedObject").''.$act->getElementUrl($act->fk_element,$act->elementtype,1).'
    '.dolGetElementUrl($act->fk_element,$act->elementtype,1).'
    '.$langs->trans("LinkedObject").''.$act->getElementUrl($act->fk_element,$act->elementtype,1).'
    '.dolGetElementUrl($act->fk_element,$act->elementtype,1).'
    '; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 349dc3aab14..efe47defd92 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -19,6 +19,7 @@ * along with this program. If not, see . */ + /** * \file htdocs/comm/action/index.php * \ingroup agenda @@ -31,7 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; @@ -76,7 +79,7 @@ $pid=GETPOST("projectid","int",3); $status=GETPOST("status"); $type=GETPOST("type"); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); -$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); +$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') { $action='show_month'; $day=''; @@ -143,9 +146,11 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0 $source='AGENDA_EXT_SRC'.$i; $name='AGENDA_EXT_NAME'.$i; $color='AGENDA_EXT_COLOR'.$i; + $buggedfile='AGENDA_EXT_BUGGEDFILE'.$i; if (! empty($conf->global->$source) && ! empty($conf->global->$name)) { - $listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'color'=>$conf->global->$color); + // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' + $listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'color'=>$conf->global->$color,'buggedfile'=>(isset($conf->global->buggedfile)?$conf->global->buggedfile:0)); } } } @@ -230,7 +235,7 @@ if ($filterd) $param.="&filterd=".$filterd; if ($socid) $param.="&socid=".$socid; if ($showbirthday) $param.="&showbirthday=1"; if ($pid) $param.="&projectid=".$pid; -if ($actioncode) $param.="&actioncode=".$actioncode; +if ($actioncode != '') $param.="&actioncode=".$actioncode; if ($type) $param.="&type=".$type; if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action; $param.="&maxprint=".$maxprint; @@ -306,11 +311,9 @@ $sql.= ' a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; $sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,'; -$sql.= " ".MAIN_DB_PREFIX.'user as u,'; $sql.= " ".MAIN_DB_PREFIX."actioncomm as a)"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; $sql.= ' WHERE a.fk_action = ca.id'; -$sql.= ' AND a.fk_user_author = u.rowid'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); @@ -319,28 +322,28 @@ if ($user->societe_id) $sql.= ' AND a.fk_soc = '.$user->societe_id; // To limit if ($action == 'show_day') { $sql.= " AND ("; - $sql.= " (datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; + $sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; $sql.= " OR "; - $sql.= " (datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; + $sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; $sql.= " OR "; - $sql.= " (datep < '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; - $sql.= " AND datep2 > '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; + $sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; + $sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; $sql.= ')'; } else { // To limit array $sql.= " AND ("; - $sql.= " (datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; // Start 7 days before + $sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; // Start 7 days before $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; // End 7 days after + 3 to go from 28 to 31 $sql.= " OR "; - $sql.= " (datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; + $sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; $sql.= " OR "; - $sql.= " (datep < '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; - $sql.= " AND datep2 > '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; + $sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; + $sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; $sql.= ')'; } if ($type) $sql.= " AND ca.id = ".$type; @@ -376,10 +379,10 @@ if ($resql) $event->type_code=$obj->code; $event->libelle=$obj->label; $event->percentage=$obj->percent; - $event->author->id=$obj->fk_user_author; - $event->usertodo->id=$obj->fk_user_action; - $event->userdone->id=$obj->fk_user_done; - + $event->author->id=$obj->fk_user_author; // user id of creator + $event->usertodo->id=$obj->fk_user_action; // user id of owner + $event->userdone->id=$obj->fk_user_done; // deprecated + // $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event $event->priority=$obj->priority; $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; @@ -526,9 +529,11 @@ if (count($listofextcals)) $url=$extcal['src']; // Example: https://www.google.com/calendar/ical/eldy10%40gmail.com/private-cde92aa7d7e0ef6110010a821a2aaeb/basic.ics $namecal = $extcal['name']; $colorcal = $extcal['color']; - //print "url=".$url." namecal=".$namecal." colorcal=".$colorcal; + $buggedfile = $extcal['buggedfile']; + //print "url=".$url." namecal=".$namecal." colorcal=".$colorcal." buggedfile=".$buggedfile; $ical=new ICal(); $ical->parse($url); + // After this $ical->cal['VEVENT'] contains array of events, $ical->cal['DAYLIGHT'] contains daylight info, $ical->cal['STANDARD'] contains non daylight info, ... //var_dump($ical->cal); exit; $icalevents=array(); @@ -642,6 +647,8 @@ if (count($listofextcals)) // Loop on each entry into cal file to know if entry is qualified and add an ActionComm into $eventarray foreach($icalevents as $icalevent) { + //var_dump($icalevent); + //print $icalevent['SUMMARY'].'->'.var_dump($icalevent).'
    ';exit; if (! empty($icalevent['RRULE'])) continue; // We found a repeatable event. It was already split into unitary events, so we discard general rule. @@ -658,12 +665,36 @@ if (count($listofextcals)) $event->fulldayevent=true; $addevent=true; } - elseif (!is_array($icalevent['DTSTART'])) // not fullday event (DTSTART is not array) + elseif (!is_array($icalevent['DTSTART'])) // not fullday event (DTSTART is not array. It is a value like '19700101T000000Z' for 00:00 in greenwitch) { $datestart=$icalevent['DTSTART']; $dateend=$icalevent['DTEND']; $addevent=true; } + elseif (isset($icalevent['DTSTART']['unixtime'])) // File contains a local timezone + a TZ (for example when using bluemind) + { + $datestart=$icalevent['DTSTART']['unixtime']; + $dateend=$icalevent['DTEND']['unixtime']; + // $buggedfile is set to uselocalandtznodaylight if conf->global->AGENDA_EXT_BUGGEDFILEx = 'uselocalandtznodaylight' + if ($buggedfile === 'uselocalandtznodaylight') // unixtime is a local date that does not take daylight into account, TZID is +1 for example for 'Europe/Paris' in summer instead of 2 + { + // TODO + } + // $buggedfile is set to uselocalandtzdaylight if conf->global->AGENDA_EXT_BUGGEDFILEx = 'uselocalandtzdaylight' (for example with bluemind) + if ($buggedfile === 'uselocalandtzdaylight') // unixtime is a local date that does take daylight into account, TZID is +2 for example for 'Europe/Paris' in summer + { + $localtzs = new DateTimeZone(preg_replace('/"/','',$icalevent['DTSTART']['TZID'])); + $localtze = new DateTimeZone(preg_replace('/"/','',$icalevent['DTEND']['TZID'])); + $localdts = new DateTime(dol_print_date($datestart,'dayrfc','gmt'), $localtzs); + $localdte = new DateTime(dol_print_date($dateend,'dayrfc','gmt'), $localtze); + $tmps=-1*$localtzs->getOffset($localdts); + $tmpe=-1*$localtze->getOffset($localdte); + $datestart+=$tmps; + $dateend+=$tmpe; + //var_dump($datestart); + } + $addevent=true; + } if ($addevent) { @@ -946,11 +977,10 @@ llxFooter(); function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60) { global $user, $conf, $langs; - global $filter, $filtera, $filtert, $filterd, $status; + global $filter, $filtera, $filtert, $filterd, $status, $actioncode; // Filters used into search form global $theme_datacolor; global $cachethirdparties, $cachecontacts, $colorindexused; - print '
    '."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); print ''; @@ -1003,6 +1033,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa || (! empty($event->userdone->id) && $event->userdone->id == $user->id)) { $nummytasks++; $cssclass='family_mytasks'; + // TODO Set a color using user color + // Must defined rule to choose color of who to use. + // event->usertodo->id will still contains user id of owner + // event->userstodo will be an array in future. + // $color=$user->color; } else if ($event->type_code == 'ICALEVENT') { @@ -1173,9 +1208,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else { - print ''.img_picto("all","1downarrow_selected.png").' ...'; print ' +'.(count($eventarray[$daykey])-$maxprint); print ''; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 0dab9196756..ebe68fa3328 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -29,7 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load("companies"); $langs->load("agenda"); @@ -261,7 +260,7 @@ if ($resql) $var=!$var; - print ""; + print ""; // Action (type) print '"; + print ""; //print ""; print ""; print "\n"; diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index e55f88de7aa..7f9d7ede440 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -42,6 +42,7 @@ $search_lastname=GETPOST('search_nom')?GETPOST('search_nom'):GETPOST('search_las $search_firstname=GETPOST('search_firstname')?GETPOST('search_firstname'):GETPOST('search_firstname'); // For backward compatibility $search_company=GETPOST('search_societe')?GETPOST('search_societe'):GETPOST('search_company'); // For backward compatibility $contactname=GETPOST('contactname'); +$begin=GETPOST('begin','alpha'); // Security check $socid = GETPOST('socid','int'); @@ -87,13 +88,7 @@ if ($socid) $sql.= " AND s.rowid = ".$socid; if (dol_strlen($stcomm)) { - $sql.= " AND s.fk_stcomm=$stcomm"; -} - -// FIXME $begin not exist -if (dol_strlen($begin)) // filtre sur la premiere lettre du nom -{ - $sql.= " AND upper(p.name) LIKE '".$begin."%'"; + $sql.= " AND s.fk_stcomm=".$db->escape($stcomm); } if (! empty($search_lastname)) @@ -113,7 +108,7 @@ if (! empty($search_company)) if (! empty($contactname)) // acces a partir du module de recherche { - $sql.= " AND (p.name LIKE '%".$db->escape(strtolower($contactname))."%' OR lower(p.firstname) LIKE '%".$db->escape(strtolower($contactname))."%') "; + $sql.= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') "; $sortfield = "p.name"; $sortorder = "ASC"; } @@ -124,55 +119,57 @@ $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); + $num = $db->num_rows($resql); - $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses")); - print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], "&type=$type",$sortfield,$sortorder,"",$num); + $param="&type=".$type; - print '
    '; diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 6443b426934..22e992c0f8a 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -416,9 +416,7 @@ else // Confirmation delete if ($action == 'delete') { - $form = new Form($db); - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?socid=".$object->socid."&id=".$id,$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete"); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF']."?socid=".$object->socid."&id=".$id,$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete"); } $nblines = count($object->lines); diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 1d34a3d987d..974c42c95bb 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php new file mode 100644 index 00000000000..f4a5226e1f0 --- /dev/null +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -0,0 +1,161 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Florian Henry + * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013 Florian Henry + * + * 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 . + */ + +/** + * \file htdocs/comm/admin/propaldet_extrafields.php + * \ingroup order + * \brief Page to setup extra fields of order + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + + +if (!$user->admin) + accessforbidden(); + +$langs->load("admin"); +$langs->load("other"); +$langs->load("orders"); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); + +$elementtype='propaldet'; //Must be the $table_element of the class that manage extrafield + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + + + +/* + * View + */ + +$textobject=$langs->transnoentitiesnoconv("Proposals"); + +llxHeader('',$langs->trans("PropalSetup")); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup'); +print "
    \n"; + +$head = propal_admin_prepare_head(null); + +dol_fiche_head($head, 'attributeslines', $langs->trans("ModuleSetup"), 0, 'order'); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
    '."\n"; +print '
    '; + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; +} + +print "
    '.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
    ".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
    "; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
    '; + print "".$langs->trans("NewAttribute").""; + print "
    "; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel */ +/* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
    "; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
    "; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php index dff26cb2618..1b5b1100736 100644 --- a/htdocs/comm/bookmark.php +++ b/htdocs/comm/bookmark.php @@ -122,7 +122,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; - print "
    " . ($i + 1 + ($limit * $page)) . "".$obj->bid."".img_object($langs->trans("ShowUser"),"user").' '.$obj->lastname." ".$obj->firstname."
    '; - print ''; - print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin,"&type=$type","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin,"&type=$type","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin,"&type=$type","",$sortfield,$sortorder); - print ''; - print ''; - print "\n"; + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses")); + print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,"",$num); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - print ''; + print '
    '.$langs->trans("Email").''.$langs->trans("Phone").'
     
    '; + print ''; + print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder); + print ''; + print ''; + print "\n"; - $var=True; - $i = 0; - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; - $var=!$var; + $var=True; + $i = 0; + while ($i < min($num,$limit)) + { + $obj = $db->fetch_object($resql); - print ""; - print ''; - print ""; + $var=!$var; - print '\n"; + print ""; + print ''; + print ""; - print ''; + print '\n"; - print ''; + print ''; - print "\n"; - $i++; - } - print "
    '.$langs->trans("Email").''.$langs->trans("Phone").'
     
    '.img_object($langs->trans("ShowContact"),"contact"); - print ' '.$obj->name.'$obj->firstname'.img_object($langs->trans("ShowCompany"),"company").' '; - print "rowid."\">$obj->nom
    '.img_object($langs->trans("ShowContact"),"contact"); + print ' '.$obj->name.'$obj->firstname'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').''.img_object($langs->trans("ShowCompany"),"company").' '; + print "rowid."\">$obj->nom'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').' '.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'

    "; - $db->free($resql); + print ''.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').' '; + + print "\n"; + $i++; + } + print "

    "; + $db->free($resql); } else { @@ -182,5 +179,4 @@ else llxFooter(); $db->close(); - -?> +?> \ No newline at end of file diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 5a1a1e4bd66..b5f50a54e93 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -1,11 +1,12 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2013 Alexandre Spangaro * * 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 @@ -128,6 +129,14 @@ if ($action == 'cstc') if ($result < 0) setEventMessage($object->error,'errors'); } +// Update communication level +if ($action == 'setOutstandingBill') +{ + $object->fetch($id); + $object->outstanding_limit=GETPOST('OutstandingBill'); + $result=$object->set_OutstandingBill($user); + if ($result < 0) setEventMessage($object->error,'errors'); +} /* @@ -188,13 +197,12 @@ if ($id > 0) print '
    '; - //print ''; - //print '"; } @@ -914,20 +935,14 @@ else if ($id > 0 || ! empty($ref)) { $result=$object->fetch($id,$ref); - if ($result > 0) - { - $result=$object->fetch_lines(); - } - if ($result < 0) - { - dol_print_error($db,$object->error); - exit; - } + if ($result < 0) dol_print_error($db,$object->error); + $result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed + if ($result < 0) dol_print_error($db,$object->error); + $result=$object->fetch_thirdparty(); + if ($result < 0) dol_print_error($db,$object->error); dol_htmloutput_errors($mesg,''); - $object->fetch_thirdparty(); - $nbofservices=count($object->lines); $author = new User($db); @@ -951,8 +966,8 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1); + } /* @@ -972,8 +987,8 @@ else $text=$langs->trans('ConfirmValidateContract',$numref); - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1); + } /* @@ -981,8 +996,8 @@ else */ if ($action == 'close') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); + } /* @@ -1010,7 +1025,7 @@ else // Ligne info remises tiers print ''; print ''; //print ''; - print '"; print "\n"; print ''; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index c8edf493f63..e2bac1c6016 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -96,7 +96,7 @@ if ($id > 0 || ! empty($ref)) // Ligne info remises tiers print ''; - print '"; print "\n"; print ''; diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php similarity index 86% rename from htdocs/core/admin_extrafields.inc.php rename to htdocs/core/actions_extrafields.inc.php index 0b608a1e736..70b173ab014 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/admin_extrafields.inc.php + * \file htdocs/core/actions_extrafields.inc.php * \brief Code for actions on extrafields admin pages */ @@ -87,7 +87,7 @@ if ($action == 'add') $mesg[]=$langs->trans("ErrorNoValueForRadioType"); $action = 'create'; } - if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox') || (GETPOST('type')=='radio')) && GETPOST('param')) + if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param')) { // Construct array for parameter (value of select list) $parameters = GETPOST('param'); @@ -117,18 +117,29 @@ if ($action == 'add') if (! $error) { - // Type et taille non encore pris en compte => varchar(255) - if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname'])) + // attrname must be alphabetical and lower case only + if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname'])) { // Construct array for parameter (value of select list) $default_value = GETPOST('default_value'); $parameters = GETPOST('param'); $parameters_array = explode("\r\n",$parameters); - foreach($parameters_array as $param_ligne) + //In sellist we have only one line and it can have come to do SQL expression + if (GETPOST('type')=='sellist') { + foreach($parameters_array as $param_ligne) + { + $params['options'] = array($parameters=>null); + } + } + else { - list($key,$value) = explode(',',$param_ligne); - $params['options'][$key] = $value; - } + //Esle it's separated key/value and coma list + foreach($parameters_array as $param_ligne) + { + list($key,$value) = explode(',',$param_ligne); + $params['options'][$key] = $value; + } + } $result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$default_value,$params); if ($result > 0) @@ -148,7 +159,7 @@ if ($action == 'add') { $error++; $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode")); + $mesg=$langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters",$langs->transnoentities("AttributeCode")); setEventMessage($mesg,'errors'); $action = 'create'; } @@ -215,7 +226,7 @@ if ($action == 'update') $mesg[]=$langs->trans("ErrorNoValueForRadioType"); $action = 'edit'; } - if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox') || (GETPOST('type')=='radio')) && GETPOST('param')) + if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param')) { // Construct array for parameter (value of select list) $parameters = GETPOST('param'); @@ -251,10 +262,21 @@ if ($action == 'update') // Construct array for parameter (value of select list) $parameters = GETPOST('param'); $parameters_array = explode("\r\n",$parameters); - foreach($parameters_array as $param_ligne) + //In sellist we have only one line and it can have come to do SQL expression + if (GETPOST('type')=='sellist') { + foreach($parameters_array as $param_ligne) + { + $params['options'] = array($parameters=>null); + } + } + else { - list($key,$value) = explode(',',$param_ligne); - $params['options'][$key] = $value; + //Esle it's separated key/value and coma list + foreach($parameters_array as $param_ligne) + { + list($key,$value) = explode(',',$param_ligne); + $params['options'][$key] = $value; + } } $result=$extrafields->update($_POST['attrname'],$_POST['label'],$_POST['type'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$pos,$params); if ($result > 0) @@ -306,4 +328,4 @@ if ($action == 'delete') } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php new file mode 100644 index 00000000000..f13113487c1 --- /dev/null +++ b/htdocs/core/actions_sendmails.inc.php @@ -0,0 +1,233 @@ + + * + * 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 . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/actions_sendmails.inc.php + * \brief Code for actions on sending mails from object page + */ + + +// TODO Include this include file into all class objects + +// $id must be defined +// $actiontypecode must be defined + + +/* + * Add file in email form + */ +if (GETPOST('addfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + dol_add_file_process($upload_dir_tmp,0,0); + $action='presend'; +} + +/* + * Remove file in email form + */ +if (! empty($_POST['removedfile'])) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + // TODO Delete only files that was uploaded from email form + dol_remove_file_process($_POST['removedfile'],0); + $action='presend'; +} + +/* + * Send mail + */ +if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) +{ + $langs->load('mails'); + + $subject='';$actionmsg='';$actionmsg2=''; + + $result=$object->fetch($id); + + $sendtosocid=0; + if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe') + { + $result=$object->fetch_thirdparty(); + $thirdparty=$object->thirdparty; + $sendtosocid=$thirdparty->id; + } + else if ($object->element == 'societe') + { + $thirdparty=$object; + $sendtosocid=$thirdparty->id; + } + else dol_print_error('','Use actions_sendmails.in.php for a type that is not supported'); + + if ($result > 0) + { + if ($_POST['sendto']) + { + // Recipient is provided into free text + $sendto = $_POST['sendto']; + $sendtoid = 0; + } + elseif ($_POST['receiver'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party + { + $sendto = $thirdparty->email; + $sendtoid = 0; + } + else // Id du contact + { + $sendto = $thirdparty->contact_get_property($_POST['receiver'],'email'); + $sendtoid = $_POST['receiver']; + } + } + + if (dol_strlen($sendto)) + { + $langs->load("commercial"); + + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; + $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; + $message = $_POST['message']; + $sendtocc = $_POST['sendtocc']; + $deliveryreceipt = $_POST['deliveryreceipt']; + + if ($action == 'send' || $action == 'relance') + { + if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; + $actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + if ($message) + { + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; + $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; + $actionmsg.=$message; + } + } + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $attachedfiles=$formmail->get_attached_files(); + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; + + // Send mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); + if ($mailfile->error) + { + $mesgs[]='
    '.$mailfile->error.'
    '; + } + else + { + $result=$mailfile->sendfile(); + if ($result) + { + $error=0; + + // Initialisation donnees + $object->socid = $sendtosocid; // To link to a company + $object->sendtoid = $sendtoid; // To link to a contact/address + $object->actiontypecode = $actiontypecode; + $object->actionmsg = $actionmsg; // Long text + $object->actionmsg2 = $actionmsg2; // Short text + $object->fk_element = $object->id; + $object->elementtype = $object->element; + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('COMPANY_SENTBYMAIL',$object,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + + if ($error) + { + dol_print_error($db); + } + else + { + // Redirect here + // This avoid sending mail twice if going out and then back to page + $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); + setEventMessage($mesg); + header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id); + exit; + } + } + else + { + $langs->load("other"); + $mesg='
    '; + if ($mailfile->error) + { + $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); + $mesg.='
    '.$mailfile->error; + } + else + { + $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; + } + $mesg.='
    '; + + setEventMessage($mesg,'warnings'); + $action = 'presend'; + } + } + /* } + else + { + $langs->load("other"); + $mesgs[]='
    '.$langs->trans('ErrorMailRecipientIsEmpty').'
    '; + dol_syslog('Recipient email is empty'); + }*/ + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")),'warnings'); + dol_syslog('Try to send email with no recipiend defined', LOG_WARNING); + $action = 'presend'; + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorFailedToReadEntity',$object->element),'errors'); + dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element); + $action = 'presend'; + } + +} + +?> \ No newline at end of file diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 2389a681000..e2ad29b8562 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -213,30 +213,42 @@ if ($type == 'directory') $textifempty = $langs->trans('NoFileFound'); } else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")); - + $formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url); } } -if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) + +if ($section) { - if ($section) - { - $param.=($param?'?':'').(preg_replace('/^&/','',$param)); + $useajax=1; + if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; + if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - $useglobalvars=1; - $form = new Form($db); - $formquestion=array('urlfile'=>array('type'=>'hidden','value'=>'','name'=>'urlfile')); - print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",'deletefile'); + $param.=($param?'?':'').(preg_replace('/^&/','',$param)); - // Enable jquery handlers on new generated HTML objects - print ''."\n"; - } + if ($useajax || $action == 'delete') + { + $urlfile=''; + if ($action == 'delete') $urlfile=GETPOST('urlfile'); + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + $useglobalvars=1; + $form = new Form($db); + $formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile')); + print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0)); + } + + if ($useajax) + { + // Enable jquery handlers on new generated HTML objects + print ''."\n"; + } } // Close db if mode is not noajax diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index db8af5ba265..640c64f40f7 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -207,6 +207,7 @@ if (file_exists($fullpathselecteddir)) // Enable jquery handlers on new generated HTML objects print ''; diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index 1f4b6acb6fb..47cb887c0cc 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011 Laurent Destailleur +/* Copyright (C) 2010 Regis Houssin + * Copyright (C) 2011-204 Laurent Destailleur * * 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 @@ -73,7 +73,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; $sql.= " ORDER BY z.zip, z.town"; - $sql.= $db->plimit(50); // Avoid pb with bad criteria + $sql.= $db->plimit(100); // Avoid pb with bad criteria } else // Use table of third parties { @@ -87,7 +87,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; $sql.= " ORDER BY s.fk_pays, s.zip, s.town"; - $sql.= $db->plimit(50); // Avoid pb with bad criteria + $sql.= $db->plimit(100); // Avoid pb with bad criteria } //print $sql; @@ -97,8 +97,8 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) { while ($row = $db->fetch_array($resql)) { - $country = $row['fk_country']?($langs->trans('Country'.$row['country_code'])!='Country'.$row['country_code']?$langs->trans('Country'.$row['country_code']):$row['country']):''; - $county = $row['fk_county']?($langs->trans($row['county_code'])!=$row['county_code']?$langs->trans($row['county_code']):($row['county']!='-'?$row['county']:'')):''; + $country = $row['fk_country']?($langs->transnoentitiesnoconv('Country'.$row['country_code'])!='Country'.$row['country_code']?$langs->transnoentitiesnoconv('Country'.$row['country_code']):$row['country']):''; + $county = $row['fk_county']?($langs->transnoentitiesnoconv($row['county_code'])!=$row['county_code']?$langs->transnoentitiesnoconv($row['county_code']):($row['county']!='-'?$row['county']:'')):''; $row_array['label'] = $row['zip'].' '.$row['town']; $row_array['label'] .= ($county || $country)?' (':''; @@ -116,7 +116,6 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) $row_array['value'] = $row['town']; $row_array['zipcode'] = $row['zip']; } - $row_array['departement_id'] = $row['fk_county']; // deprecated $row_array['selectcountry_id'] = $row['fk_country']; $row_array['state_id'] = $row['fk_county']; diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index cbc8e7ee5b7..a1094a8274c 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -127,6 +127,8 @@ class box_actions extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index d0b59b67dd7..bddeb4b957e 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -56,7 +56,7 @@ class box_activity extends ModeleBoxes // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. // FIXME: Removed number_format (not compatible with all languages) // FIXME: Pb into some status - $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous comments) } /** @@ -118,7 +118,7 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$i][3] = array('td' => 'align="right"', - 'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency) + 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) ); // We add only for the current year @@ -131,6 +131,8 @@ class box_activity extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices")); + + $db->free($result); } else dol_print_error($db); @@ -163,7 +165,7 @@ class box_activity extends ModeleBoxes ); $totalnb += $objp->nb; $this->info_box_contents[$i][3] = array('td' => 'align="right"', - 'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency) + 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) ); $totalMnt += $objp->Mnttot; $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', @@ -217,7 +219,7 @@ class box_activity extends ModeleBoxes $totalnb += $objp->nb; $this->info_box_contents[$i][3] = array('td' => 'align="right"', - 'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency) + 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) ); $totalMnt += $objp->Mnttot; $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,0,3)); @@ -268,7 +270,7 @@ class box_activity extends ModeleBoxes $totalnb += $objp->nb; $this->info_box_contents[$i][3] = array('td' => 'align="right"', - 'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency) + 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) ); $totalMnt += $objp->Mnttot; $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3)); @@ -281,8 +283,8 @@ class box_activity extends ModeleBoxes // Add the sum in the bottom of the boxes $this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead); - $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')); - $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')." ".$langs->getCurrencySymbol($conf->currency)); + $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => price($totalnb,1,$langs,0,0,-1,$conf->currency)); + $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => price($totalMnt,1,$langs,0,0,-1,$conf->currency)); $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ""); $this->info_box_contents[$i][5] = array('td' => 'align="right"', 'text' => ""); } diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index 1adc7f33657..f841786c8b8 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -74,7 +74,6 @@ class box_bookmarks extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -103,6 +102,8 @@ class box_bookmarks extends ModeleBoxes if ($user->rights->bookmark->creer) $mytxt.=' '.$langs->trans("ClickToAdd"); $this->info_box_contents[$i][0] = array('td' => 'align="center" colspan="2"', 'url'=> DOL_URL_ROOT.'/bookmarks/liste.php', 'text'=>$mytxt); } + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index e0c745504b9..a2da1ae60e3 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -106,6 +106,8 @@ class box_clients extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 992f833cc12..9f3001f1c31 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -77,7 +77,6 @@ class box_commandes extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -116,6 +115,8 @@ class box_commandes extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedOrders")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 2df5f0dd002..c6ea786aaab 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Christophe * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -89,7 +90,7 @@ class box_comptes extends ModeleBoxes $sql.= " ORDER BY label"; $sql.= $db->plimit($max, 0); - dol_syslog("Box_comptes::loadBox sql=".$sql); + dol_syslog(get_class($this)."::loadBox sql=".$sql); $result = $db->query($sql); if ($result) { @@ -122,7 +123,7 @@ class box_comptes extends ModeleBoxes ); $this->info_box_contents[$i][3] = array('td' => 'align="right"', - 'text' => price($solde).' '.$langs->trans("Currency".$objp->currency_code) + 'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code) ); $listofcurrencies[$objp->currency_code]=1; @@ -141,11 +142,13 @@ class box_comptes extends ModeleBoxes $this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"', 'text' => ' ' ); - $totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->currency); + $totalamount=price($solde_total,0,$langs,0,0,-1,$conf->currency); $this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"', 'text' => $totalamount ); } + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index a81695ca900..053d7d67329 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -117,6 +117,8 @@ class box_contacts extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContacts")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 7dea6ed7f04..4f534f2b49d 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -123,6 +123,8 @@ class box_contracts extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContracts")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 383eae8e4bb..13a1dd2c223 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -129,6 +129,8 @@ class box_factures extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 458d9a66bca..e51e3d3288f 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -127,6 +127,8 @@ class box_factures_fourn extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoModifiedSupplierBills")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 0961312be7d..ebe2f897b77 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -123,6 +123,8 @@ class box_factures_fourn_imp extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidSupplierBills")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 252aa3a4da2..85a383b0ec9 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -125,6 +125,8 @@ class box_factures_imp extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidCustomerBills")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index c821989bf4f..81cba912dff 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/core/boxes/box_intervention.php + * \file htdocs/core/boxes/box_ficheinter.php * \ingroup ficheinter - * \brief Module de generation de l'affichage de la box ficheinter + * \brief Box to show last interventions */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; @@ -51,12 +51,12 @@ class box_ficheinter extends ModeleBoxes function loadBox($max=10) { global $user, $langs, $db, $conf; - + $this->max=$max; include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $ficheinterstatic=new Fichinter($db); - + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastFicheInter",$max)); if ($user->rights->ficheinter->lire) @@ -93,7 +93,7 @@ class box_ficheinter extends ModeleBoxes $ficheinterstatic->statut=$objp->fk_statut; $ficheinterstatic->id=$objp->rowid; - + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/fichinter/fiche.php?id=".$objp->rowid); @@ -122,6 +122,8 @@ class box_ficheinter extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInterventions")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index ceb9468a054..df6505e0c94 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -102,6 +102,8 @@ class box_fournisseurs extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedSuppliers")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 5bce26306f3..f9647c4e4ca 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/core/boxes/box_invoice_permonth.php + * \file htdocs/core/boxes/box_graph_invoices_permonth.php * \ingroup factures * \brief Box to show graph of invoices per month */ @@ -30,7 +30,7 @@ class box_graph_invoices_permonth extends ModeleBoxes { var $boxcode="invoicespermonth"; var $boximg="object_bill"; - var $boxlabel="BoxInvoicesPerMonth"; + var $boxlabel="BoxCustomersInvoicesPerMonth"; var $depends = array("facture"); var $db; @@ -50,7 +50,6 @@ class box_graph_invoices_permonth extends ModeleBoxes global $conf; $this->db=$db; - $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; } /** @@ -65,63 +64,185 @@ class box_graph_invoices_permonth extends ModeleBoxes $this->max=$max; - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $facturestatic=new Facture($db); + $refreshaction='refresh_'.$this->boxcode; - $text = $langs->trans("BoxInvoicesPerMonth",$max); + //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + //$facturestatic=new Facture($db); + + $text = $langs->trans("BoxCustomersInvoicesPerMonth",$max); $this->info_box_head = array( 'text' => $text, 'limit'=> dol_strlen($text), - 'graph'=> 1 + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', + 'target'=>'none' // Set '' to get target="_blank" ); + $dir=''; // We don't need a path because image file will not be saved into disk + $prefix=''; + $socid=0; + if ($user->societe_id) $socid=$user->societe_id; + if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + if ($user->rights->facture->lire) { - $sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.datef as df"; - $sql.= ", f.paye, f.fk_statut, f.datec, f.tms"; - $sql.= ", s.nom, s.rowid as socid"; - $sql.= ", f.date_lim_reglement as datelimite"; - $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= ")"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; - $sql.= " ORDER BY f.tms DESC"; - $sql.= $db->plimit($max, 0); + $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; + $param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; - $result = $db->query($sql); - if ($result) + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) { - $num = $db->num_rows($result); - $now=dol_now(); - - $i = 0; - $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; - - while ($i < $num) - { - $objp = $db->fetch_object($result); - $datelimite=$db->jdate($objp->datelimite); - $datec=$db->jdate($objp->datec); - - $picto='bill'; - if ($objp->type == 1) $picto.='r'; - if ($objp->type == 2) $picto.='a'; - $late = ''; - if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));} - - $i++; - } - - $this->info_box_contents[0][0] = array('td' => 'align="center"','text2'=>'xxxxxxx'); + $endyear=GETPOST($param_year,'int'); + $shownb=GETPOST($param_shownb,'alpha'); + $showtot=GETPOST($param_showtot,'alpha'); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $endyear=$tmparray['year']; + $shownb=$tmparray['shownb']; + $showtot=$tmparray['showtot']; + } + if (empty($shownb) && empty($showtot)) $showtot=1; + $nowarray=dol_getdate(dol_now(),true); + if (empty($endyear)) $endyear=$nowarray['year']; + $startyear=$endyear-1; + $mode='customer'; + $userid=0; + $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; + $HEIGHT='192'; + + $stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0)); + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($shownb) + { + $data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; + + $px1 = new DolGraph(); + $mesg = $px1->isGraphKo(); + if (! $mesg) + { + $px1->SetData($data1); + unset($data1); + $px1->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px1->SetLegend($legend); + $px1->SetMaxValue($px1->GetCeilMaxValue()); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); + $px1->SetYLabel($langs->trans("NumberOfBills")); + $px1->SetShading(3); + $px1->SetHorizTickIncrement(1); + $px1->SetPrecisionY(0); + $px1->SetCssPrefix("cssboxes"); + $px1->mode='depth'; + $px1->SetTitle($langs->trans("NumberOfBillsByMonth")); + + $px1->draw($filenamenb,$fileurlnb); + } + } + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showtot) + { + $data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (! $mesg) + { + $px2->SetData($data2); + unset($data2); + $px2->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px2->SetLegend($legend); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("AmountOfBillsHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetPrecisionY(0); + $px2->SetCssPrefix("cssboxes"); + $px2->mode='depth'; + $px2->SetTitle($langs->trans("AmountOfBillsByMonthHT")); + + $px2->draw($filenamenb,$fileurlnb); + } + } + + if (! $mesg) + { + $stringtoshow=''; + $stringtoshow.=''; + $stringtoshow.='
    '; // hideobject is to start hidden + $stringtoshow.='
    '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='
    '; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.='
    '; + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($shownb) $stringtoshow.=$px1->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($showtot) $stringtoshow.=$px2->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', 'maxlength'=>500, - 'text' => ($db->error().' sql='.$sql)); + 'text' => $mesg); } } diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php new file mode 100644 index 00000000000..e985ca62912 --- /dev/null +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -0,0 +1,268 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_graph_invoices_supplier_permonth.php + * \ingroup fournisseur + * \brief Box to show graph of invoices per month + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last invoices + */ +class box_graph_invoices_supplier_permonth extends ModeleBoxes +{ + var $boxcode="invoicessupplierpermonth"; + var $boximg="object_bill"; + var $boxlabel="BoxSuppliersInvoicesPerMonth"; + var $depends = array("fournisseur"); + + var $db; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + $refreshaction='refresh_'.$this->boxcode; + + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + + $text = $langs->trans("BoxSuppliersInvoicesPerMonth",$max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $dir=''; // We don't need a path because image file will not be saved into disk + $prefix=''; + $socid=0; + if ($user->societe_id) $socid=$user->societe_id; + if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + + if ($user->rights->fournisseur->facture->lire) + { + $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; + $param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; + + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) + { + $endyear=GETPOST($param_year,'int'); + $shownb=GETPOST($param_shownb,'alpha'); + $showtot=GETPOST($param_showtot,'alpha'); + } + else + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $endyear=$tmparray['year']; + $shownb=$tmparray['shownb']; + $showtot=$tmparray['showtot']; + } + if (empty($shownb) && empty($showtot)) $showtot=1; + $nowarray=dol_getdate(dol_now(),true); + if (empty($endyear)) $endyear=$nowarray['year']; + $startyear=$endyear-1; + $mode='supplier'; + $userid=0; + $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; + $HEIGHT='192'; + + $stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0)); + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($shownb) + { + $data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png'; + + $px1 = new DolGraph(); + $mesg = $px1->isGraphKo(); + if (! $mesg) + { + $px1->SetData($data1); + unset($data1); + $px1->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px1->SetLegend($legend); + $px1->SetMaxValue($px1->GetCeilMaxValue()); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); + $px1->SetYLabel($langs->trans("NumberOfBills")); + $px1->SetShading(3); + $px1->SetHorizTickIncrement(1); + $px1->SetPrecisionY(0); + $px1->SetCssPrefix("cssboxes"); + $px1->mode='depth'; + $px1->SetTitle($langs->trans("NumberOfBillsByMonth")); + + $px1->draw($filenamenb,$fileurlnb); + } + } + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showtot) + { + $data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (! $mesg) + { + $px2->SetData($data2); + unset($data2); + $px2->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px2->SetLegend($legend); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("AmountOfBillsHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetPrecisionY(0); + $px2->SetCssPrefix("cssboxes"); + $px2->mode='depth'; + $px2->SetTitle($langs->trans("AmountOfBillsByMonthHT")); + + $px2->draw($filenamenb,$fileurlnb); + } + } + + if (! $mesg) + { + $stringtoshow=''; + $stringtoshow.=''; + $stringtoshow.='
    '; // hideobject is to start hidden + $stringtoshow.='
    '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='
    '; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.='
    '; + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($shownb) $stringtoshow.=$px1->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($showtot) $stringtoshow.=$px2->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', + 'maxlength'=>500, + 'text' => $mesg); + } + + } + else { + $this->info_box_contents[0][0] = array('td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php new file mode 100644 index 00000000000..ce4008761b7 --- /dev/null +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -0,0 +1,269 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_graph_orders_permonth.php + * \ingroup commandes + * \brief Box to show graph of orders per month + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last orders + */ +class box_graph_orders_permonth extends ModeleBoxes +{ + var $boxcode="orderspermonth"; + var $boximg="object_order"; + var $boxlabel="BoxCustomersOrdersPerMonth"; + var $depends = array("commande"); + + var $db; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + $refreshaction='refresh_'.$this->boxcode; + + //include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + //$commandestatic=new Commande($db); + + $text = $langs->trans("BoxCustomersOrdersPerMonth",$max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $dir=''; // We don't need a path because image file will not be saved into disk + $prefix=''; + $socid=0; + if ($user->societe_id) $socid=$user->societe_id; + if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + + if ($user->rights->commande->lire) + { + $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; + $param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; + + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) + { + $endyear=GETPOST($param_year,'int'); + $shownb=GETPOST($param_shownb,'alpha'); + $showtot=GETPOST($param_showtot,'alpha'); + } + else + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $endyear=$tmparray['year']; + $shownb=$tmparray['shownb']; + $showtot=$tmparray['showtot']; + } + if (empty($shownb) && empty($showtot)) $showtot=1; + $nowarray=dol_getdate(dol_now(),true); + if (empty($endyear)) $endyear=$nowarray['year']; + $startyear=$endyear-1; + $mode='customer'; + $userid=0; + $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; + $HEIGHT='192'; + + $stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0)); + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($shownb) + { + $data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$endyear.'.png'; + + $px1 = new DolGraph(); + $mesg = $px1->isGraphKo(); + if (! $mesg) + { + $px1->SetData($data1); + unset($data1); + $px1->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px1->SetLegend($legend); + $px1->SetMaxValue($px1->GetCeilMaxValue()); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); + $px1->SetYLabel($langs->trans("NumberOfOrders")); + $px1->SetShading(3); + $px1->SetHorizTickIncrement(1); + $px1->SetPrecisionY(0); + $px1->SetCssPrefix("cssboxes"); + $px1->mode='depth'; + $px1->SetTitle($langs->trans("NumberOfOrdersByMonth")); + + $px1->draw($filenamenb,$fileurlnb); + } + } + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showtot) + { + $data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$endyear.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (! $mesg) + { + $px2->SetData($data2); + unset($data2); + $px2->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px2->SetLegend($legend); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("AmountOfOrdersHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetPrecisionY(0); + $px2->SetCssPrefix("cssboxes"); + $px2->mode='depth'; + $px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT")); + + $px2->draw($filenamenb,$fileurlnb); + } + } + + if (! $mesg) + { + $stringtoshow=''; + $stringtoshow.=''; + $stringtoshow.='
    '; // hideobject is to start hidden + $stringtoshow.='
    '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='
    '; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.='
    '; + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($shownb) $stringtoshow.=$px1->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($showtot) $stringtoshow.=$px2->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', + 'maxlength'=>500, + 'text' => $mesg); + } + + } + else { + $this->info_box_contents[0][0] = array('td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php new file mode 100644 index 00000000000..7abdd742d23 --- /dev/null +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -0,0 +1,268 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_graph_orders_supplier_permonth.php + * \ingroup fournisseur + * \brief Box to show graph of orders per month + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last orders + */ +class box_graph_orders_supplier_permonth extends ModeleBoxes +{ + var $boxcode="orderssupplierpermonth"; + var $boximg="object_order"; + var $boxlabel="BoxSuppliersOrdersPerMonth"; + var $depends = array("fournisseur"); + + var $db; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + $refreshaction='refresh_'.$this->boxcode; + + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + + $text = $langs->trans("BoxSuppliersOrdersPerMonth",$max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $dir=''; // We don't need a path because image file will not be saved into disk + $prefix=''; + $socid=0; + if ($user->societe_id) $socid=$user->societe_id; + if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + + if ($user->rights->fournisseur->commande->lire) + { + $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; + $param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; + + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) + { + $endyear=GETPOST($param_year,'int'); + $shownb=GETPOST($param_shownb,'alpha'); + $showtot=GETPOST($param_showtot,'alpha'); + } + else + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $endyear=$tmparray['year']; + $shownb=$tmparray['shownb']; + $showtot=$tmparray['showtot']; + } + if (empty($shownb) && empty($showtot)) $showtot=1; + $nowarray=dol_getdate(dol_now(),true); + if (empty($endyear)) $endyear=$nowarray['year']; + $startyear=$endyear-1; + $mode='supplier'; + $userid=0; + $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; + $HEIGHT='192'; + + $stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0)); + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($shownb) + { + $data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$endyear.'.png'; + + $px1 = new DolGraph(); + $mesg = $px1->isGraphKo(); + if (! $mesg) + { + $px1->SetData($data1); + unset($data1); + $px1->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px1->SetLegend($legend); + $px1->SetMaxValue($px1->GetCeilMaxValue()); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); + $px1->SetYLabel($langs->trans("NumberOfOrders")); + $px1->SetShading(3); + $px1->SetHorizTickIncrement(1); + $px1->SetPrecisionY(0); + $px1->SetCssPrefix("cssboxes"); + $px1->mode='depth'; + $px1->SetTitle($langs->trans("NumberOfOrdersByMonth")); + + $px1->draw($filenamenb,$fileurlnb); + } + } + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showtot) + { + $data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + + $filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$endyear.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (! $mesg) + { + $px2->SetData($data2); + unset($data2); + $px2->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px2->SetLegend($legend); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("AmountOfOrdersHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetPrecisionY(0); + $px2->SetCssPrefix("cssboxes"); + $px2->mode='depth'; + $px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT")); + + $px2->draw($filenamenb,$fileurlnb); + } + } + + if (! $mesg) + { + $stringtoshow=''; + $stringtoshow.=''; + $stringtoshow.='
    '; // hideobject is to start hidden + $stringtoshow.='
    '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='
    '; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.='
    '; + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($shownb) $stringtoshow.=$px1->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($showtot) $stringtoshow.=$px2->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', + 'maxlength'=>500, + 'text' => $mesg); + } + + } + else { + $this->info_box_contents[0][0] = array('td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php new file mode 100644 index 00000000000..dd8f7512eb1 --- /dev/null +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -0,0 +1,390 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_graph_product_distribution.php + * \ingroup factures + * \brief Box to show graph of invoices per month + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; +include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + +/** + * Class to manage the box to show last invoices + */ +class box_graph_product_distribution extends ModeleBoxes +{ + var $boxcode="productdistribution"; + var $boximg="object_product"; + var $boxlabel="BoxProductDistribution"; + var $depends = array("product|service"); + + var $db; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + $refreshaction='refresh_'.$this->boxcode; + + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + + $text = $langs->trans("BoxProductDistribution",$max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_showinvoicenb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showinvoicenb'; + $param_showpropalnb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showpropalnb'; + $param_showordernb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showordernb'; + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) + { + $year=GETPOST($param_year,'int'); + $showinvoicenb=GETPOST($param_showinvoicenb,'alpha'); + $showpropalnb=GETPOST($param_showpropalnb,'alpha'); + $showordernb=GETPOST($param_showordernb,'alpha'); + } + else + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $year=$tmparray['year']; + $showinvoicenb=$tmparray['showinvoicenb']; + $showpropalnb=$tmparray['showpropalnb']; + $showordernb=$tmparray['showordernb']; + } + if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb=1; $showinvoicenb=1; $showordernb=1; } + if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) $showinvoicenb=0; + if (empty($conf->propal->enabled) || empty($user->rights->propal->lire)) $showpropalnb=0; + if (empty($conf->commande->enabled) || empty($user->rights->commande->lire)) $showordernb=0; + + $nowarray=dol_getdate(dol_now(),true); + if (empty($year)) $year=$nowarray['year']; + + $nbofgraph=0; + if ($showinvoicenb) $nbofgraph++; + if ($showpropalnb) $nbofgraph++; + if ($showordernb) $nbofgraph++; + + $paramtitle=$langs->transnoentitiesnoconv("Products").'/'.$langs->transnoentitiesnoconv("Services"); + if (empty($conf->produit->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Services"); + if (empty($conf->service->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Products"); + + $socid=empty($user->societe_id)?0:$user->societe_id; + $userid=0; // No filter on user creation + + $WIDTH=($nbofgraph >= 2 || ! empty($conf->dol_optimize_smallscreen))?'160':'320'; + $HEIGHT='192'; + + if (! empty($conf->facture->enabled) && ! empty($user->rights->facture->lire)) + { + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showinvoicenb) + { + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; + + $showpointvalue = 1; $nocolor = 0; + $mode='customer'; + $stats_invoice = new FactureStats($this->db, $socid, $mode, ($userid>0?$userid:0)); + $data1 = $stats_invoice->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24))); + if (empty($data1)) + { + $showpointvalue=0; + $nocolor=1; + $data1=array(array(0=>$langs->trans("None"),1=>1)); + } + $filenamenb = $dir."/prodserforinvoice-".$year.".png"; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=productstats&file=prodserforinvoice-'.$year.'.png'; + + $px1 = new DolGraph(); + $mesg = $px1->isGraphKo(); + if (! $mesg) + { + $i=0;$tot=count($data1);$legend=array(); + while ($i <= $tot) + { + $data1[$i][0]=dol_trunc($data1[$i][0],5); // Required to avoid error "Could not draw pie with labels contained inside canvas" + $legend[]=$data1[$i][0]; + $i++; + } + + $px1->SetData($data1); + unset($data1); + + if ($nocolor) $px1->SetDataColor(array(array(220,220,220))); + $px1->SetPrecisionY(0); + $px1->SetLegend($legend); + $px1->setShowLegend(0); + $px1->setShowPointValue($showpointvalue); + $px1->setShowPercent(0); + $px1->SetMaxValue($px1->GetCeilMaxValue()); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); + //$px1->SetYLabel($langs->trans("NumberOfBills")); + $px1->SetShading(3); + $px1->SetHorizTickIncrement(1); + $px1->SetPrecisionY(0); + $px1->SetCssPrefix("cssboxes"); + //$px1->mode='depth'; + $px1->SetType(array('pie')); + $px1->SetTitle($langs->trans("BoxProductDistributionFor",$paramtitle,$langs->transnoentitiesnoconv("Invoices"))); + + $px1->draw($filenamenb,$fileurlnb); + } + } + } + + if (! empty($conf->propal->enabled) && ! empty($user->rights->propal->lire)) + { + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showpropalnb) + { + include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; + + $showpointvalue = 1; $nocolor = 0; + $stats_proposal = new PropaleStats($this->db, $socid, ($userid>0?$userid:0)); + $data2 = $stats_proposal->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24))); + if (empty($data2)) + { + $showpointvalue = 0; + $nocolor = 1; + $data2=array(array(0=>$langs->trans("None"),1=>1)); + } + + $filenamenb = $dir."/prodserforpropal-".$year.".png"; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=proposalstats&file=prodserforpropal-'.$year.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (! $mesg) + { + $i=0;$tot=count($data2);$legend=array(); + while ($i <= $tot) + { + $data2[$i][0]=dol_trunc($data2[$i][0],5); // Required to avoid error "Could not draw pie with labels contained inside canvas" + $legend[]=$data2[$i][0]; + $i++; + } + + $px2->SetData($data2); + unset($data2); + + if ($nocolor) $px2->SetDataColor(array(array(220,220,220))); + $px2->SetPrecisionY(0); + $px2->SetLegend($legend); + $px2->setShowLegend(0); + $px2->setShowPointValue($showpointvalue); + $px2->setShowPercent(0); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + //$px2->SetYLabel($langs->trans("AmountOfBillsHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetPrecisionY(0); + $px2->SetCssPrefix("cssboxes"); + //$px2->mode='depth'; + $px2->SetType(array('pie')); + $px2->SetTitle($langs->trans("BoxProductDistributionFor",$paramtitle,$langs->transnoentitiesnoconv("Proposals"))); + + $px2->draw($filenamenb,$fileurlnb); + } + } + } + + if (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire)) + { + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showordernb) + { + include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; + + $showpointvalue = 1; $nocolor = 0; + $mode='customer'; + $stats_order = new CommandeStats($this->db, $socid, $mode, ($userid>0?$userid:0)); + $data3 = $stats_order->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24))); + if (empty($data3)) + { + $showpointvalue = 0; + $nocolor = 1; + $data3=array(array(0=>$langs->trans("None"),1=>1)); + } + + $filenamenb = $dir."/prodserfororder-".$year.".png"; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=prodserfororder-'.$year.'.png'; + + $px3 = new DolGraph(); + $mesg = $px3->isGraphKo(); + if (! $mesg) + { + $i=0;$tot=count($data3);$legend=array(); + while ($i <= $tot) + { + $data3[$i][0]=dol_trunc($data3[$i][0],5); // Required to avoid error "Could not draw pie with labels contained inside canvas" + $legend[]=$data3[$i][0]; + $i++; + } + + $px3->SetData($data3); + unset($data3); + + if ($nocolor) $px3->SetDataColor(array(array(220,220,220))); + $px3->SetPrecisionY(0); + $px3->SetLegend($legend); + $px3->setShowLegend(0); + $px3->setShowPointValue($showpointvalue); + $px3->setShowPercent(0); + $px3->SetMaxValue($px3->GetCeilMaxValue()); + $px3->SetWidth($WIDTH); + $px3->SetHeight($HEIGHT); + //$px3->SetYLabel($langs->trans("AmountOfBillsHT")); + $px3->SetShading(3); + $px3->SetHorizTickIncrement(1); + $px3->SetPrecisionY(0); + $px3->SetCssPrefix("cssboxes"); + //$px3->mode='depth'; + $px3->SetType(array('pie')); + $px3->SetTitle($langs->trans("BoxProductDistributionFor",$paramtitle,$langs->transnoentitiesnoconv("Orders"))); + $px3->draw($filenamenb,$fileurlnb); + } + } + } + + if (! $mesg) + { + $stringtoshow=''; + $stringtoshow.=''; + $stringtoshow.='
    '; // hideobject is to start hidden + $stringtoshow.='
    '; + $stringtoshow.=''; + $stringtoshow.=''; + if (! empty($conf->facture->enabled) || ! empty($user->rights->facture->lire)) + { + $stringtoshow.=' '.$langs->trans("ForCustomersInvoices"); + $stringtoshow.='   '; + } + if (! empty($conf->propal->enabled) || ! empty($user->rights->propal->lire)) + { + $stringtoshow.=' '.$langs->trans("ForProposals"); + $stringtoshow.=' '; + } + if (! empty($conf->commande->enabled) || ! empty($user->rights->commande->lire)) + { + $stringtoshow.=' '.$langs->trans("ForCustomersOrders"); + } + $stringtoshow.='
    '; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.='
    '; + + if ($nbofgraph == 1) + { + if ($showinvoicenb) $stringtoshow.=$px1->show(); + else if ($showpropalnb) $stringtoshow.=$px2->show(); + else $stringtoshow.=$px3->show(); + } + if ($nbofgraph == 2) + { + $stringtoshow.='
    '; + if ($showinvoicenb) $stringtoshow.=$px1->show(); + else if ($showpropalnb) $stringtoshow.=$px2->show(); + $stringtoshow.='
    '; + if ($showordernb) $stringtoshow.=$px3->show(); + else if ($showpropalnb) $stringtoshow.=$px2->show(); + $stringtoshow.='
    '; + } + if ($nbofgraph == 3) + { + $stringtoshow.='
    '; + $stringtoshow.=$px1->show(); + $stringtoshow.='
    '; + $stringtoshow.=$px2->show(); + $stringtoshow.='
    '; + $stringtoshow.='
    '; + $stringtoshow.=$px3->show(); + $stringtoshow.='
    '; + } + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', + 'maxlength'=>500, + 'text' => $mesg); + } + + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php new file mode 100644 index 00000000000..a934fb8e377 --- /dev/null +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -0,0 +1,274 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_graph_propales_permonth.php + * \ingroup propales + * \brief Box to show graph of proposals per month + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last propals + */ +class box_graph_propales_permonth extends ModeleBoxes +{ + var $boxcode="propalpermonth"; + var $boximg="object_propal"; + var $boxlabel="BoxProposalsPerMonth"; + var $depends = array("propal"); + + var $db; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + $refreshaction='refresh_'.$this->boxcode; + + //include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + //$propalstatic=new Propal($db); + + $text = $langs->trans("BoxProposalsPerMonth",$max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, // Set to 1 if it's a box graph + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $dir=''; // We don't need a path because image file will not be saved into disk + $prefix=''; + $socid=0; + if ($user->societe_id) $socid=$user->societe_id; + if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + + if ($user->rights->propal->lire) + { + $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; + $param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; + + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) + { + $endyear=GETPOST($param_year,'int'); + $shownb=GETPOST($param_shownb,'alpha'); + $showtot=GETPOST($param_showtot,'alpha'); + } + else + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $endyear=$tmparray['year']; + $shownb=$tmparray['shownb']; + $showtot=$tmparray['showtot']; + } + if (empty($shownb) && empty($showtot)) $showtot=1; + $nowarray=dol_getdate(dol_now(),true); + if (empty($endyear)) $endyear=$nowarray['year']; + $startyear=$endyear-1; + $mode='customer'; + $userid=0; + $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; + $HEIGHT='192'; + + $stats = new PropaleStats($this->db, 0, $mode, ($userid>0?$userid:0)); + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($shownb) + { + $data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + $datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars'); + + $filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsnbinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsnbinyear-'.$endyear.'.png'; + + $px1 = new DolGraph(); + $mesg = $px1->isGraphKo(); + if (! $mesg) + { + $px1->SetType($datatype1); + $px1->SetData($data1); + unset($data1); + $px1->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px1->SetLegend($legend); + $px1->SetMaxValue($px1->GetCeilMaxValue()); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); + $px1->SetYLabel($langs->trans("NumberOfProposals")); + $px1->SetShading(3); + $px1->SetHorizTickIncrement(1); + $px1->SetPrecisionY(0); + $px1->SetCssPrefix("cssboxes"); + $px1->mode='depth'; + $px1->SetTitle($langs->trans("NumberOfProposalsByMonth")); + + $px1->draw($filenamenb,$fileurlnb); + } + } + + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) + if ($showtot) + { + $data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24))); + $datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars'); + //$datatype2 = array('lines','bars'); + + $filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png"; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (! $mesg) + { + $px2->SetType($datatype2); + $px2->SetData($data2); + unset($data2); + $px2->SetPrecisionY(0); + $i=$startyear;$legend=array(); + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px2->SetLegend($legend); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("AmountOfProposalsHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetPrecisionY(0); + $px2->SetCssPrefix("cssboxes"); + $px2->mode='depth'; + $px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT")); + + $px2->draw($filenamenb,$fileurlnb); + } + } + + if (! $mesg) + { + $stringtoshow=''; + $stringtoshow.=''; + $stringtoshow.='
    '; // hideobject is to start hidden + $stringtoshow.='
    '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfProposalsByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfProposalsByMonthHT"); + $stringtoshow.='
    '; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.='
    '; + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($shownb) $stringtoshow.=$px1->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + if ($showtot) $stringtoshow.=$px2->show(); + if ($shownb && $showtot) + { + $stringtoshow.='
    '; + $stringtoshow.='
    '; + } + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', + 'maxlength'=>500, + 'text' => $mesg); + } + + } + else { + $this->info_box_contents[0][0] = array('td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index f14e70cc38d..2e0b41f9451 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -91,7 +91,6 @@ class box_members extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -132,6 +131,8 @@ class box_members extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_osc_client.php b/htdocs/core/boxes/box_osc_client.php index 3d1e2303f63..1d487b577ad 100644 --- a/htdocs/core/boxes/box_osc_client.php +++ b/htdocs/core/boxes/box_osc_client.php @@ -80,6 +80,8 @@ class box_osc_clients extends ModeleBoxes 'url' => DOL_URL_ROOT."/boutique/client/index.php"); $i++; } + + $db->free($resql); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index c9e668b271e..0db58e0d797 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -135,6 +135,8 @@ class box_produits extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProducts")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index a003451d8e9..826f11b97e9 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -143,6 +143,8 @@ class box_produits_alerte_stock extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoTooLowStockProducts")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 62d5c6d1f38..3c52900019a 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -75,7 +75,6 @@ class box_propales extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -120,6 +119,8 @@ class box_propales extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProposals")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 254370a4395..ec839323174 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -108,6 +108,8 @@ class box_prospect extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index ae70de77059..d26c8ed0b91 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -42,7 +42,7 @@ class box_services_contracts extends ModeleBoxes var $info_box_head = array(); var $info_box_contents = array(); - + /** * Load data into info_box_contents array to show array later. * @@ -139,6 +139,8 @@ class box_services_contracts extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoContractedProducts")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index c162211404c..eb9b12a31bd 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -119,6 +119,8 @@ class box_services_expired extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoExpiredServices")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 794dc9c1dd4..74beff90c7f 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -35,7 +35,7 @@ class box_supplier_orders extends ModeleBoxes var $boximg = "object_order"; var $boxlabel="BoxLatestSupplierOrders"; var $depends = array("fournisseur"); - + var $db; var $param; var $info_box_head = array(); @@ -85,7 +85,7 @@ class box_supplier_orders extends ModeleBoxes { $objp = $db->fetch_object($result); $datem=$db->jdate($objp->tms); - + $urlo = DOL_URL_ROOT."/fourn/commande/fiche.php?id=".$objp->rowid; $urls = DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid; @@ -117,6 +117,8 @@ class box_supplier_orders extends ModeleBoxes if ($num == 0) $this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoSupplierOrder")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index aa41cb27455..7d77c5f9828 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin * * 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 +110,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" /** - * Standard method to show a box (usage by boxes not mandatory, a box can still use its own function) + * Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) * * @param array $head Array with properties of box title * @param array $contents Array with properties of box lines @@ -135,13 +135,13 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" print "\n\n\n"; print '
    '."\n"; - if (! empty($head['text']) || ! empty($head['sublink']) || $nblines) + if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines) { print '
    '; + print ''; print ''; @@ -242,9 +250,12 @@ if ($id > 0) // Country print ''; // EMail @@ -254,11 +265,17 @@ if ($id > 0) print ''; // Phone - print ''; + print ''; // Fax print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } + // Assujeti a TVA ou pas print ''; print ''; // Conditions de reglement par defaut $langs->load('bills'); - $form = new Form($db); print '"; - print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; $company_static->client=1; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->tva; print "\n"; @@ -226,8 +228,8 @@ if (is_array($coll_list)) $x_coll_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } else @@ -284,17 +286,17 @@ if (is_array($coll_list)) $intra = ''; } } - print ""; - print ""; + print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; $company_static->fournisseur=1; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->tva; print "\n"; @@ -304,8 +306,8 @@ if (is_array($coll_list)) $x_paye_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '
    '.$langs->trans("ThirdPartyName").''; - $object->next_prev_filter="te.client in (1,3)"; + $object->next_prev_filter="te.client in (1,2,3)"; print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','',''); print '
    '.$langs->trans("Country").''; - $img=picto_from_langcode($object->country_code); - if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); - else print ($img?$img.' ':'').$object->country; + if (! empty($object->country_code)) + { + $img=picto_from_langcode($object->country_code); + if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); + else print ($img?$img.' ':'').$object->country; + } print '
    '.$langs->trans("Web").''.dol_print_url($object->url,'_blank').'
    '.$langs->trans('Phone').''.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'
    '.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
    '.$langs->trans('Skype').''.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'
    '.$langs->trans('VATIsUsed').''; @@ -293,13 +310,12 @@ if ($id > 0) } // TVA Intra - print '
    '.$langs->trans('VATIntra').''; + print '
    '.$langs->trans('VATIntra').''; print $object->tva_intra; print '
    '; print '"; print ''; // Mode de reglement par defaut - print '"; + print ""; } print "
    '; print $langs->trans('PaymentConditions'); @@ -309,18 +325,18 @@ if ($id > 0) print ''; if ($action == 'editconditions') { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement,'cond_reglement_id',-1,1); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'cond_reglement_id',-1,1); } else { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement,'none'); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'none'); } print "
    '; - print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -99,7 +99,7 @@ if ($result) $obj = $db->fetch_object($result); $var=!$var; - print "'; print ''; // Date print '\n"; print '\n"; - print '\n"; + print '\n"; print "\n"; $i++; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 3ae2b850aac..e4889645869 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -114,7 +114,7 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 92a4464a635..848998e0e76 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -157,7 +157,7 @@ if ($result) { $obj = $db->fetch_object($result); - print "'; diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index f349fe23230..95d28eeadd8 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -132,7 +132,7 @@ if ($prev_id) { $row = $db->fetch_row($resql); - print ""; + print ""; } $db->free($resql); } @@ -497,7 +531,7 @@ print "
    '; + print '
    '; + print ''; @@ -328,18 +344,18 @@ if ($id > 0) print '"; print ''; // Relative discounts (Discounts-Drawbacks-Rebates) - print '"; - print ''; + print ""; + print ''; $x_coll = 0; foreach($coll_listsell as $vatrate=>$val) @@ -157,7 +157,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_coll+=$val['localtax2']; } $subtotalcoll = $subtotalcoll + $x_coll; - print ""; + print ""; $x_paye = 0; foreach($coll_listbuy as $vatrate=>$val) @@ -165,13 +165,13 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_paye+=$val['localtax2']; } $subtotalpaye = $subtotalpaye + $x_paye; - print ""; + print ""; $diff = $x_coll - $x_paye; $total = $total + $diff; $subtotal = $subtotal + $diff; - print "\n"; + print "\n"; print "\n"; print "\n"; diff --git a/htdocs/compta/localtax/reglement.php b/htdocs/compta/localtax/reglement.php index 66c88892325..07d81d81df8 100644 --- a/htdocs/compta/localtax/reglement.php +++ b/htdocs/compta/localtax/reglement.php @@ -56,9 +56,9 @@ if ($result) print '
    '; print $langs->trans('PaymentMode'); print ''; if (($action != 'editmode') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetMode'),1).''; if ($action == 'editmode') { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement,'mode_reglement_id'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); } else { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement,'none'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'none'); } print "
    '; - print ''; + print ''; print ''; // Absolute discounts (Discounts-Drawbacks-Rebates) - print ''; print ''; print ''; @@ -373,8 +373,8 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); + } print '
    '; + print '
    '; + print '
    '; print $langs->trans("CustomerRelativeDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) @@ -347,13 +363,13 @@ if ($id > 0) print ''.img_edit($langs->trans("Modify")).''; } print '
    '; - print '
    '.($object->remise_client?''.$object->remise_client.'%':$langs->trans("DiscountNone")).''.($object->remise_percent?''.$object->remise_percent.'%':$langs->trans("DiscountNone")).'
    '; + print '
    '; print ''; - print ''; print ''; + if ($object->client) + { + print ''; + print ''; + print ''; + } + + // Multiprice level if (! empty($conf->global->PRODUIT_MULTIPRICES)) { - print ''; + print ''; + print ''; + print ''; +} +print "
    '; + print '
    '; print $langs->trans("CustomerAbsoluteDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) @@ -365,16 +381,28 @@ if ($id > 0) print ''; $amount_discount=$object->getAvailableDiscounts(); if ($amount_discount < 0) dol_print_error($db,$object->error); - if ($amount_discount > 0) print ''.price($amount_discount).' '.$langs->trans("Currency".$conf->currency); + if ($amount_discount > 0) print ''.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).''; else print $langs->trans("DiscountNone"); print '
    '; + print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer); + print ''; + print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer,'amount',($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); + print '
    '; - print ''; - // Ref client + // Ref customer print ''; @@ -1843,24 +1911,28 @@ else print ''; } - // Other attributes + if ($soc->outstanding_limit) + { + // Outstanding Bill + print ''; + print ''; + } + + // Other attributes (TODO Move this into an include) $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { - if ($action == 'edit_extras') - { - print ''; - print ''; - print ''; - print ''; - } - foreach($extrafields->attribute_label as $key=>$label) { if ($action == 'edit_extras') { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); } else { $value=$object->array_options["options_".$key]; } @@ -1879,41 +1951,34 @@ else $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } - if ($action == 'edit_extras' && $user->rights->propal->creer) + if ($action == 'edit_extras' && $user->rights->propal->creer && GETPOST('attribute') == $key) { + print ''; + print ''; + print ''; + print ''; + print ''; + print $extrafields->showInputField($key,$value); + + print ''; + + print ''; } else { print $extrafields->showOutputField($key,$value); + if ($object->statut == 0 && $user->rights->propal->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; } print ''."\n"; } } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->propal->creer) - { - print ''; - } - } - } } // Amount HT print ''; - print ''; - print ''; + print ''; + print ''; // Margin Infos if (! empty($conf->margin->enabled)) { @@ -1925,28 +1990,28 @@ else // Amount VAT print ''; - print ''; - print ''; + print ''; + print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj=="1") //Localtax1 { print ''; - print ''; - print ''; + print ''; + print ''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 { print ''; - print ''; - print ''; + print ''; + print ''; } // Amount TTC print ''; - print ''; - print ''; + print ''; + print ''; // Statut print ''; @@ -1970,17 +2035,27 @@ else /* * Lines - */ + */ + + // Show object lines + $result = $object->getLinesArray(); + + + print ' + + + + + '; + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } - print '
    '; + print '
    '; + print '
    '; print $langs->trans("PriceLevel"); print ''; if ($user->rights->societe->creer) @@ -389,8 +417,8 @@ if ($id > 0) // Level of prospect if ($object->client == 2 || $object->client == 3) { - print '
    '; - print '"; + print ""; print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php index b05f859f54e..81af4f4f6e6 100644 --- a/htdocs/comm/mailing/liste.php +++ b/htdocs/comm/mailing/liste.php @@ -121,7 +121,7 @@ if ($result) print ''; if (! $filteremail) print ''; print ''; - print '"; print "\n"; print ''; @@ -136,7 +136,7 @@ if ($result) $var=!$var; - print ""; + print ""; print ''; print ''; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 60e29a74543..cece1b3b29e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -7,8 +7,8 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2012-2013 Christophe Battarel + * Copyright (C) 2013-2014 Florian Henry * * 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 @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } $langs->load('companies'); @@ -100,7 +100,7 @@ $hookmanager->initHooks(array('propalcard')); /* * Actions -*/ + */ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -131,7 +131,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') } } -// Suppression de la propale +// Delete proposal else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) { $result=$object->delete($user); @@ -195,7 +195,8 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr else { $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); + if (count($object->errors) > 0) setEventMessage($object->errors, 'errors'); + else setEventMessage($langs->trans($object->error), 'errors'); } } @@ -414,7 +415,7 @@ else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GET // prevent browser refresh from reopening proposal several times if ($object->statut==2 || $object->statut==3) { - $object->setStatut(1); + $object->reopen($user,1); } } @@ -436,9 +437,7 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST( } } -/* - * Add file in email form -*/ +// Add file in email form if (GETPOST('addfile')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -451,9 +450,7 @@ if (GETPOST('addfile')) $action='presend'; } -/* - * Remove file in email form -*/ +// Remove file in email form if (GETPOST('removedfile')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -469,7 +466,7 @@ if (GETPOST('removedfile')) /* * Send mail -*/ + */ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { $langs->load('mails'); @@ -553,7 +550,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $interface=new Interfaces($db); $result=$interface->run_triggers('PROPAL_SENTBYMAIL',$object,$user,$langs,$conf); if ($result < 0) { - $error++; $this->errors=$interface->errors; + $error++; $object->errors=$interface->errors; } // Fin appel triggers @@ -637,14 +634,52 @@ else if ($action == "setabsolutediscount" && $user->rights->propal->creer) } } -//Ajout d'une ligne produit dans la propale -else if ($action == "addline" && $user->rights->propal->creer) +// Add line +else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->propal->creer) { - $idprod=GETPOST('idprod', 'int'); - $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); - $price_ht = GETPOST('price_ht'); - $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); - $predef=((! empty($idprod) && $conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); + // Set if we used free entry or predefined product + if (GETPOST('addline_libre') + || (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) + { + $predef=''; + $idprod=0; + $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + if (GETPOST('addline_predefined') + || (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) + { + $predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):'')); + $price_ht = ''; + $tva_tx = ''; + } + if (GETPOST('usenewaddlineform')) { + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + $qty = GETPOST('qty'.$predef); + $remise_percent=GETPOST('remise_percent'.$predef); + + //Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline,$predef); + //Unset extrafield + if (is_array($extralabelsline)) + { + // Get extra fields + foreach ($extralabelsline as $key => $value) + { + unset($_POST["options_".$key]); + } + } if (empty($idprod) && GETPOST('type') < 0) { @@ -663,13 +698,15 @@ else if ($action == "addline" && $user->rights->propal->creer) $error++; } - if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) + if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { $pu_ht=0; $pu_ttc=0; $price_min=0; $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); + $db->begin(); + // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit @@ -701,6 +738,8 @@ else if ($action == "addline" && $user->rights->propal->creer) $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; $price_min = $prod->multiprices_min[$object->client->price_level]; $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; + $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; + $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } else { @@ -710,9 +749,16 @@ else if ($action == "addline" && $user->rights->propal->creer) $price_base_type = $prod->price_base_type; } + // if price ht is forced (ie: calculated by margin rate and cost price) + if (!empty($price_ht)) + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); + } + // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tva_tx != $prod->tva_tx) + elseif ($tva_tx != $prod->tva_tx) { if ($price_base_type != 'HT') { @@ -774,8 +820,8 @@ else if ($action == "addline" && $user->rights->propal->creer) } // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + $fournprice=(GETPOST('fournprice'.$predef)?GETPOST('fournprice'.$predef):''); + $buyingprice=(GETPOST('buying_price'.$predef)?GETPOST('buying_price'.$predef):''); $date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); @@ -786,25 +832,24 @@ else if ($action == "addline" && $user->rights->propal->creer) $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - - if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + + if (! empty($price_min) && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) { - $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); + $mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); setEventMessage($mesg, 'errors'); } else { // Insert line $result=$object->addline( - $id, $desc, $pu_ht, - GETPOST('qty'), + $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, - GETPOST('remise_percent'), + $remise_percent, $price_base_type, $pu_ttc, $info_bits, @@ -816,11 +861,14 @@ else if ($action == "addline" && $user->rights->propal->creer) $buyingprice, $label, $date_start, - $date_end + $date_end, + $array_option ); if ($result > 0) { + $db->commit(); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -837,7 +885,6 @@ else if ($action == "addline" && $user->rights->propal->creer) unset($_POST['qty']); unset($_POST['type']); - unset($_POST['idprod']); unset($_POST['remise_percent']); unset($_POST['price_ht']); unset($_POST['price_ttc']); @@ -847,13 +894,23 @@ else if ($action == "addline" && $user->rights->propal->creer) unset($_POST['product_desc']); unset($_POST['fournprice']); unset($_POST['buying_price']); - - // old method - unset($_POST['np_desc']); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); unset($_POST['dp_desc']); + + unset($_POST['idprod']); + unset($_POST['qty_predef']); + unset($_POST['remise_percent_predef']); + unset($_POST['fournprice_predef']); + unset($_POST['buying_price_predef']); + unset($_POST['np_marginRate_predef']); + unset($_POST['np_markRate_predef']); + unset($_POST['np_desc']); } else { + $db->rollback(); + setEventMessage($object->error, 'errors'); } } @@ -884,8 +941,22 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $date_start=dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + //Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline); + //Unset extrafield + if (is_array($extralabelsline)) + { + // Get extra fields + foreach ($extralabelsline as $key => $value) + { + unset($_POST["options_".$key]); + } + } + // Define special_code for special lines - $special_code=0; + $special_code=GETPOST('special_code'); if (! GETPOST('qty')) $special_code=3; // Check minimum price @@ -905,7 +976,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) { - setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); + setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors'); $error++; } } @@ -920,9 +991,11 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $error++; } } - + if (! $error) { + $db->begin(); + $result = $object->updateline( GETPOST('lineid'), $pu_ht, @@ -942,11 +1015,14 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $label, $type, $date_start, - $date_end + $date_end, + $array_option ); if ($result >= 0) { + $db->commit(); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -976,6 +1052,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa } else { + $db->rollback(); + setEventMessage($object->error, 'errors'); } } @@ -1125,14 +1203,11 @@ else if ($action == 'update_extras') { // Fill array 'array_options' with data from update form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + if($ret < 0) $error++; - if($ret < 0) { - $error++; - $action = 'edit_extras'; - } - - if(!$error) { + if (! $error) + { // Actions on extra fields (by external module or standard code) // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('propaldao')); @@ -1140,17 +1215,16 @@ else if ($action == 'update_extras') $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result=$object->insertExtraFields(); + if ($result < 0) { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } else if ($reshook < 0) $error++; } + + if ($error) $action = 'edit_extras'; } if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) @@ -1216,7 +1290,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal-> /* * View -*/ + */ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); @@ -1285,7 +1359,7 @@ if ($action == 'create') // Ligne info remises tiers print ''; // Validaty duration @@ -1305,12 +1379,12 @@ if ($action == 'create') // Terms of payment print ''; // Mode of payment print ''; // What trigger creation @@ -1336,8 +1410,7 @@ if ($action == 'create') } else { - $datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; - $form->select_date($datepropal,'liv_','','','',"addprop"); + $form->select_date(-1,'liv_','','','',"addprop",1,1); } print ''; @@ -1352,13 +1425,16 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled) && $socid>0) { + + $formproject=new FormProjets($db); + $projectid = 0; if ($origin == 'project') $projectid = ($originid?$originid:0); print ''; print ''; } - print '
    '; + print '
    '; + print ''; @@ -433,7 +461,7 @@ if ($id > 0) } else { - print $langs->trans("UserNotLinkedToMember"); + print $langs->trans("ThirdpartyNotLinkedToMember"); } print ''; print "\n"; @@ -443,8 +471,6 @@ if ($id > 0) print '
    '; - //print "\n"; - //print '
    "; + print ""; print '"; + print ""; print '"; - //print "
    '; print $langs->trans('ProspectLevel'); print ''; if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
    '; // Nbre max d'elements des petites listes @@ -626,7 +652,7 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; - print "
    '; $contrat->id=$objp->id; $contrat->ref=$objp->ref?$objp->ref:$objp->id; @@ -748,7 +774,7 @@ if ($id > 0) { $objp = $db->fetch_object($resql); $var=!$var; - print "
    '; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; @@ -781,8 +807,6 @@ if ($id > 0) print ''; print '
    '; - //print "
    "; dol_fiche_end(); @@ -899,4 +923,4 @@ dol_htmloutput_mesg('',$mesgs); // End of page llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index dba3b44a14b..989f8fbb245 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -98,9 +98,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print "
    '.$langs->trans("SearchAProposal").'
    '.$langs->trans("Ref").':'.$langs->trans("Ref").':
    '.$langs->trans("Other").':
    '.$langs->trans("Other").':
    \n"; print "
    \n"; @@ -117,9 +117,9 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print "
    '.$langs->trans("SearchAContract").'
    '.$langs->trans("Ref").':'.$langs->trans("Ref").':
    '.$langs->trans("Other").':
    '.$langs->trans("Other").':
    \n"; print "
    "; @@ -475,7 +475,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; print ''; - $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD)); + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); while ($i < $nbofloop) { $obj = $db->fetch_object($result); diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 5864b4b4cee..1d2f792ab2f 100644 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -2,6 +2,8 @@ /* Copyright (C) 2001-2006 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013 Florian Henry * * 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 @@ -51,6 +53,8 @@ $search_zipcode=GETPOST("search_zipcode"); $search_town=GETPOST("search_town"); $search_code=GETPOST("search_code"); $search_compta=GETPOST("search_compta"); +$search_status = GETPOST("search_status",'int'); +if ($search_status=='') $search_status=1; // always display activ customer first // Load sale and categ filters $search_sale = GETPOST("search_sale"); @@ -84,6 +88,7 @@ if (GETPOST("button_removefilter_x")) $search_idprof2=''; $search_idprof3=''; $search_idprof4=''; + $seach_status=1; } @@ -93,6 +98,7 @@ if (GETPOST("button_removefilter_x")) */ $formother=new FormOther($db); +$form = new Form($db); $thirdpartystatic=new Societe($db); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; @@ -115,11 +121,17 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; +if ($search_nom) { + $sql .= natural_search('s.nom', $search_nom); +} if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'"; -if ($search_town) $sql.= " AND s.town LIKE '%".$db->escape($search_town)."%'"; +if ($search_town) { + $sql .= natural_search('s.town', $search_town); +} if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'"; if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'"; + +if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); // Insert sale filter if ($search_sale) { @@ -146,6 +158,7 @@ if ($result) $param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town; if ($search_categ != '') $param.='&search_categ='.$search_categ; if ($search_sale != '') $param.='&search_sale='.$search_sale; + if ($search_status != '') $param.='&search_status='.$search_status; print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); @@ -183,8 +196,8 @@ if ($result) print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); - + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); + print ''; $parameters=array(); $formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -212,11 +225,17 @@ if ($result) print ''; print ''; - print ''; + print ''; - print ''; + + print ''; $parameters=array(); @@ -232,11 +251,12 @@ if ($result) $var=!$var; - print ""; + print ""; print ''; print ''; print ''; - print ''; - + print ''; + $parameters=array('obj' => $obj); $formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 3c7d425feb1..916a6163668 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -434,9 +434,9 @@ if ($object->fetch($id) >= 0) print ''; // Source print ''; print ''; @@ -450,7 +450,7 @@ if ($object->fetch($id) >= 0) $obj = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''; print ''; print ''; @@ -507,7 +507,7 @@ if ($object->fetch($id) >= 0) if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error(); if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($obj->statut==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); - if ($obj->statut==3) print $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); + if ($obj->statut==3) print $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut5'); print ''; } print ''; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index c3f87e6e4e8..8d7f3ea988a 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -67,13 +67,10 @@ $object->substitutionarray=array( '__OTHER4__' => 'Other4', '__OTHER5__' => 'Other5', '__SIGNATURE__' => 'TagSignature', - '__CHECK_READ__' => 'TagCheckMail' + '__CHECK_READ__' => 'TagCheckMail', + '__UNSUBSCRIBE__' => 'TagUnsubscribe' //,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet ); -if (! empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE)) -{ - $object->substitutionarray=array_merge($object->substitutionarray, array('__UNSUBSCRIBE__' => 'TagUnsubscribe')); -} $object->substitutionarrayfortest=array( '__ID__' => 'TESTIdRecord', @@ -86,19 +83,12 @@ $object->substitutionarrayfortest=array( '__OTHER3__' => 'TESTOther3', '__OTHER4__' => 'TESTOther4', '__OTHER5__' => 'TESTOther5', - '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:'') - //,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet + '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''), + '__CHECK_READ__' => 'TagCheckMail', + '__UNSUBSCRIBE__' => 'TagUnsubscribe' +//,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet ); -if (!empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE)) -{ - $object->substitutionarrayfortest=array_merge( - $object->substitutionarrayfortest, - array( - '__CHECK_READ__' => 'TESTCheckMail', - '__UNSUBSCRIBE__' => 'TESTUnsubscribe' - ) - ); -} + /* * Actions @@ -700,20 +690,17 @@ else // Confirmation de la validation du mailing if ($action == 'valid') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valid",'','',1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valid",'','',1); } // Confirm reset else if ($action == 'reset') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$object->ref),"confirm_reset",'','',2); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$object->ref),"confirm_reset",'','',2); } // Confirm delete else if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1); } @@ -749,8 +736,7 @@ else } $text.=$langs->trans('ConfirmSendingEmailing').'
    '; $text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB); - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,260); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,260); } } @@ -1094,7 +1080,7 @@ else { $out.= '
    '; $out.= img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name']; - $out.= ' '; + $out.= ' '; $out.= '
    '; } } diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 088ee43a02a..ac7cbdccb5d 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -55,10 +55,10 @@ print ''; print ''; print '
    '.$langs->trans("ProposalsOpened").' ('.$num.')
      '; + print ' '; + print ''; + print ''; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print ''; print '  '; - print ''; + print ''; print '
    '; $thirdpartystatic->id=$obj->rowid; $thirdpartystatic->name=$obj->name; $thirdpartystatic->client=$obj->client; + $thirdpartystatic->code_client=$obj->code_client; $thirdpartystatic->canvas=$obj->canvas; $thirdpartystatic->status=$obj->status; print $thirdpartystatic->getNomUrl(1); @@ -246,9 +266,10 @@ if ($result) print ''.$obj->code_client.''.$obj->code_compta.''.dol_print_date($db->jdate($obj->datec),'day').''.$thirdpartystatic->getLibStatut(3); + print ''.$thirdpartystatic->getLibStatut(3); print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print '
    '.$obj->email.''.$obj->lastname.''.$obj->firstname.'
    '; print ''; -print ''; print ''; -print ''; print "
    '.$langs->trans("SearchAMailing").'
    '; +print '
    '; print $langs->trans("Ref").':
    '; +print '
    '; print $langs->trans("Other").':

    \n"; @@ -175,7 +175,7 @@ if ($result) $obj = $db->fetch_object($result); $var=!$var; - print "
    '.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''.dol_trunc($obj->titre,38).''.dol_print_date($db->jdate($obj->date_creat),'day').'   '; + print ''; print "
    '; print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).''.$obj->titre.'
    '.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$soc->getAvailableDiscounts(); print '. '; @@ -1297,7 +1371,7 @@ if ($action == 'create') // Date print '
    '.$langs->trans('Date').''; - $form->select_date('','','','','',"addprop"); + $form->select_date('','','','','',"addprop",1,1); print '
    '.$langs->trans('PaymentConditionsShort').''; - $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); + $form->select_conditions_paiements($soc->cond_reglement_id,'cond_reglement_id'); print '
    '.$langs->trans('PaymentMode').''; - $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); + $form->select_types_paiements($soc->mode_reglement_id,'mode_reglement_id'); print '
    '.$langs->trans("Project").''; - $numprojet=select_projects($soc->id,$projectid); + $numprojet=$formproject->select_projects($soc->id,$projectid); if ($numprojet==0) { $langs->load("projects"); @@ -1381,14 +1457,14 @@ if ($action == 'create') /* * Combobox pour la fonction de copie - */ + */ if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) { print ''; } - print ''; + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '
    '; if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) { // For backward compatibility @@ -1456,17 +1532,14 @@ if ($action == 'create') $form->select_produits('',"idprod".$i,'',$conf->product->limit_size); print ''; print ''; - print ''; + print ''; print ''; } - print "
    %%
    "; - } print '
    '; - print '
    '; + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '

    '; $langs->load("bills"); print '
    '; @@ -1480,7 +1553,7 @@ else { /* * Show object in view mode - */ + */ $soc = new Societe($db); $soc->fetch($object->socid); @@ -1574,12 +1647,12 @@ else print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
    '; print ''; + print $langs->trans('RefCustomer').''; if ($action != 'refclient' && ! empty($object->brouillon)) print ''; + print ''; print '
    '; - print $langs->trans('RefCustomer').''; - print ''.img_edit($langs->trans('Modify')).'
    '; print '
    '; if ($user->rights->propal->creer && $action == 'refclient') @@ -1604,30 +1677,25 @@ else // Ligne info remises tiers print '
    '.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; - $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); - $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); - $absolute_discount=price2num($absolute_discount,'MT'); - $absolute_creditnote=price2num($absolute_creditnote,'MT'); - if ($absolute_discount) - { - if ($object->statut > 0) - { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - } - else - { + $absolute_discount = $soc->getAvailableDiscounts('', 'fk_facture_source IS NULL'); + $absolute_creditnote = $soc->getAvailableDiscounts('', 'fk_facture_source IS NOT NULL'); + $absolute_discount = price2num($absolute_discount, 'MT'); + $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + if ($absolute_discount) { + if ($object->statut > 0) { + print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount, 0, $langs, 0, 0, -1, $conf->currency)); + } else { // Remise dispo de type non avoir $filter='fk_facture_source IS NULL'; print '
    '; $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); } } - if ($absolute_creditnote) - { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; + if ($absolute_creditnote) { + print $langs->trans("CompanyHasCreditNote", price($absolute_creditnote, 0, $langs, 0, 0, -1, $conf->currency)) . '. '; } if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; print '
    '; + print $langs->trans('OutstandingBill'); + print ''; + print price($soc->get_OutstandingBill()).' / '; + print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency); + print '
    '; - print ''; - print ''; - print '
    '.img_picto('','edit').' '.$langs->trans('Modify').'
    '.$langs->trans('AmountHT').''.price($object->total_ht).''.$langs->trans("Currency".$conf->currency).''.price($object->total_ht,'',$langs,0,-1,-1,$conf->currency).'
    '.$langs->trans('AmountVAT').''.price($object->total_tva).''.$langs->trans("Currency".$conf->currency).'
    '.price($object->total_tva,'',$langs,0,-1,-1,$conf->currency).'
    '.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1).''.$langs->trans("Currency".$conf->currency).'
    '.price($object->total_localtax1,'',$langs,0,-1,-1,$conf->currency).'
    '.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2).''.$langs->trans("Currency".$conf->currency).'
    '.price($object->total_localtax2,'',$langs,0,-1,-1,$conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc).''.$langs->trans("Currency".$conf->currency).'
    '.price($object->total_ttc,'',$langs,0,-1,-1,$conf->currency).'
    '.$langs->trans('Status').''.$object->getLibStatut(4).'
    '; + print '
    '; - // Show object lines - $result = $object->getLinesArray(); if (! empty($object->lines)) $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1); @@ -2016,14 +2091,15 @@ else print '
    '; - print ''; - print "\n"; + print "\n"; + + dol_fiche_end(); if ($action == 'statut') { /* * Formulaire cloture (signe ou non) - */ + */ $form_close = '
    '; $form_close.= ''; $form_close.= ''; @@ -2051,7 +2127,7 @@ else /* * Boutons Actions - */ + */ if ($action != 'presend') { print '
    '; @@ -2064,7 +2140,11 @@ else if (count($object->lines) > 0) print ''; //else print ''.$langs->trans('Validate').''; } - + // Create event + if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + { + print ''.$langs->trans("AddAction").''; + } // Edit if ($object->statut == 1 && $user->rights->propal->creer) { @@ -2158,7 +2238,7 @@ else /* * Documents generes - */ + */ $filename=dol_sanitizeFileName($object->ref); $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; @@ -2243,7 +2323,14 @@ else $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -2252,6 +2339,7 @@ else // Tableau des substitutions $formmail->substit['__PROPREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; @@ -2279,8 +2367,6 @@ else $formmail->param['models']='propal_send'; $formmail->param['id']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files if (GETPOST("mode")=='init') { diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index 8972baaac88..0e14848d1e8 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -80,7 +80,7 @@ if ($id > 0 || ! empty($ref)) // Ref client print '
    \n"; $var=!$var; $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."paiement"; $paiem = valeur($sql); -print ""; +print ""; $var=!$var; $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank WHERE amount > 0"; $credits = valeur($sql); -print ""; +print ""; $var=!$var; $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank WHERE amount < 0"; $debits = valeur($sql); -print ""; +print ""; $var=!$var; $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank "; $solde = valeur($sql); -print ""; +print ""; print "
    '; - print '"; + print ""; print '"; print ''; @@ -246,7 +246,7 @@ if ($resql) $var=!$var; $obj = $db->fetch_object($resql); - print ""; + print ""; print '"; + print ""; print '"; + print ""; print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); @@ -283,16 +298,19 @@ if ($resql) print ''; print ''; print ''; + print ''; + print ''; + print ''; $var=true; @@ -315,9 +333,15 @@ if ($resql) print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); print ''; - print ''; print ''; + // Ref customer + print ''; + // Company $companystatic->id=$objp->socid; $companystatic->nom=$objp->nom; @@ -345,14 +372,12 @@ if ($resql) if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0)) { print ' '; - print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmrtphone').''; + print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmartphone').''; } } } print ''; - print ''; - // Order date $y = dol_print_date($db->jdate($objp->date_commande),'%Y'); $m = dol_print_date($db->jdate($objp->date_commande),'%m'); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index c9ca34854b7..58023beec33 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -97,7 +97,7 @@ if ($id > 0 || ! empty($ref)) // Ref commande client print '\n"; print ''; print ''; - if ($account->useDetailedBBAN() == 1) + // Show fields of bank account + $fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey'; + if (! empty($conf->global->BANK_SHOW_ORDER_OPTION)) { - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; + if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION)) + { + if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber'; + } + else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION; } - if ($account->useDetailedBBAN() == 2) - { - print ''; - print ''; - print ''; - } + $fieldlistsarray=explode(' ',$fieldlists); - print ''; - print ''; - print ''; - - if ($account->useDetailedBBAN() == 1) + foreach($fieldlistsarray as $val) { - print ''; - print ''; - print ''; + if ($val == 'BankCode') + { + if ($account->useDetailedBBAN() == 1) + { + print ''; + print ''; + print ''; + } + } + if ($val == 'DeskCode') + { + if ($account->useDetailedBBAN() == 1) + { + print ''; + print ''; + print ''; + } + } + + if ($val == 'BankCode') + { + if ($account->useDetailedBBAN() == 2) + { + print ''; + print ''; + print ''; + } + } + + if ($val == 'AccountNumber') + { + print ''; + print ''; + print ''; + } + + if ($val == 'BankAccountNumberKey') + { + if ($account->useDetailedBBAN() == 1) + { + print ''; + print ''; + print ''; + } + } } $ibankey="IBANNumber"; @@ -310,38 +343,77 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer) if ($account->type == 0 || $account->type == 1) { + print '\n"; + // If bank account print ''; print ''; print ''; - // BBAN - if ($account->useDetailedBBAN() == 1) + // Show fields of bank account + $fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey'; + if (! empty($conf->global->BANK_SHOW_ORDER_OPTION)) { - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; + if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION)) + { + if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber'; + } + else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION; } - if ($account->useDetailedBBAN() == 2) - { - print ''; - print ''; - print ''; - } + $fieldlistsarray=explode(' ',$fieldlists); - print ''; - print ''; - print ''; - - if ($account->useDetailedBBAN() == 1) + foreach($fieldlistsarray as $val) { - print ''; - print ''; - print ''; + if ($val == 'BankCode') + { + if ($account->useDetailedBBAN() == 1) + { + print ''; + print ''; + print ''; + } + } + + if ($val == 'DeskCode') + { + if ($account->useDetailedBBAN() == 1) + { + print ''; + print ''; + print ''; + } + } + + if ($val == 'BankCode') + { + if ($account->useDetailedBBAN() == 2) + { + print ''; + print ''; + print ''; + } + } + + if ($val == 'AccountNumber') + { + print ''; + print ''; + print ''; + } + + if ($val == 'BankAccountNumberKey') + { + if ($account->useDetailedBBAN() == 1) + { + print ''; + print ''; + print ''; + } + } } $ibankey="IBANNumber"; @@ -361,10 +433,6 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer) print $account->domiciliation; print ""; - print '\n"; - print ''; print ''; @@ -376,11 +444,15 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer) } - print ''; print '
    '; + print ''; print '
    '; print $langs->trans('RefCustomer').''; print '
    '; @@ -97,7 +97,7 @@ if ($id > 0 || ! empty($ref)) // Ligne info remises tiers print '
    '.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$soc->getAvailableDiscounts(); print '. '; @@ -140,7 +140,7 @@ if ($id > 0 || ! empty($ref)) print_titre($langs->trans("Documents")); print ''; - print ""; + print ""; print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 51999290e96..244333a9a93 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -27,7 +27,7 @@ /** * \file htdocs/comm/propal/class/propal.class.php - * \brief Fichier de la classe des propales + * \brief File of class to manage proposals */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; @@ -36,8 +36,7 @@ require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT .'/margin/lib/margins.lib.php'; /** - * \class Propal - * \brief Classe permettant la gestion des propales + * Class to manage proposals */ class Propal extends CommonObject { @@ -288,7 +287,6 @@ class Propal extends CommonObject * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,'',produit) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * - * @param int $propalid Id de la propale * @param string $desc Description de la ligne * @param double $pu_ht Prix unitaire * @param double $qty Quantite @@ -298,7 +296,7 @@ class Propal extends CommonObject * @param int $fk_product Id du produit/service predefini * @param double $remise_percent Pourcentage de remise de la ligne * @param string $price_base_type HT or TTC - * @param dobule $pu_ttc Prix unitaire TTC + * @param double $pu_ttc Prix unitaire TTC * @param int $info_bits Bits de type de lignes * @param int $type Type of line (product, service) * @param int $rang Position of line @@ -307,15 +305,17 @@ class Propal extends CommonObject * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price without tax * @param string $label ??? - * @param timestamp $date_start Start date of the line - * @param timestamp $date_end End date of the line + * @param int $date_start Start date of the line + * @param int $date_end End date of the line + * @param array $array_option extrafields array * @return int >0 if OK, <0 if KO * * @see add_product */ - function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='') + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0) { - global $conf; + global $mysoc; + $propalid=$this->id; dol_syslog(get_class($this)."::addline propalid=$propalid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type"); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -355,7 +355,10 @@ class Propal extends CommonObject // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, '', $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -390,6 +393,8 @@ class Propal extends CommonObject $this->line->tva_tx=$txtva; $this->line->localtax1_tx=$txlocaltax1; $this->line->localtax2_tx=$txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; $this->line->fk_product=$fk_product; $this->line->remise_percent=$remise_percent; $this->line->subprice=$pu_ht; @@ -413,13 +418,16 @@ class Propal extends CommonObject $this->line->pa_ht = $pa_ht; // Mise en option de la ligne - //if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) $ligne->special_code=3; if (empty($qty) && empty($special_code)) $this->line->special_code=3; // TODO deprecated $this->line->price=$price; $this->line->remise=$remise; + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + $result=$this->line->insert(); if ($result > 0) { @@ -471,13 +479,14 @@ class Propal extends CommonObject * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label ??? * @param int $type 0/1=Product/service - * @param timestamp $date_start Start date of the line - * @param timestamp $date_end End date of the line + * @param int $date_start Start date of the line + * @param int $date_end End date of the line + * @param array $array_option extrafields array * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='') + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0) { - global $conf,$user,$langs; + global $conf,$user,$langs, $mysoc; dol_syslog(get_class($this)."::updateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits"); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -501,7 +510,10 @@ class Propal extends CommonObject // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'', $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -538,6 +550,8 @@ class Propal extends CommonObject $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; $this->line->remise_percent = $remise_percent; $this->line->subprice = $pu; $this->line->info_bits = $info_bits; @@ -561,6 +575,10 @@ class Propal extends CommonObject $this->line->price=$price; $this->line->remise=$remise; + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + $result=$this->line->update(); if ($result > 0) { @@ -752,7 +770,6 @@ class Propal extends CommonObject } $result = $this->addline( - $this->id, $this->lines[$i]->desc, $this->lines[$i]->subprice, $this->lines[$i]->qty, @@ -1099,13 +1116,10 @@ class Propal extends CommonObject // Retreive all extrafield for invoice // fetch optionals attributes and labels - if(!class_exists('Extrafields')) - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - if (count($extralabels)>0) { - $this->fetch_optionals($this->id,$extralabels); - } + $this->fetch_optionals($this->id,$extralabels); $this->db->free($resql); @@ -1192,13 +1206,11 @@ class Propal extends CommonObject // Retreive all extrafield for propal // fetch optionals attributes and labels - if(!class_exists('Extrafields')) - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - if (count($extralabels)>0) { - $this->fetch_optionals($this->id,$extralabels); - } + $this->fetch_optionals($this->id,$extralabels); + return 1; } @@ -1259,8 +1271,9 @@ class Propal extends CommonObject */ function valid($user, $notrigger=0) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - global $conf,$langs; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + global $conf,$langs; $error=0; $now=dol_now(); @@ -1357,7 +1370,7 @@ class Propal extends CommonObject * Define proposal date * * @param User $user Object user that modify - * @param timestamp $date Date + * @param int $date Date * @return int <0 if KO, >0 if OK */ function set_date($user, $date) @@ -1394,7 +1407,7 @@ class Propal extends CommonObject * Define end validity date * * @param User $user Object user that modify - * @param timestamp $date_fin_validite End of validity date + * @param int $date_fin_validite End of validity date * @return int <0 if KO, >0 if OK */ function set_echeance($user, $date_fin_validite) @@ -1421,7 +1434,7 @@ class Propal extends CommonObject * Set delivery date * * @param User $user Object user that modify - * @param timestamp $date_livraison Delivery date + * @param int $date_livraison Delivery date * @return int <0 if ko, >0 if ok */ function set_date_livraison($user, $date_livraison) @@ -1608,32 +1621,65 @@ class Propal extends CommonObject /** - * Close the commercial proposal + * Reopen the commercial proposal * * @param User $user Object user that close * @param int $statut Statut - * @param text $note Comment + * @param string $note Comment + * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers * @return int <0 if KO, >0 if OK */ - function reopen($user, $statut, $note) + function reopen($user, $statut, $note='', $notrigger=0) { global $langs,$conf; $this->statut = $statut; $error=0; - $now=dol_now(); - - $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture=".$this->db->idate($now).", fk_user_cloture=".$user->id; + $sql.= " SET fk_statut = ".$this->statut.","; + if (! empty($note)) $sql.= " note_private = '".$this->db->escape($note)."',"; + $sql.= " date_cloture=NULL, fk_user_cloture=NULL"; $sql.= " WHERE rowid = ".$this->id; - $resql=$this->db->query($sql); - if ($resql) - { + $this->db->begin(); - } + dol_syslog(get_class($this)."::reopen sql=".$sql, LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { + $error++; $this->errors[]="Error ".$this->db->lasterror(); + } + if (! $error) + { + if (! $notrigger) + { + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('PROPAL_REOPEN',$this,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } } @@ -1642,7 +1688,7 @@ class Propal extends CommonObject * * @param User $user Object user that close * @param int $statut Statut - * @param text $note Comment + * @param string $note Comment * @return int <0 if KO, >0 if OK */ function cloture($user, $statut, $note) @@ -1656,7 +1702,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture=".$this->db->idate($now).", fk_user_cloture=".$user->id; + $sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id; $sql.= " WHERE rowid = ".$this->id; $resql=$this->db->query($sql); @@ -1761,6 +1807,7 @@ class Propal extends CommonObject * Class invoiced the Propal * * @return int <0 si ko, >0 si ok + * @deprecated */ function classer_facturee() { @@ -2009,7 +2056,7 @@ class Propal extends CommonObject { // We remove directory $ref = dol_sanitizeFileName($this->ref); - if ($conf->propal->dir_output) + if ($conf->propal->dir_output && !empty($this->ref)) { $dir = $conf->propal->dir_output . "/" . $ref ; $file = $dir . "/" . $ref . ".pdf"; @@ -2321,6 +2368,7 @@ class Propal extends CommonObject if ($mode == 'opened') $delay_warning=$conf->propal->cloture->warning_delay; if ($mode == 'signed') $delay_warning=$conf->propal->facturation->warning_delay; + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; @@ -2459,10 +2507,12 @@ class Propal extends CommonObject $resql=$this->db->query($sql); if ($resql) { + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $this->nb["proposals"]=$obj->nb; } + $this->db->free($resql); return 1; } else @@ -2486,22 +2536,32 @@ class Propal extends CommonObject global $conf, $db, $langs; $langs->load("propal"); - $dir = DOL_DOCUMENT_ROOT . "/core/modules/propale/"; - if (! empty($conf->global->PROPALE_ADDON)) { - $file = $conf->global->PROPALE_ADDON.".php"; + $mybool=false; - // Chargement de la classe de numerotation + $file = $conf->global->PROPALE_ADDON.".php"; $classname = $conf->global->PROPALE_ADDON; - require_once $dir.$file; + + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) + { + $dir = $dirroot."/core/modules/propale/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + + if (! $mybool) + { + dol_print_error('',"Failed to include file ".$file); + return ''; + } $obj = new $classname(); - $numref = ""; $numref = $obj->getNextValue($soc,$this); - if ( $numref != "") + if ($numref != "") { return $numref; } @@ -2589,7 +2649,7 @@ class Propal extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->lines[$i] = new stdClass(); + $this->lines[$i] = new PropaleLigne($this->db); $this->lines[$i]->id = $obj->rowid; // for backward compatibility $this->lines[$i]->rowid = $obj->rowid; $this->lines[$i]->label = $obj->custom_label; @@ -2641,11 +2701,14 @@ class Propal extends CommonObject * \class PropaleLigne * \brief Class to manage commercial proposal lines */ -class PropaleLigne +class PropaleLigne extends CommonObject { var $db; var $error; + public $element='propaldet'; + public $table_element='propaldet'; + var $oldline; // From llx_propaldet @@ -2669,10 +2732,10 @@ class PropaleLigne var $marge_tx; var $marque_tx; - var $special_code; // Liste d'options non cumulabels: + var $special_code; // Tag for special lines (exlusive tags) // 1: frais de port // 2: ecotaxe - // 3: ?? + // 3: option line (when qty = 0) var $info_bits = 0; // Liste d'options cumulables: // Bit 0: 0 si TVA normal - 1 si TVA NPR @@ -2691,10 +2754,12 @@ class PropaleLigne var $libelle; // Label produit var $product_desc; // Description produit - var $localtax1_tx; - var $localtax2_tx; - var $total_localtax1; - var $total_localtax2; + var $localtax1_tx; // Local tax 1 + var $localtax2_tx; // Local tax 2 + var $localtax1_type; // Local tax 1 type + var $localtax2_type; // Local tax 2 type + var $total_localtax1; // Line total local tax 1 + var $total_localtax2; // Line total local tax 2 var $date_start; var $date_end; @@ -2798,6 +2863,8 @@ class PropaleLigne if (empty($this->tva_tx)) $this->tva_tx=0; if (empty($this->localtax1_tx)) $this->localtax1_tx=0; if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->rang)) $this->rang=0; @@ -2824,7 +2891,7 @@ class PropaleLigne // Insert line into database $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'propaldet'; $sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type,'; - $sql.= ' fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,'; + $sql.= ' fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; $sql.= ' subprice, remise_percent, '; $sql.= ' info_bits, '; $sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang,'; @@ -2840,6 +2907,8 @@ class PropaleLigne $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; + $sql.= " '".$this->localtax1_type."',"; + $sql.= " '".$this->localtax2_type."',"; $sql.= " ".($this->subprice?price2num($this->subprice):"null").","; $sql.= " ".price2num($this->remise_percent).","; $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").","; @@ -2861,6 +2930,17 @@ class PropaleLigne if ($resql) { $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet'); + + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + if (! $notrigger) { // Appel des triggers @@ -2901,6 +2981,19 @@ class PropaleLigne dol_syslog("PropaleLigne::delete sql=".$sql, LOG_DEBUG); if ($this->db->query($sql) ) { + + // Remove extrafields + if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + } + } + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); @@ -2941,6 +3034,8 @@ class PropaleLigne if (empty($this->localtax2_tx)) $this->localtax2_tx=0; if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; if (empty($this->marque_tx)) $this->marque_tx=0; if (empty($this->marge_tx)) $this->marge_tx=0; if (empty($this->price)) $this->price=0; // TODO A virer @@ -2968,6 +3063,8 @@ class PropaleLigne $sql.= " , tva_tx='".price2num($this->tva_tx)."'"; $sql.= " , localtax1_tx=".price2num($this->localtax1_tx); $sql.= " , localtax2_tx=".price2num($this->localtax2_tx); + $sql.= " , localtax1_type='".$this->localtax1_type."'"; + $sql.= " , localtax2_type='".$this->localtax2_type."'"; $sql.= " , qty='".price2num($this->qty)."'"; $sql.= " , subprice=".price2num($this->subprice).""; $sql.= " , remise_percent=".price2num($this->remise_percent).""; @@ -2995,6 +3092,16 @@ class PropaleLigne $resql=$this->db->query($sql); if ($resql) { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + if (! $notrigger) { // Appel des triggers diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 5b5b0dd7279..343413f4012 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -21,7 +21,7 @@ /** * \file htdocs/comm/propal/class/propalestats.class.php * \ingroup propales - * \brief Fichier de la classe de gestion des stats des propales + * \brief File of class to manage proposals statistics */ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; @@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** - * Class to manage proposal statistics + * Class to manage proposals statistics */ class PropaleStats extends Stats { @@ -62,10 +62,11 @@ class PropaleStats extends Stats $object=new Propal($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as p"; - //$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; + $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field='total_ht'; - + $this->field_line='total_ht'; + $this->where.= " p.fk_statut > 0"; //$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity; $this->where.= " AND p.entity = ".$conf->entity; @@ -182,5 +183,29 @@ class PropaleStats extends Stats return $this->_getAllByYear($sql); } + + + /** + * Return nb, amount of predefined product for year + * + * @param int $year Year to scan + * @return array Array of values + */ + function getAllByProduct($year) + { + global $user; + + $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; + $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; + //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE ".$this->where; + $sql.= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid"; + $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " GROUP BY product.ref"; + $sql.= $this->db->order('nb','DESC'); + //$sql.= $this->db->plimit(20); + + return $this->_getAllByProduct($sql); + } } ?> diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 7e94ec5a912..2d7d432a51d 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -166,7 +166,7 @@ if ($object->id > 0) // Ref client print ''; + print $langs->trans("NewValue").''; // Motif/Note print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 56dec89394d..0de58ca2ed0 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -297,7 +297,7 @@ if ($socid > 0) if ($_GET['action'] == 'remove') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); } /* @@ -338,7 +338,7 @@ if ($socid > 0) { $obj = $db->fetch_object($resql); $var = !$var; - print ""; + print ""; print ''; if ($obj->description == '(CREDIT_NOTE)') { @@ -384,7 +384,7 @@ if ($socid > 0) if ($_GET["action"]=='split' && $_GET['remid'] == $obj->rowid) { - print ""; + print ""; print ''; print ''; } @@ -495,7 +495,7 @@ if ($socid > 0) { $obj = array_shift($tab_sqlobj); $var = !$var; - print ""; + print ""; print ''; if ($obj->description == '(CREDIT_NOTE)') { diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index f92a309a53c..10bc0b500f4 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref)) // Ref cde client print ''; print ''; -print ''; +print ''; print ''; print "
    ".$langs->trans("Propal")." PDF
    ".$langs->trans("Propal")." PDF'.$object->ref.'.pdf
    '; - print '"; + print ""; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; @@ -241,7 +241,7 @@ if ($resql) $var=!$var; $obj = $db->fetch_object($resql); - print ""; + print ""; print '\n"; + + // Customer ref + print ''; + $url = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->rowid; // Company $companystatic->id=$objp->rowid; $companystatic->nom=$objp->nom; $companystatic->client=$objp->client; + $companystatic->code_client=$objp->code_client; print ''; - // Customer ref - print ''; - // Date propale + // Date proposal print '\n"; - // Date fin validite + // Date end validity if ($objp->dfv) { print ''; + print ''; + } + else + { + $var=!$var; + print ''; + print ''; + } + + } + print '
    '; + print ''; print '
    '; print $langs->trans('RefCustomer').''; print '
    '; diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 2859550ed4b..d3766ae27ce 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -64,38 +65,14 @@ $object->fetch($id,$ref); if ($object->id > 0) { $object->fetch_thirdparty(); + $upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; } /* * Actions */ -// Envoi fichier -if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) -{ - if ($object->id > 0) - { - $upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); - dol_add_file_process($upload_dir,0,1,'userfile'); - } -} - -// Delete -if ($action == 'confirm_deletefile' && $confirm == 'yes') -{ - if ($object->id > 0) - { - $langs->load("other"); - - $upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); - $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } -} /* @@ -133,7 +110,7 @@ if ($object->id > 0) // Ref client print '
    '; - print ''; print ''; -print ''; +print ''; print ''; print "
    '; + print ''; print '
    '; print $langs->trans('RefCustomer').''; print '
    '; @@ -153,26 +130,14 @@ if ($object->id > 0) print ''; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '
    '; - } - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->propal->creer,50,$object); - - - // List of document - $formfile->list_of_documents($filearray,$object,'propal'); + $modulepart = 'propal'; + $permission = $user->rights->propal->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { - print $langs->trans("UnkownError"); + print $langs->trans("ErrorUnknown"); } llxFooter(); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 7389990c105..409d76f2505 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -69,7 +69,7 @@ print ''; print '
    '.$langs->trans("SearchPropal").'
    '; print $langs->trans("Ref").':
    '.$langs->trans("Other").':
    '.$langs->trans("Other").':

    \n"; @@ -180,7 +180,7 @@ if (! empty($conf->propal->enabled)) { $var=!$var; $obj = $db->fetch_object($resql); - print "
    '; $propalstatic->id=$obj->rowid; @@ -315,7 +315,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) print ''; print ''; - $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD)); + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); while ($i < $nbofloop) { $obj = $db->fetch_object($result); @@ -409,7 +409,7 @@ if (! empty($conf->propal->enabled)) { $var=!$var; $obj = $db->fetch_object($resql); - print ""; + print ""; print '"; + print ""; print ''; - print ''; } print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Town'),$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('DateEndPropalShort'),$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; print ''; print ''; + print ''; print ''; - print ''; + print ''; + // Date print ''; print ''; - print ''; - print ''; + // Author + print ''; print ''; - print ''; print "\n"; @@ -311,33 +344,48 @@ if ($result) print $objectstatic->getNomUrl(1); print ''; - print ''; - print '
    '.$langs->trans("ProposalsOpened").' ('.$num.')
    '; $propalstatic->id=$obj->rowid; @@ -481,7 +481,7 @@ if (! empty($conf->propal->enabled)) { $var=!$var; $obj = $db->fetch_object($resql); - print "
    '; $propalstatic->id=$obj->rowid; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 065ce0f4aa3..d45718b5daf 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -8,6 +8,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2011 Philippe Grand * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2013 Cédric Salvador * * 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,8 @@ $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','al $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); +$search_author=GETPOST('search_author','alpha'); +$search_town=GETPOST('search_town','alpha'); $sall=GETPOST("sall"); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); @@ -77,7 +80,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('propalcard')); +$hookmanager->initHooks(array('propallist')); @@ -85,6 +88,10 @@ $hookmanager->initHooks(array('propalcard')); * Actions */ + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) { @@ -95,6 +102,8 @@ if (GETPOST("button_removefilter_x")) $search_refcustomer=''; $search_societe=''; $search_montant_ht=''; + $search_author=''; + $search_town=''; $year=''; $month=''; } @@ -131,8 +140,9 @@ if (! $sortfield) $sortfield='p.datep'; if (! $sortorder) $sortorder='DESC'; $limit = $conf->liste_limit; -$sql = 'SELECT s.rowid, s.nom, s.client, '; -$sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; + +$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client,'; +$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p'; @@ -151,23 +161,29 @@ if (! $user->rights->societe->client->voir && ! $socid) //restriction { $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } -if ($search_ref) -{ - $sql.= " AND p.ref LIKE '%".$db->escape(trim($search_ref))."%'"; +if ($search_town) {//restriction + $sql .= natural_search('s.town', $search_town); } -if ($search_refcustomer) -{ - $sql.= " AND p.ref_client LIKE '%".$db->escape(trim($search_refcustomer))."%'"; +if ($search_ref) { + $sql .= natural_search('p.ref', $search_ref); } -if ($search_societe) +if ($search_refcustomer) { + $sql .= natural_search('p.ref_client', $search_refcustomer); +} +if ($search_societe) { + $sql .= natural_search('s.nom', $search_societe); +} +if ($search_author) { - $sql.= " AND s.nom LIKE '%".$db->escape(trim($search_societe))."%'"; + $sql.= " AND u.login LIKE '%".$db->escape(trim($search_author))."%'"; } if ($search_montant_ht) { $sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'"; } -if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR p.note_private LIKE '%".$db->escape($sall)."%' OR p.note_public LIKE '%".$db->escape($sall)."%' OR pd.description LIKE '%".$db->escape($sall)."%')"; +if ($sall) { + $sql .= natural_search(array('s.nom', 'p.note_private', 'p.note_public', 'pd.description'), $sall); +} if ($socid) $sql.= ' AND s.rowid = '.$socid; if ($viewstatut <> '') { @@ -194,6 +210,15 @@ if ($search_user > 0) $sql.= ' ORDER BY '.$sortfield.' '.$sortorder.', p.ref DESC'; + +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + $sql.= $db->plimit($limit + 1,$offset); $result=$db->query($sql); @@ -201,7 +226,6 @@ if ($result) { $objectstatic=new Propal($db); $userstatic=new User($db); - $num = $db->num_rows($result); if ($socid) @@ -214,12 +238,14 @@ if ($result) if ($month) $param.='&month='.$month; if ($year) $param.='&year='.$year; if ($search_ref) $param.='&search_ref=' .$search_ref; - if ($search_refcustomer) $param.='&search_ref=' .$search_refcustomer; + if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer; if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; - print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); + if ($search_author) $param.='&search_author='.$search_author; + if ($search_town) $param.='&search_town='.$search_town; + print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); // Lignes des champs de filtre print '
    '; @@ -246,33 +272,36 @@ if ($result) if (! empty($moreforfilter)) { print '
    '; + print ''; print $moreforfilter; print '
    '; - print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; - print ''; - print ''; print $langs->trans('Month').': '; print ' '.$langs->trans('Year').': '; @@ -280,14 +309,18 @@ if ($result) $formother->select_year($syear,'year',1, 20, 5); print ' '; + // Amount + print ''; print ''; print ' '; + print ''; + print ''; $formpropal->select_propal_statut($viewstatut,1); print ''; + print ''; print '
    '; + print ''; if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + if (! empty($objp->note_private)) + { + print ' '; + print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + print ''; + } print ''; + // Ref + print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid; print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '
    '; + print "
    '; + print $objp->ref_client; + print ''; print $companystatic->getNomUrl(1,'customer'); print ''; - print $objp->ref_client; + // Town + print ''; + print $objp->town; print ''; $y = dol_print_date($db->jdate($objp->dp),'%Y'); $m = dol_print_date($db->jdate($objp->dp),'%m'); @@ -349,7 +397,7 @@ if ($result) print ' '; print $y."'.dol_print_date($db->jdate($objp->dfv),'day'); @@ -380,6 +428,25 @@ if ($result) $i++; } + + if ($total>0) + { + if($num<$limit){ + $var=!$var; + print '
    '.$langs->trans("TotalHT").''.price($total).''; + print '
    '.$langs->trans("TotalHTforthispage").''.price($total).''; + print '
    '; print ''; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 367fe7c0e69..2855a296010 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -96,7 +96,7 @@ if ($id > 0 || ! empty($ref)) // Ref client print '
    '; - print ''; - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); + print ''; $parameters=array(); $formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -360,9 +372,13 @@ if ($resql) print ' '; print ''; + print ''; + // Print the search button print ''; $parameters=array(); @@ -387,6 +403,8 @@ if ($resql) $prospectstatic->id=$obj->rowid; $prospectstatic->nom=$obj->nom; $prospectstatic->status=$obj->status; + $prospectstatic->code_client=$obj->code_client; + $prospectstatic->client=$obj->client; $prospectstatic->fk_prospectlevel=$obj->fk_prospectlevel; print $prospectstatic->getNomUrl(1,'prospect'); print ''; @@ -417,9 +435,10 @@ if ($resql) } print ''; - print ''; + print ''; $parameters=array('obj' => $obj); $formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 306be40a5db..81bc362695e 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -114,7 +114,7 @@ if ($socid > 0) // Remise print '"; + print $langs->trans("CustomerRelativeDiscount").'"; print '
    '; + print ''; print '
    '; print $langs->trans('RefCustomer').''; print '
    '; @@ -113,7 +113,7 @@ if ($id > 0 || ! empty($ref)) // Ligne info remises tiers print '
    '.$langs->trans('Discounts').''; - if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client); + if ($societe->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$societe->getAvailableDiscounts(); print '. '; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index ec9a0f982a0..e0805d385e6 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -227,7 +227,7 @@ print '
    '; print '
    '; print ''; print ''; - print ''; + print ''; // Company print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; } print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/prospect/class/prospect.class.php b/htdocs/comm/prospect/class/prospect.class.php index ec0454c4847..c322d6af6d6 100644 --- a/htdocs/comm/prospect/class/prospect.class.php +++ b/htdocs/comm/prospect/class/prospect.class.php @@ -81,6 +81,7 @@ class Prospect extends Societe if ($obj->client == 1 || $obj->client == 3) $this->nb["customers"]+=$obj->nb; if ($obj->client == 2 || $obj->client == 3) $this->nb["prospects"]+=$obj->nb; } + $this->db->free($resql); return 1; } else diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index e6496c32a58..1f3e0fc4c0c 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -60,7 +60,7 @@ if (! empty($conf->propal->enabled)) print ''; print ''; - print ''; + print ''; print ''; print "
    '.$langs->trans("Filter").'
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; $filter='s.client in (1,2,3)'; @@ -267,14 +267,14 @@ foreach ($data as $val) { // If we have empty year $oldyear--; print '
    '.$oldyear.'0?'&userid='.$userid:'').'">'.$oldyear.'000
    '.$year.'0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
    '.$langs->trans("SearchAProposal").'
    '; print $langs->trans("Ref").':
    '.$langs->trans("Other").':
    '.$langs->trans("Other").':

    \n"; } diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index f0f58df9a08..767a29f0b88 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -46,6 +47,8 @@ $search_town = GETPOST("search_town"); $search_state = GETPOST("search_state"); $search_datec = GETPOST("search_datec"); $search_categ = GETPOST("search_categ",'int'); +$search_status = GETPOST("search_status",'int'); +if ($search_status=='') $search_status=1; // always display activ customer first $catid = GETPOST("catid",'int'); $sortfield = GETPOST("sortfield",'alpha'); @@ -172,8 +175,9 @@ if ($action == 'cstc') */ $formother=new FormOther($db); +$form=new Form($db); -$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status,"; +$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status, s.code_client, s.client,"; $sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,"; $sql.= " d.nom as departement"; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $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) @@ -192,11 +196,18 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'"; +if ($search_nom) { + $sql .= natural_search('s.nom', $search_nom); +} if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'"; -if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape(strtolower($search_town))."%'"; -if ($search_state) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_state))."%'"; +if ($search_town) { + $sql .= natural_search('s.town', $search_town); +} +if ($search_state) { + $sql .= natural_search('d.nom', $search_state); +} if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; +if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); // Insert levels filters if ($search_levels) { @@ -207,9 +218,8 @@ if ($search_sale) { $sql .= " AND sc.fk_user = ".$db->escape($search_sale); } -if ($socname) -{ - $sql .= " AND s.nom LIKE '%".$db->escape($socname)."%'"; +if ($socname) { + $sql .= natural_search('s.nom', $search_nom); $sortfield = "s.nom"; $sortorder = "ASC"; } @@ -223,7 +233,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= " ORDER BY $sortfield $sortorder, s.nom ASC"; $sql.= $db->plimit($conf->liste_limit+1, $offset); -dol_syslog('comm/propsect/list.php: sql='.$sql,LOG_DEBUG); +dol_syslog('comm/prospect/list.php sql='.$sql,LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -257,6 +267,7 @@ if ($resql) if ($search_level_to != '') $param.='&search_level_to='.$search_level_to; if ($search_categ != '') $param.='&search_categ='.$search_categ; if ($search_sale != '') $param.='&search_sale='.$search_sale; + if ($search_status != '') $param.='&search_status='.$search_status; // $param and $urladd should have the same value $urladd = $param; @@ -298,7 +309,8 @@ if ($resql) print_liste_field_titre($langs->trans("ProspectLevelShort"),$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); print '
      '; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print ''; - print ''; + print ''; print ''; + print ''; print $prospectstatic->LibStatut($prospectstatic->status,3); print '
    '; - print $langs->trans("CustomerRelativeDiscount").''.price2num($objsoc->remise_client)."%
    '.price2num($objsoc->remise_percent)."%
    '; print '
    '; @@ -130,7 +130,7 @@ if ($socid > 0) // Nouvelle valeur print '
    '; - print $langs->trans("NewValue").'remise_client).'">%
    remise_percent).'">%
    '; @@ -184,7 +184,7 @@ if ($socid > 0) $tag = !$tag; print '
    '.dol_print_date($db->jdate($obj->dc),"dayhour").''.price2num($obj->remise_client).'%'.price2num($obj->remise_percent).'%'.$obj->note.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'
    '.dol_print_date($db->jdate($obj->dc),'dayhour').'
    '; $amount1=price2num($obj->amount_ttc/2,'MT'); $amount2=($obj->amount_ttc-$amount1); @@ -394,7 +394,7 @@ if ($socid > 0) array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); print '
    '.dol_print_date($db->jdate($obj->dc),'dayhour').'
    '; - print ''; } - // Other attributes + + if ($soc->outstanding_limit) + { + // Outstanding Bill + print ''; + print ''; + } + + // Other attributes (TODO Move this into an include) $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { - if ($action == 'edit_extras') - { - print ''; - print ''; - print ''; - print ''; - } - foreach($extrafields->attribute_label as $key=>$label) { if ($action == 'edit_extras') { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); } else { $value=$object->array_options["options_".$key]; } @@ -2187,35 +2332,27 @@ else $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } - if ($action == 'edit_extras' && $user->rights->commande->creer) + if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) { + print ''; + print ''; + print ''; + print ''; + print ''; + print $extrafields->showInputField($key,$value); + + print ''; + print ''; } else { print $extrafields->showOutputField($key,$value); + if ($object->statut == 0 && $user->rights->commande->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; } print ''."\n"; } } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->commande->creer) - { - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->commande->creer) - { - print ''; - } - } - } } $rowspan=4; @@ -2277,25 +2414,34 @@ else /* * Lines - */ + */ $result = $object->getLinesArray(); - $numlines = count($object->lines); + + print ' + + + + + '; + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } - print '
    '; + print ''; print '
    '; print $langs->trans('RefCustomer').''; print '
    '; @@ -126,7 +126,7 @@ if ($id > 0 || ! empty($ref)) print_titre($langs->trans("Documents")); print ''; - print ""; + print ""; print ''; print ''; @@ -137,7 +137,7 @@ if ($id > 0 || ! empty($ref)) // TODO obsolete ? if (file_exists($filedetail)) { - print ""; + print ""; print ''; print ''; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b0af9c29e58..6b88ff3553d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -129,36 +129,39 @@ class Commande extends CommonOrder global $db, $langs, $conf; $langs->load("order"); - $dir = DOL_DOCUMENT_ROOT . "/core/modules/commande"; - if (! empty($conf->global->COMMANDE_ADDON)) { - $file = $conf->global->COMMANDE_ADDON.".php"; + $mybool=false; - // Chargement de la classe de numerotation + $file = $conf->global->COMMANDE_ADDON.".php"; $classname = $conf->global->COMMANDE_ADDON; - $result=include_once $dir.'/'.$file; - if ($result) + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) { - $obj = new $classname(); - $numref = ""; - $numref = $obj->getNextValue($soc,$this); + $dir = $dirroot."/core/modules/commande/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } - if ( $numref != "") - { - return $numref; - } - else - { - dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error); - return ""; - } + if (! $mybool) + { + dol_print_error('',"Failed to include file ".$file); + return ''; + } + + $obj = new $classname(); + $numref = ""; + $numref = $obj->getNextValue($soc,$this); + + if ($numref != "") + { + return $numref; } else - { - print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_ADDON_NotDefined"); - return ""; + { + dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error); + return ""; } } else @@ -287,13 +290,6 @@ class Commande extends CommonOrder } } - // Set new ref and current status - if (! $error) - { - $this->ref = $num; - $this->statut = 1; - } - if (! $error) { // Appel des triggers @@ -304,6 +300,13 @@ class Commande extends CommonOrder // Fin appel triggers } + // Set new ref and current status + if (! $error) + { + $this->ref = $num; + $this->statut = 1; + } + if (! $error) { $this->db->commit(); @@ -449,8 +452,13 @@ class Commande extends CommonOrder } else { - $this->db->rollback(); - return -1; + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::set_reopen ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } } @@ -475,7 +483,7 @@ class Commande extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande'; $sql.= ' SET fk_statut = 3,'; $sql.= ' fk_user_cloture = '.$user->id.','; - $sql.= ' date_cloture = '.$this->db->idate($now); + $sql.= " date_cloture = '".$this->db->idate($now)."'"; $sql.= ' WHERE rowid = '.$this->id.' AND fk_statut > 0'; if ($this->db->query($sql)) @@ -576,8 +584,14 @@ class Commande extends CommonOrder else { $this->error=$mouvP->error; + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::cancel ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } $this->db->rollback(); - return -1; + return -1*$error; } } else @@ -678,7 +692,6 @@ class Commande extends CommonOrder } $result = $this->addline( - $this->id, $this->lines[$i]->desc, $this->lines[$i]->subprice, $this->lines[$i]->qty, @@ -793,8 +806,19 @@ class Commande extends CommonOrder // Fin appel triggers } - $this->db->commit(); - return $this->id; + if (!$error) { + $this->db->commit(); + return $this->id; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } else { @@ -1002,7 +1026,6 @@ class Commande extends CommonOrder /** * Add an order line into database (linked to product/service or not) * - * @param int $commandeid Id of line * @param string $desc Description of line * @param double $pu_ht Unit price (without tax) * @param double $qty Quantite @@ -1024,6 +1047,7 @@ class Commande extends CommonOrder * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) * @param string $label Label + * @param array $array_option extrafields array * @return int >0 if OK, <0 if KO * * @see add_product @@ -1033,8 +1057,12 @@ class Commande extends CommonOrder * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) */ - function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_option=0) { + global $mysoc; + + $commandeid=$this->id; + dol_syslog(get_class($this)."::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -1079,7 +1107,10 @@ class Commande extends CommonOrder // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'', $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -1114,6 +1145,8 @@ class Commande extends CommonOrder $this->line->tva_tx=$txtva; $this->line->localtax1_tx=$txlocaltax1; $this->line->localtax2_tx=$txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; $this->line->fk_product=$fk_product; $this->line->fk_remise_except=$fk_remise_except; $this->line->remise_percent=$remise_percent; @@ -1140,6 +1173,10 @@ class Commande extends CommonOrder $this->line->price=$price; $this->line->remise=$remise; + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + $result=$this->line->insert(); if ($result > 0) { @@ -1342,15 +1379,12 @@ class Commande extends CommonOrder // Retreive all extrafield for invoice // fetch optionals attributes and labels - if(!class_exists('Extrafields')) - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - if (count($extralabels)>0) { - $this->fetch_optionals($this->id,$extralabels); - } + $this->fetch_optionals($this->id,$extralabels); - $this->db->free(); + $this->db->free($result); /* * Lines @@ -1758,7 +1792,7 @@ class Commande extends CommonOrder else { $this->db->rollback(); - $this->error=$this->db->lasterror(); + $this->error=$line->error; return -1; } } @@ -2192,9 +2226,14 @@ class Commande extends CommonOrder else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::classifyBilled ".$this->error, LOG_ERR); + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::classifyBilled ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } $this->db->rollback(); - return -2; + return -1*$error; } } else @@ -2210,6 +2249,7 @@ class Commande extends CommonOrder * Classify the order as invoiced * * @return int <0 if ko, >0 if ok + * @deprecated */ function classer_facturee() { @@ -2239,11 +2279,12 @@ class Commande extends CommonOrder * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label Label * @param int $special_code Special code (also used by externals modules!) + * @param array $array_option extrafields array * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) { - global $conf; + global $conf, $mysoc; dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $date_start, $date_end, $type"); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -2273,7 +2314,10 @@ class Commande extends CommonOrder // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, '', $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -2312,6 +2356,8 @@ class Commande extends CommonOrder $this->line->tva_tx=$txtva; $this->line->localtax1_tx=$txlocaltax1; $this->line->localtax2_tx=$txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; $this->line->remise_percent=$remise_percent; $this->line->subprice=$subprice; $this->line->info_bits=$info_bits; @@ -2335,6 +2381,10 @@ class Commande extends CommonOrder $this->line->price=$price; $this->line->remise=$remise; + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + $result=$this->line->update(); if ($result > 0) { @@ -2349,11 +2399,10 @@ class Commande extends CommonOrder } else { - $this->error=$this->db->lasterror(); - $this->errors=array($this->db->lasterror()); - $this->db->rollback(); - dol_syslog(get_class($this)."::updateline Error=".$this->error, LOG_ERR); - return -1; + $this->error=$this->line->error; + + $this->db->rollback(); + return -1; } } else @@ -2434,7 +2483,7 @@ class Commande extends CommonOrder // On efface le repertoire de pdf provisoire $comref = dol_sanitizeFileName($this->ref); - if ($conf->commande->dir_output) + if ($conf->commande->dir_output && !empty($this->ref)) { $dir = $conf->commande->dir_output . "/" . $comref ; $file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf"; @@ -2471,9 +2520,13 @@ class Commande extends CommonOrder else { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); - $this->db->rollback(); - return -1; + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } } @@ -2493,7 +2546,7 @@ class Commande extends CommonOrder $this->nbtodo=$this->nbtodolate=0; $clause = " WHERE"; - $sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut"; + $sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) { @@ -2512,7 +2565,9 @@ class Commande extends CommonOrder while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++; + + $date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date; + if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++; } return 1; } @@ -2823,6 +2878,7 @@ class Commande extends CommonOrder { $this->nb["orders"]=$obj->nb; } + $this->db->free($resql); return 1; } else @@ -2900,6 +2956,7 @@ class Commande extends CommonOrder { $obj = $this->db->fetch_object($resql); + $this->lines[$i] = new OrderLine($this->db); $this->lines[$i]->id = $obj->rowid; $this->lines[$i]->label = $obj->custom_label; $this->lines[$i]->description = $obj->description; @@ -2952,11 +3009,14 @@ class Commande extends CommonOrder * \class OrderLine * \brief Classe de gestion des lignes de commande */ -class OrderLine +class OrderLine extends CommonOrderLine { var $db; var $error; + public $element='commandedet'; + public $table_element='commandedet'; + var $oldline; // From llx_commandedet @@ -2972,6 +3032,8 @@ class OrderLine var $tva_tx; // VAT Rate for product/service (example 19.6) var $localtax1_tx; // Local tax 1 var $localtax2_tx; // Local tax 2 + var $localtax1_type; // Local tax 1 type + var $localtax2_type; // Local tax 2 type var $subprice; // U.P. HT (example 100) var $remise_percent; // % for line discount (example 20%) var $fk_remise_except; @@ -3097,12 +3159,26 @@ class OrderLine $error=0; + $this->db->begin(); + $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';"; dol_syslog("OrderLine::delete sql=".$sql); $resql=$this->db->query($sql); if ($resql) { + // Remove extrafields + if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + } + } + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); @@ -3110,7 +3186,18 @@ class OrderLine if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers - return 1; + if (!$error) { + $this->db->commit(); + return 1; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } else { @@ -3138,6 +3225,8 @@ class OrderLine if (empty($this->tva_tx)) $this->tva_tx=0; if (empty($this->localtax1_tx)) $this->localtax1_tx=0; if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->rang)) $this->rang=0; @@ -3162,7 +3251,8 @@ class OrderLine // Insertion dans base de la ligne $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commandedet'; - $sql.= ' (fk_commande, fk_parent_line, label, description, qty, tva_tx, localtax1_tx, localtax2_tx,'; + $sql.= ' (fk_commande, fk_parent_line, label, description, qty, '; + $sql.= ' tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; $sql.= ' fk_product, product_type, remise_percent, subprice, price, remise, fk_remise_except,'; $sql.= ' special_code, rang, fk_product_fournisseur_price, buy_price_ht,'; $sql.= ' info_bits, total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, date_start, date_end)'; @@ -3174,6 +3264,8 @@ class OrderLine $sql.= " '".price2num($this->tva_tx)."',"; $sql.= " '".price2num($this->localtax1_tx)."',"; $sql.= " '".price2num($this->localtax2_tx)."',"; + $sql.= " '".$this->localtax1_type."',"; + $sql.= " '".$this->localtax2_type."',"; $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; $sql.= " '".$this->product_type."',"; $sql.= " '".price2num($this->remise_percent)."',"; @@ -3201,6 +3293,16 @@ class OrderLine { $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'commandedet'); + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + if (! $notrigger) { // Appel des triggers @@ -3211,8 +3313,18 @@ class OrderLine // Fin appel triggers } - $this->db->commit(); - return 1; + if (!$error) { + $this->db->commit(); + return 1; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } else { @@ -3239,6 +3351,8 @@ class OrderLine if (empty($this->tva_tx)) $this->tva_tx=0; if (empty($this->localtax1_tx)) $this->localtax1_tx=0; if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; if (empty($this->qty)) $this->qty=0; if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; @@ -3267,6 +3381,8 @@ class OrderLine $sql.= " , tva_tx=".price2num($this->tva_tx); $sql.= " , localtax1_tx=".price2num($this->localtax1_tx); $sql.= " , localtax2_tx=".price2num($this->localtax2_tx); + $sql.= " , localtax1_type='".$this->localtax1_type."'"; + $sql.= " , localtax2_type='".$this->localtax2_type."'"; $sql.= " , qty=".price2num($this->qty); $sql.= " , subprice=".price2num($this->subprice).""; $sql.= " , remise_percent=".price2num($this->remise_percent).""; @@ -3295,6 +3411,16 @@ class OrderLine $resql=$this->db->query($sql); if ($resql) { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + if (! $notrigger) { // Appel des triggers @@ -3305,8 +3431,18 @@ class OrderLine // Fin appel triggers } - $this->db->commit(); - return 1; + if (!$error) { + $this->db->commit(); + return 1; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } else { diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index c5923edbb55..8691656128e 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -21,7 +21,7 @@ /** * \file htdocs/commande/class/commandestats.class.php * \ingroup commandes - * \brief Fichier de la classe de gestion des stats des commandes + * \brief File of class to manage order statistics */ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; @@ -66,16 +66,18 @@ class CommandeStats extends Stats { $object=new Commande($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as c"; - //$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; + $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field='total_ht'; + $this->field_line='total_ht'; $this->where.= " c.fk_statut > 0"; // Not draft and not cancelled } if ($mode == 'supplier') { $object=new CommandeFournisseur($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as c"; - //$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; + $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field='total_ht'; + $this->field_line='total_ht'; $this->where.= " c.fk_statut > 2"; // Only approved & ordered } //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; @@ -191,6 +193,30 @@ class CommandeStats extends Stats return $this->_getAllByYear($sql); } + + /** + * Return nb, amount of predefined product for year + * + * @param int $year Year to scan + * @return array Array of values + */ + function getAllByProduct($year) + { + global $user; + + $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; + $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; + //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE ".$this->where; + $sql.= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid"; + $sql.= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " GROUP BY product.ref"; + $sql.= $this->db->order('nb','DESC'); + //$sql.= $this->db->plimit(20); + + return $this->_getAllByProduct($sql); + } + } ?> \ No newline at end of file diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index cde8d1d4a35..055d4a42787 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -162,7 +162,7 @@ if ($id > 0 || ! empty($ref)) // Ref commande client print '"; @@ -1609,8 +1716,10 @@ if ($action == 'create' && $user->rights->commande->creer) // Project if (! empty($conf->projet->enabled) && $socid>0) { + $formproject=new FormProjets($db); + print ''; print ''; - print ''; + print ''; } print '
    ".$langs->trans("Order")." PDF
    ".$langs->trans("Order")." PDF'.$object->ref.'.pdf'.dol_print_size(dol_filesize($file)).'
    Commande detaillee
    Commande detaillee'.$object->ref.'-detail.pdf'.dol_print_size(dol_filesize($filedetail)).'
    '; - print ''; print ''; print "\n"; @@ -154,7 +154,7 @@ if ($resql) $var=!$var; - print ""; + print ""; print '
    '; + print ''; print '
    '; print $langs->trans('RefCustomer').''; print '
    '; diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index bc04697f93f..373775a0da0 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -142,7 +142,7 @@ if ($resql) print '
    '; - print ''; + print ''; print '
    '; $result=''; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index c81c799ab1b..17e041adaf5 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -65,35 +66,13 @@ $object = new Commande($db); /* * Actions */ - -// Envoi fichier -if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) +if ($object->fetch($id)) { - if ($object->fetch($id)) - { - $object->fetch_thirdparty(); - $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref); - dol_add_file_process($upload_dir,0,1,'userfile'); - } + $object->fetch_thirdparty(); + $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref); } -// Delete -else if ($action == 'confirm_deletefile' && $confirm == 'yes') -{ - if ($object->fetch($id)) - { - $langs->load("other"); - $object->fetch_thirdparty(); - - $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref); - $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } -} +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; /* @@ -107,10 +86,10 @@ $form = new Form($db); if ($id > 0 || ! empty($ref)) { if ($object->fetch($id, $ref)) - { - $object->fetch_thirdparty(); + { + $object->fetch_thirdparty(); - $upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($object->ref); $head = commande_prepare_head($object); dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), 0, 'order'); @@ -140,23 +119,10 @@ if ($id > 0 || ! empty($ref)) print "
    \n"; print "\n"; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '
    '; - } - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/commande/document.php?id='.$object->id,'',0,0,$user->rights->commande->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'commande',$param); + $modulepart = 'commande'; + $permission = $user->rights->commande->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 907977d7cbd..99864a59dd2 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1,34 +1,34 @@ * Copyright (C) 2004-2013 Laurent Destailleur -* Copyright (C) 2005 Marc Barilley / Ocebo -* Copyright (C) 2005-2013 Regis Houssin -* Copyright (C) 2006 Andre Cianfarani -* Copyright (C) 2010-2013 Juanjo Menent -* Copyright (C) 2011 Philippe Grand -* Copyright (C) 2012 Christophe Battarel -* Copyright (C) 2012 Marcos García -* Copyright (C) 2013 Florian Henry -* -* 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 . -*/ + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2012-2013 Christophe Battarel + * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Florian Henry + * + * 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 . + */ /** * \file htdocs/commande/fiche.php -* \ingroup commande -* \brief Page to show customer order -*/ + * \ingroup commande + * \brief Page to show customer order + */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -43,7 +43,7 @@ if (! empty($conf->propal->enabled)) require DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->projet->enabled)) { require DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -80,7 +80,6 @@ $result=restrictedArea($user,'commande',$id); $object = new Commande($db); $extrafields = new ExtraFields($db); - // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); @@ -113,6 +112,9 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->commande-> { if ($object->id > 0) { + //Because createFromClone modifies the object, we must clone it so that we can restore it later + $orig = dol_clone($object); + $result=$object->createFromClone($socid); if ($result > 0) { @@ -121,7 +123,8 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->commande-> } else { - $mesg='
    '.$object->error.'
    '; + setEventMessage($object->error, 'errors'); + $object = $orig; $action=''; } } @@ -141,7 +144,7 @@ else if ($action == 'reopen' && $user->rights->commande->creer) } else { - $mesg='
    '.$object->error.'
    '; + setEventMessage($object->error, 'errors'); } } } @@ -155,9 +158,8 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->comm header('Location: index.php'); exit; } - else - { - $mesg='
    '.$object->error.'
    '; + else { + setEventMessage($object->error, 'errors'); } } @@ -188,7 +190,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> } else { - $mesg='
    '.$object->error.'
    '; + setEventMessage($object->error, 'errors'); } } @@ -318,8 +320,14 @@ else if ($action == 'add' && $user->rights->commande->creer) $fk_parent_line = 0; } + //Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals') ) // For avoid conflicts if trigger used + { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_option=$lines[$i]->array_options; + } + $result = $object->addline( - $object_id, $desc, $lines[$i]->subprice, $lines[$i]->qty, @@ -340,7 +348,8 @@ else if ($action == 'add' && $user->rights->commande->creer) $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, - $label + $label, + $array_option ); if ($result < 0) @@ -439,6 +448,10 @@ else if ($action == 'add' && $user->rights->commande->creer) else if ($action == 'classifybilled' && $user->rights->commande->creer) { $ret=$object->classifyBilled(); + + if ($ret < 0) { + setEventMessage($object->error, 'errors'); + } } // Positionne ref commande client @@ -558,51 +571,87 @@ else if ($action == 'setnote_private' && $user->rights->commande->creer) if ($result < 0) dol_print_error($db,$object->error); } -/* - * Ajout d'une ligne produit dans la commande -*/ +// Add a new line else if ($action == 'addline' && $user->rights->commande->creer) { $langs->load('errors'); - $error = false; + $error = 0; - $idprod=GETPOST('idprod', 'int'); - $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); - $price_ht = GETPOST('price_ht'); - $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); + // Set if we used free entry or predefined product + if (GETPOST('addline_libre') + || (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) + { + $predef=''; + $idprod=0; + $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + if (GETPOST('addline_predefined') + || (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) + { + $predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):'')); + $price_ht = ''; + $tva_tx = ''; + } + if (GETPOST('usenewaddlineform')) { + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + $qty = GETPOST('qty'.$predef); + $remise_percent=GETPOST('remise_percent'.$predef); - if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0)) + //Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline,$predef); + //Unset extrafield + if (is_array($extralabelsline)) + { + // Get extra fields + foreach ($extralabelsline as $key => $value) + { + unset($_POST["options_".$key]); + } + } + + if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && ($qty < 0)) { setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error = true; + $error++; } if (empty($idprod) && GETPOST('type') < 0) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); - $error = true; + $error++; } if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; } - if (! GETPOST('qty') && GETPOST('qty') == '') + if ($qty == '') { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error = true; + $error++; } if (empty($idprod) && empty($product_desc)) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); - $error = true; + $error++; } - if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) + if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { // Clean parameters - $predef=((! empty($idprod) && $conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); - $date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); - $date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); + $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); + $date_end=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); // Ecrase $pu par celui du produit @@ -637,6 +686,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; $price_min = $prod->multiprices_min[$object->client->price_level]; $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; + $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; + $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } else { @@ -646,9 +697,16 @@ else if ($action == 'addline' && $user->rights->commande->creer) $price_base_type = $prod->price_base_type; } + // if price ht is forced (ie: calculated by margin rate and cost price) + if (!empty($price_ht)) + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); + } + // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tva_tx != $prod->tva_tx) + elseif ($tva_tx != $prod->tva_tx) { if ($price_base_type != 'HT') { @@ -710,8 +768,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) } // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + $fournprice=(GETPOST('fournprice'.$predef)?GETPOST('fournprice'.$predef):''); + $buyingprice=(GETPOST('buying_price'.$predef)?GETPOST('buying_price'.$predef):''); // Local Taxes $localtax1_tx= get_localtax($tva_tx, 1, $object->client); @@ -722,24 +780,23 @@ else if ($action == 'addline' && $user->rights->commande->creer) $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + if (! empty($price_min) && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) { - $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); + $mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); setEventMessage($mesg, 'errors'); } else { // Insert line $result = $object->addline( - $object->id, $desc, $pu_ht, - GETPOST('qty'), + $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, - GETPOST('remise_percent'), + $remise_percent, $info_bits, 0, $price_base_type, @@ -752,7 +809,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) GETPOST('fk_parent_line'), $fournprice, $buyingprice, - $label + $label, + $array_option ); if ($result > 0) @@ -776,7 +834,6 @@ else if ($action == 'addline' && $user->rights->commande->creer) unset($_POST['qty']); unset($_POST['type']); - unset($_POST['idprod']); unset($_POST['remise_percent']); unset($_POST['price_ht']); unset($_POST['price_ttc']); @@ -786,10 +843,18 @@ else if ($action == 'addline' && $user->rights->commande->creer) unset($_POST['product_desc']); unset($_POST['fournprice']); unset($_POST['buying_price']); - - // old method - unset($_POST['np_desc']); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); unset($_POST['dp_desc']); + + unset($_POST['idprod']); + unset($_POST['qty_predef']); + unset($_POST['remise_percent_predef']); + unset($_POST['fournprice_predef']); + unset($_POST['buying_price_predef']); + unset($_POST['np_marginRate_predef']); + unset($_POST['np_markRate_predef']); + unset($_POST['np_desc']); } else { @@ -807,8 +872,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' // Clean parameters $date_start=''; $date_end=''; - $date_start=dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - $date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description=dol_htmlcleanlastbr(GETPOST('product_desc')); $pu_ht=GETPOST('price_ht'); $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); @@ -826,6 +891,19 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + //Extrafields Lines + $extrafieldsline = new ExtraFields($db); + $extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline); + //Unset extrafield POST Data + if (is_array($extralabelsline)) + { + foreach ($extralabelsline as $key => $value) + { + unset($_POST["options_".$key]); + } + } + // Check minimum price $productid = GETPOST('productid', 'int'); if (! empty($productid)) @@ -843,7 +921,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) { - setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); + setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors'); $error++; } } @@ -879,7 +957,9 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' 0, $fournprice, $buyingprice, - $label + $label, + 0, + $array_option ); if ($result >= 0) @@ -931,8 +1011,18 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co { $idwarehouse=GETPOST('idwarehouse'); + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + // Check parameters - if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == -1) { @@ -967,8 +1057,18 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) { $idwarehouse=GETPOST('idwarehouse'); + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + // Check parameters - if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == -1) { @@ -1005,15 +1105,27 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) { $result = $object->cloture($user); - if ($result < 0) $mesgs=$object->errors; + if ($result < 0) { + setEventMessage($object->error, 'errors'); + } } else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande->valider) { $idwarehouse=GETPOST('idwarehouse'); + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + // Check parameters - if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == -1) { @@ -1026,6 +1138,10 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->comm if (! $error) { $result = $object->cancel($idwarehouse); + + if ($result < 0) { + setEventMessage($object->error, 'errors'); + } } } @@ -1079,14 +1195,11 @@ else if ($action == 'builddoc') // In get or post { /* * Generate order document - * define into /core/modules/commande/modules_commande.php - */ + * define into /core/modules/commande/modules_commande.php + */ - // Sauvegarde le dernier modele choisi pour generer un document - if ($_REQUEST['model']) - { - $object->setDocModel($user, $_REQUEST['model']); - } + // Save last template used to generate document + if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); // Define output language $outputlangs = $langs; @@ -1105,11 +1218,6 @@ else if ($action == 'builddoc') // In get or post dol_print_error($db,$result); exit; } - else - { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); - exit; - } } // Remove file in doc form @@ -1130,23 +1238,24 @@ else if ($action == 'remove_file') } // Print file -else if ($action == 'print_file' AND $user->rights->printipp->use) +else if ($action == 'print_file' AND $user->rights->printipp->read) { require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php'; $printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD); $printer->print_file(GETPOST('file','alpha'),GETPOST('printer','alpha')); + setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file'))); + $action=''; } else if ($action == 'update_extras') { // Fill array 'array_options' with data from update form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + if($ret < 0) $error++; - if($ret < 0) - $error++; - - if(!$error) { + if (! $error) + { // Actions on extra fields (by external module or standard code) // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('orderdao')); @@ -1154,22 +1263,16 @@ else if ($action == 'update_extras') $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result=$object->insertExtraFields(); + if ($result < 0) { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } else if ($reshook < 0) $error++; } - else - { - $action = 'edit_extras'; - } + if ($error) $action = 'edit_extras'; } /* @@ -1418,7 +1521,7 @@ if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->righ /* * View -*/ + */ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'); @@ -1429,9 +1532,9 @@ $formorder = new FormOrder($db); /********************************************************************* * -* Mode creation -* -*********************************************************************/ + * Mode creation + * + *********************************************************************/ if ($action == 'create' && $user->rights->commande->creer) { print_fiche_titre($langs->trans('CreateOrder')); @@ -1476,6 +1579,10 @@ if ($action == 'create' && $user->rights->commande->creer) if (empty($objectsrc->lines) && method_exists($objectsrc,'fetch_lines')) $objectsrc->fetch_lines(); $objectsrc->fetch_thirdparty(); + //Replicate extrafields + $objectsrc->fetch_optionals($originid); + $object->array_options=$objectsrc->array_options; + $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); $ref_client = (!empty($objectsrc->ref_client)?$objectsrc->ref_client:''); @@ -1486,7 +1593,7 @@ if ($action == 'create' && $user->rights->commande->creer) $demand_reason_id = (!empty($objectsrc->demand_reason_id)?$objectsrc->demand_reason_id:(!empty($soc->demand_reason_id)?$soc->demand_reason_id:0)); $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; $datedelivery = (!empty($objectsrc->date_livraison)?$objectsrc->date_livraison:''); @@ -1505,7 +1612,7 @@ if ($action == 'create' && $user->rights->commande->creer) $demand_reason_id = $soc->demand_reason_id; $remise_percent = $soc->remise_percent; $remise_absolue = 0; - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; $projectid = 0; } $absolute_discount=$soc->getAvailableDiscounts(); @@ -1518,7 +1625,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; print '' ."\n"; - print ''; + print ''; print ''; print ''; @@ -1562,7 +1669,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Ligne info remises tiers print '
    '.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; $absolute_discount=$soc->getAvailableDiscounts(); @@ -1581,7 +1688,7 @@ if ($action == 'create' && $user->rights->commande->creer) if (empty($datedelivery)) { if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); - else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; } $form->select_date($datedelivery,'liv_','','','',"crea_commande",1,1); print "
    '.$langs->trans('Project').''; - $numprojet=select_projects($soc->id,$projectid); + $numprojet=$formproject->select_projects($soc->id,$projectid); if ($numprojet==0) { print '   '.$langs->trans("AddProject").''; @@ -1720,7 +1829,7 @@ if ($action == 'create' && $user->rights->commande->creer) print $form->select_produits('','idprod'.$i,'',$conf->product->limit_size); print '%
    %
    '; @@ -1808,8 +1917,19 @@ else $text.='
    '; $text.=$notify->confirmMessage('ORDER_VALIDATE',$object->socid); } + + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + $formquestion=array(); - if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; @@ -1818,7 +1938,7 @@ else //'text' => $langs->trans("ConfirmClone"), //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1))); } $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220); @@ -1827,9 +1947,19 @@ else // Confirm back to draft status if ($action == 'modif') { + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + $text=$langs->trans('ConfirmUnvalidateOrder',$object->ref); $formquestion=array(); - if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; @@ -1838,7 +1968,7 @@ else //'text' => $langs->trans("ConfirmClone"), //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1))); } $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220); @@ -1855,12 +1985,22 @@ else /* * Confirmation de l'annulation - */ + */ if ($action == 'cancel') { + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + $text=$langs->trans('ConfirmCancelOrder',$object->ref); $formquestion=array(); - if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; @@ -1869,7 +2009,7 @@ else //'text' => $langs->trans("ConfirmClone"), //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1))); } $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1); @@ -1877,7 +2017,7 @@ else /* * Confirmation de la suppression d'une ligne produit - */ + */ if ($action == 'ask_deleteline') { $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); @@ -1974,7 +2114,7 @@ else $addcreditnote=''.$langs->trans("AddCreditNote").''; print '
    '.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); @@ -2151,24 +2291,29 @@ else print '
    '; + print $langs->trans('OutstandingBill'); + print ''; + print price($soc->get_OutstandingBill()).' / '; + print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency); + print '
    '; - print ''; - print ''; - print '
    '.img_picto('','edit').' '.$langs->trans('Modify').'
    '; + print '
    '; // Show object lines if (! empty($object->lines)) $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1); + $numlines = count($object->lines); + /* * Form to add new line - */ + */ if ($object->statut == 0 && $user->rights->commande->creer) { if ($action != 'editline') @@ -2325,7 +2471,10 @@ else } } print '
    '; - print ''; + + print "\n"; + + dol_fiche_end(); /* @@ -2342,13 +2491,16 @@ else { print ''; } - // Edit if ($object->statut == 1 && $user->rights->commande->creer) { print ''; } - + // Create event + if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + { + print ''.$langs->trans("AddAction").''; + } // Send if ($object->statut > 0) { @@ -2411,15 +2563,15 @@ else print ''; } - // Create bill and Classify billed - if (! empty($conf->facture->enabled) && $object->statut > 0 && ! $object->billed) + // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" + if ($object->statut > 0 && ! $object->billed) { - if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) + if (! empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { print ''; } - if ($user->rights->commande->creer && $object->statut > 2 && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORsKFLOW_BILL_ON_SHIPMENT)) + if ($user->rights->commande->creer && $object->statut > 2 && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { print ''; } @@ -2478,9 +2630,7 @@ else $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed=$user->rights->commande->creer; $delallowed=$user->rights->commande->supprimer; - $printer = false; - if ($user->rights->printipp->use AND $conf->printipp->enabled) $printer = true; - $somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$printer); + $somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); /* * Linked object block @@ -2551,7 +2701,14 @@ else $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -2559,6 +2716,7 @@ else // Tableau des substitutions $formmail->substit['__ORDERREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index d9f5cca0415..2327c2063be 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -70,7 +70,7 @@ print ''; print '
    '.$langs->trans("SearchOrder").'
    '; print $langs->trans("Ref").':
    '.$langs->trans("Other").':
    '.$langs->trans("Other").':

    \n"; @@ -194,7 +194,7 @@ if (! empty($conf->commande->enabled)) { $var=!$var; $obj = $db->fetch_object($resql); - print "
    '; print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'
    '; $commandestatic->id=$obj->rowid; @@ -315,7 +315,7 @@ if (! empty($conf->commande->enabled)) { $var=!$var; $obj = $db->fetch_object($resql); - print "
    '; $commandestatic->id=$obj->rowid; @@ -386,7 +386,7 @@ if (! empty($conf->commande->enabled)) { $var=!$var; $obj = $db->fetch_object($resql); - print "
    '; $commandestatic->id=$obj->rowid; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 481a01b8980..2e96a5451d4 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -68,10 +69,16 @@ $limit = $conf->liste_limit; $viewstatut=GETPOST('viewstatut'); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('orderlist')); + /* * Actions */ +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook + // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) { @@ -105,7 +112,7 @@ $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Ped llxHeader('',$langs->trans("Orders"),$help_url); $sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; -$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee'; +$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ', '.MAIN_DB_PREFIX.'commande as c'; // We'll need this table joined to the select in order to filter by sale @@ -119,13 +126,12 @@ $sql.= ' WHERE c.fk_soc = s.rowid'; $sql.= ' AND c.entity = '.$conf->entity; if ($socid) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($sref) -{ - $sql.= " AND c.ref LIKE '%".$db->escape($sref)."%'"; +if ($sref) { + $sql .= natural_search('c.ref', $sref); } if ($sall) { - $sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')"; + $sql .= natural_search(array('c.ref', 'c.note_private'), $sall); } if ($viewstatut <> '') { @@ -181,7 +187,7 @@ else if ($deliveryyear > 0) } if (!empty($snom)) { - $sql.= ' AND s.nom LIKE \'%'.$db->escape($snom).'%\''; + $sql .= natural_search('s.nom', $snom); } if (!empty($sref_client)) { @@ -194,6 +200,15 @@ if ($search_user > 0) } $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; + +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + $sql.= $db->plimit($limit + 1,$offset); //print $sql; @@ -239,7 +254,7 @@ if ($resql) if ($search_sale > 0) $param.='&search_sale='.$search_sale; $num = $db->num_rows($resql); - print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); + print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); $i = 0; // Lignes des champs de filtre @@ -274,8 +289,8 @@ if ($resql) print '
    '; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; - print ''; - print ' '; + print ' '; print ' '; print ' '; print ''; - print ''; + print ''; print '
    '; + print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_valid),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); + if(!empty($objp->note_private)) + { + print ' '; + print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + print ''; + } print ''; @@ -330,6 +354,9 @@ if ($resql) print ''.$objp->ref_client.''.$objp->ref_client.'
    '; - print ''; // Payment term - print ''; // Payment mode @@ -419,11 +426,30 @@ if ($action == 'create' && empty($mesgs)) // Project if (! empty($conf->projet->enabled)) { + $formproject=new FormProjets($db); + $langs->load('projects'); print ''; } + + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $objectsrc = new Commande($db); + $listoforders = array(); + foreach ($selected as $sel) + { + $result=$objectsrc->fetch($sel); + if ($result > 0) + { + $listoforders[] = $objectsrc->ref; + } + } + + // Other attributes + $parameters=array('objectsrc' => $objectsrc, 'idsrc' => $listoforders, 'colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + // Modele PDF print ''; print ''; // Private note @@ -588,7 +603,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) //SEARCH BUTTON print '\n"; print "
    '; + print ''; print '
    '; print $langs->trans('RefCustomer').''; print '
    '; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 93a4db53fbb..7411d3a9368 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Andreu Bisquerra Gaya @@ -34,7 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} $langs->load('orders'); $langs->load('deliveries'); @@ -78,6 +80,12 @@ if ($action == 'create') } } +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager=new HookManager($db); +$hookmanager->initHooks(array('orderstoinvoice')); + + /* * Actions */ @@ -88,9 +96,8 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; - if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - } + if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $langs->load('bills'); $langs->load('products'); $langs->load('main'); @@ -119,7 +126,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $lineid = GETPOST('lineid','int'); $userid = GETPOST('userid','int'); $search_ref = GETPOST('sf_ref')?GETPOST('sf_ref'):GETPOST('search_ref'); - $closeOrders = GETPOST('autocloseorders') != '' ? true : false; + $closeOrders = GETPOST('autocloseorders') ? true : false; // Security check $fieldid = GETPOST('ref','alpha')?'facnumber':'rowid'; @@ -200,18 +207,19 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) while ($ii < $nn) { - dol_include_once('/commande/class/commande.class.php'); - $srcobject = new Commande($db); + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $objectsrc = new Commande($db); dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); - $result=$srcobject->fetch($orders_id[$ii]); + $result=$objectsrc->fetch($orders_id[$ii]); if ($result > 0) { - if($closeOrders) { - $srcobject->classer_facturee(); - $srcobject->setStatut(3); + if ($closeOrders) + { + $objectsrc->classifyBilled(); + $objectsrc->setStatut(3); } - $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); + $lines = $objectsrc->lines; + if (empty($lines) && method_exists($objectsrc,'fetch_lines')) $lines = $objectsrc->fetch_lines(); $fk_parent_line=0; $num=count($lines); for ($i=0;$i<$num;$i++) @@ -261,7 +269,6 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $fk_parent_line = 0; } $result = $object->addline( - $id, $desc, $lines[$i]->subprice, $lines[$i]->qty, @@ -278,7 +285,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) 'HT', 0, $product_type, - $lines[$i]->rang, + $ii, $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, @@ -306,7 +313,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) } else { - $mesgs[]=$srcobject->error; + $mesgs[]=$objectsrc->error; $error++; } $ii++; @@ -366,7 +373,7 @@ if ($action == 'create' && empty($mesgs)) $remise_percent = $soc->remise_percent; } $remise_absolue = 0; - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; $absolute_discount=$soc->getAvailableDiscounts(); print '
    '; @@ -406,10 +413,10 @@ if ($action == 'create' && empty($mesgs)) // Date invoice print '
    '.$langs->trans('Date').''; - $html->select_date(0,'','','','',"add",1,1); + $html->select_date('','','','','',"add",1,1); print '
    '.$langs->trans('PaymentConditionsShort').''; + print '
    '.$langs->trans('PaymentConditionsShort').''; $html->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id'); print '
    '.$langs->trans('Project').''; - select_projects($soc->id, $projectid, 'projectid'); + $formproject->select_projects($soc->id, $projectid, 'projectid'); print '
    '.$langs->trans('Model').''; @@ -438,18 +464,7 @@ if ($action == 'create' && empty($mesgs)) print ''; print '
    '; - print ''; + print ''; //ALL/NONE print ''; @@ -682,4 +697,4 @@ dol_htmloutput_mesg($mesg,$mesgs); llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index d6e1d471139..45d242bd4e5 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -1,6 +1,6 @@ - * Copyright (c) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * @@ -52,7 +52,9 @@ $startyear=$year-1; $endyear=$year; $langs->load('orders'); +$langs->load('companies'); $langs->load('other'); +$langs->load('suppliers'); /* @@ -70,7 +72,7 @@ if ($mode == 'customer') } if ($mode == 'supplier') { - $title=$langs->trans("OrdersStatisticsSuppliers"); + $title=$langs->trans("OrdersStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; $dir=$conf->fournisseur->dir_output.'/commande/temp'; } @@ -248,7 +250,7 @@ print '
    '; print ''; print ''; print ''; - print ''; + print ''; // Company print ''; - print ''; + print ''; print ''; print ''; @@ -297,7 +299,7 @@ foreach ($data as $val) } print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index b16c0304b46..2cdda511bdb 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -50,7 +50,7 @@ $confirm=GETPOST('confirm','alpha'); $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :'')); $fieldtype = (! empty($ref) ? 'ref' :'rowid'); if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype); +$result=restrictedArea($user,'banque',$fieldvalue,'bank_account&bank_account','','',$fieldtype); $paiementtype=GETPOST('paiementtype','alpha',3); $req_nb=GETPOST("req_nb",'',3); @@ -64,8 +64,8 @@ $page=GETPOST('page','int'); $negpage=GETPOST('negpage','int'); if ($negpage) { - $page=$_GET["nbpage"] - $negpage; - if ($page > $_GET["nbpage"]) $page = $_GET["nbpage"]; + $page=GETPOST("nbpage") - $negpage; + if ($page > GETPOST("nbpage")) $page = GETPOST("nbpage"); } $mesg=''; @@ -104,6 +104,7 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user); if ($insertid > 0) { + setEventMessage($langs->trans("RecordSaved")); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id."&action=addline"); exit; } @@ -269,6 +270,7 @@ if ($id > 0 || ! empty($ref)) $head=bank_prepare_head($object); dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account'); + print '
    '.$langs->trans("Filter").'
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; @@ -288,7 +290,7 @@ foreach ($data as $val) { // If we have empty year $oldyear--; print '
    '.$oldyear.'0?'&userid='.$userid:'').'">'.$oldyear.'00
    '.$year.'0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
    '; $linkback = ''.$langs->trans("BackToList").''; @@ -292,36 +294,41 @@ if ($id > 0 || ! empty($ref)) /** * Search form */ - $param.='&account='.$object->id; + $param.='&account='.$object->id.'&vline='.$vline; // Confirmation delete if ($action == 'delete') { $text=$langs->trans('ConfirmDeleteTransaction'); - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete'); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete'); + } // Define transaction list navigation string - $navig = '
    '; - //print 'nbpage='.$totalPages.' viewline='.$viewline.' limitsql='.$limitsql; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $navig ='
    '; if ($limitsql > $viewline) $navig.=''.img_previous().''; $navig.= ' "; // ' Page '; $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; $navig.='/'.$totalPages.' '; if ($total_lines > $limitsql ) { $navig.= ''.img_next().''; } - $navig.='
    '; + $navig.='
    '; + //var_dump($navig); print '
    '; @@ -335,12 +342,6 @@ if ($id > 0 || ! empty($ref)) // Form to add a transaction with no invoice if ($user->rights->banque->modifier && $action == 'addline') { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; print ''; print ''; @@ -421,9 +422,9 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - print ''; + print ''; print "\n"; - print "\n"; + /* * Another solution @@ -432,7 +433,7 @@ if ($id > 0 || ! empty($ref)) */ $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; - $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; + $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_bordereau,"; $sql.= " ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel"; if ($mode_search) { @@ -519,15 +520,21 @@ if ($id > 0 || ! empty($ref)) print "\n"; // Payment type - print "\n"; // Num - print '\n"; + print '\n"; // Description print '
    '.$langs->trans("AddBankRecordLong").'
     
    "; + print ''; $label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type; if ($objp->fk_type == 'SOLD') $label=' '; + if ($objp->fk_type == 'CHQ' && $objp->fk_bordereau > 0) { + dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php'); + $bordereaustatic = new RemiseCheque($db); + $bordereaustatic->id = $objp->fk_bordereau; + $label .= ' '.$bordereaustatic->getNomUrl(2); + } print $label; print "'.($objp->num_chq?$objp->num_chq:"")."'.($objp->num_chq?$objp->num_chq:"")."'; @@ -548,35 +555,31 @@ if ($id > 0 || ! empty($ref)) if ($links[$key]['type']=='payment') { $paymentstatic->id=$links[$key]['url_id']; + $paymentstatic->ref=$links[$key]['url_id']; print ' '.$paymentstatic->getNomUrl(2); } - else if ($links[$key]['type']=='payment_supplier') + elseif ($links[$key]['type']=='payment_supplier') { $paymentsupplierstatic->id=$links[$key]['url_id']; $paymentsupplierstatic->ref=$links[$key]['url_id']; print ' '.$paymentsupplierstatic->getNomUrl(2); } - else if ($links[$key]['type']=='company') + elseif ($links[$key]['type']=='payment_sc') { - - } - else if ($links[$key]['type']=='payment_sc') - { - //print ' - '; print ''; print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; //print $langs->trans("SocialContributionPayment"); print ''; } - else if ($links[$key]['type']=='payment_vat') + elseif ($links[$key]['type']=='payment_vat') { $paymentvatstatic->id=$links[$key]['url_id']; $paymentvatstatic->ref=$links[$key]['url_id']; print ' '.$paymentvatstatic->getNomUrl(2); } - else if ($links[$key]['type']=='banktransfert') + elseif ($links[$key]['type']=='banktransfert') { - // Do not show link to transfer ince there is no transfer card (avoid confusion). Can already be accessed from transaction detail. + // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. if ($objp->amount > 0) { $banklinestatic->fetch($links[$key]['url_id']); @@ -605,11 +608,15 @@ if ($id > 0 || ! empty($ref)) } //var_dump($links); } - else if ($links[$key]['type']=='member') + elseif ($links[$key]['type']=='company') { } - else if ($links[$key]['type']=='sc') + elseif ($links[$key]['type']=='member') + { + + } + elseif ($links[$key]['type']=='sc') { } @@ -764,7 +771,10 @@ if ($id > 0 || ! empty($ref)) print "
    "; - print "\n
    \n"; + print "\n"; + + dol_fiche_end(); + /* * Boutons actions @@ -778,7 +788,7 @@ if ($id > 0 || ! empty($ref)) { if ($user->rights->banque->consolidate) { - print ''.$langs->trans("Conciliate").''; + print ''.$langs->trans("Conciliate").''; } else { @@ -788,13 +798,20 @@ if ($id > 0 || ! empty($ref)) if ($action != 'addline') { - if ($user->rights->banque->modifier) + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print 'id.'&page='.$page.'">'.$langs->trans("AddBankRecord").''; + if ($user->rights->banque->modifier) + { + print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; + } + else + { + print ''.$langs->trans("AddBankRecord").''; + } } else { - print ''.$langs->trans("AddBankRecord").''; + print ''.$langs->trans("AddBankRecord").''; } } diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 3258adbb55d..ac857172470 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Charles-Fr BENKE * * 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 @@ -20,12 +21,13 @@ /** * \file htdocs/compta/bank/annuel.php * \ingroup banque - * \brief Page reporting mensuel Entrees/Sorties d'un compte bancaire + * \brief Page to report input-output of a bank account */ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $langs->load("banks"); $langs->load("categories"); @@ -278,6 +280,231 @@ print "
    "; +// BUILDING GRAPHICS + +$year = $year_end; + +$result=dol_mkdir($conf->banque->dir_temp); +if ($result < 0) +{ + $langs->load("errors"); + $error++; + $mesg='
    '.$langs->trans("ErrorFailedToCreateDir").'
    '; +} +else +{ + // Definition de $width et $height + $width = 480; + $height = 300; + + // Calcul de $min et $max + $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= " WHERE b.fk_account = ba.rowid"; + $sql.= " AND ba.entity = ".$conf->entity; + if ($id && $_GET["option"]!='all') $sql.= " AND b.fk_account IN (".$id.")"; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $min = $db->jdate($obj->min); + $max = $db->jdate($obj->max); + } + else + { + dol_print_error($db); + } + $log="graph.php: min=".$min." max=".$max; + dol_syslog($log); + +// CRED PART + // Chargement du tableau des années + $tblyear[0] = array(); + $tblyear[1] = array(); + $tblyear[2] = array(); + + for ($annee=0;$annee<3;$annee++) + { + $sql = "SELECT date_format(b.datev,'%m')"; + $sql.= ", SUM(b.amount)"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= " WHERE b.fk_account = ba.rowid"; + $sql.= " AND ba.entity = ".$conf->entity; + $sql.= " AND b.datev >= '".($year-$annee)."-01-01 00:00:00'"; + $sql.= " AND b.datev <= '".($year-$annee)."-12-31 23:59:59'"; + $sql.= " AND b.amount > 0"; + if ($id && $_GET["option"]!='all') $sql.= " AND b.fk_account IN (".$id.")"; + $sql .= " GROUP BY date_format(b.datev,'%m');"; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($resql); + $tblyear[$annee][$row[0]] = $row[1]; + $i++; + } + $db->free($resql); + + } + else + { + dol_print_error($db); + } + } + // Chargement de labels et data_xxx pour tableau 4 Mouvements + $labels = array(); + $data_year_0 = array(); + $data_year_1 = array(); + $data_year_2 = array(); + + for ($i = 0 ; $i < 12 ; $i++) + { + $data_year_0[$i] = isset($tblyear[0][substr("0".($i+1),-2)]) ? $tblyear[0][substr("0".($i+1),-2)] : 0; + $data_year_1[$i] = isset($tblyear[1][substr("0".($i+1),-2)]) ? $tblyear[1][substr("0".($i+1),-2)] : 0; + $data_year_2[$i] = isset($tblyear[2][substr("0".($i+1),-2)]) ? $tblyear[2][substr("0".($i+1),-2)] : 0; + $labels[$i] = dol_print_date(dol_mktime(12,0,0,$i+1,1,2000),"%b"); + $datamin[$i] = 0; + } + + // Fabrication tableau 4b + $file= $conf->banque->dir_temp."/credmovement".$id."-".$year.".png"; + $fileurl=DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/credmovement".$id."-".$year.".png"; + $title=$langs->transnoentities("Credit").' - '.$langs->transnoentities("Year").': '.($year-2).' - '.($year-1)." - ".$year; + $graph_datas=array(); + for($i=0;$i<12;$i++) + { + $graph_datas[$i]=array($labels[$i], $data_year_0[$i], $data_year_1[$i], $data_year_2[$i]); + } + + $px1 = new DolGraph(); + $px1->SetData($graph_datas); + $px1->SetLegend(array(($year),($year-1),($year-2))); + $px1->SetLegendWidthMin(180); + $px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue()); + $px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue()); + $px1->SetTitle($title); + $px1->SetWidth($width); + $px1->SetHeight($height); + $px1->SetType(array('line','line','line')); + $px1->SetShading(3); + $px1->setBgColor('onglet'); + $px1->setBgColorGrid(array(255,255,255)); + $px1->SetHorizTickIncrement(1); + $px1->SetPrecisionY(0); + $px1->draw($file,$fileurl); + + $show1 = $px1->show(); + + unset($graph_datas); + unset($px1); + unset($tblyear[0]); + unset($tblyear[1]); + unset($tblyear[2]); + +// DEDBT PART + // Chargement du tableau des années + $tblyear[0] = array(); + $tblyear[1] = array(); + $tblyear[2] = array(); + + for ($annee=0;$annee<3;$annee++) + { + $sql = "SELECT date_format(b.datev,'%m')"; + $sql.= ", SUM(b.amount)"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= " WHERE b.fk_account = ba.rowid"; + $sql.= " AND ba.entity = ".$conf->entity; + $sql.= " AND b.datev >= '".($year-$annee)."-01-01 00:00:00'"; + $sql.= " AND b.datev <= '".($year-$annee)."-12-31 23:59:59'"; + $sql.= " AND b.amount < 0"; + if ($id && $_GET["option"]!='all') $sql.= " AND b.fk_account IN (".$id.")"; + $sql .= " GROUP BY date_format(b.datev,'%m');"; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($resql); + $tblyear[$annee][$row[0]] = abs($row[1]); + $i++; + } + $db->free($resql); + } + else + { + dol_print_error($db); + } + } + // Chargement de labels et data_xxx pour tableau 4 Mouvements + $labels = array(); + $data_year_0 = array(); + $data_year_1 = array(); + $data_year_2 = array(); + + for ($i = 0 ; $i < 12 ; $i++) + { + $data_year_0[$i] = isset($tblyear[0][substr("0".($i+1),-2)]) ? $tblyear[0][substr("0".($i+1),-2)] : 0; + $data_year_1[$i] = isset($tblyear[1][substr("0".($i+1),-2)]) ? $tblyear[1][substr("0".($i+1),-2)] : 0; + $data_year_2[$i] = isset($tblyear[2][substr("0".($i+1),-2)]) ? $tblyear[2][substr("0".($i+1),-2)] : 0; + $labels[$i] = dol_print_date(dol_mktime(12,0,0,$i+1,1,2000),"%b"); + $datamin[$i] = 0; + } + + $file= $conf->banque->dir_temp."/debmovement".$id."-".$year.".png"; + $fileurl= DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/debmovement".$id."-".$year.".png"; + $title=$langs->transnoentities("Debit").' - '.$langs->transnoentities("Year").': '.($year-2).' - '.($year-1)." - ".$year; + $graph_datas=array(); + for($i=0;$i<12;$i++) + { + $graph_datas[$i]=array($labels[$i], $data_year_0[$i], $data_year_1[$i], $data_year_2[$i]); + } + + $px2 = new DolGraph(); + $px2->SetData($graph_datas); + $px2->SetLegend(array(($year),($year-1),($year-2))); + $px2->SetLegendWidthMin(180); + $px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue()); + $px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue()); + $px2->SetTitle($title); + $px2->SetWidth($width); + $px2->SetHeight($height); + $px2->SetType(array('line','line','line')); + $px2->SetShading(3); + $px2->setBgColor('onglet'); + $px2->setBgColorGrid(array(255,255,255)); + $px2->SetHorizTickIncrement(1); + $px2->SetPrecisionY(0); + $px2->draw($file,$fileurl); + + $show2 = $px2->show(); + + unset($graph_datas); + unset($px2); + unset($tblyear[0]); + unset($tblyear[1]); + unset($tblyear[2]); + + print '
    '; + print $show1; + print '
    '; + print $show2; + print '
    '; + print '
    '; +} + + print "\n\n"; llxFooter(); diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index dbe67212f37..d193ff83b59 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -43,7 +43,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"])) } $fieldid = isset($_GET["ref"])?'ref':'rowid'; if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid); +$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid); /* @@ -130,8 +130,8 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') // Confirmation de la suppression if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); + } @@ -171,38 +171,71 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') print '
    '.$langs->trans("BankAccountCountry").''; $img=picto_from_langcode($account->country_code); print $img?$img.' ':''; - print getCountry($account->getCountryCode(),0,$db); + print getCountry($account->getCountryCode(), 0, $db); print "
    '.$langs->trans("BankName").''.$account->bank.'
    '.$langs->trans("BankCode").''.$account->code_banque.'
    '.$langs->trans("DeskCode").''.$account->code_guichet.'
    '.$langs->trans("BankCode").''.$account->code_banque.'
    '.$langs->trans("BankAccountNumber").''.$account->number.'
    '.$langs->trans("BankAccountNumberKey").''.$account->cle_rib.'
    '.$langs->trans("BankCode").''.$account->code_banque.'
    '.$langs->trans("DeskCode").''.$account->code_guichet.'
    '.$langs->trans("BankCode").''.$account->code_banque.'
    '.$langs->trans("BankAccountNumber").''.$account->number.'
    '.$langs->trans("BankAccountNumberKey").''.$account->cle_rib.'
    '.$langs->trans("BankAccountCountry").''; + $img=picto_from_langcode($account->country_code); + print $img?$img.' ':''; + print getCountry($account->getCountryCode(), 0, $db); + print "
    '.$langs->trans("BankName").'
    '.$langs->trans("BankCode").'
    '.$langs->trans("DeskCode").'
    '.$langs->trans("BankCode").'
    '.$langs->trans("BankAccountNumber").'
    '.$langs->trans("BankAccountNumberKey").'
    '.$langs->trans("BankCode").'
    '.$langs->trans("DeskCode").'
    '.$langs->trans("BankCode").'
    '.$langs->trans("BankAccountNumber").'
    '.$langs->trans("BankAccountNumberKey").'
    '.$langs->trans("BankAccountCountry").''; - print getCountry($account->getCountryCode()); - print "
    '.$langs->trans("BankAccountOwner").''; print '
    '; - print '   '; - print '
    '; + print '
    '; + + print '
    '; + print ''; + print '   '; + print '
    '; + print ''; } diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index a5e6605ad85..e3942381d1e 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -69,22 +69,22 @@ print "
    Somme des paiements (associes a une facture)".price($paiem)."
    Somme des paiements (associes a une facture)".price($paiem)."
    Somme des credits".price($credits)."
    Somme des credits".price($credits)."
    Somme des debits".price($debits)."
    Somme des debits".price($debits)."
    ".$langs->trans("BankBalance")."".price($solde)."
    ".$langs->trans("BankBalance")."".price($solde)."
    "; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 0ce66ded189..94370d699e6 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2013 Charles-Fr BENKE * * 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 @@ -29,28 +30,30 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); +$action=GETPOST('action'); + if (!$user->rights->banque->configurer) accessforbidden(); /* -* Actions ajout cat�gorie -*/ -if ($_POST["action"] == 'add') + * Add category + */ +if (GETPOST('add')) { - if ($_POST["label"]) + if (GETPOST("label")) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_categ ("; $sql.= "label"; $sql.= ", entity"; $sql.= ") VALUES ("; - $sql.= "'".$db->escape($_POST["label"])."'"; + $sql.= "'".$db->escape(GETPOST("label"))."'"; $sql.= ", ".$conf->entity; $sql.= ")"; + dol_syslog("sql=".$sql); $result = $db->query($sql); - if (!$result) { dol_print_error($db); @@ -59,18 +62,38 @@ if ($_POST["action"] == 'add') } /* -* Action suppression cat�gorie -*/ -if ( $_REQUEST['action'] == 'delete' ) + * Update category + */ +if (GETPOST('update')) { - if ( $_REQUEST['categid'] ) + if (GETPOST("label")) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_categ"; - $sql.= " WHERE rowid = '".$_REQUEST['categid']."'"; + $sql = "UPDATE ".MAIN_DB_PREFIX."bank_categ "; + $sql.= "set label='".$db->escape(GETPOST("label"))."'"; + $sql.= " WHERE rowid = '".GETPOST('categid')."'"; $sql.= " AND entity = ".$conf->entity; + dol_syslog("sql=".$sql); $result = $db->query($sql); + if (!$result) + { + dol_print_error($db); + } + } +} +/* +* Action suppression catégorie +*/ +if ($action == 'delete') +{ + if (GETPOST('categid')) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_categ"; + $sql.= " WHERE rowid = '".GETPOST('categid')."'"; + $sql.= " AND entity = ".$conf->entity; + dol_syslog("sql=".$sql); + $result = $db->query($sql); if (!$result) { dol_print_error($db); @@ -81,7 +104,7 @@ if ( $_REQUEST['action'] == 'delete' ) /* - * Affichage liste des cat�gories + * View */ llxHeader(); @@ -89,10 +112,9 @@ llxHeader(); print_fiche_titre($langs->trans("Rubriques")); - -print '
    '; +print ''; print ''; -print ""; + print ''; print ''; print ''; @@ -106,36 +128,57 @@ $sql.= " ORDER BY label"; $result = $db->query($sql); if ($result) { - $num = $db->num_rows($result); - $i = 0; $total = 0; + $num = $db->num_rows($result); + $i = 0; $total = 0; - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - print ''; - print ""; - print ''; - print ""; - $i++; - } - $db->free($result); + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ""; + print ''; + if (GETPOST("action") == 'edit' && GETPOST("categid")== $objp->rowid) + { + print ""; + } + else + { + print ""; + print ''; + } + print ""; + $i++; + } + $db->free($result); } +print ""; + /* - * Affichage ligne ajout de categorie + * Line to add category */ -$var=!$var; -print ""; -print ""; -print ''; -print "
    '.$langs->trans("Ref").''.$langs->trans("Label").'
    '.$objp->rowid.'$objp->label'.img_delete().'
    '.$objp->rowid.'"; + print ''; + print ''; + print ''; + + print "".$objp->label."'; + print ''.img_edit().'  '; + print ''.img_delete().'
     
    "; +if ($action != 'edit') +{ + $var=!$var; + print '
     
    "; - -$db->close(); +print ""; llxFooter(); + +$db->close(); ?> diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 4bdbb7a0587..97e7543a030 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -613,7 +613,7 @@ class Account extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON ba.fk_pays = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid'; - $sql.= " WHERE entity IN (".getEntity('bank_account', 1).')'; + $sql.= " WHERE entity IN (".getEntity($this->element, 1).")"; if ($id) $sql.= " AND ba.rowid = ".$id; if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'"; @@ -1436,18 +1436,21 @@ class AccountLine extends CommonObject if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTransaction"),'account').$lienfin.' '); $result.=$lien.$this->rowid.$lienfin; + if ($option == 'showall' || $option == 'showconciliated') $result.=' ('; if ($option == 'showall') { - $result.=' ('; $result.=$langs->trans("BankAccount").': '; $accountstatic=new Account($this->db); $accountstatic->id=$this->fk_account; $accountstatic->label=$this->bank_account_label; $result.=$accountstatic->getNomUrl(0).', '; + } + if ($option == 'showall' || $option == 'showconciliated') + { $result.=$langs->trans("BankLineConciliated").': '; $result.=yn($this->rappro); - $result.=')'; } + if ($option == 'showall' || $option == 'showconciliated') $result.=')'; return $result; } diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 62ef1957f45..47af3ca5086 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -44,7 +44,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"])) } $fieldid = isset($_GET["ref"])?'ref':'rowid'; if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid); +$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid); /* @@ -325,7 +325,7 @@ if ($action == 'create') print '
    '.$langs->trans("Date").''; - $form->select_date(time(), 're', 0, 0, 0, 'formsoc'); + $form->select_date('', 're', 0, 0, 0, 'formsoc'); print '
    '.$langs->trans("BalanceMinimalAllowed").'
    '; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 3954edf99ee..734cdd8eb83 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -41,7 +41,7 @@ if (isset($_GET["account"]) || isset($_GET["ref"])) } $fieldid = isset($_GET["ref"])?'ref':'rowid'; if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid); +$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid); $account=$_GET["account"]; $mode='standard'; @@ -202,6 +202,7 @@ else $datas[$i] = $solde + $subtotal; } $datamin[$i] = $acct->min_desired; + $dataall[$i] = $acct->min_allowed; //$labels[$i] = strftime("%d",$day); $labels[$i] = $xday; @@ -227,21 +228,24 @@ else $graph_datas=array(); foreach($datas as $i => $val) { - if ($acct->min_desired) $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i],$datamin[$i]); - else $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]); + $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]); + if ($acct->min_desired) array_push($graph_datas[$i],$datamin[$i]); + if ($acct->min_allowed) array_push($graph_datas[$i],$dataall[$i]); } $px1 = new DolGraph(); $px1->SetData($graph_datas); - if ($acct->min_desired) $px1->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired"))); - else $px1->SetLegend(array($langs->transnoentities("Balance"))); + $arraylegends=array($langs->transnoentities("Balance")); + if ($acct->min_desired) array_push($arraylegends,$langs->transnoentities("BalanceMinimalDesired")); + if ($acct->min_allowed) array_push($arraylegends,$langs->transnoentities("BalanceMinimalAllowed")); + $px1->SetLegend($arraylegends); $px1->SetLegendWidthMin(180); $px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue()); $px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue()); $px1->SetTitle($title); $px1->SetWidth($WIDTH); $px1->SetHeight($HEIGHT); - $px1->SetType(array('lines','lines')); + $px1->SetType(array('lines','lines','lines')); $px1->setBgColor('onglet'); $px1->setBgColorGrid(array(255,255,255)); $px1->SetHorizTickIncrement(1); @@ -253,6 +257,7 @@ else unset($px1); unset($datas); unset($datamin); + unset($dataall); unset($labels); unset($amounts); } @@ -319,6 +324,7 @@ else $labels = array(); $datas = array(); $datamin = array(); + $dataall = array(); $subtotal = 0; $now = time(); @@ -340,6 +346,7 @@ else $datas[$i] = $solde + $subtotal; } $datamin[$i] = $acct->min_desired; + $dataall[$i] = $acct->min_allowed; if ($xday == '15') { $labels[$i] = dol_print_date($day,"%b"); @@ -358,20 +365,23 @@ else $graph_datas=array(); foreach($datas as $i => $val) { - if ($acct->min_desired) $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i],$datamin[$i]); - else $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]); + $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]); + if ($acct->min_desired) array_push($graph_datas[$i],$datamin[$i]); + if ($acct->min_allowed) array_push($graph_datas[$i],$dataall[$i]); } $px2 = new DolGraph(); $px2->SetData($graph_datas); - if ($acct->min_desired) $px2->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired"))); - else $px2->SetLegend(array($langs->transnoentities("Balance"))); + $arraylegends=array($langs->transnoentities("Balance")); + if ($acct->min_desired) array_push($arraylegends,$langs->transnoentities("BalanceMinimalDesired")); + if ($acct->min_allowed) array_push($arraylegends,$langs->transnoentities("BalanceMinimalAllowed")); + $px2->SetLegend($arraylegends); $px2->SetLegendWidthMin(180); $px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue()); $px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue()); $px2->SetTitle($title); $px2->SetWidth($WIDTH); $px2->SetHeight($HEIGHT); - $px2->SetType(array('lines','lines')); + $px2->SetType(array('lines','lines','lines')); $px2->setBgColor('onglet'); $px2->setBgColorGrid(array(255,255,255)); $px2->SetHideXGrid(true); @@ -385,6 +395,7 @@ else unset($graph_datas); unset($datas); unset($datamin); + unset($dataall); unset($labels); unset($amounts); } @@ -430,7 +441,8 @@ else $labels = array(); $datas = array(); $datamin = array(); - + $dataall = array(); + $subtotal = 0; $day = $min; @@ -450,6 +462,7 @@ else $datas[$i] = '' + $solde + $subtotal; } $datamin[$i] = $acct->min_desired; + $dataall[$i] = $acct->min_allowed; if (substr($textdate,6,2) == '01' || $i == 0) { $labels[$i] = substr($textdate,4,2); @@ -467,20 +480,24 @@ else $graph_datas=array(); foreach($datas as $i => $val) { - if ($acct->min_desired) $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i],$datamin[$i]); - else $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]); + $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]); + if ($acct->min_desired) array_push($graph_datas[$i],$datamin[$i]); + if ($acct->min_allowed) array_push($graph_datas[$i],$dataall[$i]); } + $px3 = new DolGraph(); $px3->SetData($graph_datas); - if ($acct->min_desired) $px3->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired"))); - else $px3->SetLegend(array($langs->transnoentities("Balance"))); + $arraylegends=array($langs->transnoentities("Balance")); + if ($acct->min_desired) array_push($arraylegends,$langs->transnoentities("BalanceMinimalDesired")); + if ($acct->min_allowed) array_push($arraylegends,$langs->transnoentities("BalanceMinimalAllowed")); + $px3->SetLegend($arraylegends); $px3->SetLegendWidthMin(180); $px3->SetMaxValue($px3->GetCeilMaxValue()<0?0:$px3->GetCeilMaxValue()); $px3->SetMinValue($px3->GetFloorMinValue()>0?0:$px3->GetFloorMinValue()); $px3->SetTitle($title); $px3->SetWidth($WIDTH); $px3->SetHeight($HEIGHT); - $px3->SetType(array('lines','lines')); + $px3->SetType(array('lines','lines','lines')); $px3->setBgColor('onglet'); $px3->setBgColorGrid(array(255,255,255)); $px3->SetPrecisionY(0); @@ -492,6 +509,7 @@ else unset($graph_datas); unset($datas); unset($datamin); + unset($dataall); unset($labels); unset($amounts); } diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 87369430f45..00cd0b163ee 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -59,7 +59,7 @@ $accounts = array(); $sql = "SELECT rowid, courant, rappro"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; -$sql.= " WHERE entity IN (".getEntity('bank_account', 1).')'; +$sql.= " WHERE entity IN (".getEntity('bank_account', 1).")"; if ($statut != 'all') $sql.= " AND clos = 0"; $sql.= $db->order('label', 'ASC'); @@ -234,7 +234,6 @@ if (! $found) print ''; print "
    '.$langs->trans("None").' print '
    '.$langs->trans("Total").''.price($total).'
    "; -print "
    "; /* @@ -242,7 +241,7 @@ print "
    "; */ print '
    '."\n"; -if ($user->rights->banque->configurer) +if ($user->rights->banque->configurer) { print ''.$langs->trans("NewFinancialAccount").''; } diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index dcad7cd4f22..ef57d15d355 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -266,8 +266,8 @@ if ($result) // Confirmations if ($action == 'delete_categ') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1); + } print '
    '; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index e7b3b5ed917..4c04655ae65 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -20,11 +20,17 @@ /** * \file htdocs/compta/bank/releve.php * \ingroup banque - * \brief Page d'affichage d'un releve + * \brief Page to show a bank receipt report */ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); @@ -76,6 +82,14 @@ $pagenext = $page + 1; llxHeader(); $form = new Form($db); +$societestatic=new Societe($db); +$chargestatic=new ChargeSociales($db); +$memberstatic=new Adherent($db); +$paymentstatic=new Paiement($db); +$paymentsupplierstatic=new PaiementFourn($db); +$paymentvatstatic=new TVA($db); +$bankstatic=new Account($db); +$banklinestatic=new AccountLine($db); // Load account @@ -131,7 +145,7 @@ if (empty($num)) print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$acct->id, $sortfield, $sortorder,'',$numrows); print ''; - print ""; + print ''; print ''; //while ($i < min($numrows,$conf->liste_limit)) // retrait de la limite tant qu'il n'y a pas de pagination @@ -145,7 +159,7 @@ if (empty($num)) } else { - print "\n"; + print ''."\n"; } $i++; } @@ -252,16 +266,19 @@ else } // Recherche les ecritures pour le releve - $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv"; - $sql.= ", b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; + $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; + $sql.= " ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= ", ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.num_releve='".$db->escape($num)."'"; if (!isset($num)) $sql.= " OR b.num_releve is null"; $sql.= " AND b.fk_account = ".$acct->id; - $sql.= " ORDER BY b.datev ASC"; + $sql.= " AND b.fk_account = ba.rowid"; + $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day + dol_syslog("sql=".$sql); $result = $db->query($sql); - if ($result) { $var=True; @@ -278,7 +295,7 @@ else $total = $total + $objp->amount; $var=!$var; - print ""; + print ""; // Date operation print ''; @@ -292,10 +309,10 @@ else print img_next().''; print "\n"; - // Num cheque + // Type and num print ''; - // Libelle + // Description print ''; print ''; @@ -206,7 +206,7 @@ if ($resql) if ($printline) { $var=!$var; - print ""; + print ""; // Ref print '\n"; // Num - print '\n"; + print '\n"; // Description print ""; + print ""; if ($object->lines[$i]->fk_product > 0) { print '\n"; - // Date - print ''; + + // Date + print ''; // Date limit - print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; // Affiche statut de la facture print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 03af99cc6fd..f542fa9bbd9 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -211,7 +211,6 @@ if ($object->id > 0) } print ')'; } - // FIXME $facidnext not defined /* if ($facidnext > 0) { @@ -224,7 +223,7 @@ if ($object->id > 0) // Discounts print '"; + print ""; print '\n"; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 9dfd38c4a82..51747fe04d2 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (c) 2004-2012 Laurent Destailleur * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -226,7 +227,7 @@ print '
    '; print ''; print ''; print '
    '.$langs->trans("AccountStatement").'
    numr&account=".$acct->id."\">$objp->numr
    '.$objp->numr.'
    '.dol_print_date($db->jdate($objp->do),"day").''.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').''; $reg=array(); preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthese on tente recherche de traduction @@ -314,18 +331,60 @@ else else print '
    '; if ($links[$key]['type']=='payment') { - print '
    '; - print img_object($langs->trans('ShowPayment'),'payment').' '; - print $langs->trans("Payment"); + $paymentstatic->id=$links[$key]['url_id']; + $paymentstatic->ref=$langs->trans("Payment"); + print ' '.$paymentstatic->getNomUrl(1); + $newline=0; + } + elseif ($links[$key]['type']=='payment_supplier') + { + $paymentsupplierstatic->id=$links[$key]['url_id']; + $paymentsupplierstatic->ref=$langs->trans("Payment");; + print ' '.$paymentsupplierstatic->getNomUrl(1); + $newline=0; + } + elseif ($links[$key]['type']=='payment_sc') + { + print ''; + print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; + print $langs->trans("SocialContributionPayment"); print ''; $newline=0; } - elseif ($links[$key]['type']=='payment_supplier') { - print ''; - print img_object($langs->trans('ShowPayment'),'payment').' '; - print $langs->trans("Payment"); - print ''; - $newline=0; + elseif ($links[$key]['type']=='payment_vat') + { + $paymentvatstatic->id=$links[$key]['url_id']; + $paymentvatstatic->ref=$langs->trans("Payment"); + print ' '.$paymentvatstatic->getNomUrl(1); + } + elseif ($links[$key]['type']=='banktransfert') { + // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. + if ($objp->amount > 0) + { + $banklinestatic->fetch($links[$key]['url_id']); + $bankstatic->id=$banklinestatic->fk_account; + $bankstatic->label=$banklinestatic->bank_account_label; + print ' ('.$langs->trans("from").' '; + print $bankstatic->getNomUrl(1,'transactions'); + print ' '.$langs->trans("toward").' '; + $bankstatic->id=$objp->bankid; + $bankstatic->label=$objp->bankref; + print $bankstatic->getNomUrl(1,''); + print ')'; + } + else + { + $bankstatic->id=$objp->bankid; + $bankstatic->label=$objp->bankref; + print ' ('.$langs->trans("from").' '; + print $bankstatic->getNomUrl(1,''); + print ' '.$langs->trans("toward").' '; + $banklinestatic->fetch($links[$key]['url_id']); + $bankstatic->id=$banklinestatic->fk_account; + $bankstatic->label=$banklinestatic->bank_account_label; + print $bankstatic->getNomUrl(1,'transactions'); + print ')'; + } } elseif ($links[$key]['type']=='company') { print ''; @@ -334,34 +393,19 @@ else print ''; $newline=0; } - else if ($links[$key]['type']=='sc') { - print ''; - print img_object($langs->trans('ShowBill'),'bill').' '; - print $langs->trans("SocialContribution"); - print ''; - $newline=0; - } - else if ($links[$key]['type']=='payment_sc') { - print ''; - print img_object($langs->trans('ShowPayment'),'payment').' '; - print $langs->trans("SocialContributionPayment"); - print ''; - $newline=0; - } - else if ($links[$key]['type']=='member') { + elseif ($links[$key]['type']=='member') { print ''; print img_object($langs->trans('ShowMember'),'user').' '; print $links[$key]['label']; print ''; $newline=0; } - else if ($links[$key]['type']=='banktransfert') { - /* print ''; - print img_object($langs->trans('ShowTransaction'),'payment').' '; - print $langs->trans("TransactionOnTheOtherAccount"); - print ''; - $newline=0; - */ + elseif ($links[$key]['type']=='sc') { + print ''; + print img_object($langs->trans('ShowBill'),'bill').' '; + print $langs->trans("SocialContribution"); + print ''; + $newline=0; } else { print ''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index ea7d29beb0f..a94e2fc5cd0 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -42,7 +42,7 @@ $debit=GETPOST("debit"); $credit=GETPOST("credit"); $type=GETPOST("type"); $account=GETPOST("account"); -$bid=GETPOST("bid"); +$bid=GETPOST("bid","int"); $param=''; if ($description) $param.='&description='.$description; @@ -83,7 +83,7 @@ $sql.= " b.fk_account, b.fk_type,"; $sql.= " ba.rowid as bankid, ba.ref as bankref,"; $sql.= " bu.label as labelurl, bu.url_id"; $sql.= " FROM "; -if (! empty($_REQUEST["bid"])) $sql.= MAIN_DB_PREFIX."bank_class as l,"; +if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,"; $sql.= " ".MAIN_DB_PREFIX."bank_account as ba,"; $sql.= " ".MAIN_DB_PREFIX."bank as b"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND type = 'company'"; @@ -92,21 +92,21 @@ $sql.= " WHERE b.fk_account = ba.rowid"; $sql.= " AND ba.entity = ".$conf->entity; if (GETPOST("req_nb")) { - $sql.= " AND b.num_chq like '%".$db->escape(GETPOST("req_nb"))."%'"; + $sql.= " AND b.num_chq LIKE '%".$db->escape(GETPOST("req_nb"))."%'"; $param.='&req_nb='.urlencode(GETPOST("req_nb")); } if (GETPOST("thirdparty")) { - $sql.=" AND (COALESCE(s.nom,'') LIKE '%".$db->escape(GETPOST("thirdparty"))."%')"; + $sql.=" AND s.nom LIKE '%".$db->escape(GETPOST("thirdparty"))."%'"; $param.='&thirdparty='.urlencode(GETPOST("thirdparty")); } -if (! empty($_REQUEST["bid"])) +if ($bid) { - $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$_REQUEST["bid"]; + $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid; } -if(! empty($type)) +if (! empty($type)) { - $sql .= " AND b.fk_type = '" . $type ."' "; + $sql.= " AND b.fk_type = '".$db->escape($type)."' "; } // Search criteria amount $si=0; @@ -184,7 +184,7 @@ if ($resql) print '
    '; print ''; if (! empty($_REQUEST['bid'])) print ''; - print ''; + print ''; print '
    '; @@ -227,7 +227,7 @@ if ($resql) print "'.($objp->num_chq?$objp->num_chq:"")."'.($objp->num_chq?$objp->num_chq:"").""; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index af7078421a2..ffbf6be1ce9 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -42,7 +42,7 @@ if (isset($_GET["account"]) || isset($_GET["ref"])) } $fieldid = isset($_GET["ref"])?'ref':'rowid'; if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid); +$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid); $vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"]; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 2c26a5d6361..21d68d42663 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -65,28 +65,26 @@ llxHeader('',$langs->trans("TaxAndDividendsArea")); $title=$langs->trans("TaxAndDividendsArea"); if ($_GET["mode"] == 'sconly') $title=$langs->trans("SocialContributionsPayments"); -print_fiche_titre($title,($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":"")); +$param=''; +if (GETPOST("mode") == 'sconly') $param='&mode=sconly'; +if ($sortfield) $param.='&sortfield='.$sortfield; +if ($sortorder) $param.='&sortorder='.$sortorder; -if ($_GET["mode"] != 'sconly') +print_fiche_titre($title, ($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":"")); + +if ($year) $param.='&year='.$year; + +// Social contributions only +if (GETPOST("mode") != 'sconly') { print $langs->trans("DescTaxAndDividendsArea").'
    '; print "
    "; -} - -// Social contributions -if ($_GET["mode"] != 'sconly') -{ - print_titre($langs->trans("SocialContributionsPayments")); -} - -if ($_GET["mode"] == 'sconly') -{ - $param='&mode=sconly'; + print_fiche_titre($langs->trans("SocialContributionsPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); } print ''; -print ""; +print ''; print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="120"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder); @@ -110,10 +108,10 @@ if ($year > 0) // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; - $sql .= "OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; + $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= ")"; } -$sql.= $db->order($sortfield,$sortorder); +if (! preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); //$sql.= $db->plimit($limit+1,$offset); //print $sql; @@ -132,7 +130,7 @@ if ($resql) { $obj = $db->fetch_object($resql); $var = !$var; - print ""; + print ""; // Date $date=$obj->periode; if (empty($date)) $date=$obj->date_ech; @@ -184,18 +182,18 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') $tva = new Tva($db); - print_titre($langs->trans("VATPayments")); + print_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); - $sql = "SELECT f.rowid, f.amount, f.label, f.datev as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as f "; - $sql.= " WHERE f.entity = ".$conf->entity; + $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as pv"; + $sql.= " WHERE pv.entity = ".$conf->entity; if ($year > 0) { // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire - $sql.= " AND f.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " AND pv.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } - $sql.= " ORDER BY dm DESC"; + if (preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); $result = $db->query($sql); if ($result) @@ -205,12 +203,12 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') $total = 0 ; print '
    '; print ''; - print ''; - print ""; - print '"; - print '"; - print '"; - print '"; + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $var=1; while ($i < $num) @@ -220,19 +218,20 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') $total = $total + $obj->amount; $var=!$var; - print ""; + print ""; print ''."\n"; print "\n"; print '"; + // Ref payment $tva_static->id=$obj->rowid; $tva_static->ref=$obj->rowid; - print '\n"; + print '\n"; print '\n"; - print ""; + print '"; print "\n"; $i++; diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 96fd0231efb..4f6719adb14 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -173,7 +173,7 @@ if ($resql) print ''; print ''; print "\n"; @@ -185,7 +185,7 @@ if ($resql) $var=!$var; - print ""; + print ""; print ''; } else @@ -2075,6 +2199,7 @@ if ($action == 'create') $options.=''; } + // Show link for credit note $facids=$facturestatic->list_qualified_avoir_invoices($soc->id); if ($facids < 0) { @@ -2121,7 +2246,7 @@ if ($action == 'create') print ''."\n"; } - if ((empty($origin)) || (($origin=='propal') && (!empty($originid)))) + if ((empty($origin)) || ((($origin=='propal') || ($origin=='commande')) && (!empty($originid)))) { // Deposit print ''; - - // Conditions de reglement - print ''; - - // Date payment term - print ''; - - // Payment mode - print ''; - - // Amount - print ''; - print ''; - print ''; - print ''; - - // Amount Local Taxes - if ($mysoc->localtax1_assuj=="1" && $mysoc->useLocalTax(1)) //Localtax1 (example RE) - { - print ''; - print ''; - } - if ($mysoc->localtax2_assuj=="1" && $mysoc->useLocalTax(2)) //Localtax2 (example IRPF) - { - print ''; - print ''; - } - - // Revenue stamp - if ($selleruserevenustamp) // Test company use revenue stamp - { - print ''; - } - - // Total with tax - print ''; - - // Statut - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load('projects'); - print ''; - print ''; - print ''; - } - - // Other attributes - $res=$object->fetch_optionals($object->id,$extralabels); - $parameters=array('colspan' => ' colspan="2"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - - if ($action == 'edit_extras') - { - print ''; - print ''; - print ''; - print ''; - } - - foreach($extrafields->attribute_label as $key=>$label) - { - if ($action == 'edit_extras') { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - } else { - $value=$object->array_options["options_".$key]; - } - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } - } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->facture->creer) - { - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->facture->creer) - { - print ''; - } - } - } - } - - print '
    '.$langs->trans("PeriodEndDate").'".$langs->trans("Label")."'.$langs->trans("ExpectedToPay")."'.$langs->trans("RefPayment")."'.$langs->trans("DatePayment")."'.$langs->trans("PayedByThisPayment")."
    '.dol_print_date($db->jdate($obj->dm),'day').' ? ".$obj->label."'.price($obj->amount)."'.$tva_static->getNomUrl(1)."'.$tva_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->dm),'day')."".price($obj->amount)."'.price($obj->amount)."
    '; - print ''; + print ''; print '
    '; $thirdpartystatic->id=$obj->rowid; $thirdpartystatic->nom=$obj->nom; diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 66644cde848..b5ff84546fd 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -27,8 +27,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - * \class Deplacement - * \brief Class to manage trips and working credit notes + * Class to manage trips and working credit notes */ class Deplacement extends CommonObject { @@ -65,6 +64,9 @@ class Deplacement extends CommonObject { $this->db = $db; + $this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed'); + $this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed'); + return 1; } @@ -327,7 +329,6 @@ class Deplacement extends CommonObject } if ($mode == 4) { - //if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); } diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 9b07bccd7ae..fb9df1fcb37 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -71,29 +72,7 @@ $modulepart='trip'; * Actions */ -if (GETPOST('sendit','alpha') && ! empty($conf->global->MAIN_UPLOAD_DOC)) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - dol_add_file_process($upload_dir,0,1,'userfile'); -} - -// Delete -else if ($action == 'confirm_deletefile' && $confirm == 'yes') -{ - if ($object->id > 0) - { - $langs->load("other"); - $object->fetch_thirdparty(); - - $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } -} +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; /* @@ -141,28 +120,15 @@ if ($object->id) print ''; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '
    '; - } - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id,'',0,0,$user->rights->deplacement->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'deplacement',$param); + $modulepart = 'deplacement'; + $permission = $user->rights->deplacement->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { - print $langs->trans("UnkownError"); + print $langs->trans("ErrorUnknown"); } llxFooter(); diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 958aed0b90a..808d9163222 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php' require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -437,8 +436,8 @@ else if ($id) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete"); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete"); + } $soc = new Societe($db); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 1c94159d083..3ca0d70e156 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -60,7 +60,6 @@ llxHeader('',$langs->trans("ListOfFees"),$help_url); - $totalnb=0; $sql = "SELECT count(d.rowid) as nb, sum(d.km) as km, d.type"; $sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d"; @@ -90,13 +89,11 @@ if ($result) print_fiche_titre($langs->trans("ExpensesArea")); -print ''; - -// Left area -print ''; - print '\n"; $var=true; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 8c1b9e2d832..cd52ada8220 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -212,7 +212,7 @@ print '
    '; print ''; print ''; print '
    '; +print '
    '; +// Statistics print ''; print ''; print ''; @@ -124,8 +121,8 @@ print ''; print '
    '.$langs->trans("Statistics").'
    '; -// Right area -print '
    '; +print '
    '; + $max=10; @@ -191,6 +188,9 @@ if ($result) else dol_print_error($db); +print '
    '; + + llxFooter(); $db->close(); diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 330f493e6ba..94a3a26a0f3 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -119,7 +119,7 @@ if ($resql) print '
    '; print ' '; print ''; + print ''; print "
    '; -print ''; +print ''; // Company print '\n"; } @@ -414,9 +412,11 @@ if (! empty($id) && $action == 'edit') // Project if (! empty($conf->projet->enabled)) { + $formproject=new FormProjets($db); + $langs->load('projects'); print ''; } @@ -475,7 +475,7 @@ if (! empty($id) && $action != 'edit') print ''; - print "".''; + print "".''; print "'; - print '\n"; $var=True; diff --git a/htdocs/compta/dons/stats.php b/htdocs/compta/dons/stats.php index affbab7d56f..b2f71859831 100644 --- a/htdocs/compta/dons/stats.php +++ b/htdocs/compta/dons/stats.php @@ -63,12 +63,12 @@ if ($result) print ''; $var=!$var; - print ""; + print ""; print ''; $var=!$var; - print "".''; + print "".''; $var=!$var; - print "".''; + print "".''; print ""; print "
    '.$langs->trans("Filter").'
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; $filter=''; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index e04c6699848..b9cf534f8a5 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -30,7 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} $langs->load("companies"); $langs->load("donations"); @@ -215,35 +217,28 @@ if ($action == 'set_encaisse') */ if ($action == 'builddoc') { - $donation = new Don($db); - $donation->fetch($id); + $object = new Don($db); + $object->fetch($id); - if ($_REQUEST['model']) - { - $donation->setDocModel($user, $_REQUEST['model']); - } + // Save last template used to generate document + if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); // Define output language $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$donation->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - $result=don_create($db, $donation->id, '', $donation->modelpdf, $outputlangs); + $result=don_create($db, $object->id, '', $object->modelpdf, $outputlangs); if ($result <= 0) { dol_print_error($db,$result); exit; } - else - { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$donation->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); - exit; - } } @@ -317,9 +312,12 @@ if ($action == 'create') if (! empty($conf->projet->enabled)) { + + $formproject=new FormProjets($db); + // Si module projet actif print "
    ".$langs->trans("Project").""; - select_projects('',$_POST["projectid"],"projectid"); + $formproject->select_projects('',$_POST["projectid"],"projectid"); print "
    '.$langs->trans('Project').''; - select_projects(-1, (isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project), 'projectid'); + $formproject->select_projects(-1, (isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project), 'projectid'); print '
    '.$langs->trans("Comments").' :
    '; print nl2br($don->note_private).'
    '.$langs->trans("Amount").''.price($don->amount).' '.$langs->trans("Currency".$conf->currency).'
    '.$langs->trans("Amount").''.price($don->amount,0,$langs,0,0,-1,$conf->currency).'
    ".$langs->trans("PublicDonation").""; print yn($don->public); diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index 38ad764182d..f045e82be71 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -75,11 +76,11 @@ if (trim($search_ref) != '') } if (trim($search_company) != '') { - $sql.= ' AND d.societe LIKE \'%'.$db->escape(trim($search_company)) . '%\''; + $sql .= natural_search('d.societe', $search_company); } if (trim($search_name) != '') { - $sql.= ' AND d.lastname LIKE \'%'.$db->escape(trim($search_name)) . '%\' OR d.firstname LIKE \'%'.$db->escape(trim($search_name)) . '%\''; + $sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name); } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -143,7 +144,7 @@ if ($resql) print ''; print ' '; print ''; + print ''; print "
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.$langs->trans("DonationsNumber").''.$num.'
    '.$langs->trans("AmountTotal").''.price($total).'
    '.$langs->trans("AmountTotal").''.price($total).'
    '.$langs->trans("Average").''.price($total / ($num?$num:1)).'
    '.$langs->trans("Average").''.price($total / ($num?$num:1)).'
    "; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d225574d37e..07960ed2c2c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -6,9 +6,10 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2013 Jean-Francois FERRY - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -42,12 +43,15 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load('bills'); $langs->load('companies'); +$langs->load('compta'); $langs->load('products'); $langs->load('banks'); $langs->load('main'); @@ -575,14 +579,21 @@ else if ($action == 'confirm_canceled' && $confirm == 'yes') // Convertir en reduc else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer) { - $db->begin(); - $object->fetch($id); $object->fetch_thirdparty(); $object->fetch_lines(); - if (! $object->paye) // protection against multiple submit + // Check if there is already a discount (protection to avoid duplicate creation when resubmit post) + $discountcheck=new DiscountAbsolute($db); + $result=$discountcheck->fetch(0,$object->id); + + $canconvert=0; + if ($object->type == 3 && $object->paye == 1 && empty($discountcheck->id)) $canconvert=1; // we can convert deposit into discount if deposit is payed completely and not already converted (see real condition into condition used to show button converttoreduc) + if ($object->type == 2 && $object->paye == 0 && empty($discountcheck->id)) $canconvert=1; // we can convert credit note into discount if credit note is not payed back and amount of payment is 0 (see real condition into condition used to show button converttoreduc) + if ($canconvert) { + $db->begin(); + // Boucle sur chaque taux de tva $i=0; foreach($object->lines as $line) @@ -598,8 +609,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ if ($object->type == 2) $discount->description='(CREDIT_NOTE)'; elseif ($object->type == 3) $discount->description='(DEPOSIT)'; else { - $this->error="CantConvertToReducAnInvoiceOfThisType"; - return -1; + setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors'); } $discount->tva_tx=abs($object->total_ttc); $discount->fk_soc=$object->socid; @@ -614,6 +624,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ $discount->tva_tx=abs($tva_tx); $result=$discount->create($user); + if ($result < 0) { $error++; @@ -621,24 +632,24 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ } } - if (! $error) + if (empty($error)) { // Classe facture $result=$object->set_paid($user); - if ($result > 0) + if ($result >= 0) { //$mesgs[]='OK'.$discount->id; $db->commit(); } else { - $mesgs[]='
    '.$object->error.'
    '; + setEventMessage($object->error,'errors'); $db->rollback(); } } else { - $mesgs[]='
    '.$discount->error.'
    '; + setEventMessage($discount->error,'errors'); $db->rollback(); } } @@ -665,8 +676,8 @@ else if ($action == 'add' && $user->rights->facture->creer) // Replacement invoice if ($_POST['type'] == 1) { - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - if (empty($datefacture)) + $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($dateinvoice)) { $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); @@ -684,7 +695,7 @@ else if ($action == 'add' && $user->rights->facture->creer) $result=$object->fetch($_POST['fac_replacement']); $object->fetch_thirdparty(); - $object->date = $datefacture; + $object->date = $dateinvoice; $object->note_public = trim($_POST['note_public']); $object->note = trim($_POST['note']); $object->ref_client = $_POST['ref_client']; @@ -714,8 +725,8 @@ else if ($action == 'add' && $user->rights->facture->creer) setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CorrectInvoice")),'errors'); } - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - if (empty($datefacture)) + $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($dateinvoice)) { $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors'); @@ -723,14 +734,9 @@ else if ($action == 'add' && $user->rights->facture->creer) if (! $error) { - // Si facture avoir - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - - //$result=$object->fetch($_POST['fac_avoir']); - $object->socid = GETPOST('socid','int'); $object->number = $_POST['facnumber']; - $object->date = $datefacture; + $object->date = $dateinvoice; $object->note_public = trim($_POST['note_public']); $object->note = trim($_POST['note']); $object->ref_client = $_POST['ref_client']; @@ -757,7 +763,7 @@ else if ($action == 'add' && $user->rights->facture->creer) $product->fetch($_POST['idprod'.$i]); $startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']); $endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']); - $result=$object->addline($id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); + $result=$object->addline($product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); } } } @@ -766,8 +772,8 @@ else if ($action == 'add' && $user->rights->facture->creer) // Standard invoice or Deposit invoice created from a Predefined invoice if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0) { - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - if (empty($datefacture)) + $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($dateinvoice)) { $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); @@ -778,7 +784,7 @@ else if ($action == 'add' && $user->rights->facture->creer) $object->socid = GETPOST('socid','int'); $object->type = $_POST['type']; $object->number = $_POST['facnumber']; - $object->date = $datefacture; + $object->date = $dateinvoice; $object->note_public = trim($_POST['note_public']); $object->note_private = trim($_POST['note_private']); $object->ref_client = $_POST['ref_client']; @@ -803,8 +809,8 @@ else if ($action == 'add' && $user->rights->facture->creer) setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); } - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - if (empty($datefacture)) + $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($dateinvoice)) { $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); @@ -816,7 +822,7 @@ else if ($action == 'add' && $user->rights->facture->creer) $object->socid = GETPOST('socid','int'); $object->type = GETPOST('type'); $object->number = $_POST['facnumber']; - $object->date = $datefacture; + $object->date = $dateinvoice; $object->note_public = trim($_POST['note_public']); $object->note_private = trim($_POST['note_private']); $object->ref_client = $_POST['ref_client']; @@ -897,13 +903,17 @@ else if ($action == 'add' && $user->rights->facture->creer) { $totalamount=0; $lines = $srcobject->lines; + $numlines=count($lines); for ($i=0; $i<$numlines; $i++) { - $totalamount += $lines[$i]->total_ht; + $qualified=1; + if (empty($lines[$i]->qty)) $qualified=0; // We discard qty=0, it is an option + if (! empty($lines[$i]->special_code)) $qualified=0; // We discard special_code (frais port, ecotaxe, option, ...) + if ($qualified) $totalamount += $lines[$i]->total_ht; } - if ($totalamount!=0) + if ($totalamount!=0) { $amountdeposit=($totalamount*$valuedeposit)/100; } @@ -917,7 +927,6 @@ else if ($action == 'add' && $user->rights->facture->creer) } $result = $object->addline( - $id, $langs->trans('Deposit'), $amountdeposit, //subprice 1, //quantity @@ -961,7 +970,6 @@ else if ($action == 'add' && $user->rights->facture->creer) $fk_parent_line=0; $num=count($lines); - for ($i=0;$i<$num;$i++) { $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); @@ -1012,8 +1020,14 @@ else if ($action == 'add' && $user->rights->facture->creer) $fk_parent_line = 0; } + //Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals')) + { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_option=$lines[$i]->array_options; + } + $result = $object->addline( - $id, $desc, $lines[$i]->subprice, $lines[$i]->qty, @@ -1037,7 +1051,8 @@ else if ($action == 'add' && $user->rights->facture->creer) $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, - $label + $label, + $array_option ); if ($result > 0) @@ -1089,7 +1104,7 @@ else if ($action == 'add' && $user->rights->facture->creer) $product->fetch($_POST['idprod'.$i]); $startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']); $endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']); - $result=$object->addline($id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); + $result=$object->addline($product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); } } } @@ -1119,12 +1134,50 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $langs->load('errors'); $error = 0; - $idprod=GETPOST('idprod', 'int'); - $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); - $price_ht = GETPOST('price_ht'); - $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + // Set if we used free entry or predefined product + if (GETPOST('addline_libre') + || (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) + { + $predef=''; + $idprod=0; + $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + if (GETPOST('addline_predefined') + || (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) + { + $predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):'')); + $price_ht = ''; + $tva_tx = ''; + } + if (GETPOST('usenewaddlineform')) { // TODO Remove this + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + $qty = GETPOST('qty'.$predef); + $remise_percent=GETPOST('remise_percent'.$predef); - if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0)) + //Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline,$predef); + //Unset extrafield + if (is_array($extralabelsline)) + { + // Get extra fields + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_".$key.$predef]); + } + } + + if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && ($qty < 0)) { setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); $error++; @@ -1139,7 +1192,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; } - if (! GETPOST('qty') && GETPOST('qty') == '') + if ($qty == '') { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); $error++; @@ -1150,7 +1203,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $error++; } - if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) + if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { $ret=$object->fetch($id); if ($ret < 0) @@ -1161,7 +1214,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $ret=$object->fetch_thirdparty(); // Clean parameters - $predef=((! empty($idprod) && $conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); @@ -1202,6 +1254,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; $price_min = $prod->multiprices_min[$object->client->price_level]; $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; + $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; + $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } else { @@ -1211,9 +1265,16 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $price_base_type = $prod->price_base_type; } + // if price ht is forced (ie: calculated by margin rate and cost price) + if (!empty($price_ht)) + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); + } + // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tva_tx != $prod->tva_tx) + elseif ($tva_tx != $prod->tva_tx) { if ($price_base_type != 'HT') { @@ -1275,8 +1336,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- } // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + $fournprice=price2num(GETPOST('fournprice'.$predef)?GETPOST('fournprice'.$predef):''); + $buyingprice=price2num(GETPOST('buying_price'.$predef)?GETPOST('buying_price'.$predef):''); // Local Taxes $localtax1_tx= get_localtax($tva_tx, 1, $object->client); @@ -1285,24 +1346,23 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + if (! empty($price_min) && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) { - $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); + $mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); setEventMessage($mesg, 'errors'); } else { // Insert line $result = $object->addline( - $id, $desc, $pu_ht, - GETPOST('qty'), + $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, - GETPOST('remise_percent'), + $remise_percent, $date_start, $date_end, 0, @@ -1318,7 +1378,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- GETPOST('fk_parent_line'), $fournprice, $buyingprice, - $label + $label, + $array_option ); if ($result > 0) @@ -1341,7 +1402,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- unset($_POST['qty']); unset($_POST['type']); - unset($_POST['idprod']); unset($_POST['remise_percent']); unset($_POST['price_ht']); unset($_POST['price_ttc']); @@ -1351,10 +1411,18 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- unset($_POST['product_desc']); unset($_POST['fournprice']); unset($_POST['buying_price']); - - // old method - unset($_POST['np_desc']); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); unset($_POST['dp_desc']); + + unset($_POST['idprod']); + unset($_POST['qty_predef']); + unset($_POST['remise_percent_predef']); + unset($_POST['fournprice_predef']); + unset($_POST['buying_price_predef']); + unset($_POST['np_marginRate_predef']); + unset($_POST['np_markRate_predef']); + unset($_POST['np_desc']); } else { @@ -1366,7 +1434,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- } } -else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save'] == $langs->trans('Save')) +elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel')) { if (! $object->fetch($id) > 0) dol_print_error($db); $object->fetch_thirdparty(); @@ -1390,8 +1458,23 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa $localtax2_rate=get_localtax($vat_rate,2,$object->client); // Add buying price - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + $fournprice=price2num(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=price2num(GETPOST('buying_price')?GETPOST('buying_price'):''); + + //Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline); + //Unset extrafield + if (is_array($extralabelsline)) + { + // Get extra fields + foreach ($extralabelsline as $key => $value) + { + unset($_POST["options_".$key]); + } + } + // Check minimum price $productid = GETPOST('productid', 'int'); @@ -1408,9 +1491,10 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); - if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + // Check price is not lower than minimum (check is done only for standard or replacement invoices) + if (($object->type == 0 || $object->type == 1) && $price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) { - setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); + setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors'); $error++; } } @@ -1447,7 +1531,9 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa 0, $fournprice, $buyingprice, - $label + $label, + 0, + $array_option ); if ($result >= 0) @@ -1540,6 +1626,15 @@ else if ($action == 'down' && $user->rights->facture->creer) exit; } +// Link invoice to order +if (GETPOST('linkedOrder')) +{ + $object->fetch($id); + $object->fetch_thirdparty(); + $result=$object->add_object_linked('commande',GETPOST('linkedOrder')); +} + + /* * Add file in email form */ @@ -1685,7 +1780,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $interface=new Interfaces($db); $result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf); if ($result < 0) { - $error++; $this->errors=$interface->errors; + $error++; $object->errors=$interface->errors; } // Fin appel triggers @@ -1753,29 +1848,29 @@ else if ($action == 'builddoc') // En get ou en post $object->fetch($id); $object->fetch_thirdparty(); - if (GETPOST('model')) $object->setDocModel($user, GETPOST('model')); + // Save last template used to generate document + if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank'); - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) + // object->modelpdf can be empty when we are using odt template by default and builddoc is called by POS module (invoice was just created and no template ODT template was selected). + if (! empty($object->modelpdf)) { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - else - { - header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); - exit; + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } } } @@ -1798,6 +1893,16 @@ else if ($action == 'remove_file') } } +// Print file +else if ($action == 'print_file' AND $user->rights->printipp->read) +{ + require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php'; + $printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD); + $printer->print_file(GETPOST('file','alpha'),GETPOST('printer','alpha')); + setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file'))); + $action=''; +} + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer) { if ($action == 'addcontact') @@ -1863,11 +1968,11 @@ if ($action == 'update_extras') { // Fill array 'array_options' with data from add form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - if($ret < 0) - $error++; + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + if ($ret < 0) $error++; - if(!$error) { + if (! $error) + { // Actions on extra fields (by external module or standard code) // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('invoicedao')); @@ -1875,28 +1980,23 @@ if ($action == 'update_extras') $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result=$object->insertExtraFields(); + if ($result < 0) { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } else if ($reshook < 0) $error++; } - else - { - $action = 'edit_extras'; - } + if ($error) $action = 'edit_extras'; } + /* * View -*/ + */ $form = new Form($db); $formother=new FormOther($db); @@ -1906,6 +2006,16 @@ $now=dol_now(); llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); +print ' + +'; + /********************************************************************* * @@ -1969,7 +2079,11 @@ if ($action == 'create') $mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); $remise_percent = (! empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(! empty($soc->remise_percent)?$soc->remise_percent:0)); $remise_absolue = (! empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(! empty($soc->remise_absolue)?$soc->remise_absolue:0)); - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); + + //Replicate extrafields + $objectsrc->fetch_optionals($originid); + $object->array_options=$objectsrc->array_options; } } else @@ -1978,7 +2092,7 @@ if ($action == 'create') $mode_reglement_id = $soc->mode_reglement_id; $remise_percent = $soc->remise_percent; $remise_absolue = 0; - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); } $absolute_discount=$soc->getAvailableDiscounts(); @@ -2012,6 +2126,16 @@ if ($action == 'create') print '
    '; print $soc->getNomUrl(1); print ''; + // Outstanding Bill + $outstandigBills=$soc->get_OutstandingBill(); + print ' ('.$langs->trans('CurrentOutstandingBill').': '; + print price($outstandigBills,'',$langs,0,0,-1,$conf->currency); + if ($soc->outstanding_limit != '') + { + if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ' / '.price($soc->outstanding_limit); + } + print ')'; print '
    '; @@ -2129,7 +2254,7 @@ if ($action == 'create') print ''; $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); print ''; - if (($origin=='propal')) + if (($origin=='propal') || ($origin=='commande')) { print ''; // Payment term - print ''; @@ -2233,9 +2358,11 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled) && $socid>0) { + $formproject=new FormProjets($db); + $langs->load('projects'); print ''; } @@ -2305,9 +2432,9 @@ if ($action == 'create') print ''; $newclassname=$classname; - if ($newclassname == 'Propal') $newclassname = 'CommercialProposal'; - elseif ($newclassname == 'Commande') $newclassname = 'Order'; - elseif ($newclassname == 'Expedition') $newclassname = 'Sending'; + if ($newclassname == 'Propal') $newclassname = 'CommercialProposal'; + elseif ($newclassname == 'Commande') $newclassname = 'Order'; + elseif ($newclassname == 'Expedition') $newclassname = 'Sending'; print ''; print ''; @@ -2353,7 +2480,7 @@ if ($action == 'create') $form->select_produits('','idprod'.$i,'',$conf->product->limit_size); print ''; print ''; - print ''; + print ''; print ''; // Si le module service est actif, on propose des dates de debut et fin a la ligne if (! empty($conf->service->enabled)) @@ -2408,1383 +2535,1483 @@ else if ($id > 0 || ! empty($ref)) { /* * Show object in view mode - */ + */ $result=$object->fetch($id,$ref); + if ($result <= 0) { dol_print_error($db, $object->error); exit; } // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - if ($result > 0) + if ($user->societe_id>0 && $user->societe_id!=$object->socid) accessforbidden('',0); + + $result=$object->fetch_thirdparty(); + + $soc = new Societe($db); + $soc->fetch($object->socid); + $selleruserevenustamp=$mysoc->useRevenueStamp(); + + $totalpaye = $object->getSommePaiement(); + $totalcreditnotes = $object->getSumCreditNotesUsed(); + $totaldeposits = $object->getSumDepositsUsed(); + //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits." selleruserrevenuestamp=".$selleruserevenustamp; + + // We can also use bcadd to avoid pb with floating points + // For example print 239.2 - 229.3 - 9.9; does not return 0. + //$resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); + //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); + $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits,'MT'); + + if ($object->paye) $resteapayer=0; + $resteapayeraffiche=$resteapayer; + + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - if ($user->societe_id>0 && $user->societe_id!=$object->socid) accessforbidden('',0); + $filterabsolutediscount="fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $filtercreditnote="fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + } + else + { + $filterabsolutediscount="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')"; + $filtercreditnote="fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'"; + } - $result=$object->fetch_thirdparty(); + $absolute_discount=$soc->getAvailableDiscounts('',$filterabsolutediscount); + $absolute_creditnote=$soc->getAvailableDiscounts('',$filtercreditnote); + $absolute_discount=price2num($absolute_discount,'MT'); + $absolute_creditnote=price2num($absolute_creditnote,'MT'); - $soc = new Societe($db); - $soc->fetch($object->socid); - $selleruserevenustamp=$mysoc->useRevenueStamp(); + $author = new User($db); + if ($object->user_author) + { + $author->fetch($object->user_author); + } - $totalpaye = $object->getSommePaiement(); - $totalcreditnotes = $object->getSumCreditNotesUsed(); - $totaldeposits = $object->getSumDepositsUsed(); - //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits." selleruserrevenuestamp=".$selleruserevenustamp; + $objectidnext=$object->getIdReplacingInvoice(); - // We can also use bcadd to avoid pb with floating points - // For example print 239.2 - 229.3 - 9.9; does not return 0. - //$resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); - //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); - $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits,'MT'); + $head = facture_prepare_head($object); - if ($object->paye) $resteapayer=0; - $resteapayeraffiche=$resteapayer; + dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill'); - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $formconfirm=''; + + // Confirmation de la conversion de l'avoir en reduc + if ($action == 'converttoreduc') + { + $text=$langs->trans('ConfirmConvertToReduc'); + $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('ConvertToReduc'),$text,'confirm_converttoreduc','',"yes",2); + } + + // Confirmation to delete invoice + if ($action == 'delete') + { + $text=$langs->trans('ConfirmDeleteBill',$object->ref); + $formquestion=array(); + + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - $filterabsolutediscount="fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - $filtercreditnote="fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $qualified_for_stock_change=$object->hasProductsOrServices(2); } else { - $filterabsolutediscount="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')"; - $filtercreditnote="fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'"; + $qualified_for_stock_change=$object->hasProductsOrServices(1); } - $absolute_discount=$soc->getAvailableDiscounts('',$filterabsolutediscount); - $absolute_creditnote=$soc->getAvailableDiscounts('',$filtercreditnote); - $absolute_discount=price2num($absolute_discount,'MT'); - $absolute_creditnote=price2num($absolute_creditnote,'MT'); - - $author = new User($db); - if ($object->user_author) + if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut>=1) { - $author->fetch($object->user_author); + $langs->load("stocks"); + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct=new FormProduct($db); + $label=$object->type==2?$langs->trans("SelectWarehouseForStockDecrease"):$langs->trans("SelectWarehouseForStockIncrease"); + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1,0,0,$langs->trans("NoStockAction")))); + $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('DeleteBill'),$text,'confirm_delete',$formquestion,"yes",1); + }else { + $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('DeleteBill'),$text,'confirm_delete','','',1); } + } - $objectidnext=$object->getIdReplacingInvoice(); - - $head = facture_prepare_head($object); - - dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill'); - - $formconfirm=''; - - // Confirmation de la conversion de l'avoir en reduc - if ($action == 'converttoreduc') + // Confirmation de la validation + if ($action == 'valid') + { + // on verifie si l'objet est en numerotation provisoire + $objectref = substr($object->ref, 1, 4); + if ($objectref == 'PROV') { - $text=$langs->trans('ConfirmConvertToReduc'); - $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('ConvertToReduc'),$text,'confirm_converttoreduc','',"yes",2); - } - - // Confirmation to delete invoice - if ($action == 'delete') - { - $text=$langs->trans('ConfirmDeleteBill',$object->ref); - $formquestion=array(); - - $qualified_for_stock_change=0; - if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + $savdate=$object->date; + if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) { - $qualified_for_stock_change=$object->hasProductsOrServices(2); - } - else - { - $qualified_for_stock_change=$object->hasProductsOrServices(1); + $object->date=dol_now(); + $object->date_lim_reglement=$object->calculate_date_lim_reglement(); } + $numref = $object->getNextNumRef($soc); + //$object->date=$savdate; + } + else + { + $numref = $object->ref; + } - if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut>=1) - { - $langs->load("stocks"); - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct=new FormProduct($db); + $text=$langs->trans('ConfirmValidateBill',$numref); + if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; + $notify=new Notify($db); + $text.='
    '; + $text.=$notify->confirmMessage('BILL_VALIDATE',$object->socid); + } + $formquestion=array(); + + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + + if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) + { + $langs->load("stocks"); + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + $formproduct=new FormProduct($db); + $warehouse = new Entrepot($db); + $warehouse_array = $warehouse->list_array(); + if (count($warehouse_array) == 1) { + $label = $object->type==2?$langs->trans("WarehouseForStockIncrease", current($warehouse_array)):$langs->trans("WarehouseForStockDecrease", current($warehouse_array)); + $value = ''; + } else { + $label = $object->type==2?$langs->trans("SelectWarehouseForStockIncrease"):$langs->trans("SelectWarehouseForStockDecrease"); + $value = $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1); + } + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $value)); + } + if ($object->type != 2 && $object->total_ttc < 0) // Can happen only if $conf->global->FACTURE_ENABLE_NEGATIVE is on + { + $text.='
    '.img_warning().' '.$langs->trans("ErrorInvoiceOfThisTypeMustBePositive"); + } + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('ValidateBill'),$text,'confirm_valid',$formquestion,(($object->type != 2 && $object->total_ttc < 0)?"no":"yes"),($conf->notification->enabled?0:2)); + } + + // Confirm back to draft status + if ($action == 'modif') + { + $text=$langs->trans('ConfirmUnvalidateBill',$object->ref); + $formquestion=array(); + + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) + { + $langs->load("stocks"); + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + $formproduct=new FormProduct($db); + $warehouse = new Entrepot($db); + $warehouse_array = $warehouse->list_array(); + if (count($warehouse_array) == 1) { + $label = $object->type==2?$langs->trans("WarehouseForStockDecrease", current($warehouse_array)):$langs->trans("WarehouseForStockIncrease", current($warehouse_array)); + $value = ''; + } else { $label=$object->type==2?$langs->trans("SelectWarehouseForStockDecrease"):$langs->trans("SelectWarehouseForStockIncrease"); - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1,0,0,$langs->trans("NoStockAction")))); - $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('DeleteBill'),$text,'confirm_delete',$formquestion,"yes",1); - }else { - $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('DeleteBill'),$text,'confirm_delete','','',1); + $value = $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1); } + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $value)); } - // Confirmation de la validation - if ($action == 'valid') + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('UnvalidateBill'),$text,'confirm_modif',$formquestion,"yes",1); + } + + // Confirmation du classement paye + if ($action == 'paid' && $resteapayer <= 0) + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('ClassifyPaid'),$langs->trans('ConfirmClassifyPaidBill',$object->ref),'confirm_paid','',"yes",1); + } + if ($action == 'paid' && $resteapayer > 0) + { + // Code + $i=0; + $close[$i]['code']='discount_vat';$i++; + $close[$i]['code']='badcustomer';$i++; + // Help + $i=0; + $close[$i]['label']=$langs->trans("HelpEscompte").'

    '.$langs->trans("ConfirmClassifyPaidPartiallyReasonDiscountVatDesc");$i++; + $close[$i]['label']=$langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");$i++; + // Texte + $i=0; + $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++; + $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++; + // arrayreasons[code]=reason + foreach($close as $key => $val) { - // on verifie si l'objet est en numerotation provisoire - $objectref = substr($object->ref, 1, 4); - if ($objectref == 'PROV') - { - $savdate=$object->date; - if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) - { - $object->date=dol_now(); - $object->date_lim_reglement=$object->calculate_date_lim_reglement(); - } - $numref = $object->getNextNumRef($soc); - //$object->date=$savdate; - } - else - { - $numref = $object->ref; - } - - $text=$langs->trans('ConfirmValidateBill',$numref); - if (! empty($conf->notification->enabled)) - { - require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; - $notify=new Notify($db); - $text.='
    '; - $text.=$notify->confirmMessage('BILL_VALIDATE',$object->socid); - } - $formquestion=array(); - - $qualified_for_stock_change=0; - if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $qualified_for_stock_change=$object->hasProductsOrServices(2); - } - else - { - $qualified_for_stock_change=$object->hasProductsOrServices(1); - } - - if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) - { - $langs->load("stocks"); - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct=new FormProduct($db); - $label=$object->type==2?$langs->trans("SelectWarehouseForStockIncrease"):$langs->trans("SelectWarehouseForStockDecrease"); - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); - } - if ($object->type != 2 && $object->total_ttc < 0) // Can happen only if $conf->global->FACTURE_ENABLE_NEGATIVE is on - { - $text.='
    '.img_warning().' '.$langs->trans("ErrorInvoiceOfThisTypeMustBePositive"); - } - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('ValidateBill'),$text,'confirm_valid',$formquestion,(($object->type != 2 && $object->total_ttc < 0)?"no":"yes"),($conf->notification->enabled?0:2)); + $arrayreasons[$close[$key]['code']]=$close[$key]['reason']; } - // Confirm back to draft status - if ($action == 'modif') + // Cree un tableau formulaire + $formquestion=array( + 'text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"), + array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), + array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100') + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('ClassifyPaid'),$langs->trans('ConfirmClassifyPaidPartially',$object->ref),'confirm_paid_partially',$formquestion,"yes"); + } + + // Confirmation du classement abandonne + if ($action == 'canceled') + { + // S'il y a une facture de remplacement pas encore validee (etat brouillon), + // on ne permet pas de classer abandonner la facture. + if ($objectidnext) { - $text=$langs->trans('ConfirmUnvalidateBill',$object->ref); - $formquestion=array(); - - $qualified_for_stock_change=0; - if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $qualified_for_stock_change=$object->hasProductsOrServices(2); - } - else - { - $qualified_for_stock_change=$object->hasProductsOrServices(1); - } - if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) - { - $langs->load("stocks"); - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct=new FormProduct($db); - $label=$object->type==2?$langs->trans("SelectWarehouseForStockDecrease"):$langs->trans("SelectWarehouseForStockIncrease"); - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); - } - - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('UnvalidateBill'),$text,'confirm_modif',$formquestion,"yes",1); + $facturereplacement=new Facture($db); + $facturereplacement->fetch($objectidnext); + $statusreplacement=$facturereplacement->statut; } - - // Confirmation du classement paye - if ($action == 'paid' && $resteapayer <= 0) + if ($objectidnext && $statusreplacement == 0) { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('ClassifyPaid'),$langs->trans('ConfirmClassifyPaidBill',$object->ref),'confirm_paid','',"yes",1); + print '
    '.$langs->trans("ErrorCantCancelIfReplacementInvoiceNotValidated").'
    '; } - if ($action == 'paid' && $resteapayer > 0) + else { // Code - $i=0; - $close[$i]['code']='discount_vat';$i++; - $close[$i]['code']='badcustomer';$i++; + $close[1]['code']='badcustomer'; + $close[2]['code']='abandon'; // Help - $i=0; - $close[$i]['label']=$langs->trans("HelpEscompte").'

    '.$langs->trans("ConfirmClassifyPaidPartiallyReasonDiscountVatDesc");$i++; - $close[$i]['label']=$langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");$i++; + $close[1]['label']=$langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc"); + $close[2]['label']=$langs->trans("ConfirmClassifyAbandonReasonOtherDesc"); // Texte - $i=0; - $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++; - $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++; - // arrayreasons[code]=reason - foreach($close as $key => $val) - { - $arrayreasons[$close[$key]['code']]=$close[$key]['reason']; - } + $close[1]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$object->ref),$close[1]['label'],1); + $close[2]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyAbandonReasonOther"),$close[2]['label'],1); + // arrayreasons + $arrayreasons[$close[1]['code']]=$close[1]['reason']; + $arrayreasons[$close[2]['code']]=$close[2]['reason']; // Cree un tableau formulaire $formquestion=array( - 'text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"), + 'text' => $langs->trans("ConfirmCancelBillQuestion"), array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100') ); - // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('ClassifyPaid'),$langs->trans('ConfirmClassifyPaidPartially',$object->ref),'confirm_paid_partially',$formquestion,"yes"); - } - // Confirmation du classement abandonne - if ($action == 'canceled') + $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('CancelBill'),$langs->trans('ConfirmCancelBill',$object->ref),'confirm_canceled',$formquestion,"yes"); + } + } + + // Confirmation de la suppression d'une ligne produit + if ($action == 'ask_deleteline') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); + } + + // Clone confirmation + if ($action == 'clone') + { + // Create an array for form + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes',1); + } + + if (! $formconfirm) + { + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + + // Print form confirm + print $formconfirm; + + + + + // Invoice content + + print '
    '.$desc.''; $arraylist=array('amount'=>'FixAmount','variable'=>'VarAmount'); @@ -2203,7 +2328,7 @@ if ($action == 'create') { // Discounts for third party print '
    '.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",''.$soc->remise_client.''); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",''.$soc->remise_percent.''); else print $langs->trans("CompanyHasNoRelativeDiscount"); print ' ('.$langs->trans("EditRelativeDiscount").')'; print '. '; @@ -2221,7 +2346,7 @@ if ($action == 'create') print '
    '.$langs->trans('PaymentConditionsShort').''; + print '
    '.$langs->trans('PaymentConditionsShort').''; $form->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id'); print '
    '.$langs->trans('Project').''; - select_projects($soc->id, $projectid, 'projectid'); + $formproject->select_projects($soc->id, $projectid, 'projectid'); print '
    '.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).'
    '.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
    %% 
    '; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + print ''; + + // Ref customer + print ''; + print ''; + + // Third party + print ''; + + // Type + print ''; + + // Relative and absolute discounts + $addrelativediscount=''.$langs->trans("EditRelativeDiscounts").''; + $addabsolutediscount=''.$langs->trans("EditGlobalDiscounts").''; + $addcreditnote=''.$langs->trans("AddCreditNote").''; + + print ''; + print ''; + } - $resteapayeraffiche=$resteapayer; + // Link for paypal payment + if (! empty($conf->paypal->enabled) && $object->statut != 0) + { + include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; + print showPaypalPaymentUrl('invoice',$object->ref); + } - // Loop on each credit note or deposit amount applied - $creditnoteamount=0; - $depositamount=0; - $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; - $sql.= " re.description, re.fk_facture_source"; - $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re"; - $sql.= " WHERE fk_facture = ".$object->id; - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - $invoice=new Facture($db); - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $invoice->fetch($obj->fk_facture_source); - print ''; - print ''; - print ''; - $i++; - if ($invoice->type == 2) $creditnoteamount += $obj->amount_ttc; - if ($invoice->type == 3) $depositamount += $obj->amount_ttc; - } - } - else - { - dol_print_error($db); - } + print '
    '; - // Paye partiellement 'escompte' - if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'discount_vat') - { - print '
    '; - $resteapayeraffiche=0; - } - // Paye partiellement ou Abandon 'badcustomer' - if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'badcustomer') - { - print ''; - //$resteapayeraffiche=0; - } - // Paye partiellement ou Abandon 'product_returned' - if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'product_returned') - { - print ''; - $resteapayeraffiche=0; - } - // Paye partiellement ou Abandon 'abandon' - if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'abandon') - { - print ''; - $resteapayeraffiche=0; - } + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($object,'invoice',$socid); - // Billed - print ''; - - // Remainder to pay - print ''; - print ''; - print ''; - } - else // Credit note - { - // Total already paid back - print ''; - - // Billed - print ''; - - // Remainder to pay back - print ''; - print ''; - print ''; - - // Sold credit note - //print ''; - //print ''; - } - - print '
    '.$langs->trans('Ref').''; + $morehtmlref=''; + $discount=new DiscountAbsolute($db); + $result=$discount->fetch(0,$object->id); + if ($result > 0) + { + $morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')'; + } + if ($result < 0) + { + dol_print_error('',$discount->error); + } + print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref); + print '
    '; + print ''; + if ($action != 'refclient' && ! empty($object->brouillon)) print ''; + print '
    '; + print $langs->trans('RefCustomer'); + print ''.img_edit($langs->trans('Modify')).'
    '; + print '
    '; + if ($user->rights->facture->creer && $action == 'refclient') + { + print ''; + print ''; + print ''; + print ''; + print ' '; + print ''; + } + else + { + print $object->ref_client; + } + print '
    '; + print ''; + print ''; + print ''; + print '
    '.$langs->trans('Company').''; + if (! empty($conf->global->FACTURE_CHANGE_THIRDPARTY) && $action != 'editthirdparty' && $object->brouillon && $user->rights->facture->creer) + print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
    '; + print '
    '; + if ($action == 'editthirdparty') + { + $form->form_thirdparty($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,'socid'); + } + else + { + print '  '.$soc->getNomUrl(1,'compta'); + print '   '; + print '('.$langs->trans('OtherBills').''; + // Outstanding Bill + $outstandigBills=$soc->get_OutstandingBill(); + print ' - '.$langs->trans('CurrentOutstandingBill').': '; + print price($outstandigBills,'',$langs,0,0,-1,$conf->currency); + if ($soc->outstanding_limit != '') { - // S'il y a une facture de remplacement pas encore validee (etat brouillon), - // on ne permet pas de classer abandonner la facture. - if ($objectidnext) + if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ' / '.price($soc->outstanding_limit); + } + print ')'; + } + print '
    '.$langs->trans('Type').''; + print $object->getLibType(); + if ($object->type == 1) + { + $facreplaced=new Facture($db); + $facreplaced->fetch($object->fk_facture_source); + print ' ('.$langs->transnoentities("ReplaceInvoice",$facreplaced->getNomUrl(1)).')'; + } + if ($object->type == 2) + { + $facusing=new Facture($db); + $facusing->fetch($object->fk_facture_source); + print ' ('.$langs->transnoentities("CorrectInvoice",$facusing->getNomUrl(1)).')'; + } + + $facidavoir=$object->getListIdAvoirFromInvoice(); + if (count($facidavoir) > 0) + { + print ' ('.$langs->transnoentities("InvoiceHasAvoir"); + $i=0; + foreach($facidavoir as $id) + { + if ($i==0) print ' '; + else print ','; + $facavoir=new Facture($db); + $facavoir->fetch($id); + print $facavoir->getNomUrl(1); + } + print ')'; + } + if ($objectidnext > 0) + { + $facthatreplace=new Facture($db); + $facthatreplace->fetch($objectidnext); + print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')'; + } + print '
    '.$langs->trans('Discounts'); + print ''; + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + //print ' ('.$addrelativediscount.')'; + + if ($absolute_discount > 0) + { + print '. '; + if ($object->statut > 0 || $object->type == 2 || $object->type == 3) + { + if ($object->statut == 0) { - $facturereplacement=new Facture($db); - $facturereplacement->fetch($objectidnext); - $statusreplacement=$facturereplacement->statut; - } - if ($objectidnext && $statusreplacement == 0) - { - print '
    '.$langs->trans("ErrorCantCancelIfReplacementInvoiceNotValidated").'
    '; + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); + print '. '; } else { - // Code - $close[1]['code']='badcustomer'; - $close[2]['code']='abandon'; - // Help - $close[1]['label']=$langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc"); - $close[2]['label']=$langs->trans("ConfirmClassifyAbandonReasonOtherDesc"); - // Texte - $close[1]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$object->ref),$close[1]['label'],1); - $close[2]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyAbandonReasonOther"),$close[2]['label'],1); - // arrayreasons - $arrayreasons[$close[1]['code']]=$close[1]['reason']; - $arrayreasons[$close[2]['code']]=$close[2]['reason']; - - // Cree un tableau formulaire - $formquestion=array( - 'text' => $langs->trans("ConfirmCancelBillQuestion"), - array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), - array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100') - ); - - $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('CancelBill'),$langs->trans('ConfirmCancelBill',$object->ref),'confirm_canceled',$formquestion,"yes"); - } - } - - // Confirmation de la suppression d'une ligne produit - if ($action == 'ask_deleteline') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); - } - - // Clone confirmation - if ($action == 'clone') - { - // Create an array for form - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) - ); - // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes',1); - } - - if (! $formconfirm) - { - $parameters=array('lineid'=>$lineid); - $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - - // Print form confirm - print $formconfirm; - - - - - // Invoice content - - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - print ''; - - // Ref customer - print ''; - print ''; - - // Third party - print ''; - - // Type - print ''; - - // Relative and absolute discounts - $addrelativediscount=''.$langs->trans("EditRelativeDiscounts").''; - $addabsolutediscount=''.$langs->trans("EditGlobalDiscounts").''; - $addcreditnote=''.$langs->trans("AddCreditNote").''; - - print ''; - - // Date invoice - print ''; + + // Date invoice + print ''; + + + // List of payments + + $sign=1; + if ($object->type == 2) $sign=-1; + + $nbrows=8; $nbcols=2; + if (! empty($conf->projet->enabled)) $nbrows++; + if (! empty($conf->banque->enabled)) $nbcols++; + //if (! empty($soc->outstandingbill)) $nbrows++; + if($mysoc->localtax1_assuj=="1") $nbrows++; + if($mysoc->localtax2_assuj=="1") $nbrows++; + if ($selleruserevenustamp) $nbrows++; + + print ''; + + // Conditions de reglement + print ''; + + // Date payment term + print ''; + + // Payment mode + print ''; + + // Amount + print ''; + print ''; + print ''; + print ''; + + // Amount Local Taxes + if ($mysoc->localtax1_assuj=="1" && $mysoc->useLocalTax(1)) //Localtax1 (example RE) + { + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1" && $mysoc->useLocalTax(2)) //Localtax2 (example IRPF) + { + print ''; + print ''; + } + + // Revenue stamp + if ($selleruserevenustamp) // Test company use revenue stamp + { + print ''; + } + // Total with tax + print ''; - // List of payments + // Statut + print ''; + print ''; - $sign=1; - if ($object->type == 2) $sign=-1; + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load('projects'); + print ''; + print ''; - $label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label; - print ''; - if (! empty($conf->banque->enabled)) + if (! $objectidnext) { - $bankaccountstatic->id=$objp->baid; - $bankaccountstatic->ref=$objp->ref; - $bankaccountstatic->label=$objp->ref; - print ''; + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate) + { + print ''; + } + else + { + print '
    '.$langs->trans('Modify').'
    '; + } } - print ''; - print ''; - print ''; - $i++; + else + { + print '
    '.$langs->trans('Modify').'
    '; + } + } + } + + // Reopen a standard paid invoice + if ((($object->type == 0 || $object->type == 1) + || ($object->type == 2 && empty($discount->id)) + || ($object->type == 3 && empty($discount->id))) + && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) + { + if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice + { + print ''; + } + else + { + print '
    '.$langs->trans('ReOpen').'
    '; + } + } + + // Validate + if ($object->statut == 0 && count($object->lines) > 0 && + ( + (($object->type == 0 || $object->type == 1 || $object->type == 3 || $object->type == 4) && (! empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) + || ($object->type == 2 && $object->total_ttc <= 0)) + ) + { + if ($user->rights->facture->valider) + { + print ''; + } + } + + // Send by mail + if (($object->statut == 1 || $object->statut == 2)) + { + if ($objectidnext) + { + print '
    '.$langs->trans('SendByMail').'
    '; + } + else + { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->facture->invoice_advance->send) + { + print ''; + } + else print ''; + } + } + + if (! empty($conf->global->FACTURE_SHOW_SEND_REMINDER)) // For backward compatibility + { + if (($object->statut == 1 || $object->statut == 2) && $resteapayer > 0) + { + if ($objectidnext) + { + print '
    '.$langs->trans('SendRemindByMail').'
    '; + } + else + { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->facture->invoice_advance->send) + { + print ''; + } + else print ''; + } + } + } + + // Create payment + if ($object->type != 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) + { + if ($objectidnext) + { + print '
    '.$langs->trans('DoPayment').'
    '; + } + else + { + if ($resteapayer == 0) + { + print '
    '.$langs->trans('DoPayment').'
    '; + } + else + { + print ''; + } + } + } + + // Reverse back money or convert to reduction + if ($object->type == 2 || $object->type == 3) + { + // For credit note only + if ($object->type == 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) + { + if ($resteapayer == 0) + { + print '
    '.$langs->trans('DoPaymentBack').'
    '; + } + else + { + print ''; + } + } + + // For credit note + if ($object->type == 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->creer && $object->getSommePaiement() == 0) + { + print ''; + } + // For deposit invoice + if ($object->type == 3 && $object->paye == 1 && $resteapayer == 0 && $user->rights->facture->creer && empty($discount->id)) + { + print ''; + } + } + + // Classify paid + if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement && (($object->type != 2 && $object->type != 3 && $resteapayer <= 0) || ($object->type == 2 && $resteapayer >= 0)) + || ($object->type == 3 && $object->paye == 0 && $resteapayer == 0 && $user->rights->facture->paiement && empty($discount->id)) + ) + { + print ''; + } + + // Classify 'closed not completely paid' (possible si validee et pas encore classee payee) + if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 + && $user->rights->facture->paiement) + { + if ($totalpaye > 0 || $totalcreditnotes > 0) + { + // If one payment or one credit note was linked to this invoice + print ''; + } + else + { + if ($objectidnext) + { + print '
    '.$langs->trans('ClassifyCanceled').'
    '; + } + else + { + print ''; + } + } + } + + // Clone + if (($object->type == 0 || $object->type == 3 || $object->type == 4) && $user->rights->facture->creer) + { + print ''; + } + + // Clone as predefined + if (($object->type == 0 || $object->type == 3 || $object->type == 4) && $object->statut == 0 && $user->rights->facture->creer) + { + if (! $objectidnext) + { + print ''; + } + } + + // Delete + if ($user->rights->facture->supprimer) + { + if (! $object->is_erasable()) + { + print ''; + } + else if ($objectidnext) + { + print ''; + } + elseif ($object->getSommePaiement()) + { + print ''; + } + else + { + print ''; } } else { - print ''; + print ''; } - //} - $db->free($result); + + print ''; + } + } + print '
    '; + + if ($action != 'prerelance' && $action != 'presend') + { + print '
    '; + print ''; // ancre + + // Documents generes + $filename=dol_sanitizeFileName($object->ref); + $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref); + $urlsource=$_SERVER['PHP_SELF'].'?facid='.$object->id; + $genallowed=$user->rights->facture->creer; + $delallowed=$user->rights->facture->supprimer; + + print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); + $somethingshown=$formfile->numoffiles; + + // Linked object block + $somethingshown=$object->showLinkedObjectBlock(); + + if (empty($somethingshown) && $object->statut > 0) + { + print '
    '.$langs->trans('LinkedOrder').''; + + print '
    '.$langs->trans('Ref').''; - $morehtmlref=''; - $discount=new DiscountAbsolute($db); - $result=$discount->fetch(0,$object->id); - if ($result > 0) - { - $morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')'; - } - if ($result < 0) - { - dol_print_error('',$discount->error); - } - print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref); - print '
    '; - print ''; - if ($action != 'refclient' && ! empty($object->brouillon)) print ''; - print '
    '; - print $langs->trans('RefCustomer'); - print ''.img_edit($langs->trans('Modify')).'
    '; - print '
    '; - if ($user->rights->facture->creer && $action == 'refclient') - { - print '
    '; - print ''; - print ''; - print ''; - print ' '; - print '
    '; - } - else - { - print $object->ref_client; - } - print '
    '; - print ''; - print ''; - print ''; - print '
    '.$langs->trans('Company').''; - if (! empty($conf->global->FACTURE_CHANGE_THIRDPARTY) && $action != 'editthirdparty' && $object->brouillon && $user->rights->facture->creer) - print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
    '; - print '
    '; - if ($action == 'editthirdparty') - { - $form->form_thirdparty($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,'socid'); - } - else - { - print '  '.$soc->getNomUrl(1,'compta'); - print '   ('.$langs->trans('OtherBills').')'; - } - print '
    '.$langs->trans('Type').''; - print $object->getLibType(); - if ($object->type == 1) - { - $facreplaced=new Facture($db); - $facreplaced->fetch($object->fk_facture_source); - print ' ('.$langs->transnoentities("ReplaceInvoice",$facreplaced->getNomUrl(1)).')'; - } - if ($object->type == 2) - { - $facusing=new Facture($db); - $facusing->fetch($object->fk_facture_source); - print ' ('.$langs->transnoentities("CorrectInvoice",$facusing->getNomUrl(1)).')'; - } - - $facidavoir=$object->getListIdAvoirFromInvoice(); - if (count($facidavoir) > 0) - { - print ' ('.$langs->transnoentities("InvoiceHasAvoir"); - $i=0; - foreach($facidavoir as $id) - { - if ($i==0) print ' '; - else print ','; - $facavoir=new Facture($db); - $facavoir->fetch($id); - print $facavoir->getNomUrl(1); - } - print ')'; - } - if ($objectidnext > 0) - { - $facthatreplace=new Facture($db); - $facthatreplace->fetch($objectidnext); - print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')'; - } - print '
    '.$langs->trans('Discounts'); - print ''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - //print ' ('.$addrelativediscount.')'; - - if ($absolute_discount > 0) - { - print '. '; - if ($object->statut > 0 || $object->type == 2 || $object->type == 3) - { - if ($object->statut == 0) + if ($object->statut < 1 || $object->type == 2 || $object->type == 3) { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - print '. '; + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); + print '
    '.$text.'.
    '; } else { - if ($object->statut < 1 || $object->type == 2 || $object->type == 3) - { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - print '
    '.$text.'.
    '; - } - else - { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - $text2=$langs->trans("AbsoluteDiscountUse"); - print $form->textwithpicto($text,$text2); - } + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); + $text2=$langs->trans("AbsoluteDiscountUse"); + print $form->textwithpicto($text,$text2); } } - else - { - // Remise dispo de type remise fixe (not credit note) - print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, GETPOST('discountid'), 'remise_id', $soc->id, $absolute_discount, $filterabsolutediscount, $resteapayer, ' ('.$addabsolutediscount.')'); - } } else { - if ($absolute_creditnote > 0) // If not, link will be added later - { - if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')
    '; - else print '. '; - } - else print '. '; + // Remise dispo de type remise fixe (not credit note) + print '
    '; + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, GETPOST('discountid'), 'remise_id', $soc->id, $absolute_discount, $filterabsolutediscount, $resteapayer, ' ('.$addabsolutediscount.')'); } - if ($absolute_creditnote > 0) + } + else + { + if ($absolute_creditnote > 0) // If not, link will be added later { - // If validated, we show link "add credit note to payment" - if ($object->statut != 1 || $object->type == 2 || $object->type == 3) - { - if ($object->statut == 0 && $object->type != 3) - { - $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)); - print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse")); - } - else - { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.'; - } - } - else - { - // Remise dispo de type avoir - if (! $absolute_discount) print '
    '; - //$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer); - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We must allow credit not even if amount is higher - } - } - if (! $absolute_discount && ! $absolute_creditnote) - { - print $langs->trans("CompanyHasNoAbsoluteDiscount"); if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')
    '; else print '. '; } - //if ($object->statut == 0 && $object->type != 2 && $object->type != 3) - // { - //if (! $absolute_discount && ! $absolute_creditnote) print '
    '; - //print '   -   '; - //print $addabsolutediscount; - //print '   -   '.$addcreditnote; // We disbale link to credit note - //} - print '
    '; - print ''; - if ($object->type != 2 && $action != 'editinvoicedate' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; - print '
    '; - print $langs->trans('Date'); - print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
    '; - print '
    '; - - if ($object->type != 2) + else print '. '; + } + if ($absolute_creditnote > 0) + { + // If validated, we show link "add credit note to payment" + if ($object->statut != 1 || $object->type == 2 || $object->type == 3) { - if ($action == 'editinvoicedate') + if ($object->statut == 0 && $object->type != 3) { - $form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->date,'invoicedate'); + $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)); + print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse")); } else { - print dol_print_date($object->date,'daytext'); + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.'; } } else + { + // Remise dispo de type avoir + if (! $absolute_discount) print '
    '; + //$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We must allow credit not even if amount is higher + } + } + if (! $absolute_discount && ! $absolute_creditnote) + { + print $langs->trans("CompanyHasNoAbsoluteDiscount"); + if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')
    '; + else print '. '; + } + //if ($object->statut == 0 && $object->type != 2 && $object->type != 3) + // { + //if (! $absolute_discount && ! $absolute_creditnote) print '
    '; + //print '   -   '; + //print $addabsolutediscount; + //print '   -   '.$addcreditnote; // We disbale link to credit note + //} + print '
    '; + print ''; + if ($object->type != 2 && $action != 'editinvoicedate' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; + print '
    '; + print $langs->trans('Date'); + print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
    '; + print '
    '; + + if ($object->type != 2) + { + if ($action == 'editinvoicedate') + { + $form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->date,'invoicedate'); + } + else { print dol_print_date($object->date,'daytext'); } + } + else + { + print dol_print_date($object->date,'daytext'); + } + print ''; + + print ''; + + // List of payments already done + print ''; + print ''; + print ''; + if (! empty($conf->banque->enabled)) print ''; + print ''; + print ''; + print ''; + + $var=true; + + // Payments already done (from payment on this invoice) + $sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,'; + $sql.= ' c.code as payment_code, c.libelle as payment_label,'; + $sql.= ' pf.amount,'; + $sql.= ' ba.rowid as baid, ba.ref, ba.label'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; + $sql.= ' WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; + $sql.= ' ORDER BY p.datep, p.tms'; + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + + //if ($object->type != 2) + //{ + if ($num > 0) + { + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ''; + $label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label; + print ''; + if (! empty($conf->banque->enabled)) + { + $bankaccountstatic->id=$objp->baid; + $bankaccountstatic->ref=$objp->ref; + $bankaccountstatic->label=$objp->ref; + print ''; + } + print ''; + print ''; + print ''; + $i++; + } + } + else + { + print ''; + } + //} + $db->free($result); + } + else + { + dol_print_error($db); + } + + if ($object->type != 2) + { + // Total already paid + print ''; + + $resteapayeraffiche=$resteapayer; + + // Loop on each credit note or deposit amount applied + $creditnoteamount=0; + $depositamount=0; + $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql.= " re.description, re.fk_facture_source"; + $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re"; + $sql.= " WHERE fk_facture = ".$object->id; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + $invoice=new Facture($db); + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $invoice->fetch($obj->fk_facture_source); + print ''; + print ''; + print ''; + $i++; + if ($invoice->type == 2) $creditnoteamount += $obj->amount_ttc; + if ($invoice->type == 3) $depositamount += $obj->amount_ttc; + } + } + else + { + dol_print_error($db); + } + + // Paye partiellement 'escompte' + if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'discount_vat') + { + print ''; + $resteapayeraffiche=0; + } + // Paye partiellement ou Abandon 'badcustomer' + if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'badcustomer') + { + print ''; + //$resteapayeraffiche=0; + } + // Paye partiellement ou Abandon 'product_returned' + if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'product_returned') + { + print ''; + $resteapayeraffiche=0; + } + // Paye partiellement ou Abandon 'abandon' + if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'abandon') + { + print ''; + $resteapayeraffiche=0; + } + + // Billed + print ''; + + // Remainder to pay + print ''; + print ''; + print ''; + } + else // Credit note + { + // Total already paid back + print ''; + + // Billed + print ''; + + // Remainder to pay back + print ''; + print ''; + print ''; + + // Sold credit note + //print ''; + //print ''; + } + + print '
    '.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
    '; + print ''.img_object($langs->trans('ShowPayment'),'payment').' '; + print dol_print_date($db->jdate($objp->dp),'day').''.$label.' '.$objp->num_paiement.''; + if ($bankaccountstatic->id) print $bankaccountstatic->getNomUrl(1,'transactions'); + print ''.price($sign * $objp->amount).' 
    '.$langs->trans("None").'
    '; + if ($object->type != 3) print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); + else print $langs->trans('AlreadyPaid'); + print ' :'.price($totalpaye).' 
    '; + if ($invoice->type == 2) print $langs->trans("CreditNote").' '; + if ($invoice->type == 3) print $langs->trans("Deposit").' '; + print $invoice->getNomUrl(0); + print ' :'.price($obj->amount_ttc).''; + print 'rowid.'">'.img_delete().''; + print '
    '; + print $form->textwithpicto($langs->trans("Discount").':',$langs->trans("HelpEscompte"),-1); + print ''.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '; + print $form->textwithpicto($langs->trans("Abandoned").':',$langs->trans("HelpAbandonBadCustomer"),-1); + print ''.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '; + print $form->textwithpicto($langs->trans("ProductReturned").':',$langs->trans("HelpAbandonProductReturned"),-1); + print ''.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '; + $text=$langs->trans("HelpAbandonOther"); + if ($object->close_note) $text.='

    '.$langs->trans("Reason").':'.$object->close_note; + print $form->textwithpicto($langs->trans("Abandoned").':',$text,-1); + print '
    '.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '.$langs->trans("Billed").' :'.price($object->total_ttc).' 
    '; + if ($resteapayeraffiche >= 0) print $langs->trans('RemainderToPay'); + else print $langs->trans('ExcessReceived'); + print ' :'.price($resteapayeraffiche).' 
    '; + print $langs->trans('AlreadyPaidBack'); + print ' :'.price($sign * $totalpaye).' 
    '.$langs->trans("Billed").' :'.price($sign * $object->total_ttc).' 
    '; + if ($resteapayeraffiche <= 0) print $langs->trans('RemainderToPayBack'); + else print $langs->trans('ExcessPaydBack'); + print ' :'.price($sign * $resteapayeraffiche).' 
    '.$langs->trans('TotalTTC').' :'.price($sign * $object->total_ttc).' 
    '; + + // Margin Infos + if (! empty($conf->margin->enabled)) + { + print '
    '; + $object->displayMarginInfos($object->statut > 0); + } + + print '
    '; + print ''; + if ($object->type != 2 && $action != 'editconditions' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; + print '
    '; + print $langs->trans('PaymentConditionsShort'); + print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
    '; + print '
    '; + if ($object->type != 2) + { + if ($action == 'editconditions') + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); + } + else + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->cond_reglement_id,'none'); + } + } + else + { + print ' '; + } + print '
    '; + print ''; + if ($object->type != 2 && $action != 'editpaymentterm' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; + print '
    '; + print $langs->trans('DateMaxPayment'); + print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
    '; + print '
    '; + if ($object->type != 2) + { + if ($action == 'editpaymentterm') + { + $form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->date_lim_reglement,'paymentterm'); + } + else + { + print dol_print_date($object->date_lim_reglement,'daytext'); + if ($object->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $object->paye && $object->statut == 1 && ! isset($object->am)) print img_warning($langs->trans('Late')); + } + } + else + { + print ' '; + } + print '
    '; + print ''; + if ($action != 'editmode' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; + print '
    '; + print $langs->trans('PaymentMode'); + print 'id.'">'.img_edit($langs->trans('SetMode'),1).'
    '; + print '
    '; + if ($action == 'editmode') + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); + } + else + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'none'); + } + print '
    '.$langs->trans('AmountHT').''.price($object->total_ht,1,'',1,-1,-1,$conf->currency).'
    '.$langs->trans('AmountVAT').''.price($object->total_tva,1,'',1,-1,-1,$conf->currency).'
    '.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1,1,'',1,-1,-1,$conf->currency).'
    '.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2,1,'',1,-1,-1,$conf->currency).'
    '; + print ''; + if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; + print '
    '; + print $langs->trans('RevenueStamp'); print 'id.'">'.img_edit($langs->trans('SetRevenuStamp'),1).'
    '; + print '
    '; + if ($action == 'editrevenuestamp') + { + print '
    '; + print ''; + print ''; + print $formother->select_revenue_stamp(GETPOST('revenuestamp'), 'revenuestamp', $mysoc->country_code); + //print ''; + print ' '; + print '
    '; + } + else + { + print price($object->revenuestamp,1,'',1,-1,-1,$conf->currency); + } + print '
    '.$langs->trans('AmountTTC').''.price($object->total_ttc,1,'',1,-1,-1,$conf->currency).'
    '.$langs->trans('Status').''.($object->getLibStatut(4,$totalpaye)).'
    '; - $nbrows=8; $nbcols=2; - if (! empty($conf->projet->enabled)) $nbrows++; - if (! empty($conf->banque->enabled)) $nbcols++; - if($mysoc->localtax1_assuj=="1") $nbrows++; - if($mysoc->localtax2_assuj=="1") $nbrows++; - if ($selleruserevenustamp) $nbrows++; + print ''; + if ($action != 'classify') + { + print ''; + } + print '
    '; + print $langs->trans('Project'); + print 'id.'">'; + print img_edit($langs->trans('SetProject'),1); + print '
    '; - print '
    '; - - print ''; - - // List of payments already done - print ''; - print ''; - print ''; - if (! empty($conf->banque->enabled)) print ''; - print ''; - print ''; + print ''; print ''; + } + // Other attributes (TODO Move this into an include) + $res=$object->fetch_optionals($object->id,$extralabels); + $parameters=array('colspan' => ' colspan="2"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + + foreach($extrafields->attribute_label as $key=>$label) + { + if ($action == 'edit_extras') { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + } else { + $value=$object->array_options["options_".$key]; + } + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } + } + } + + print '
    '.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' '; + if ($action == 'classify') + { + $form->form_project($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,$object->fk_project,'projectid'); + } + else + { + $form->form_project($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,$object->fk_project,'none'); + } + print '
    '; + // Convert date into timestamp format + if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) + { + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); + } + + if ($action == 'edit_extras' && $user->rights->facture->creer && GETPOST('attribute') == $key) + { + print '
    '; + print ''; + print ''; + print ''; + print ''; + + print $extrafields->showInputField($key,$value); + + print ''; + print '
    '; + } + else + { + print $extrafields->showOutputField($key,$value); + if ($object->statut == 0 && $user->rights->facture->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; + } + print '

    '; + + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + $blocname = 'contacts'; + $title = $langs->trans('ContactsAddresses'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $blocname = 'notes'; + $title = $langs->trans('Notes'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + // Lines + $result = $object->getLinesArray(); + + + print '
    + + + + + '; + + + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) + { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; + } + + print ''; + + // Show object lines + if (! empty($object->lines)) + $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1); + + // Form to add new line + if ($object->statut == 0 && $user->rights->facture->creer && $action <> 'valid' && $action <> 'editline') + { $var=true; - // Payments already done (from payment on this invoice) - $sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,'; - $sql.= ' c.code as payment_code, c.libelle as payment_label,'; - $sql.= ' pf.amount,'; - $sql.= ' ba.rowid as baid, ba.ref, ba.label'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; - $sql.= ' WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; - $sql.= ' ORDER BY p.datep, p.tms'; - - $result = $db->query($sql); - if ($result) + if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - $num = $db->num_rows($result); - $i = 0; + // Add free or predefined products/services + $object->formAddObjectLine(1,$mysoc,$soc); + } + else + { + // Add free products/services + $object->formAddFreeProduct(1,$mysoc,$soc); - //if ($object->type != 2) - //{ - if ($num > 0) + // Add predefined products/services + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - while ($i < $num) + $var=!$var; + $object->formAddPredefinedProduct(1,$mysoc,$soc); + } + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + + print "
    \n"; + + print "
    \n"; + + dol_fiche_end(); + + + // Boutons actions + + if ($action != 'prerelance' && $action != 'presend') + { + if ($user->societe_id == 0 && $action <> 'valid' && $action <> 'editline') + { + print '
    '; + + // Editer une facture deja validee, sans paiement effectue et pas exporte en compta + if ($object->statut == 1) + { + // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + $ventilExportCompta = $object->getVentilExportCompta(); + + if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) { - $objp = $db->fetch_object($result); - $var=!$var; - print '
    '; - print ''.img_object($langs->trans('ShowPayment'),'payment').' '; - print dol_print_date($db->jdate($objp->dp),'day').''.$label.' '.$objp->num_paiement.''; - if ($bankaccountstatic->id) print $bankaccountstatic->getNomUrl(1,'transactions'); - print ''.price($sign * $objp->amount).' 
    '.$langs->trans("None").'
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + while ($i < $num) + { + $objp = $db->fetch_object($resqlorderlist); + if ($objp->socid == $soc->id) + { + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + + $i++; + } + print '
    '.$langs->trans("Ref").''.$langs->trans("RefCustomer").''.$langs->trans("AmountHTShort").''.$langs->trans("Company").'
    '; + print ''; + print ''.$objp->ref.''.$objp->ref_client.''.price($objp->total_ht).''.$objp->name.'
    '; + print '
    '; + print ''; + $db->free($resqlorderlist); } else { dol_print_error($db); } - if ($object->type != 2) - { - // Total already paid - print '
    '; - if ($object->type != 3) print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); - else print $langs->trans('AlreadyPaid'); - print ' :'.price($totalpaye).' 
    '; - if ($invoice->type == 2) print $langs->trans("CreditNote").' '; - if ($invoice->type == 3) print $langs->trans("Deposit").' '; - print $invoice->getNomUrl(0); - print ' :'.price($obj->amount_ttc).''; - print 'rowid.'">'.img_delete().''; - print '
    '; - print $form->textwithpicto($langs->trans("Discount").':',$langs->trans("HelpEscompte"),-1); - print ''.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '; - print $form->textwithpicto($langs->trans("Abandoned").':',$langs->trans("HelpAbandonBadCustomer"),-1); - print ''.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '; - print $form->textwithpicto($langs->trans("ProductReturned").':',$langs->trans("HelpAbandonProductReturned"),-1); - print ''.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '; - $text=$langs->trans("HelpAbandonOther"); - if ($object->close_note) $text.='

    '.$langs->trans("Reason").':'.$object->close_note; - print $form->textwithpicto($langs->trans("Abandoned").':',$text,-1); - print '
    '.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
    '.$langs->trans("Billed").' :'.price($object->total_ttc).' 
    '; - if ($resteapayeraffiche >= 0) print $langs->trans('RemainderToPay'); - else print $langs->trans('ExcessReceived'); - print ' :'.price($resteapayeraffiche).' 
    '; - print $langs->trans('AlreadyPaidBack'); - print ' :'.price($sign * $totalpaye).' 
    '.$langs->trans("Billed").' :'.price($sign * $object->total_ttc).' 
    '; - if ($resteapayeraffiche <= 0) print $langs->trans('RemainderToPayBack'); - else print $langs->trans('ExcessPaydBack'); - print ' :'.price($sign * $resteapayeraffiche).' 
    '.$langs->trans('TotalTTC').' :'.price($sign * $object->total_ttc).' 
    '; - - // Margin Infos - if (! empty($conf->margin->enabled)) - { - print '
    '; - $object->displayMarginInfos($object->statut > 0); - } - - print '
    '; - print ''; - if ($object->type != 2 && $action != 'editconditions' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; - print '
    '; - print $langs->trans('PaymentConditionsShort'); - print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
    '; - print '
    '; - if ($object->type != 2) - { - if ($action == 'editconditions') - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); - } - else - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->cond_reglement_id,'none'); - } - } - else - { - print ' '; - } - print '
    '; - print ''; - if ($object->type != 2 && $action != 'editpaymentterm' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; - print '
    '; - print $langs->trans('DateMaxPayment'); - print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
    '; - print '
    '; - if ($object->type != 2) - { - if ($action == 'editpaymentterm') - { - $form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->date_lim_reglement,'paymentterm'); - } - else - { - print dol_print_date($object->date_lim_reglement,'daytext'); - if ($object->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $object->paye && $object->statut == 1 && ! isset($object->am)) print img_warning($langs->trans('Late')); - } - } - else - { - print ' '; - } - print '
    '; - print ''; - if ($action != 'editmode' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; - print '
    '; - print $langs->trans('PaymentMode'); - print 'id.'">'.img_edit($langs->trans('SetMode'),1).'
    '; - print '
    '; - if ($action == 'editmode') - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); - } - else - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'none'); - } - print '
    '.$langs->trans('AmountHT').''.price($object->total_ht,1,'',1,-1,-1,$conf->currency).'
    '.$langs->trans('AmountVAT').''.price($object->total_tva,1,'',1,-1,-1,$conf->currency).'
    '.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1,1,'',1,-1,-1,$conf->currency).'
    '.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2,1,'',1,-1,-1,$conf->currency).'
    '; - print ''; - if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; - print '
    '; - print $langs->trans('RevenueStamp'); - print 'id.'">'.img_edit($langs->trans('SetRevenuStamp'),1).'
    '; - print '
    '; - if ($action == 'editrevenuestamp') - { - print '
    '; - print ''; - print ''; - print $formother->select_revenue_stamp(GETPOST('revenuestamp'), 'revenuestamp', $mysoc->country_code); - //print ''; - print ' '; - print '
    '; - } - else - { - print price($object->revenuestamp,1,'',1,-1,-1,$conf->currency); - } - print '
    '.$langs->trans('AmountTTC').''.price($object->total_ttc,1,'',1,-1,-1,$conf->currency).'
    '.$langs->trans('Status').''.($object->getLibStatut(4,$totalpaye)).'
    '; - - print ''; - if ($action != 'classify') - { - print ''; - } - print '
    '; - print $langs->trans('Project'); - print 'id.'">'; - print img_edit($langs->trans('SetProject'),1); - print '
    '; - - print '
    '; - if ($action == 'classify') - { - $form->form_project($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,$object->fk_project,'projectid'); - } - else - { - $form->form_project($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,$object->fk_project,'none'); - } - print '
    '; - // Convert date into timestamp format - if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) - { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); - } - - if ($action == 'edit_extras' && $user->rights->facture->creer) - { - print $extrafields->showInputField($key,$value); - } - else - { - print $extrafields->showOutputField($key,$value); - } - print '
    '; - print ''; - print ''; - print '
    '.img_picto('','edit').' '.$langs->trans('Modify').'

    '; - - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) - { - $blocname = 'contacts'; - $title = $langs->trans('ContactsAddresses'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $blocname = 'notes'; - $title = $langs->trans('Notes'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - // Lines - $result = $object->getLinesArray(); - - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) - { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print ''; - - // Show object lines - if (! empty($object->lines)) - $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1); - - // Form to add new line - if ($object->statut == 0 && $user->rights->facture->creer && $action <> 'valid' && $action <> 'editline') - { - $var=true; - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { - // Add free or predefined products/services - $object->formAddObjectLine(1,$mysoc,$soc); - } - else - { - // Add free products/services - $object->formAddFreeProduct(1,$mysoc,$soc); - - // Add predefined products/services - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $var=!$var; - $object->formAddPredefinedProduct(1,$mysoc,$soc); - } - } - - $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - - print "
    \n"; - - print "\n"; - - - // Boutons actions - - if ($action != 'prerelance' && $action != 'presend') - { - if ($user->societe_id == 0 && $action <> 'valid' && $action <> 'editline') - { - print '
    '; - - // Editer une facture deja validee, sans paiement effectue et pas exporte en compta - if ($object->statut == 1) - { - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees - $ventilExportCompta = $object->getVentilExportCompta(); - - if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) - { - if (! $objectidnext) - { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate) - { - print ''; - } - else - { - print '
    '.$langs->trans('Modify').'
    '; - } - } - else - { - print '
    '.$langs->trans('Modify').'
    '; - } - } - } - - // Reopen a standard paid invoice - if (($object->type == 0 || $object->type == 1) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) - { - if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice - { - print ''; - } - else - { - print '
    '.$langs->trans('ReOpen').'
    '; - } - } - - // Validate - if ($object->statut == 0 && count($object->lines) > 0 && - ( - (($object->type == 0 || $object->type == 1 || $object->type == 3 || $object->type == 4) && (! empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) - || ($object->type == 2 && $object->total_ttc <= 0)) - ) - { - if ($user->rights->facture->valider) - { - print ''; - } - } - - // Send by mail - if (($object->statut == 1 || $object->statut == 2)) - { - if ($objectidnext) - { - print '
    '.$langs->trans('SendByMail').'
    '; - } - else - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->facture->invoice_advance->send) - { - print ''; - } - else print ''; - } - } - - if (! empty($conf->global->FACTURE_SHOW_SEND_REMINDER)) // For backward compatibility - { - if (($object->statut == 1 || $object->statut == 2) && $resteapayer > 0) - { - if ($objectidnext) - { - print '
    '.$langs->trans('SendRemindByMail').'
    '; - } - else - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->facture->invoice_advance->send) - { - print ''; - } - else print ''; - } - } - } - - // Create payment - if ($object->type != 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) - { - if ($objectidnext) - { - print '
    '.$langs->trans('DoPayment').'
    '; - } - else - { - if ($resteapayer == 0) - { - print '
    '.$langs->trans('DoPayment').'
    '; - } - else - { - print ''; - } - } - } - - // Reverse back money or convert to reduction - if ($object->type == 2 || $object->type == 3) - { - // For credit note only - if ($object->type == 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) - { - print ''; - } - // For credit note - if ($object->type == 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->creer && $object->getSommePaiement() == 0) - { - print ''; - } - // For deposit invoice - if ($object->type == 3 && $object->statut == 1 && $resteapayer == 0 && $user->rights->facture->creer) - { - print ''; - } - } - - // Classify paid (if not deposit and not credit note. Such invoice are "converted") - if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement && - (($object->type != 2 && $object->type != 3 && $resteapayer <= 0) || ($object->type == 2 && $resteapayer >= 0)) ) - { - print ''; - } - - // Classify 'closed not completely paid' (possible si validee et pas encore classee payee) - if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 - && $user->rights->facture->paiement) - { - if ($totalpaye > 0 || $totalcreditnotes > 0) - { - // If one payment or one credit note was linked to this invoice - print ''; - } - else - { - if ($objectidnext) - { - print '
    '.$langs->trans('ClassifyCanceled').'
    '; - } - else - { - print ''; - } - } - } - - // Clone - if (($object->type == 0 || $object->type == 3 || $object->type == 4) && $user->rights->facture->creer) - { - print ''; - } - - // Clone as predefined - if (($object->type == 0 || $object->type == 3 || $object->type == 4) && $object->statut == 0 && $user->rights->facture->creer) - { - if (! $objectidnext) - { - print ''; - } - } - - // Delete - if ($user->rights->facture->supprimer) - { - if (! $object->is_erasable()) - { - print ''; - } - else if ($objectidnext) - { - print ''; - } - elseif ($object->getSommePaiement()) - { - print ''; - } - else - { - print ''; - } - } - else - { - print ''; - } - - print '
    '; - } - } - print '
    '; - - if ($action != 'prerelance' && $action != 'presend') - { - print '
    '; - print ''; // ancre - - // Documents generes - $filename=dol_sanitizeFileName($object->ref); - $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref); - $urlsource=$_SERVER['PHP_SELF'].'?facid='.$object->id; - $genallowed=$user->rights->facture->creer; - $delallowed=$user->rights->facture->supprimer; - - print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); - $somethingshown=$formfile->numoffiles; - - // Linked object block - $somethingshown=$object->showLinkedObjectBlock(); - - // Link for paypal payment - if (! empty($conf->paypal->enabled) && $object->statut != 0) - { - include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; - print showPaypalPaymentUrl('invoice',$object->ref); - } - - print '
    '; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'invoice',$socid); - - print '
    '; - } - else - { - /* - * Affiche formulaire mail - */ - - // By default if $action=='presend' - $titreform='SendBillByMail'; - $topicmail='SendBillRef'; - $modelmail='facture_send'; - - if ($action == 'prerelance') // For backward compatibility - { - $titrefrom='SendReminderBillByMail'; - $topicmail='SendReminderBillRef'; - $modelmail='facture_relance'; - $action='relance'; - } - else $action='send'; - - $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; - - // Build document if it not exists - if (! $file || ! is_readable($file)) - { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $result=facture_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; - } - - print '
    '; - print_titre($langs->trans($titreform)); - - // Cree l'objet formulaire mail - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->fromtype = 'user'; - $formmail->fromid = $user->id; - $formmail->fromname = $user->getFullName($langs); - $formmail->frommail = $user->email; - $formmail->withfrom=1; - $liste=array(); - foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; - $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; - $formmail->withtocc=$liste; - $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__'); - $formmail->withfile=2; - $formmail->withbody=1; - $formmail->withdeliveryreceipt=1; - $formmail->withcancel=1; - // Tableau des substitutions - $formmail->substit['__FACREF__']=$object->ref; - $formmail->substit['__SIGNATURE__']=$user->signature; - $formmail->substit['__PERSONALIZED__']=''; - $formmail->substit['__CONTACTCIVNAME__']=''; - - //Find the good contact adress - $custcontact=''; - $contactarr=array(); - $contactarr=$object->liste_contact(-1,'external'); - - if (is_array($contactarr) && count($contactarr)>0) { - foreach($contactarr as $contact) { - if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) { - - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; - - $contactstatic=new Contact($db); - $contactstatic->fetch($contact['id']); - $custcontact=$contactstatic->getFullName($langs,1); - } - } - - if (!empty($custcontact)) { - $formmail->substit['__CONTACTCIVNAME__']=$custcontact; - } - } - - - // Tableau des parametres complementaires du post - $formmail->param['action']=$action; - $formmail->param['models']=$modelmail; - $formmail->param['facid']=$object->id; - $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files - if (GETPOST("mode")=='init') - { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); - } - - $formmail->show_form(); - - print '
    '; - } + print ''; } else { - dol_print_error($db,$object->error); + /* + * Affiche formulaire mail + */ + + // By default if $action=='presend' + $titreform='SendBillByMail'; + $topicmail='SendBillRef'; + $modelmail='facture_send'; + + if ($action == 'prerelance') // For backward compatibility + { + $titrefrom='SendReminderBillByMail'; + $topicmail='SendReminderBillRef'; + $modelmail='facture_relance'; + $action='relance'; + } + else $action='send'; + + $ref = dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; + + // Build document if it not exists + if (! $file || ! is_readable($file)) + { + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $result=facture_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; + } + + print '
    '; + print_titre($langs->trans($titreform)); + + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->fromtype = 'user'; + $formmail->fromid = $user->id; + $formmail->fromname = $user->getFullName($langs); + $formmail->frommail = $user->email; + $formmail->withfrom=1; + $liste=array(); + foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) + { + $liste[$key]=$value; + } + $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; + $formmail->withtocc=$liste; + $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__(__REFCLIENT__)'); + } + $formmail->withfile=2; + $formmail->withbody=1; + $formmail->withdeliveryreceipt=1; + $formmail->withcancel=1; + // Tableau des substitutions + $formmail->substit['__FACREF__']=$object->ref; + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; + $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) { + + require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; + + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + + + // Tableau des parametres complementaires du post + $formmail->param['action']=$action; + $formmail->param['models']=$modelmail; + $formmail->param['facid']=$object->id; + $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); + } + + $formmail->show_form(); + + print '
    '; } } diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 8d6fb63cf80..0efcb94d079 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -52,7 +52,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; @@ -146,7 +146,9 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
    "; + $langs->load("members"); + + print "
    "; print_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php new file mode 100644 index 00000000000..a0c560d52cb --- /dev/null +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -0,0 +1,159 @@ + +* Copyright (C) 2003 Jean-Louis Bergamo +* Copyright (C) 2004-2011 Laurent Destailleur +* Copyright (C) 2012 Regis Houssin +* Copyright (C) 2013 Jean-Francois FERRY +* Copyright (C) 2013 Florian Henry +* +* 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 . +*/ + +/** +* \file htdocs/compta/facture/admin/facture_cust_extrafields.php +* \ingroup invoice +* \brief Page to setup extra fields of customer invoice +*/ + +require '../../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + +$langs->load("companies"); +$langs->load("admin"); +$langs->load("bills"); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); +$elementtype='facturedet'; //Must be the $table_element of the class that manage extrafield + +if (!$user->admin) accessforbidden(); + + +/* +* Actions +*/ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + + + +/* +* View +*/ + +$textobject=strtolower($langs->transnoentitiesnoconv("BillsCustomers")); + + +llxHeader('',$langs->trans("BillsSetup")); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup'); +print '
    '; + +$head = invoice_admin_prepare_head(null); + +dol_fiche_head($head, 'attributeslines', $langs->trans("Invoices"), 0, 'invoice'); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
    '."\n"; + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; + // $i++; +} + +print "
    '.$langs->trans("Position").''.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
    ".$extrafields->attribute_pos[$key]."".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
    "; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
    '; + print "".$langs->trans("NewAttribute").""; + print "
    "; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel +/* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
    "; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
    "; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index f31f0a50f0f..ab508e50035 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -149,7 +149,7 @@ if ($id > 0 || ! empty($ref)) print '
    '.$langs->trans('Discounts'); print ''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); if ($absolute_discount > 0) @@ -316,7 +316,7 @@ if ($id > 0 || ! empty($ref)) print_titre($langs->trans("Documents")); print ''; - print ""; + print ""; print ''; print ''; @@ -326,7 +326,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier detail PDF existe if (file_exists($filedetail)) // facture detaillee supplementaire { - print ""; + print ""; print ''; print ''; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 91616065284..ed9c04806a6 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -148,7 +148,6 @@ class FactureRec extends Facture for ($i = 0; $i < $num; $i++) { $result_insert = $this->addline( - $this->id, $facsrc->lines[$i]->desc, $facsrc->lines[$i]->subprice, $facsrc->lines[$i]->qty, @@ -400,7 +399,6 @@ class FactureRec extends Facture /** * Add a line to invoice * - * @param int $facid Id de la facture * @param string $desc Description de la ligne * @param double $pu_ht Prix unitaire HT (> 0 even for credit note) * @param double $qty Quantite @@ -417,8 +415,10 @@ class FactureRec extends Facture * @param string $label Label of the line * @return int <0 if KO, Id of line if OK */ - function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='') + function addline($desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='') { + $facid=$this->id; + dol_syslog("FactureRec::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a3ef1ec7931..e9bf109b9e7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1,37 +1,37 @@ - * Copyright (C) 2004-2012 Laurent Destailleur -* Copyright (C) 2004 Sebastien Di Cintio -* Copyright (C) 2004 Benoit Mortier -* Copyright (C) 2005 Marc Barilley / Ocebo -* Copyright (C) 2005-2013 Regis Houssin -* Copyright (C) 2006 Andre Cianfarani -* Copyright (C) 2007 Franky Van Liedekerke -* Copyright (C) 2010-2012 Juanjo Menent -* Copyright (C) 2012 Christophe Battarel -* Copyright (C) 2012 Marcos García -* Copyright (C) 2013 Cedric Gross -* Copyright (C) 2013 Florian Henry -* -* 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 . -*/ + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Cedric Gross + * Copyright (C) 2013 Florian Henry + * + * 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 . + */ /** * \file htdocs/compta/facture/class/facture.class.php -* \ingroup facture -* \brief File of class to manage invoices -*/ + * \ingroup facture + * \brief File of class to manage invoices + */ include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php'; @@ -181,9 +181,7 @@ class Facture extends CommonInvoice $result=$_facrec->fetch($this->fac_rec); $this->fk_project = $_facrec->fk_project; - $this->cond_reglement = $_facrec->cond_reglement_id; $this->cond_reglement_id = $_facrec->cond_reglement_id; - $this->mode_reglement = $_facrec->mode_reglement_id; $this->mode_reglement_id = $_facrec->mode_reglement_id; $this->remise_absolue = $_facrec->remise_absolue; $this->remise_percent = $_facrec->remise_percent; @@ -346,7 +344,6 @@ class Facture extends CommonInvoice } $result = $this->addline( - $this->id, $this->lines[$i]->desc, $this->lines[$i]->subprice, $this->lines[$i]->qty, @@ -405,7 +402,6 @@ class Facture extends CommonInvoice $localtax2_tx=get_localtax($tva_tx,2,$soc); $result_insert = $this->addline( - $this->id, $_facrec->lines[$i]->desc, $_facrec->lines[$i]->subprice, $_facrec->lines[$i]->qty, @@ -437,6 +433,7 @@ class Facture extends CommonInvoice if (! $error) { + $result=$this->update_price(1); if ($result > 0) { @@ -880,13 +877,10 @@ class Facture extends CommonInvoice // Retreive all extrafield for invoice // fetch optionals attributes and labels - if(!class_exists('Extrafields')) - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - if (count($extralabels)>0) { - $this->fetch_optionals($this->id,$extralabels); - } + $this->fetch_optionals($this->id,$extralabels); /* * Lines @@ -929,7 +923,7 @@ class Facture extends CommonInvoice $this->lines=array(); $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, '; - $sql.= ' l.localtax1_tx, l.localtax2_tx, l.remise, l.remise_percent, l.fk_remise_except, l.subprice,'; + $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.fk_remise_except, l.subprice,'; $sql.= ' l.rang, l.special_code,'; $sql.= ' l.date_start as date_start, l.date_end as date_end,'; $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; @@ -964,6 +958,8 @@ class Facture extends CommonInvoice $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; + $line->localtax1_type = $objp->localtax1_type; + $line->localtax2_type = $objp->localtax2_type; $line->remise_percent = $objp->remise_percent; $line->fk_remise_except = $objp->fk_remise_except; $line->fk_product = $objp->fk_product; @@ -1256,6 +1252,16 @@ class Facture extends CommonInvoice } // Fin appel triggers } + + // Removed extrafields + if (! $error) { + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR); + } + } if (! $error) { @@ -1327,7 +1333,7 @@ class Facture extends CommonInvoice { // On efface le repertoire de pdf provisoire $ref = dol_sanitizeFileName($this->ref); - if ($conf->facture->dir_output) + if ($conf->facture->dir_output && !empty($this->ref)) { $dir = $conf->facture->dir_output . "/" . $ref; $file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf"; @@ -1475,6 +1481,7 @@ class Facture extends CommonInvoice if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; $sql.= ' WHERE rowid = '.$this->id; + dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1490,8 +1497,7 @@ class Facture extends CommonInvoice else { $error++; - $this->error=$this->db->error(); - dol_print_error($this->db); + $this->error=$this->db->lasterror(); } if (! $error) @@ -1792,8 +1798,8 @@ class Facture extends CommonInvoice // Rename directory if dir was a temporary ref if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref) - // in order not to lose the attachments + // Rename of object directory ($this->ref = old ref, $num = new ref) + // to not lose the linked files $facref = dol_sanitizeFileName($this->ref); $snumfa = dol_sanitizeFileName($num); $dirsource = $conf->facture->dir_output.'/'.$facref; @@ -1951,7 +1957,6 @@ class Facture extends CommonInvoice * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * - * @param int $facid Id de la facture * @param string $desc Description de la ligne * @param double $pu_ht Prix unitaire HT (> 0 even for credit note) * @param double $qty Quantite @@ -1976,10 +1981,15 @@ class Facture extends CommonInvoice * @param int $fk_fournprice To calculate margin * @param int $pa_ht Buying price of line * @param string $label Label of the line + * @param array $array_option extrafields array * @return int <0 if KO, Id of line if OK */ - function addline($facid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_option=0) { + global $mysoc; + + $facid=$this->id; + dol_syslog(get_class($this)."::Addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -2023,7 +2033,10 @@ class Facture extends CommonInvoice // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'',$localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -2070,6 +2083,8 @@ class Facture extends CommonInvoice $this->line->total_tva= (($this->type==2||$qty<0)?-abs($total_tva):$total_tva); $this->line->total_localtax1=(($this->type==2||$qty<0)?-abs($total_localtax1):$total_localtax1); $this->line->total_localtax2=(($this->type==2||$qty<0)?-abs($total_localtax2):$total_localtax2); + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; $this->line->total_ttc= (($this->type==2||$qty<0)?-abs($total_ttc):$total_ttc); $this->line->special_code=$special_code; $this->line->fk_parent_line=$fk_parent_line; @@ -2080,6 +2095,10 @@ class Facture extends CommonInvoice $this->line->fk_fournprice = $fk_fournprice; $this->line->pa_ht = $pa_ht; + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + $result=$this->line->insert(); if ($result > 0) { @@ -2133,12 +2152,15 @@ class Facture extends CommonInvoice * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label Label of the line * @param int $special_code Special code (also used by externals modules!) + * @param array $array_option extrafields array * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + global $mysoc; + dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line", LOG_DEBUG); if ($this->brouillon) @@ -2164,7 +2186,10 @@ class Facture extends CommonInvoice // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'',$localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -2206,6 +2231,8 @@ class Facture extends CommonInvoice $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; $this->line->remise_percent = $remise_percent; $this->line->subprice = ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise $this->line->date_start = $date_start; @@ -2229,6 +2256,10 @@ class Facture extends CommonInvoice //$this->line->price=$price; //$this->line->remise=$remise; + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + $result=$this->line->update(); if ($result > 0) { @@ -2521,6 +2552,7 @@ class Facture extends CommonInvoice { $file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php"; $classname = "mod_facture_".$conf->global->FACTURE_ADDON; + $classname = preg_replace('/\-.*$/','',$classname); // Include file with class foreach ($conf->file->dol_document_root as $dirroot) { @@ -2538,11 +2570,10 @@ class Facture extends CommonInvoice } $obj = new $classname(); - $numref = ""; $numref = $obj->getNumRef($soc,$this,$mode); - if ( $numref != "") + if ($numref != "") { return $numref; } @@ -2852,17 +2883,18 @@ class Facture extends CommonInvoice { dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); - $soc = new Societe($this->db); - $soc->id = $this->socid; - $soc->load_ban(); - if ($this->statut > 0 && $this->paye == 0) { - $sql = 'SELECT count(*)'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; + $bac = new CompanyBankAccount($this->db); + $bac->fetch(0,$this->socid); + + $sql = 'SELECT count(*)'; $sql.= ' FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; $sql.= ' WHERE fk_facture = '.$this->id; $sql.= ' AND traite = 0'; + dol_syslog(get_class($this)."::demande_prelevement sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -2886,18 +2918,21 @@ class Facture extends CommonInvoice $sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)'; $sql .= ' VALUES ('.$this->id; $sql .= ",'".price2num($resteapayer)."'"; - $sql .= ",".$this->db->idate($now).",".$user->id; - $sql .= ",'".$soc->bank_account->code_banque."'"; - $sql .= ",'".$soc->bank_account->code_guichet."'"; - $sql .= ",'".$soc->bank_account->number."'"; - $sql .= ",'".$soc->bank_account->cle_rib."')"; - if ( $this->db->query($sql)) + $sql .= ",'".$this->db->idate($now)."'"; + $sql .= ",".$user->id; + $sql .= ",'".$bac->code_banque."'"; + $sql .= ",'".$bac->code_guichet."'"; + $sql .= ",'".$bac->number."'"; + $sql .= ",'".$bac->cle_rib."')"; + + dol_syslog(get_class($this)."::demande_prelevement sql=".$sql); + if ($this->db->query($sql)) { return 1; } else - { - $this->error=$this->db->error(); + { + $this->error=$this->db->lasterror(); dol_syslog(get_class($this).'::demandeprelevement Erreur'); return -1; } @@ -3178,6 +3213,7 @@ class Facture extends CommonInvoice { $this->nb["invoices"]=$obj->nb; } + $this->db->free($resql); return 1; } else @@ -3218,6 +3254,7 @@ class Facture extends CommonInvoice { $obj = $this->db->fetch_object($resql); + $this->lines[$i] = new FactureLigne($this->db); $this->lines[$i]->id = $obj->rowid; $this->lines[$i]->label = $obj->custom_label; $this->lines[$i]->description = $obj->description; @@ -3270,11 +3307,14 @@ class Facture extends CommonInvoice * \brief Classe permettant la gestion des lignes de factures * Gere des lignes de la table llx_facturedet */ -class FactureLigne +class FactureLigne extends CommonInvoiceLine { var $db; var $error; + public $element='facturedet'; + public $table_element='facturedet'; + var $oldline; //! From llx_facturedet @@ -3293,6 +3333,8 @@ class FactureLigne var $tva_tx; // Taux tva produit/service (example 19.6) var $localtax1_tx; // Local tax 1 var $localtax2_tx; // Local tax 2 + var $localtax1_type; // Local tax 1 type + var $localtax2_type; // Local tax 2 type var $subprice; // P.U. HT (example 100) var $remise_percent; // % de la remise ligne (example 20%) var $fk_remise_except; // Link to line into llx_remise_except @@ -3440,6 +3482,8 @@ class FactureLigne if (empty($this->tva_tx)) $this->tva_tx=0; if (empty($this->localtax1_tx)) $this->localtax1_tx=0; if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->rang)) $this->rang=0; @@ -3464,7 +3508,8 @@ class FactureLigne // Insertion dans base de la ligne $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; - $sql.= ' (fk_facture, fk_parent_line, label, description, qty, tva_tx, localtax1_tx, localtax2_tx,'; + $sql.= ' (fk_facture, fk_parent_line, label, description, qty,'; + $sql.= ' tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; $sql.= ' fk_product, product_type, remise_percent, subprice, fk_remise_except,'; $sql.= ' date_start, date_end, fk_code_ventilation, '; $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; @@ -3477,6 +3522,8 @@ class FactureLigne $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; + $sql.= " '".$this->localtax1_type."',"; + $sql.= " '".$this->localtax2_type."',"; $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; $sql.= " ".$this->product_type.","; $sql.= " ".price2num($this->remise_percent).","; @@ -3503,6 +3550,16 @@ class FactureLigne { $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + // Si fk_remise_except defini, on lie la remise a la facture // ce qui la flague comme "consommee". if ($this->fk_remise_except) @@ -3594,6 +3651,8 @@ class FactureLigne if (empty($this->tva_tx)) $this->tva_tx=0; if (empty($this->localtax1_tx)) $this->localtax1_tx=0; if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->remise_percent)) $this->remise_percent=0; @@ -3626,6 +3685,8 @@ class FactureLigne $sql.= ",tva_tx=".price2num($this->tva_tx).""; $sql.= ",localtax1_tx=".price2num($this->localtax1_tx).""; $sql.= ",localtax2_tx=".price2num($this->localtax2_tx).""; + $sql.= ",localtax1_type='".$this->localtax1_type."'"; + $sql.= ",localtax2_type='".$this->localtax2_type."'"; $sql.= ",qty=".price2num($this->qty).""; $sql.= ",date_start=".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null"); $sql.= ",date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null"); @@ -3650,6 +3711,16 @@ class FactureLigne $resql=$this->db->query($sql); if ($resql) { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + if (! $notrigger) { // Appel des triggers diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 31b1d0812f8..676160ca846 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -28,8 +28,7 @@ include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** - * \class FactureStats - * \brief Classe permettant la gestion des stats des factures + * Class to manage stats for invoices (customer and supplier) */ class FactureStats extends Stats { @@ -40,7 +39,7 @@ class FactureStats extends Stats var $from; var $field; var $where; - + /** * Constructor @@ -57,18 +56,23 @@ class FactureStats extends Stats $this->db = $db; $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; - + $this->cachefilesuffix = $mode; + if ($mode == 'customer') { $object=new Facture($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as f"; + $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field='total'; + $this->field_line='total_ht'; } if ($mode == 'supplier') { $object=new FactureFournisseur($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as f"; + $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field='total_ht'; + $this->field_line='total_ht'; } $this->where = " f.fk_statut > 0"; @@ -86,8 +90,8 @@ class FactureStats extends Stats /** * Return orders number by month for a year * - * @param int $year Year to scan - * @return array Array of values + * @param int $year Year to scan + * @return array Array of values */ function getNbByMonth($year) { @@ -189,6 +193,31 @@ class FactureStats extends Stats return $this->_getAllByYear($sql); } + + /** + * Return nb, amount of predefined product for year + * + * @param int $year Year to scan + * @return array Array of values + */ + function getAllByProduct($year) + { + global $user; + + $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; + $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; + //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE ".$this->where; + $sql.= " AND f.rowid = tl.fk_facture AND tl.fk_product = product.rowid"; + $sql.= " AND f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " GROUP BY product.ref"; + $sql.= $this->db->order('nb','DESC'); + //$sql.= $this->db->plimit(20); + + return $this->_getAllByProduct($sql); + } + + } ?> diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 5671f4f8d9c..1eb5909544b 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -64,40 +65,17 @@ if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; $object = new Facture($db); - +if ($object->fetch($id)) +{ + $object->fetch_thirdparty(); + $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); +} /* * Actions */ +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; -// Envoi fichier -if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) -{ - if ($object->fetch($id)) - { - $object->fetch_thirdparty(); - $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); - dol_add_file_process($upload_dir,0,1,'userfile'); - } -} - -// Delete -if ($action == 'confirm_deletefile' && $confirm == 'yes') -{ - if ($object->fetch($id)) - { - $langs->load("other"); - $object->fetch_thirdparty(); - - $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); - $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } -} /* * View @@ -169,24 +147,10 @@ if ($id > 0 || ! empty($ref)) print "
    ".$langs->trans("Bill")." PDF
    ".$langs->trans("Bill")." PDF'.$object->ref.'.pdf'.dol_print_size(dol_filesize($file)). '
    Facture detaillee
    Facture detaillee'.$object->ref.'-detail.pdf'.dol_print_size(dol_filesize($filedetail)).'
    \n"; print "\n"; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '
    '; - } - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id,'',0,0,$user->rights->facture->creer,50,$object); - - - // List of document - $param='&facid='.$object->id; - $formfile->list_of_documents($filearray,$object,'facture',$param); + $modulepart = 'facture'; + $permission = $user->rights->facture->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else @@ -196,7 +160,7 @@ if ($id > 0 || ! empty($ref)) } else { - print $langs->trans("UnkownError"); + print $langs->trans("ErrorUnknown"); } $db->close(); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 8a550fe56bf..11e2e91b1e9 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $langs->load('bills'); +$langs->load('compta'); +$langs->load('products'); // Security check $id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int')); @@ -445,7 +447,7 @@ else if (! empty($objp->date_end)) $type=1; // Show line - print "
    '; @@ -522,7 +524,6 @@ else /* * List mode */ - $sql = "SELECT s.nom, s.rowid as socid, f.titre, f.total, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f"; $sql.= " WHERE f.fk_soc = s.rowid"; @@ -532,13 +533,14 @@ else //$sql .= " ORDER BY $sortfield $sortorder, rowid DESC "; // $sql .= $db->plimit($limit + 1,$offset); - $result = $db->query($sql); - - if ($result) + $resql = $db->query($sql); + if ($resql) { - $num = $db->num_rows($result); + $num = $db->num_rows($resql); print_barre_liste($langs->trans("RepeatableInvoices"),$page,$_SERVER['PHP_SELF'],"&socid=$socid",$sortfield,$sortorder,'',$num); + print $langs->trans("ToCreateAPredefinedInvoice").'

    '; + $i = 0; print ''; print ''; @@ -553,10 +555,10 @@ else $var=True; while ($i < min($num,$limit)) { - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; print '\n"; @@ -587,9 +589,10 @@ else $i++; } } + else print ''; print "
    '.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre; print "
    '.$langs->trans("NoneF").'
    "; - $db->free(); + $db->free($resql); } else { @@ -602,5 +605,4 @@ else llxFooter(); $db->close(); - ?> diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 79838cbe86b..57fc4e9b529 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -37,19 +37,21 @@ $langs->load("bills"); $id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int')); $action = GETPOST('action','alpha'); $option = GETPOST('option'); - -$diroutputpdf=$conf->facture->dir_output . '/unpaid/temp'; +$builddoc_generatebutton=GETPOST('builddoc_generatebutton'); // Security check if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user,'facture',$id,''); +$diroutputpdf=$conf->facture->dir_output . '/unpaid/temp'; +if (! $user->rights->societe->client->voir || $socid) $diroutputpdf.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user + /* * Action */ -if ($action == "builddoc" && $user->rights->facture->lire) +if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search') && !empty($builddoc_generatebutton)) { if (is_array($_POST['toGenerate'])) { @@ -149,14 +151,14 @@ if ($action == 'remove_file') * View */ +$form = new Form($db); +$formfile = new FormFile($db); + $title=$langs->trans("BillsCustomersUnpaid"); if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid"); llxHeader('',$title); -$form = new Form($db); -$formfile = new FormFile($db); - ?> liste_limit; $sql = "SELECT s.nom, s.rowid as socid"; -$sql.= ", f.rowid as facid, f.facnumber, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp"; +$sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp"; $sql.= ", f.datef as df, f.date_lim_reglement as datelimite"; $sql.= ", f.paye as paye, f.fk_statut, f.type"; $sql.= ", sum(pf.amount) as am"; @@ -222,12 +219,13 @@ if (GETPOST('filtre')) $sql .= " AND " . $filt[0] . " = " . $filt[1]; } } -if ($search_ref) $sql .= " AND f.facnumber LIKE '%".$search_ref."%'"; -if ($search_societe) $sql .= " AND s.nom LIKE '%".$search_societe."%'"; -if ($search_montant_ht) $sql .= " AND f.total = '".$search_montant_ht."'"; -if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$search_montant_ttc."'"; +if ($search_ref) $sql .= " AND f.facnumber LIKE '%".$db->escape($search_ref)."%'"; +if ($search_refcustomer) $sql .= " AND f.ref_client LIKE '%".$db->escape($search_refcustomer)."%'"; +if ($search_societe) $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'"; +if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'"; +if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; -$sql.= " GROUP BY s.nom, s.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.rowid, f.fk_statut, f.type "; +$sql.= " GROUP BY s.nom, s.rowid, f.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type "; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " ORDER BY "; $listfield=explode(',',$sortfield); @@ -251,6 +249,7 @@ if ($resql) $param.=(! empty($socid)?"&socid=".$socid:""); $param.=(! empty($option)?"&option=".$option:""); if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_refcustomer) $param.='&search_ref='.urlencode($search_refcustomer); if ($search_societe) $param.='&search_societe='.urlencode($search_societe); if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); @@ -271,11 +270,15 @@ if ($resql) dol_htmloutput_mesg($mesg); + print '
    '; + print ''; + if ($late) print ''; + $i = 0; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); @@ -289,27 +292,28 @@ if ($resql) print "\n"; // Lignes des champs de filtre - print ''; print ''; // Ref print ''; + print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print "\n"; - print ''; if ($num > 0) { @@ -321,9 +325,6 @@ if ($resql) $facturestatic=new Facture($db); - print ''; - print ''; - while ($i < $num) { $objp = $db->fetch_object($resql); @@ -363,8 +364,13 @@ if ($resql) print "\n"; - print ''."\n"; - print ''."\n"; + // Customer ref + print ''; + + print ''."\n"; + print ''."\n"; print ''; @@ -409,7 +415,7 @@ if ($resql) } print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -426,17 +432,13 @@ if ($resql) * Show list of available documents */ $filedir=$diroutputpdf; - if ($search_ref) print ''; - if ($search_societe) print ''; - if ($search_montant_ht) print ''; - if ($search_montant_ttc) print ''; - if ($late) print ''; $genallowed=$user->rights->facture->lire; $delallowed=$user->rights->facture->lire; print '
    '; print ''; - $formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'',1,0,0,48,1,$param,$langs->trans("PDFMerge"),$langs->trans("PDFMerge")); + // We disable multilang because we concat already existing pdf. + $formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'',1,1,0,48,1,$param,$langs->trans("PDFMerge"),$langs->trans("PDFMerge")); print ''; $db->free($resql); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 998d4fab931..12d2f0f032b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -8,6 +8,7 @@ * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -43,7 +44,6 @@ if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; } $langs->load('bills'); @@ -62,9 +62,11 @@ $confirm=GETPOST('confirm','alpha'); $lineid=GETPOST('lineid','int'); $userid=GETPOST('userid','int'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); +$search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); +$search_status=GETPOST('search_status','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -92,13 +94,10 @@ $fieldid = (! empty($ref)?'facnumber':'rowid'); if (! empty($user->societe_id)) $socid=$user->societe_id; $result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid); -// FIXME $usehm not used ? -$usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:false); - $object=new Facture($db); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('invoicecard')); +$hookmanager->initHooks(array('invoicelist')); $now=dol_now(); @@ -120,6 +119,8 @@ if (GETPOST("button_removefilter_x")) $search_refcustomer=''; $search_societe=''; $search_montant_ht=''; + $search_montant_ttc=''; + $search_status=''; $year=''; $month=''; } @@ -139,10 +140,10 @@ $facturestatic=new Facture($db); if (! $sall) $sql = 'SELECT'; else $sql = 'SELECT DISTINCT'; -$sql.= ' f.rowid as facid, f.facnumber, f.type, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,'; +$sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; $sql.= ' f.paye as paye, f.fk_statut,'; -$sql.= ' s.nom, s.rowid as socid'; +$sql.= ' s.nom, s.rowid as socid, s.code_client, s.client '; if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ', '.MAIN_DB_PREFIX.'facture as f'; @@ -175,11 +176,15 @@ if ($filtre) } if ($search_ref) { - $sql.= ' AND f.facnumber LIKE \'%'.$db->escape(trim($search_ref)).'%\''; + $sql .= natural_search('f.facnumber', $search_ref); +} +if ($search_refcustomer) +{ + $sql .= natural_search('f.ref_client', $search_refcustomer); } if ($search_societe) { - $sql.= ' AND s.nom LIKE \'%'.$db->escape(trim($search_societe)).'%\''; + $sql .= natural_search('s.nom', $search_societe); } if ($search_montant_ht) { @@ -189,6 +194,10 @@ if ($search_montant_ttc) { $sql.= ' AND f.total_ttc = \''.$db->escape(price2num(trim($search_montant_ttc))).'\''; } +if ($search_status != '') +{ + $sql.= " AND f.fk_statut = '".$db->escape($search_status)."'"; +} if ($month > 0) { if ($year > 0 && empty($day)) @@ -212,16 +221,25 @@ if (! $sall) $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total,f.tva, f.total_ttc,'; $sql.= ' f.datef, f.date_lim_reglement,'; $sql.= ' f.paye, f.fk_statut,'; - $sql.= ' s.nom, s.rowid'; + $sql.= ' s.nom, s.rowid, f.note_private'; } else { - $sql.= ' AND (s.nom LIKE \'%'.$db->escape($sall).'%\' OR f.facnumber LIKE \'%'.$db->escape($sall).'%\' OR f.note_private LIKE \'%'.$db->escape($sall).'%\' OR f.note_public LIKE \'%'.$db->escape($sall).'%\' OR fd.description LIKE \'%'.$db->escape($sall).'%\')'; + $sql .= natural_search(array('s.nom', 'f.facnumber', 'f.note_public', 'fd.description'), $sall); } $sql.= ' ORDER BY '; $listfield=explode(',',$sortfield); foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.','; $sql.= ' f.rowid DESC '; + +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + $sql.= $db->plimit($limit+1,$offset); //print $sql; @@ -240,12 +258,13 @@ if ($resql) if ($month) $param.='&month='.$month; if ($year) $param.='&year=' .$year; if ($search_ref) $param.='&search_ref=' .$search_ref; + if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer; if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_sale > 0) $param.='&search_sale=' .$search_sale; if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc; - print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); + print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); $i = 0; print '
    '."\n"; @@ -269,13 +288,14 @@ if ($resql) if ($moreforfilter) { print '
    '; - print ''; } print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Company'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder); @@ -290,8 +310,11 @@ if ($resql) // Filters lines print ''; print ''; + print ''; print ''; print ''; print ''; - print '\n"; if ($num > 0) @@ -337,24 +360,35 @@ if ($resql) print $objp->increment; print ''; - print ''; + print ''; print ''; print '
    '; print ''; + print ''; + print '     '; - print ''; + print ''; print ''; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
    '.dol_print_date($db->jdate($objp->df),'day').''.dol_print_date($db->jdate($objp->datelimite),'day').''; + print $objp->ref_client; + print ''.dol_print_date($db->jdate($objp->df),'day').''.dol_print_date($db->jdate($objp->datelimite),'day').''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,28).'
    '.$langs->trans("Total").''.$langs->trans("Total").''.price($total_ht).''.price($total_tva).''.price($total_ttc).'
    '; + print ''; print $moreforfilter; print '
    '; - print ''; + print ''; print ''; + print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; @@ -303,7 +326,7 @@ if ($resql) print '  '; + print ''; print "
    '; + print ''; + if (! empty($objp->note_private)) + { + print ' '; + print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + print ''; + } $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid; print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); - print '
    '; print "
    '; + // Customer ref + print ''; + print $objp->ref_client; + print ''; print dol_print_date($db->jdate($objp->df),'day'); print ''.dol_print_date($datelimit,'day'); + print ''.dol_print_date($datelimit,'day'); if ($datelimit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1 && ! $paiement) { print img_warning($langs->trans('Late')); @@ -365,16 +399,18 @@ if ($resql) $thirdparty=new Societe($db); $thirdparty->id=$objp->socid; $thirdparty->nom=$objp->nom; + $thirdparty->client=$objp->client; + $thirdparty->code_client=$objp->code_client; print $thirdparty->getNomUrl(1,'customer'); print ''.price($objp->total_ht).' '.$langs->getCurrencySymbol($conf->currency).''.price($objp->total_ht,0,$langs).''.price($objp->total_tva).' '.$langs->getCurrencySymbol($conf->currency).''.price($objp->total_tva,0,$langs).''.price($objp->total_ttc).' '.$langs->getCurrencySymbol($conf->currency).''.price($objp->total_ttc,0,$langs).''.(! empty($paiement)?price($paiement).' '.$langs->getCurrencySymbol($conf->currency):' ').''.(! empty($paiement)?price($paiement,0,$langs):' ').''; @@ -393,11 +429,11 @@ if ($resql) { // Print total print '
    '.$langs->trans('Total').''.price($total_ht).' '.$langs->getCurrencySymbol($conf->currency).''.price($total_tva).' '.$langs->getCurrencySymbol($conf->currency).''.price($total_ttc).' '.$langs->getCurrencySymbol($conf->currency).''.price($totalrecu).' '.$langs->getCurrencySymbol($conf->currency).''.$langs->trans('Total').''.price($total_ht,0,$langs).''.price($total_tva,0,$langs).''.price($total_ttc,0,$langs).''.price($totalrecu,0,$langs).' 
    '.$langs->trans('Discounts').''; - if ($object->thirdparty->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_client); + if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; if ($absolute_discount > 0) @@ -429,7 +428,7 @@ if ($object->id > 0) /* * Withdrawal request - */ + */ $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; $sql .= " , pfd.date_traite as date_traite"; @@ -463,12 +462,13 @@ if ($object->id > 0) } else { - print ''.$langs->trans("MakeWithdrawRequest").''; + print ''.$langs->trans("MakeWithdrawRequest").''; } } else { - print ''.$langs->trans("MakeWithdrawRequest").''; + if ($num == 0) print ''.$langs->trans("MakeWithdrawRequest").''; + else print ''.$langs->trans("MakeWithdrawRequest").''; } print "
    \n"; @@ -546,7 +546,7 @@ if ($object->id > 0) $obj = $db->fetch_object($result); $var=!$var; - print "
    '.dol_print_date($db->jdate($obj->date_demande),'day')."
    '; - print ''; + print ''; // Company print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; } print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index e67e4868dcc..bccf0128b42 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -133,7 +133,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) */ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { - print ''; + print ''; print ''; print '
    '.$langs->trans("Filter").'
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; @@ -266,14 +267,14 @@ foreach ($data as $val) { // If we have empty year $oldyear--; print '
    '.$oldyear.'0?'&userid='.$userid:'').'">'.$oldyear.'000
    '.$year.'0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
    '; print ''; @@ -216,7 +216,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $i = 0; $tot_ttc = 0; - while ($i < $num && $i < 20) + while ($i < $num) { $obj = $db->fetch_object($resql); print '"; + print ""; $chargestatic->id=$obj->rowid; $chargestatic->ref=$obj->libelle; $chargestatic->lib=$obj->libelle; @@ -762,7 +762,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us { $obj = $db->fetch_object($resql); - print ""; + print ""; print '"; + print ""; print ""; $i++; } diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 887e9b85b6b..847a0bda654 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -1,7 +1,7 @@ * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2011-2012 Alexandre spangaro * Copyright (C) 2013 Marcos García @@ -61,7 +61,9 @@ if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accountin * View */ -llxHeader('',$langs->trans("PurchasesJournal"),''); +$morequery='&date_startyear='.$date_startyear.'&date_startmonth='.$date_startmonth.'&date_startday='.$date_startday.'&date_endyear='.$date_endyear.'&date_endmonth='.$date_endmonth.'&date_endday='.$date_endday; + +llxHeader('',$langs->trans("PurchasesJournal"),'','',0,0,'','',$morequery); $form=new Form($db); @@ -96,6 +98,7 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; + $sql = "SELECT f.rowid, f.ref_supplier, f.type, f.datef, f.libelle,"; $sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,"; $sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,"; @@ -111,6 +114,9 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.t else $sql.= " AND f.type IN (0,1,2,3)"; if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; +// TODO Find a better trick to avoid problem with some mysql installations +if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1'); + dol_syslog("sql=".$sql); $result = $db->query($sql); if ($result) @@ -118,7 +124,7 @@ if ($result) $num = $db->num_rows($result); // les variables $cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER)?$conf->global->COMPTA_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef")); - $cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)?$conf->global->COMPTA_VAT_ACCOUNT:$langs->trans("CodeNotDef")); + $cpttva = (! empty($conf->global->COMPTA_VAT_BUY_ACCOUNT)?$conf->global->COMPTA_VAT_BUY_ACCOUNT:$langs->trans("CodeNotDef")); $tabfac = array(); $tabht = array(); @@ -226,7 +232,7 @@ foreach ($tabfac as $key => $val) { print ""; //print ""; - print ""; + print ""; print ""; print ""; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index f502cb79e94..e6700684dba 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -1,7 +1,7 @@ * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2011-2012 Alexandre Spangaro * Copyright (C) 2013 Marcos García @@ -64,7 +64,9 @@ if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accountin $form=new Form($db); -llxHeader('',$langs->trans("SellsJournal"),''); +$morequery='&date_startyear='.$date_startyear.'&date_startmonth='.$date_startmonth.'&date_startday='.$date_startday.'&date_endyear='.$date_endyear.'&date_endmonth='.$date_endmonth.'&date_endday='.$date_endday; + +llxHeader('',$langs->trans("SellsJournal"),'','',0,0,'','',$morequery); $year_current = strftime("%Y",dol_now()); @@ -116,6 +118,9 @@ $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)."'"; $sql.= " ORDER BY f.rowid"; +// TODO Find a better trick to avoid problem with some mysql installations +if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1'); + dol_syslog("sql=".$sql); $result = $db->query($sql); if ($result) @@ -237,7 +242,7 @@ foreach ($tabfac as $key => $val) { print ""; //print ""; - print ""; + print ""; print ""; print ""; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index d82e7fabad9..72b02194bc1 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -176,15 +176,15 @@ if (is_array($coll_list)) } } print ""; - print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->localtax2; print "\n"; @@ -194,8 +194,8 @@ if (is_array($coll_list)) $x_coll_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } else @@ -244,16 +244,16 @@ if (is_array($coll_list)) $intra = ''; } } - print ""; - print ""; + print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->localtax2; print "\n"; @@ -263,8 +263,8 @@ if (is_array($coll_list)) $x_paye_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '
    '.$langs->trans("SearchASupplierInvoice").'
    '; @@ -285,10 +285,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $i = 0; $tot_ttc = 0; - while ($i < $num && $i < 20) + while ($i < $num) { $obj = $db->fetch_object($resql); - print '
    '; + print '
    '; $facturesupplierstatic->ref=$obj->ref; $facturesupplierstatic->id=$obj->rowid; $facturesupplierstatic->type=$obj->type; @@ -679,7 +679,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - print "
    '; $commandestatic->id=$obj->rowid; @@ -1026,7 +1026,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; - print "
    ".dol_print_date($obj->da,"day")."
    ".dol_print_date($obj->da,"day")."$obj->libelle $obj->label
    ".$conf->global->COMPTA_JOURNAL_BUY."".$val["date"]."".dol_print_date($val["date"])."".$invoicestatic->getNomUrl(1)."".$k."".$line['label']."
    ".$conf->global->COMPTA_JOURNAL_SELL."".$val["date"]."".dol_print_date($val["date"])."".$invoicestatic->getNomUrl(1)."".$k."".$line['label']."
    ".$i."'.$i."'.$company_static->getNomUrl(1).''.$company_static->getNomUrl(1).'".$intra."".price($coll->amount)."".price($coll->localtax2)."'.$intra."".price($coll->amount)."".price($coll->localtax2)."
    '.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
    ".$i."
    '.$i."'.$company_static->getNomUrl(1).''.$company_static->getNomUrl(1).'".$intra."".price($coll->amount)."".price($coll->localtax2)."'.$intra."".price($coll->amount)."".price($coll->localtax2)."
    '.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
    '; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 0d46cd7ae11..aaa36a7edd7 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -83,7 +83,7 @@ function pt ($db, $sql, $date) $db->free($result); } else { - dolibar_print_error($db); + dol_print_error($db); } } @@ -148,8 +148,8 @@ for ($m = 1 ; $m < 13 ; $m++ ) } $var=!$var; - print "
    '.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'
    '.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."".price($x_coll)."".price($x_paye)."".price($x_paye)."".price($diff)."".price($diff)." 
    '; print ''; - print ''; + print ''; print ""; - print ''; + print ''; print ""; print "\n"; $var=1; @@ -66,7 +66,7 @@ if ($result) { $obj = $db->fetch_object($result); $var=!$var; - print ""; + print ""; $localtax_static->id=$obj->rowid; $localtax_static->ref=$obj->rowid; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index c8a2480155c..7a149ed80fd 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -57,7 +57,20 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$object=new Facture($db); +// Load object +if ($facid > 0) +{ + $ret=$object->fetch($facid); +} + +// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array +$hookmanager = new HookManager($db); +$hookmanager->initHooks(array('paiementcard')); + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks /* * Action add_paiement et confirm_paiement @@ -384,7 +397,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Date payment print ''; print ''; @@ -473,6 +486,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes } + // Sort invoices by date and serial number: the older one comes first + $sql.=' ORDER BY f.datef ASC, f.facnumber ASC'; + $resql = $db->query($sql); if ($resql) { @@ -576,6 +592,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook print "\n"; @@ -710,6 +728,10 @@ if (! GETPOST('action')) print '\n"; print '\n"; print ''; + + $parameters=array(); + $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook + print ''; $i++; } diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php index 03ebf1d40a6..82936395d2a 100644 --- a/htdocs/compta/paiement/avalider.php +++ b/htdocs/compta/paiement/avalider.php @@ -95,7 +95,7 @@ if ($resql) { $objp = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; print ''; print '\n"; print "\n"; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 2d5eaebf8e9..aec7c54d53a 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -21,13 +21,13 @@ /** * \file htdocs/compta/paiement/cheque/class/remisecheque.class.php * \ingroup compta - * \brief Fichier de la classe des bordereau de remise de cheque + * \brief File with class to manage cheque delivery receipts */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - * Classe permettant la gestion des remises de cheque + * Class to manage cheque delivery receipts */ class RemiseCheque extends CommonObject { @@ -37,6 +37,7 @@ class RemiseCheque extends CommonObject var $id; var $num; var $intitule; + var $ref_ext; //! Numero d'erreur Plage 1024-1279 var $errno; @@ -63,7 +64,7 @@ class RemiseCheque extends CommonObject { global $conf; - $sql = "SELECT bc.rowid, bc.datec, bc.fk_user_author, bc.fk_bank_account, bc.amount, bc.number, bc.statut, bc.nbcheque"; + $sql = "SELECT bc.rowid, bc.datec, bc.fk_user_author, bc.fk_bank_account, bc.amount, bc.number, bc.statut, bc.nbcheque, bc.ref_ext"; $sql.= ", bc.date_bordereau as date_bordereau"; $sql.= ", ba.label as account_label"; $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc"; @@ -86,6 +87,7 @@ class RemiseCheque extends CommonObject $this->author_id = $obj->fk_user_author; $this->nbcheque = $obj->nbcheque; $this->statut = $obj->statut; + $this->ref_ext = $obj->ref_ext; if ($this->statut == 0) { @@ -139,6 +141,7 @@ class RemiseCheque extends CommonObject $sql.= ", number"; $sql.= ", entity"; $sql.= ", nbcheque"; + $sql.= ", ref_ext"; $sql.= ") VALUES ("; $sql.= $this->db->idate($now); $sql.= ", ".$this->db->idate($now); @@ -149,6 +152,7 @@ class RemiseCheque extends CommonObject $sql.= ", 0"; $sql.= ", ".$conf->entity; $sql.= ", 0"; + $sql.= ", ''"; $sql.= ")"; dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); @@ -576,25 +580,25 @@ class RemiseCheque extends CommonObject if ( $resql ) { while ( $row = $this->db->fetch_row($resql) ) - { - $total += $row[0]; - $nb++; - } + { + $total += $row[0]; + $nb++; + } - $this->db->free($resql); + $this->db->free($resql); - $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql.= " SET amount = '".price2num($total)."'"; - $sql.= ", nbcheque = ".$nb; - $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; + $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; + $sql.= " SET amount = '".price2num($total)."'"; + $sql.= ", nbcheque = ".$nb; + $sql.= " WHERE rowid = ".$this->id; + $sql.= " AND entity = ".$conf->entity; - $resql = $this->db->query($sql); - if (!$resql) - { - $this->errno = -1030; - dol_syslog("RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)"); - } + $resql = $this->db->query($sql); + if (!$resql) + { + $this->errno = -1030; + dol_syslog("RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)"); + } } else { @@ -725,7 +729,7 @@ class RemiseCheque extends CommonObject /** * Renvoie nom clicable (avec eventuellement le picto) * - * @param int $withpicto Inclut le picto dans le lien + * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param string $option Sur quoi pointe le lien * @return string Chaine avec URL */ @@ -735,14 +739,13 @@ class RemiseCheque extends CommonObject $result=''; - $number=$this->ref; - if ($this->statut == 0) $number='(PROV'.$this->id.')'; - $lien = ''; $lienfin=''; - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"),'payment').$lienfin.' '); - $result.=$lien.$number.$lienfin; + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"),'payment').$lienfin); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; + return $result; } diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index ae0469d581c..6c601b20f72 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -3,6 +3,7 @@ * Copyright (C) 2007-2011 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -60,7 +61,6 @@ $offset = $limit * $page ; $dir=$conf->banque->dir_output.'/bordereau/'; $filterdate=dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear')); $filteraccountid=GETPOST('accountid'); -//var_dump($_POST); $object = new RemiseCheque($db); @@ -80,12 +80,35 @@ if ($action == 'setdate' && $user->rights->banque->cheque) $result=$object->set_date($user,$date); if ($result < 0) { - $mesg='
    '.$object->error.'
    '; + setEventMessage($object->error, 'errors'); } } else { - $mesg='
    '.$object->error.'
    '; + setEventMessage($object->error, 'errors'); + } +} + +/* + * Actions + */ + +if ($action == 'setrefext' && $user->rights->banque->cheque) +{ + $result = $object->fetch(GETPOST('id','int')); + if ($result > 0) + { + $ref_ext = GETPOST('ref_ext'); + + $result=$object->setValueFrom('ref_ext', $ref_ext); + if ($result < 0) + { + setEventMessage($object->error, 'errors'); + } + } + else + { + setEventMessage($object->error, 'errors'); } } @@ -117,12 +140,12 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che } else { - $mesg='
    '.$object->error.'
    '; + setEventMessage($object->error, 'errors'); } } else { - $mesg=$langs->trans("ErrorSelectAtLeastOne"); + setEventMessage($langs->trans("ErrorSelectAtLeastOne")); $action='new'; } } @@ -138,7 +161,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq } else { - $mesg='
    '.$object->error.'
    '; + setEventMessage($object->error, 'errors'); } } @@ -153,7 +176,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c } else { - $mesg='
    '.$paiement->error.'
    '; + setEventMessage($paiement->error, 'errors'); } } @@ -180,7 +203,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c } else { - $mesg='
    '.$paiement->error.'
    '; + setEventMessage($paiement->error, 'errors'); } } @@ -188,10 +211,8 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) { $result = $object->fetch($id); - /*if ($_REQUEST['model']) - { - $object->setDocModel($user, $_REQUEST['model']); - }*/ + // Save last template used to generate document + //if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); $outputlangs = $langs; $newlang=''; @@ -283,8 +304,8 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1); + } /* @@ -292,8 +313,8 @@ else */ if ($action == 'valide') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1); + } } @@ -492,6 +513,32 @@ else print ''; print '
    '; + // External ref + print ''; + print ''; + print ''; @@ -535,7 +582,7 @@ else $param="&id=".$object->id; print ''; - print_liste_field_titre($langs->trans("Cheque"),'','','','','width="30"'); + print_liste_field_titre($langs->trans("Cheques"),'','','','','width="30"'); print_liste_field_titre($langs->trans("DateChequeReceived"),$_SERVER["PHP_SELF"],"b.dateo,b.rowid", "",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"b.num_chq", "",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("CheckTransmitter"),$_SERVER["PHP_SELF"],"b.emetteur", "",$param,"",$sortfield,$sortorder); @@ -553,7 +600,7 @@ else $accounts[$objp->bid]=0; $accounts[$objp->bid] += 1; - print ""; + print ""; print ''; print ''; // Date operation print ''; diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 80ea9ea6817..bcfa32582d4 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -55,7 +55,7 @@ $sql = "SELECT count(b.rowid)"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " WHERE ba.rowid = b.fk_account"; -$sql.= " AND ba.entity = ".$conf->entity; +$sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; $sql.= " AND b.fk_type = 'CHQ'"; $sql.= " AND b.fk_bordereau = 0"; $sql.= " AND b.amount > 0"; @@ -126,7 +126,7 @@ if ($resql) $accountstatic->label=$objp->label; $var=!$var; - print "\n"; + print "\n"; print ''; print ''; diff --git a/htdocs/compta/paiement/cheque/liste.php b/htdocs/compta/paiement/cheque/liste.php index 705bc15eb88..7f656a75c79 100644 --- a/htdocs/compta/paiement/cheque/liste.php +++ b/htdocs/compta/paiement/cheque/liste.php @@ -102,7 +102,7 @@ if ($resql) print ''; print ''; print ''; print "\n"; @@ -111,7 +111,7 @@ if ($resql) { $objp = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; // Num ref cheque print ''; // Amount -print ''; +print ''; // Note print ''; print ''; print ''; print ''; + + print ''; + print ''; + print ''; + print ''; + + if($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) { + dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php'); + $bordereau = new RemiseCheque($db); + $bordereau->fetch($bankline->fk_bordereau); + + print ''; + print ''; + print ''; + print ''; + } } } diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index db2b3173a1c..32400cf29cc 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2006 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -28,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("bills"); +$langs->load("compta"); // Security check $facid =GETPOST('facid','int'); @@ -112,7 +114,7 @@ else if (GETPOST("search_account") > 0) $sql .=" AND b.fk_account=".GETPOST("search_account",'int'); if (GETPOST("search_paymenttype") != "") $sql .=" AND c.code='".GETPOST("search_paymenttype")."'"; if (GETPOST("search_amount")) $sql .=" AND p.amount=".price2num(GETPOST("search_amount")); - if (GETPOST("search_company")) $sql .=" AND s.nom LIKE '%".$db->escape(GETPOST("search_company"))."%'"; + if (GETPOST("search_company")) $sql .= natural_search('s.nom', GETPOST('search_company')); } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -166,7 +168,7 @@ if ($resql) print ''; print ''; if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { @@ -180,7 +182,7 @@ if ($resql) { $objp = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; print '\n"; - // } - // $db->free(); - // } - // else - // { - // print $sql ."
    ".$db->error(); - // } - /* - * - */ print "
    '.$langs->trans("Ref").''.$langs->trans("Ref").'".$langs->trans("Label")."'.$langs->trans("DatePayment").''.$langs->trans("DatePayment").'".$langs->trans("PayedByThisPayment")."
    '.$langs->trans('Date').''; $datepayment = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - $datepayment= ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0) : $datepayment); + $datepayment= ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'') : $datepayment); $form->select_date($datepayment,'','','',0,"add_paiement",1,1); print ''.$langs->trans('Comments').'
    '.dol_print_date($db->jdate($objp->dp))."'.$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount).' 
    '.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."$objp->paiement_type $objp->num_paiement
    '; + + print ''; + if ($action != 'editrefext') print ''; + print '
    '; + print $langs->trans('RefExt'); + print 'id.'">'.img_edit($langs->trans('SetRefExt'),1).'
    '; + print '
    '; + if ($action == 'editrefext') + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + else + { + print $object->ref_ext; + } + + print '
    '.$langs->trans('Account').''; print $accountstatic->getNomUrl(1); print '
    '.$i.''.dol_print_date($db->jdate($objp->date),'day').''.($objp->num_chq?$objp->num_chq:' ').'
    '.$checkdepositstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->db),'day').''; - print ''; + print ''; print '
    '; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 7ef5f44fb88..86ff46d2a53 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002-2004 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2014 Marcos García * * 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 @@ -209,7 +210,15 @@ class Paiement extends CommonObject } } - if ($invoice->type != 0 && $invoice->type != 1 && $invoice->type != 2) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note. We do nothing more."); + //Invoice types that are eligible for changing status to paid + $affected_types = array( + 0, + 1, + 2, + 3 + ); + + if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice. We do nothing more."); else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more."); else $result=$invoice->set_paid($user,'',''); diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 50ce36d4e9c..6d3d7157833 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -192,8 +192,8 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"), 0, 'p */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); + } /* @@ -202,8 +202,8 @@ if ($action == 'delete') if ($action == 'valide') { $facid = $_GET['facid']; - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + } @@ -230,7 +230,7 @@ print $form->editfieldval("Numero",'num_paiement',$object->numero,$object,$objec print '
    '.$langs->trans('Amount').''.price($object->montant).' '.$langs->trans('Currency'.$conf->currency).'
    '.$langs->trans('Amount').''.price($object->montant,'',$langs,0,0,-1,$conf->currency).'
    '.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->facture->paiement).''; @@ -248,9 +248,32 @@ if (! empty($conf->banque->enabled)) print '
    '.$langs->trans('BankTransactionLine').''; - print $bankline->getNomUrl(1,0,'showall'); + print $bankline->getNomUrl(1,0,'showconciliated'); print '
    '.$langs->trans('BankAccount').''; + $accountstatic=new Account($db); + $accountstatic->id=$bankline->fk_account; + $accountstatic->label=$bankline->bank_account_ref.' - '.$bankline->bank_account_label; + print $accountstatic->getNomUrl(0); + print '
    '.$langs->trans('CheckReceipt').''; + print $bordereau->getNomUrl(1); + print '
    '; print ''; - print ''; + print ''; print '
    '; $paymentstatic->id=$objp->rowid; diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index ce4a3b7cb7f..eeeaa715718 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * * 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 @@ -32,16 +32,16 @@ if (! $user->rights->facture->lire) accessforbidden(); $action=GETPOST('action'); -$dir = $conf->facture->dir_output.'/payments'; - $socid=0; if ($user->societe_id > 0) { $action = ''; $socid = $user->societe_id; - $dir = $conf->facture->dir_output.'/payments/private/'.$user->id; } +$dir = $conf->facture->dir_output.'/payments'; +if (! $user->rights->societe->client->voir || $socid) $dir.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user + $year = $_GET["year"]; if (! $year) { $year=date("Y"); } @@ -55,10 +55,10 @@ if ($action == 'builddoc') $rap = new pdf_paiement($db); $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + if (GETPOST('lang_id')) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang(GETPOST('lang_id')); } // We save charset_output to restore it because write_file can change it if needed for diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 09d053c47b2..637c426d7c9 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * * 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 @@ -28,7 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("bills"); -$chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"]; +$chid=GETPOST("id"); +$action=GETPOST('action'); $amounts = array(); // Security check @@ -43,7 +44,7 @@ if ($user->societe_id > 0) * Actions */ -if ($_POST["action"] == 'add_payment') +if ($action == 'add_payment') { $error=0; @@ -171,7 +172,8 @@ if ($_GET["action"] == 'create') print '
    '; print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -184,7 +186,6 @@ if ($_GET["action"] == 'create') print '\n"; print '\n"; print '\n"; - print ''; $sql = "SELECT sum(p.amount) as total"; @@ -198,43 +199,50 @@ if ($_GET["action"] == 'create') $db->free(); } print ''; - print "'; + print "'; - print "'; + print ''; - print ""; + print "'; - print '"; - print ''; + print ''; - print '\n"; - - print ''; + print ''; print ''; print ''; - print ''; print '\n"; + print ''."\n"; + + print ''; + print ''; + print ''; + print ''; + + print '
    '.$langs->trans("Period")."".dol_print_date($charge->periode,'day')."
    '.$langs->trans("Label").''.$charge->lib."
    '.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."
    '.$langs->trans("AmountTTC")."".price($charge->amount).' '.$langs->trans("Currency".$conf->currency).'
    '.$langs->trans("AlreadyPaid").''.price($sumpaid).' '.$langs->trans("Currency".$conf->currency).'
    ".$langs->trans("RemainderToPay")."".price($total - $sumpaid).' '.$langs->trans("Currency".$conf->currency).'
    ".$langs->trans("RemainderToPay").''.price($total - $sumpaid).' '.$langs->trans("Currency".$conf->currency).'
    ".$langs->trans("Payment").'
    ".$langs->trans("Payment").'
    '.$langs->trans("Date").''; + print '
    '.$langs->trans("Date").''; $datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0; $form->select_date($datepayment,'','','','',"add_payment",1,1); print "'.$langs->trans("Comments").'
    '.$langs->trans("PaymentMode").''; + print '
    '.$langs->trans("PaymentMode").''; $form->select_types_paiements(isset($_POST["paiementtype"])?$_POST["paiementtype"]:$charge->paiementtype, "paiementtype"); print "
    '.$langs->trans('AccountToDebit').''; + print ''; $form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$charge->accountid, "accountid", 0, '',1); // Show opend bank account list print '
    '.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; - print "
    '.$langs->trans("Comments").'
    '; + + print '
    '; /* * Autres charges impayees */ $num = 1; $i = 0; - print '
    '; - print ''; + print '
    '; print ''; //print ''; print ''; @@ -255,7 +263,7 @@ if ($_GET["action"] == 'create') $var=!$var; - print ""; + print ""; //print '\n"; @@ -303,17 +311,6 @@ if ($_GET["action"] == 'create') print ''; print "\n"; } - print "
    '.$langs->trans("SocialContribution").''.$langs->trans("DateDue").'
    '.$charge->getNomUrl(1)." 
    "; diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index 0ad3eaf8622..d502e6e2fc0 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -146,8 +146,8 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, */ if ($_GET['action'] == 'delete') { - $ret=$form->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - if ($ret == 'html') print '
    '; + print $form->formconfirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); + } /* @@ -156,8 +156,8 @@ if ($_GET['action'] == 'delete') if ($_GET['action'] == 'valide') { $facid = $_GET['facid']; - $ret=$form->form_confirm('fiche.php?id='.$paiement->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - if ($ret == 'html') print '
    '; + print $form->formconfirm('fiche.php?id='.$paiement->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + } diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index eecc14711ea..cd460f1aac2 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -88,7 +88,7 @@ if ($result) print ''; print '
     
    "; + print "
    "; print $bon->LibStatut($obj->statut,2); print " "; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7b2db3003dd..740d92ac0d8 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1,8 +1,8 @@ * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2014 Laurent Destailleur * * 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 @@ -576,8 +576,8 @@ class BonPrelevement extends CommonObject /** * Get invoice list * - * @param $amounts If you want to get the amount of the order for each invoice - * @return array id of invoices + * @param int $amounts If you want to get the amount of the order for each invoice + * @return array Id of invoices */ private function getListInvoices($amounts=0) { @@ -671,9 +671,10 @@ class BonPrelevement extends CommonObject /** * Get number of invoices to withdrawal + * TODO delete params banque and agence when not necesary * - * @param int $banque bank - * @param int $agence agence + * @param int $banque dolibarr mysoc bank + * @param int $agence dolibarr mysoc agence * @return int entity; $sql.= " AND f.rowid = pfd.fk_facture"; $sql.= " AND f.paye = 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND f.total_ttc > 0"; - if ($banque == 1 || $agence == 1) $sql.= " AND f.fk_soc = sr.rowid"; - if ($banque == 1) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'"; - if ($agence == 1) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'"; + //if ($banque || $agence) $sql.= " AND f.fk_soc = sr.rowid"; + //if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'"; + //if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'"; $resql = $this->db->query($sql); @@ -715,9 +716,10 @@ class BonPrelevement extends CommonObject /** * Create a withdraw + * TODO delete params banque and agence when not necesary * - * @param int $banque code of bank - * @param int $agence code of bank office (guichet) + * @param int $banque dolibarr mysoc bank + * @param int $agence dolibarr mysoc bank office (guichet) * @param string $mode real=do action, simu=test only * @return int <0 if KO, nbre of invoice withdrawed if OK */ @@ -755,17 +757,17 @@ class BonPrelevement extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - if ($banque == 1 || $agence ==1) $sql.= ", ".MAIN_DB_PREFIX."societe_rib as sr"; + //if ($banque || $agence) $sql.= ", ".MAIN_DB_PREFIX."societe_rib as sr"; $sql.= " WHERE f.rowid = pfd.fk_facture"; $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND s.rowid = f.fk_soc"; - if ($banque == 1 || $agence ==1) $sql.= " AND s.rowid = sr.fk_soc"; + //if ($banque || $agence) $sql.= " AND s.rowid = sr.fk_soc"; $sql.= " AND f.fk_statut = 1"; $sql.= " AND f.paye = 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND f.total_ttc > 0"; - if ($banque == 1) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'"; - if ($agence == 1) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'"; + //if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'"; + //if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'"; dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); @@ -777,7 +779,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $row = $this->db->fetch_row($resql); - $factures[$i] = $row; + $factures[$i] = $row; // All fields $i++; } $this->db->free($resql); @@ -793,22 +795,25 @@ class BonPrelevement extends CommonObject if (! $error) { - // Check RIB + require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; + $soc = new Societe($this->db); + + // Check RIB $i = 0; dol_syslog("Start RIB check"); if (count($factures) > 0) { - foreach ($factures as $fac) + foreach ($factures as $key => $fac) { $fact = new Facture($this->db); - - if ($fact->fetch($fac[0]) >= 0) + if ($fact->fetch($fac[0]) >= 0) // Field 0 of $fac is rowid of invoice { - $soc = new Societe($this->db); if ($soc->fetch($fact->socid) >= 0) { - if ($soc->verif_rib() == 1) + $bac = new CompanyBankAccount($this->db); + $bac->fetch(0,$soc->id); + if ($bac->verif() >= 1) { $factures_prev[$i] = $fac; /* second tableau necessaire pour BonPrelevement */ @@ -816,24 +821,24 @@ class BonPrelevement extends CommonObject $i++; } else - { - dol_syslog("Error on third party bank number RIB/IBAN $fact->socid $soc->nom", LOG_ERR); - $facture_errors[$fac[0]]="Error on third party bank number RIB/IBAN $fact->socid $soc->nom"; + { + dol_syslog("Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->nom, LOG_ERR); + $facture_errors[$fac[0]]="Error on default bank number RIB/IBAN for thirdparty reported by function verif() ".$fact->socid." ".$soc->nom; } } else - { + { dol_syslog("Failed to read company", LOG_ERR); } } else - { + { dol_syslog("Failed to read invoice", LOG_ERR); } } } else - { + { dol_syslog("No invoice to process"); } } @@ -1252,7 +1257,7 @@ class BonPrelevement extends CommonObject $num = $this->db->num_rows($resql); $client = new Societe($this->db); - + while ($i < $num) { $obj = $this->db->fetch_object($resql); diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index d040de378f2..a8c5b5f019c 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -26,10 +26,8 @@ /** - * \class LignePrelevement - * \brief Classe permettant la gestion des prelevements + * Class to manage withdrawals */ - class LignePrelevement { var $id; diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 543c0cdbab5..77bafae3603 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -175,6 +175,7 @@ class RejetPrelevement dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref); $fac->set_unpaid($fac->id, $user); + //TODO: Must be managed by notifications module // Send email to sender of the standing order request $this->_send_email($fac); } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index ddf8a988b48..81bb6794736 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -58,9 +58,9 @@ if ($action == 'modify') dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"),'chaine',0,'',$conf->entity); } } - if ($action == 'create') { + // $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty $bprev = new BonPrelevement($db); $result=$bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET); if ($result < 0) @@ -201,7 +201,7 @@ if ($resql) print $thirdpartystatic->getNomUrl(1,'customer'); print ''; - print price($obj->total_ttc).' '.$langs->trans("Currency".$conf->currency); + print price($obj->total_ttc,0,$langs,0,0,-1,$conf->currency); print ''; @@ -254,14 +254,14 @@ if ($result) $obj = $db->fetch_object($result); $var=!$var; - print "
    "; + print "
    "; $bprev->id=$obj->rowid; $bprev->ref=$obj->ref; print $bprev->getNomUrl(1); print "'.dol_print_date($db->jdate($obj->datec),'day')."'.price($obj->amount).' '.$langs->trans("Currency".$conf->currency)."'.price($obj->amount,0,$langs,0,0,-1,$conf->currency)."
    "; + print "
    "; print ''; print img_object($langs->trans("ShowBill"),"bill"); @@ -194,7 +194,7 @@ if ($result) if($socid) { - print "
    "; + print "
    "; print ''.$langs->trans("Total").'
    "; + print "
    "; print $ligne->LibStatut($row[1],1); diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index 43e2e042456..a4ec2ce9d14 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -150,8 +150,8 @@ if ($id > 0) /*if ($action == 'credite') { - $ret=$form->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1); - if ($ret == 'html') print '
    '; + print $form->formconfirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1); + }*/ print ''; diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 9d0d0fc3718..d9d993aff40 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -63,35 +63,35 @@ if ($action == 'confirm_rejet') $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors'); } - + elseif ($daterej > dol_now()) { $error++; $langs->load("error"); setEventMessage($langs->transnoentities("ErrorDateMustBeBeforeToday"),'errors'); } - + if (GETPOST('motif','alpha') == 0) { $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefusedReason")),'errors'); } - + if ( ! $error ) { $lipre = new LignePrelevement($db, $user); - + if ($lipre->fetch($id) == 0) - + { $rej = new RejetPrelevement($db, $user); - + $rej->create($user, $id, GETPOST('motif','alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer','int')); header("Location: ligne.php?id=".$id); exit; } - + } else { @@ -196,13 +196,13 @@ if ($id) print ''; //Date - print ''; + print ''; print ''; //Reason - print ''; + print ''; print ''; @@ -299,7 +299,7 @@ if ($id) { $obj = $db->fetch_object($result); - print "'; diff --git a/htdocs/compta/prelevement/liste.php b/htdocs/compta/prelevement/liste.php index 33e2bfb71e1..2cd859969a9 100644 --- a/htdocs/compta/prelevement/liste.php +++ b/htdocs/compta/prelevement/liste.php @@ -129,7 +129,7 @@ if ($result) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -141,7 +141,7 @@ if ($result) $var=!$var; - print ""; + print ""; print '\n"; print '"; + print ""; } $db->free($resql); } @@ -489,7 +523,7 @@ print "
    '.$langs->trans("RefusedData").'
    '.$langs->trans("RefusedData").''; print $form->select_date('','','','','',"confirm_rejet"); print '
    '.$langs->trans("RefusedReason").'
    '.$langs->trans("RefusedReason").''; print $form->selectarray("motif", $rej->motifs); print '
    "; + print "
    "; print ''; print img_object($langs->trans("ShowBill"),"bill"); @@ -325,7 +325,6 @@ if ($id) { dol_print_error($db); } - } llxFooter(); diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php index 32f83b93906..0942554ddd3 100644 --- a/htdocs/compta/prelevement/lignes.php +++ b/htdocs/compta/prelevement/lignes.php @@ -166,7 +166,7 @@ if ($result) { $obj = $db->fetch_object($result); - print "
    "; + print "
    "; print $ligne->LibStatut($obj->statut,2); print " "; @@ -199,7 +199,7 @@ if ($result) if($socid) { - print "
    "; + print "
    "; print 'Total  
    "; + print "
    "; print $ligne->LibStatut($obj->statut_ligne,2); print " "; diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 5744ab0eb7b..b307717e4b3 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -101,7 +101,7 @@ if ($result) { $obj = $db->fetch_object($result); - print "
    "; + print "
    "; print $ligne->LibStatut($obj->statut,2).' '; print ''; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 418d733dbd4..3da79a89f0c 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -102,7 +102,7 @@ if ($resql) { $row = $db->fetch_row($resql); - print "
    "; + print "
    "; print $ligne->LibStatut($row[2],1); //print $st[$row[2]]; @@ -202,7 +202,7 @@ if ($resql) { $row = $db->fetch_row($resql); - print "
    "; + print "
    "; print $Rejet->motifs[$row[2]]; print ''.$row[1]; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 78c81f9ab9c..609a624adce 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -177,7 +177,7 @@ if ($socid > 0) { $objp = $db->fetch_object($resqlp); //$var=!$var; - print "
    '.dol_print_date($db->jdate($objp->dp),'day')."'; print '      '; // Decalage diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 36aab937d92..9a08c76abe7 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -116,7 +116,8 @@ $total_ttc=0; if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("AnnualByCompaniesDueDebtMode"); - $nom.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().' '.img_next().''; $description=$langs->trans("RulesResultDue"); @@ -127,7 +128,8 @@ if ($modecompta=="CREANCES-DETTES") } else { $nom=$langs->trans("AnnualByCompaniesInputOutputMode"); - $nom.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().' '.img_next().''; @@ -135,7 +137,7 @@ else { $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta)); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); // Show report array print ''; @@ -198,7 +200,7 @@ if ($result) { $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ""; print "\n"; if ($modecompta == 'CREANCES-DETTES') @@ -243,7 +245,7 @@ if ($modecompta != 'CREANCES-DETTES') $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ""; print ""; + print ""; print ''; print ''; } @@ -330,8 +332,8 @@ if ($result) { $objp = $db->fetch_object($result); $var=!$var; - print ""; - print "\n"; + print ""; + print "\n"; if ($modecompta == 'CREANCES-DETTES') print "\n"; @@ -349,7 +351,7 @@ if ($result) { else { $var=!$var; - print ""; + print ""; print ''; print ''; } @@ -416,7 +418,7 @@ if ($result) { $subtotal_ttc += $obj->amount; $var = !$var; - print ""; + print ""; print ''; if ($modecompta == 'CREANCES-DETTES') print ''; print ''; @@ -426,7 +428,7 @@ if ($result) { } else { $var = !$var; - print ""; + print ""; print ''; print ''; } @@ -493,7 +495,7 @@ if ($result) { $subtotal_ttc += $obj->amount; $var = !$var; - print ""; + print ""; print ''; if ($modecompta == 'CREANCES-DETTES') print ''; @@ -504,7 +506,7 @@ if ($result) { } else { $var = !$var; - print ""; + print ""; print ''; print ''; } @@ -585,7 +587,7 @@ if ($modecompta == 'CREANCES-DETTES') } else { dol_print_error($db); } - print ""; + print ""; print "\n"; print "\n"; print "\n"; @@ -631,7 +633,7 @@ if ($modecompta == 'CREANCES-DETTES') } else { dol_print_error($db); } - print ""; + print ""; print "\n"; print "\n"; print "\n"; @@ -673,7 +675,7 @@ else } else { dol_print_error($db); } - print ""; + print ""; print "\n"; if ($modecompta == 'CREANCES-DETTES') print "\n"; @@ -716,7 +718,7 @@ else { dol_print_error($db); } - print ""; + print ""; print "\n"; if ($modecompta == 'CREANCES-DETTES') print "\n"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 4279490d801..e4ead871b42 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -63,7 +63,8 @@ $exportlink=''; if ($modecompta == 'CREANCES-DETTES') { $nom=$langs->trans("AnnualSummaryDueDebtMode"); - $nom.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); @@ -75,7 +76,8 @@ if ($modecompta == 'CREANCES-DETTES') } else { $nom=$langs->trans("AnnualSummaryInputOutputMode"); - $nom.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); @@ -83,7 +85,7 @@ else { $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta)); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); /* diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 2ec6539db9e..0b938510365 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -256,7 +256,7 @@ if ($id > 0) $head=tax_prepare_head($object); - print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); + dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); // Confirmation de la suppression de la charge if ($action == 'paid') @@ -297,27 +297,14 @@ if ($id > 0) } // Type - print ""; - - // Period end date - print ""; - print ""; + print ""; $rowspan=5; print ''; print ''; print ''; print "\n"; @@ -174,7 +174,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var = !$var; - print ""; + print ""; // Ref print ''; print ''; // Array header print ""; @@ -331,7 +333,7 @@ if ($modecompta == 'CREANCES-DETTES') $var=!$var; print ""; - // Third party + // Product $fullname=$name[$key]; if ($key >= 0) { $linkname=''.img_object($langs->trans("ShowProduct"),'product').' '.$fullname.''; @@ -343,23 +345,24 @@ if ($modecompta == 'CREANCES-DETTES') // Amount w/o VAT print ''; // Amount with VAT print ''; // Percent; @@ -385,11 +388,10 @@ if ($modecompta == 'CREANCES-DETTES') print ''; } else { // $modecompta != 'CREANCES-DETTES' - // TODO: better message, for example: // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an // invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ? // Because there is no way to know this, this report is not relevant. - print '
    ' . $langs->trans("WarningNotRelevant") . '
    '; + print '
    '.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '
    '; } llxFooter(); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 82bbff465eb..7473f71eaf1 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -137,7 +137,8 @@ $form=new Form($db); // Show report header if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); - $nom.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink="".img_previous()."".img_next().""; $description=$langs->trans("RulesCADue"); @@ -147,7 +148,8 @@ if ($modecompta=="CREANCES-DETTES") { //$exportlink=$langs->trans("NotYetAvailable"); } else { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); - $nom.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink="".img_previous()."".img_next().""; $description=$langs->trans("RulesCAIn"); @@ -158,7 +160,7 @@ if ($modecompta=="CREANCES-DETTES") { $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); // Show array diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index bbf03e0865c..9745ef16290 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -151,7 +151,8 @@ $formother = new FormOther($db); if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); - $nom.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().''.img_next().''; $description=$langs->trans("RulesCADue"); @@ -161,7 +162,8 @@ if ($modecompta=="CREANCES-DETTES") //$exportlink=$langs->trans("NotYetAvailable"); } else { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); - $nom.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().''.img_next().''; $description=$langs->trans("RulesCAIn"); @@ -170,7 +172,7 @@ if ($modecompta=="CREANCES-DETTES") //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); // Show Array @@ -246,6 +248,7 @@ $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY s.rowid, s.nom"; $sql.= " ORDER BY s.rowid"; +//echo $sql; dol_syslog("casoc sql=".$sql); $result = $db->query($sql); @@ -319,7 +322,7 @@ if ($subcat) { } print'>'; print ''; print ''; // Array titles @@ -426,13 +429,13 @@ if (count($amount)) { print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { + if ($modecompta == 'CREANCES-DETTES') print ''; print ''; print ''; if ($annee != $year_end) print ''; @@ -224,6 +229,22 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) $case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m"); $caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m"); + if ($modecompta == 'CREANCES-DETTES') { + // Valeur CA du mois w/o VAT + print '"; + } + // Valeur CA du mois print ''; } + $total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;; $total[$annee]+=$cum[$case]; if ($annee_decalage != $year_end) print ''; } @@ -284,7 +306,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) for ($mois = 1 ; $mois < 13 ; $mois++) { $var=!$var; - print ""; + print ""; print ""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -349,6 +371,18 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { + if ($modecompta == 'CREANCES-DETTES') { + // Montant total HT + if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear))) + { + print '"; + } + else + { + print ''; + } + } + // Montant total if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear))) { @@ -439,7 +473,7 @@ print "
     
     ".$langs->trans("Bills").' '.$objp->nom."
     
     ".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n"; if ($modecompta == 'CREANCES-DETTES') @@ -266,7 +268,7 @@ if ($modecompta != 'CREANCES-DETTES') if ($total_ttc == 0) { $var=!$var; - print "
     
     '.$langs->trans("None").'
     ".$langs->trans("Bills")." socid."\">".$objp->nom."
     ".$langs->trans("Bills")." socid."\">".$objp->nom."".price(-$objp->amount_ht)."
     
     '.$langs->trans("None").'
     
     '.$obj->nom.''.price(-$obj->amount).''.price(-$obj->amount).'
     
     '.$langs->trans("None").'
     
     '.$obj->nom.''.price(-$obj->amount).'
     
     '.$langs->trans("None").'
     
     ".$langs->trans("VATToPay")." ".price($amount)."
     
     ".$langs->trans("VATToCollect")." ".price($amount)."
     
     ".$langs->trans("VATPaid")."".price($amount)."
     
     ".$langs->trans("VATCollected")."".price($amount)."
    ".$langs->trans("Type")."".$object->type_libelle."".$langs->trans("Payments")."
    ".$langs->trans("PeriodEndDate").""; - if ($action == 'edit') - { - print $form->select_date($object->periode, 'period', 0, 0, 0, 'charge', 1); - } - else - { - print dol_print_date($object->periode,"day"); - } - print "
    ".$langs->trans("Type")."".$object->type_libelle."'; /* - * Paiements - */ + * Payments + */ $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; $sql.= "c.libelle as paiement_type"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; @@ -337,8 +324,12 @@ if ($id > 0) $i = 0; $total = 0; echo ''; print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; $var=True; while ($i < $num) @@ -346,10 +337,10 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print "\n"; + print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; + print '\n"; print "\n"; - print '\n"; + print '\n"; print ""; $totalpaye += $objp->amount; $i++; @@ -376,6 +367,19 @@ if ($id > 0) print ""; + // Period end date + print ""; + print ""; + // Due date if ($action == 'edit') { @@ -393,8 +397,6 @@ if ($id > 0) // Status print ''; - print ''; - print '
    '.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
    '.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
    "; - print ''.img_object($langs->trans("Payment"),"payment").' '; - print dol_print_date($db->jdate($objp->dp),'day')."'.dol_print_date($db->jdate($objp->dp),'day')."".$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."
    ".$langs->trans("PeriodEndDate").""; + if ($action == 'edit') + { + print $form->select_date($object->periode, 'period', 0, 0, 0, 'charge', 1); + } + else + { + print dol_print_date($object->periode,"day"); + } + print "
    '.$langs->trans("Status").''.$object->getLibStatut(4).'
     
    '; if ($action == 'edit') @@ -408,7 +410,7 @@ if ($id > 0) if ($action == 'edit') print "\n"; - print ''; + dol_fiche_end(); /* diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index f62b2fcc594..4efd90c10aa 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -35,6 +35,7 @@ class ChargeSociales extends CommonObject public $table_element='chargesociales'; var $id; + var $ref; var $date_ech; var $lib; var $type; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 452de21285a..88c888de62e 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -40,6 +41,7 @@ $langs->load("bills"); $id = GETPOST('id','int'); $action = GETPOST("action"); +$confirm = GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -71,18 +73,7 @@ $modulepart='tax'; * Actions */ -if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) -{ - dol_add_file_process($upload_dir,0,1,'userfile'); -} - -if ($action == 'delete') -{ - $file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); -} +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; /* @@ -169,20 +160,14 @@ if ($object->id) print ''; - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object); - - - // List of document - //$param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'tax',$param); - + $modulepart = 'tax'; + $permission = $user->rights->tax->charges->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { - print $langs->trans("UnkownError"); + print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index d59a414550d..6ccc9943afa 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -27,15 +27,15 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; +$langs->load("compta"); +$langs->load("banks"); +$langs->load("bills"); + // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); -$langs->load("compta"); -$langs->load("banks"); -$langs->load("bills"); - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -165,7 +165,7 @@ if ($resql) print '
      '; - print ''; + print ''; print '
    '; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index f3e5f746e6b..ac82e2e342a 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -143,7 +143,8 @@ $formother = new FormOther($db); $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices"); if ($modecompta=="CREANCES-DETTES") { - $nom.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -156,7 +157,8 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=time(); } else { - $nom.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -166,7 +168,7 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=time(); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); // SQL request @@ -250,7 +252,7 @@ if ($modecompta == 'CREANCES-DETTES') } print '>
    '; - print ''; + print ''; print '
    '; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount_ht[$key]); + //print ''; print ''; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount[$key]); - print ''; + //print ''; print ' '; -print ''; +print ''; print '
    '; if ($modecompta != 'CREANCES-DETTES') { if ($key > 0) { - print ''; + print ''; } else { - print ''; + print ''; } } else { if ($key > 0) { - print ''; + print ''; } else { print ''; } @@ -500,4 +503,4 @@ print ''; llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 2d90767cffb..8cdbb8ddad4 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -60,7 +60,8 @@ $form=new Form($db); if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover"); - $nom.='
    ('.$langs->trans("SeeReportInInputOutputMode",'
    ','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCADue"); @@ -71,7 +72,8 @@ if ($modecompta=="CREANCES-DETTES") } else { $nom=$langs->trans("SalesTurnover"); - $nom.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCAIn"); @@ -81,7 +83,7 @@ else { } $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); if ($modecompta == 'CREANCES-DETTES') @@ -118,6 +120,7 @@ if ($result) while ($i < $num) { $obj = $db->fetch_object($result); + $cum_ht[$obj->dm] = !empty($obj->amount) ? $obj->amount : 0; $cum[$obj->dm] = $obj->amount_ttc; if ($obj->amount_ttc) { @@ -180,7 +183,8 @@ print '
     '; + if ($modecompta == 'CREANCES-DETTES') print ''; + else print ''; print ''; print $annee; if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1); @@ -192,6 +196,7 @@ print '
    '.$langs->trans("Month").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Delta").' '; + if ($cum_ht[$case]) + { + $now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre. + print ''.price($cum_ht[$case],1).''; + } + else + { + if ($minyearmonth < $case && $case <= max($maxyearmonth,$nowyearmonth)) { print '0'; } + else { print ' '; } + } + print "'; if ($cum[$case]) @@ -273,6 +294,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) print ' 
    ".dol_print_date(dol_mktime(12,0,0,$mois,1,2000),"%B")."
    '.$langs->trans("Total").''.($total_ht[$annee]?price($total_ht[$annee]):"0")." 
    "; $i++; } $var=!$var; - print "
    Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r�gl� des factures partiellement r�gl�es
    Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r�gl� des factures partiellement r�gl�es
    "; $i++; } $var=!$var; - print "
    Signe et non facture:".price($total_pr)."<-- bug ici, ca devrait exclure le deja facture
    Signe et non facture:".price($total_pr)."<-- bug ici, ca devrait exclure le deja facture
    "; { dol_print_error($db); } - print "
    Total CA previsionnel : ".price($total_CA)."<-- bug ici car bug sur les 2 precedents
    Total CA previsionnel : ".price($total_CA)."<-- bug ici car bug sur les 2 precedents
    "; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 34dc0262c2e..8ddfad8c3f1 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -27,10 +27,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - \class Tva - \brief Put here description of your class - \remarks Initialy built by build_class_from_table on 2008-04-03 21:01 -*/ + * Put here description of your class + */ class Tva extends CommonObject { //public $element='tva'; //!< Id that identify managed objects @@ -51,7 +49,6 @@ class Tva extends CommonObject - /** * Constructor * @@ -115,7 +112,7 @@ class Tva extends CommonObject $sql.= ")"; - dol_syslog("Tva::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -133,16 +130,17 @@ class Tva extends CommonObject else { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::create ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -1; } } - /* - * \brief Update database - * \param user User that modify - * \param notrigger 0=no, 1=yes (no update trigger) - * \return int <0 if KO, >0 if OK + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int <0 if KO, >0 if OK */ function update($user=0, $notrigger=0) { @@ -177,12 +175,12 @@ class Tva extends CommonObject $sql.= " WHERE rowid=".$this->id; - dol_syslog("Tva::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::update ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); return -1; } @@ -200,11 +198,12 @@ class Tva extends CommonObject } - /* - * \brief Load object in memory from database - * \param id id object - * \param user User that load - * \return int <0 if KO, >0 if OK + /** + * Load object in memory from database + * + * @param int $id id object + * @param User $user User that load + * @return int <0 if KO, >0 if OK */ function fetch($id, $user=0) { @@ -229,7 +228,7 @@ class Tva extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog("Tva::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -259,17 +258,18 @@ class Tva extends CommonObject else { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::fetch ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; } } - /* - * \brief Delete object in database - * \param user User that delete - * \return int <0 if KO, >0 if OK - */ + /** + * Delete object in database + * + * @param User $user User that delete + * @return int <0 if KO, >0 if OK + */ function delete($user) { global $conf, $langs; @@ -279,12 +279,12 @@ class Tva extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva"; $sql.= " WHERE rowid=".$this->id; - dol_syslog("Tva::delete sql=".$sql); + dol_syslog(get_class($this)."::delete sql=".$sql); $resql = $this->db->query($sql); if (! $resql) { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::delete ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); return -1; } @@ -322,9 +322,11 @@ class Tva extends CommonObject } - /* - * \brief Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de TVA, non ? - * + /** + * Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de TVA, non ? + * + * @param int $year Year + * @return double Amount */ function solde($year = 0) { @@ -339,11 +341,12 @@ class Tva extends CommonObject return $solde; } - /* - * \brief Total de la TVA des factures emises par la societe. - * + /** + * Total de la TVA des factures emises par la societe. + * + * @param int $year Year + * @return double Amount */ - function tva_sum_collectee($year = 0) { @@ -352,7 +355,7 @@ class Tva extends CommonObject if ($year) { - $sql .= " AND f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' "; + $sql .= " AND f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' "; } $result = $this->db->query($sql); @@ -379,11 +382,12 @@ class Tva extends CommonObject } } - /* - * \brief Tva pay�e + /** + * VAT payed * + * @param int $year Year + * @return double Amount */ - function tva_sum_payee($year = 0) { @@ -392,7 +396,7 @@ class Tva extends CommonObject if ($year) { - $sql .= " WHERE f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' "; + $sql .= " WHERE f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' "; } $result = $this->db->query($sql); @@ -419,12 +423,12 @@ class Tva extends CommonObject } - /* - * \brief Tva r�gl�e - * Total de la TVA r�glee aupres de qui de droit + /** + * Total de la TVA reglee aupres de qui de droit * + * @param int $year Year + * @return double Amount */ - function tva_sum_reglee($year = 0) { @@ -433,7 +437,7 @@ class Tva extends CommonObject if ($year) { - $sql .= " WHERE f.datev >= '$year-01-01' AND f.datev <= '$year-12-31' "; + $sql .= " WHERE f.datev >= '".$year."-01-01' AND f.datev <= '".$year."-12-31' "; } $result = $this->db->query($sql); @@ -473,14 +477,16 @@ class Tva extends CommonObject $this->db->begin(); + // Clean parameters + $this->amount=price2num(trim($this->amount)); + // Check parameters - $this->amount=price2num($this->amount); if (! $this->label) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); return -3; } - if ($this->amount <= 0) + if ($this->amount < 0 || $this->amount == '') { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; @@ -509,7 +515,7 @@ class Tva extends CommonObject $sql.=", '".$user->id."', NULL, ".$conf->entity; $sql.= ")"; - dol_syslog("Tva::addPayment sql=".$sql); + dol_syslog(get_class($this)."::addPayment sql=".$sql); $result = $this->db->query($sql); if ($result) { @@ -525,7 +531,7 @@ class Tva extends CommonObject if ($this->id > 0) { $ok=1; - if (! empty($conf->banque->enabled)) + if (! empty($conf->banque->enabled) && ! empty($this->amount)) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -536,7 +542,7 @@ class Tva extends CommonObject $bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user); - // Mise a jour fk_bank dans llx_tva. On connait ainsi la ligne de tva qui a g�n�r� l'�criture bancaire + // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); @@ -547,7 +553,7 @@ class Tva extends CommonObject $ok=0; } - // Mise a jour liens + // Update links $result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/tva/fiche.php?id=', "(VATPayment)", "payment_vat"); if ($result < 0) { diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index a5e0e7fdbb9..fbde1584541 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006 Yannick Warnier * * This program is free software; you can redistribute it and/or modify @@ -110,6 +110,8 @@ $fsearch.=' '; if ($modetax==1) // Calculate on invoice for goods and services { $nom=$langs->trans("VATReportByCustomersInDueDebtMode"); + $calcmode=$langs->trans("CalcModeVATDebt"); + $calcmode.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; //$nom.='
    ('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); @@ -121,7 +123,6 @@ if ($modetax==1) // Calculate on invoice for goods and services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
    '.$langs->trans("DepositsAreNotIncluded"); else $description.='
    '.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; - $description.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -137,6 +138,8 @@ if ($modetax==1) // Calculate on invoice for goods and services if ($modetax==0) // Invoice for goods, payment for services { $nom=$langs->trans("VATReportByCustomersInInputOutputMode"); + $calcmode=$langs->trans("CalcModeVATEngagement"); + $calcmode.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; //$nom.='
    ('.$langs->trans("SeeVATReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); @@ -149,7 +152,6 @@ if ($modetax==0) // Invoice for goods, payment for services //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
    '.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
    '.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; - $description.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -162,7 +164,7 @@ if ($modetax==0) // Invoice for goods, payment for services $amountsup=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -207,16 +209,16 @@ if (is_array($coll_list)) } } print "
    ".$i."'.$i."'.$company_static->getNomUrl(1,'customer').''.$company_static->getNomUrl(1,'customer').'".$intra."".price($coll->amount)."".price($coll->tva)."'.$intra."".price($coll->amount)."".price($coll->tva)."
    '.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
    ".$i."
    '.$i."'.$company_static->getNomUrl(1,'supplier').''.$company_static->getNomUrl(1,'supplier').'".$intra."".price($coll->amount)."".price($coll->tva)."'.$intra."".price($coll->amount)."".price($coll->tva)."
    '.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
    '; diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index 5295608ad99..a0d181e8f81 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -34,8 +34,6 @@ $langs->load("bills"); $id=GETPOST("id",'int'); $action=GETPOST('action'); -$mesg = ''; - // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; @@ -82,7 +80,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) else { $db->rollback(); - $mesg='
    '.$tva->error.'
    '; + setEventMessage($tva->error, 'errors'); $action="create"; } } @@ -115,18 +113,18 @@ if ($action == 'delete') { $tva->error=$accountline->error; $db->rollback(); - $mesg='
    '.$tva->error.'
    '; + setEventMessage($tva->error,'errors'); } } else { $db->rollback(); - $mesg='
    '.$tva->error.'
    '; + setEventMessage($tva->error,'errors'); } } else { - $mesg='
    Error try do delete a line linked to a conciliated bank transaction
    '; + setEventMessage('Error try do delete a line linked to a conciliated bank transaction','errors'); } } @@ -159,8 +157,6 @@ if ($action == 'create') print_fiche_titre($langs->trans("NewVATPayment")); - if ($mesg) print $mesg; - print ''; print ""; @@ -213,8 +209,6 @@ if ($action == 'create') if ($id) { - if ($mesg) print $mesg; - $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/tva/fiche.php?id='.$vatpayment->id; $head[$h][1] = $langs->trans('Card'); @@ -274,9 +268,20 @@ if ($id) */ print "
    \n"; if ($vatpayment->rappro == 0) - print ''.$langs->trans("Delete").''; + { + if (! empty($user->rights->tax->charges->supprimer)) + { + print ''.$langs->trans("Delete").''; + } + else + { + print ''.$langs->trans("Delete").''; + } + } else + { print ''.$langs->trans("Delete").''; + } print "
    "; } @@ -284,4 +289,4 @@ if ($id) $db->close(); llxFooter(); -?> \ No newline at end of file +?> diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 469b1121d61..4bab6f143d1 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -33,8 +33,8 @@ $langs->load("compta"); $langs->load("banks"); $langs->load("bills"); -$year=$_GET["year"]; -if ($year == 0 ) +$year=GETPOST("year","int"); +if ($year == 0) { $year_current = strftime("%Y",time()); $year_start = $year_current; @@ -54,7 +54,14 @@ $modetax = $conf->global->TAX_MODE; if (isset($_GET["modetax"])) $modetax=$_GET["modetax"]; - +/** + * pt + * + * @param DoliDB $db Database handler + * @param string $sql SQL Request + * @param date $date Date + * @return void + */ function pt ($db, $sql, $date) { global $conf, $bc,$langs; @@ -91,7 +98,7 @@ function pt ($db, $sql, $date) $db->free($result); } else { - dolibar_print_error($db); + dol_print_error($db); } } @@ -160,8 +167,8 @@ for ($m = 1 ; $m < 13 ; $m++ ) } $var=!$var; - print ""; - print ''; + print ""; + print ''; $x_coll = 0; foreach($coll_listsell as $vatrate=>$val) @@ -169,7 +176,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_coll+=$val['vat']; } $subtotalcoll = $subtotalcoll + $x_coll; - print ""; + print ""; $x_paye = 0; foreach($coll_listbuy as $vatrate=>$val) @@ -177,13 +184,13 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_paye+=$val['vat']; } $subtotalpaye = $subtotalpaye + $x_paye; - print ""; + print ""; $diff = $x_coll - $x_paye; $total = $total + $diff; $subtotal = $subtotal + $diff; - print "\n"; + print "\n"; print "\n"; print "\n"; @@ -225,7 +232,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."tva as f"; $sql.= " WHERE f.entity = ".$conf->entity; $sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'"; $sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'"; -$sql.= " GROUP BY dm ASC"; +$sql.= " GROUP BY dm ORDER BY dm ASC"; pt($db, $sql,$langs->trans("Year")." $y"); diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index 393a9ee4efc..b97eca7bacb 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -261,13 +261,13 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES") $x_paye_ht = 0; foreach($x_both as $rate => $both){ $var=!$var; - print ""; + print ""; print ""; - print ""; - print ""; + print ""; + print ""; print ""; - print ""; - print ""; + print ""; + print ""; print ""; print ""; print ""; @@ -284,9 +284,9 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES") $subtotal = $subtotal + $diff; $var=!$var; - print ""; + print ""; print ''; - print "\n"; + print "\n"; print "\n"; $i++; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 88c1be06409..cc084655bf0 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier * * This program is free software; you can redistribute it and/or modify @@ -121,10 +121,13 @@ $fsearch.=' '; //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; //$fsearch.=' '; + // Affiche en-tete du rapport if ($modetax==1) // Calculate on invoice for goods and services { $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); + $calcmode=$langs->trans("CalcModeVATDebt"); + $calcmode.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $prevyear=$year_start; $prevquarter=$q; if ($prevquarter > 1) $prevquarter--; @@ -140,7 +143,6 @@ if ($modetax==1) // Calculate on invoice for goods and services //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
    '.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
    '.$langs->trans("DepositsAreNotIncluded"); else $description.='
    '.$langs->trans("DepositsAreIncluded"); - $description.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $description.=$fsearch; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -159,6 +161,8 @@ if ($modetax==1) // Calculate on invoice for goods and services if ($modetax==0) // Invoice for goods, payment for services { $nom=$langs->trans("VATReportByQuartersInInputOutputMode"); + $calcmode=$langs->trans("CalcModeVATEngagement"); + $calcmode.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $prevyear=$year_start; $prevquarter=$q; if ($prevquarter > 1) $prevquarter--; @@ -176,7 +180,6 @@ if ($modetax==0) // Invoice for goods, payment for services //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
    '.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
    '.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; - $description.='
    ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -191,7 +194,7 @@ if ($modetax==0) // Invoice for goods, payment for services $vatsup=$langs->trans("VATPaid"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -342,7 +345,7 @@ else print '
    '; // Ref - print ''; + print ''; // Description print ''; // VAT - print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } @@ -450,11 +453,11 @@ else print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } @@ -499,7 +502,7 @@ else print ''; // Ref - print ''; + print ''; // Description print ''; // VAT - print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } @@ -601,11 +604,11 @@ else print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 85d3fa4736a..ea9f7ea445d 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -60,9 +60,9 @@ if ($result) print '
    '.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'
    '.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."".price($x_coll)."".price($x_paye)."".price($x_paye)."".price($diff)."".price($diff)." 
    $rate%".price($both['coll']['totalht'])."".price($both['coll']['vat'])."".price($both['coll']['totalht'])."".price($both['coll']['vat'])."".$both['coll']['links']."".price($both['paye']['totalht'])."".price($both['paye']['vat'])."".price($both['paye']['totalht'])."".price($both['paye']['vat'])."".$both['paye']['links']."
    ".price($diff)."".price($diff)."
    '.$fields['link'].''.$fields['link'].''; @@ -374,7 +377,7 @@ else // Total HT if ($modetax == 0) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { @@ -390,7 +393,7 @@ else if ($modetax == 0) { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); - print ''; + print ''; //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; if ($fields['payment_amount'] && $fields['ftotal_ttc']) { @@ -409,14 +412,14 @@ else } // Total collected - print ''; + print ''; $temp_ht=$fields['totalht']; if ($type == 1) $temp_ht=$fields['totalht']*$ratiopaymentinvoice; print price(price2num($temp_ht,'MT')); print ''; + print ''; $temp_vat=$fields['vat']; if ($type == 1) $temp_vat=$fields['vat']*$ratiopaymentinvoice; print price(price2num($temp_vat,'MT')); @@ -435,11 +438,11 @@ else print ''.$langs->trans("Total").':   '.price(price2num($subtot_coll_total_ht,'MT')).''.price(price2num($subtot_coll_vat,'MT')).''.price(price2num($subtot_coll_vat,'MT')).'
    '.$langs->trans("Total").':   '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
    '.$fields['link'].''.$fields['link'].''; @@ -525,7 +528,7 @@ else // Total HT if ($modetax == 0) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { @@ -541,7 +544,7 @@ else if ($modetax == 0) { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); - print ''; + print ''; if ($fields['payment_amount'] && $fields['ftotal_ttc']) { $paymentfourn_static->id=$fields['payment_id']; @@ -560,14 +563,14 @@ else } // VAT paid - print ''; + print ''; $temp_ht=$fields['totalht']; if ($type == 1) $temp_ht=$fields['totalht']*$ratiopaymentinvoice; print price(price2num($temp_ht,'MT')); print ''; + print ''; $temp_vat=$fields['vat']; if ($type == 1) $temp_vat=$fields['vat']*$ratiopaymentinvoice; print price(price2num($temp_vat,'MT')); @@ -586,11 +589,11 @@ else print ''.$langs->trans("Total").':   '.price(price2num($subtot_paye_total_ht,'MT')).''.price(price2num($subtot_paye_vat,'MT')).''.price(price2num($subtot_paye_vat,'MT')).'
    '.$langs->trans("Total").':   '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
    '; print ''; - print ''; + print ''; print ""; - print ''; + print ''; print ""; print "\n"; $var=1; @@ -70,7 +70,7 @@ if ($result) { $obj = $db->fetch_object($result); $var=!$var; - print ""; + print ""; $tva_static->id=$obj->rowid; $tva_static->ref=$obj->rowid; diff --git a/htdocs/compta/ventilation/fournisseur/lignes.php b/htdocs/compta/ventilation/fournisseur/lignes.php index 513736cbe59..0a27fb3ddaa 100644 --- a/htdocs/compta/ventilation/fournisseur/lignes.php +++ b/htdocs/compta/ventilation/fournisseur/lignes.php @@ -89,7 +89,7 @@ if ($result) { $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ""; print ''; diff --git a/htdocs/compta/ventilation/fournisseur/liste.php b/htdocs/compta/ventilation/fournisseur/liste.php index a3290dac20f..83256709771 100644 --- a/htdocs/compta/ventilation/fournisseur/liste.php +++ b/htdocs/compta/ventilation/fournisseur/liste.php @@ -74,7 +74,7 @@ if ($result) { $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ""; print ''; print ''; diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php index c938e9774c4..fbc86557178 100644 --- a/htdocs/compta/ventilation/lignes.php +++ b/htdocs/compta/ventilation/lignes.php @@ -90,7 +90,7 @@ if ($result) print ''; print ''; print ''; print "\n"; @@ -104,7 +104,7 @@ if ($result) $var=!$var; $codeCompta = $objp->numero.' '.$objp->intitule; - print ""; + print ""; // Ref facture $facture_static->ref=$objp->facnumber; diff --git a/htdocs/compta/ventilation/liste.php b/htdocs/compta/ventilation/liste.php index 81613640541..4cfe167d60c 100644 --- a/htdocs/compta/ventilation/liste.php +++ b/htdocs/compta/ventilation/liste.php @@ -88,7 +88,7 @@ if ($result) { $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ""; // Ref facture $facture_static->ref=$objp->facnumber; diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index fdc28d2c1fc..c35fec78ce7 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -14,9 +14,10 @@ // dolibarr_main_url_root // This parameter defines the root URL of your Dolibarr index.php page. // It must link to the htdocs directory htdocs. -// In most cases, this is autodetected but it still required to show full -// url bookmarks for some services (ie: agenda rss export url, ...) or -// when using Apache dir aliases (autodetect fails). +// In most cases, this is autodetected but it's still required +// * to show full url bookmarks for some services (ie: agenda rss export url, ...) +// * or when using Apache dir aliases (autodetect fails) +// * or when using nginx (autodetect fails) // Examples: // $dolibarr_main_url_root='http://localhost'; // $dolibarr_main_url_root='http://mydolibarrvirtualhost'; @@ -37,21 +38,25 @@ $dolibarr_main_document_root=''; // dolibarr_main_url_root_alt -// This parameter defines the alternative URL of your Dolibarr. -// It must link to a secondary directory htdocs. +// This parameter defines the relative sub URLs to add to $dolibarr_main_url_root to +// forge alternative root directories (used by modules developers). +// You can put several values, separated by a coma, but number of entries must match +// number of entries into $dolibarr_main_document_root_alt. // Examples: -// $dolibarr_main_url_root_alt='http://localhost/custom'; -// $dolibarr_main_url_root_alt='http://mydolibarrvirtualhost/custom'; -// $dolibarr_main_url_root_alt='http://myserver/dolibarr/htdocs/custom'; +// $dolibarr_main_url_root_alt='/extensions'; +// $dolibarr_main_url_root_alt='/extensions1,/extensions2'; // $dolibarr_main_url_root_alt=''; // dolibarr_main_document_root_alt -// This parameter contains absolute alternative file system directory of Dolibarr +// This parameter contains absolute alternative root file system directories (used by +// modules developers). +// You can put several values, separated by a coma, but number of entries must match +// number of entries into $dolibarr_main_url_root_alt. // Examples: -// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom'; -// $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/custom'; +// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/extensions'; +// $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/extensions1,C:/My web sites/dolibarr/htdocs/extensions2'; // $dolibarr_main_document_root_alt=''; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index f86970afc0a..cd9169e1b2c 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -285,10 +285,10 @@ abstract class ActionsContactCardCommon } // Zip - $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); // Town - $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id')); + $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id')); if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id; @@ -432,9 +432,9 @@ abstract class ActionsContactCardCommon $this->object->address = $_POST["address"]; $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; - $this->object->fk_departement = $_POST["departement_id"]; + $this->object->fk_departement = $_POST["state_id"]; $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; - $this->object->state_id = $_POST["departement_id"]; + $this->object->state_id = $_POST["state_id"]; $this->object->phone_pro = $_POST["phone_pro"]; $this->object->phone_perso = $_POST["phone_perso"]; $this->object->phone_mobile = $_POST["phone_mobile"]; diff --git a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php index 0810624eb4c..a445444e42c 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php @@ -111,7 +111,7 @@ echo $this->control->tpl['ajax_selectcountry']; control->tpl['nb_emailing']) { ?> - + diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index d0ad081e92e..d7556f09f9f 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -96,7 +96,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors'] control->tpl['nb_emailing']) { ?> - + diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4a05f112eba..91e814be7c9 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -5,7 +5,9 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -39,6 +41,7 @@ class Contact extends CommonObject protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; + var $ref_ext; var $civilite_id; // In fact we store civility_code var $lastname; var $firstname; @@ -57,11 +60,22 @@ class Contact extends CommonObject var $country_code; // Code of country var $country; // Label of country + var $poste; // Position + var $socid; // fk_soc - var $status; // 0=brouillon, 1=4=actif, 5=inactif + var $statut; // 0=inactif, 1=actif var $code; var $email; + var $skype; + var $jabberid; + var $phone_pro; + var $phone_perso; + var $phone_mobile; + var $fax; + + var $priv; + var $birthday; var $default_lang; var $note_public; // Public note @@ -89,6 +103,7 @@ class Contact extends CommonObject function __construct($db) { $this->db = $db; + $this->statut = 1; // By default, status is enabled } /** @@ -111,8 +126,9 @@ class Contact extends CommonObject $this->firstname=trim($this->firstname); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); - if (! $this->socid) $this->socid = 0; - if (! $this->priv) $this->priv = 0; + if (empty($this->socid)) $this->socid = 0; + if (empty($this->priv)) $this->priv = 0; + if (empty($this->statut)) $this->statut = 0; // This is to convert '' into '0' to avoid bad sql request $sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople ("; $sql.= " datec"; @@ -121,6 +137,7 @@ class Contact extends CommonObject $sql.= ", firstname"; $sql.= ", fk_user_creat"; $sql.= ", priv"; + $sql.= ", statut"; $sql.= ", canvas"; $sql.= ", entity"; $sql.= ", import_key"; @@ -132,6 +149,7 @@ class Contact extends CommonObject $sql.= "'".$this->db->escape($this->firstname)."',"; $sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").","; $sql.= " ".$this->priv.","; + $sql.= " ".$this->statut.","; $sql.= " ".(! empty($this->canvas)?"'".$this->canvas."'":"null").","; $sql.= " ".$conf->entity.","; $sql.= " ".(! empty($this->import_key)?"'".$this->import_key."'":"null"); @@ -220,11 +238,13 @@ class Contact extends CommonObject $this->phone_perso=trim($this->phone_perso); $this->phone_mobile=trim($this->phone_mobile); $this->jabberid=trim($this->jabberid); + $this->skype=trim($this->skype); $this->fax=trim($this->fax); $this->zip=(empty($this->zip)?'':$this->zip); $this->town=(empty($this->town)?'':$this->town); $this->country_id=($this->country_id > 0?$this->country_id:$this->country_id); $this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement); + if (empty($this->statut)) $this->statut = 0; $this->db->begin(); @@ -242,6 +262,7 @@ class Contact extends CommonObject $sql .= ", poste='".$this->db->escape($this->poste)."'"; $sql .= ", fax='".$this->db->escape($this->fax)."'"; $sql .= ", email='".$this->db->escape($this->email)."'"; + $sql .= ", skype='".$this->db->escape($this->skype)."'"; $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); $sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null"); @@ -249,6 +270,7 @@ class Contact extends CommonObject $sql .= ", phone_mobile = ".(isset($this->phone_mobile)?"'".$this->db->escape($this->phone_mobile)."'":"null"); $sql .= ", jabberid = ".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null"); $sql .= ", priv = '".$this->priv."'"; + $sql .= ", statut = ".$this->statut; $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"NULL"); $sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"NULL"); $sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"0"); @@ -371,6 +393,7 @@ class Contact extends CommonObject if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; if ($this->phone_mobile && ! empty($conf->global->LDAP_CONTACT_FIELD_MOBILE)) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; if ($this->fax && ! empty($conf->global->LDAP_CONTACT_FIELD_FAX)) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; + if ($this->skype && ! empty($conf->global->LDAP_CONTACT_FIELD_SKYPE)) $info[$conf->global->LDAP_CONTACT_FIELD_SKYPE] = $this->skype; if ($this->note_private && ! empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note_private; if ($this->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; @@ -482,11 +505,11 @@ class Contact extends CommonObject $langs->load("companies"); $sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civilite as civilite_id, c.lastname, c.firstname,"; - $sql.= " c.address, c.zip, c.town,"; + $sql.= " c.address, c.statut, c.zip, c.town,"; $sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_departement,"; $sql.= " c.birthday,"; - $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,"; + $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,"; $sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,"; $sql.= " c.import_key,"; $sql.= " p.libelle as country, p.code as country_code,"; @@ -532,6 +555,7 @@ class Contact extends CommonObject $this->socid = $obj->fk_soc; $this->socname = $obj->socname; $this->poste = $obj->poste; + $this->statut = $obj->statut; $this->phone_pro = trim($obj->phone); $this->fax = trim($obj->fax); @@ -540,6 +564,7 @@ class Contact extends CommonObject $this->email = $obj->email; $this->jabberid = $obj->jabberid; + $this->skype = $obj->skype; $this->priv = $obj->priv; $this->mail = $obj->email; @@ -722,6 +747,21 @@ class Contact extends CommonObject } } + if (! $error) + { + // Remove category + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople = ".$this->id; + dol_syslog(get_class($this)."::delete sql=".$sql); + $resql=$this->db->query($sql); + if (! $resql) + { + $error++; + $this->error .= $this->db->lasterror(); + $errorflag=-1; + dol_syslog(get_class($this)."::delete error ".$errorflag." ".$this->error, LOG_ERR); + } + } + if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople"; @@ -890,14 +930,14 @@ class Contact extends CommonObject } /** - * Retourne le libelle du statut du contact + * Return label of contact status * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @return string Libelle + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of contact status */ function getLibStatut($mode) { - return $this->LibStatut($this->status,$mode); + return $this->LibStatut($this->statut,$mode); } /** @@ -907,51 +947,40 @@ class Contact extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle */ - function LibStatut($statut, $mode) + function LibStatut($statut,$mode) { global $langs; if ($mode == 0) { - if ($statut==0) return $langs->trans('StatusContactDraft'); - elseif ($statut==1) return $langs->trans('StatusContactValidated'); - elseif ($statut==4) return $langs->trans('StatusContactValidated'); - elseif ($statut==5) return $langs->trans('StatusContactValidated'); + if ($statut==0 || $statut==5) return $langs->trans('Disabled'); + elseif ($statut==1 || $statut==4) return $langs->trans('Enabled'); } elseif ($mode == 1) { - if ($statut==0) return $langs->trans('StatusContactDraftShort'); - elseif ($statut==1) return $langs->trans('StatusContactValidatedShort'); - elseif ($statut==4) return $langs->trans('StatusContactValidatedShort'); - elseif ($statut==5) return $langs->trans('StatusContactValidatedShort'); + if ($statut==0 || $statut==5) return $langs->trans('Disabled'); + elseif ($statut==1 || $statut==4) return $langs->trans('Enabled'); } elseif ($mode == 2) { - if ($statut==0) return img_picto($langs->trans('StatusContactDraftShort'),'statut0').' '.$langs->trans('StatusContactDraft'); - elseif ($statut==1) return img_picto($langs->trans('StatusContactValidatedShort'),'statut1').' '.$langs->trans('StatusContactValidated'); - elseif ($statut==4) return img_picto($langs->trans('StatusContactValidatedShort'),'statut4').' '.$langs->trans('StatusContactValidated'); - elseif ($statut==5) return img_picto($langs->trans('StatusContactValidatedShort'),'statut5').' '.$langs->trans('StatusContactValidated'); + if ($statut==0 || $statut==5) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + } elseif ($mode == 3) { - if ($statut==0) return img_picto($langs->trans('StatusContactDraft'),'statut0'); - elseif ($statut==1) return img_picto($langs->trans('StatusContactValidated'),'statut1'); - elseif ($statut==4) return img_picto($langs->trans('StatusContactValidated'),'statut4'); - elseif ($statut==5) return img_picto($langs->trans('StatusContactValidated'),'statut5'); + if ($statut==0 || $statut==5) return img_picto($langs->trans('Disabled'),'statut5'); + elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4'); } elseif ($mode == 4) { - if ($statut==0) return img_picto($langs->trans('StatusContactDraft'),'statut0').' '.$langs->trans('StatusContactDraft'); - elseif ($statut==1) return img_picto($langs->trans('StatusContactValidated'),'statut1').' '.$langs->trans('StatusContactValidated'); - elseif ($statut==4) return img_picto($langs->trans('StatusContactValidated'),'statut4').' '.$langs->trans('StatusContactValidated'); - elseif ($statut==5) return img_picto($langs->trans('StatusContactValidated'),'statut5').' '.$langs->trans('StatusContactValidated'); + if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft'); + elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); } elseif ($mode == 5) { - if ($statut==0) return ''.$langs->trans('StatusContactDraftShort').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0'); - elseif ($statut==1) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1'); - elseif ($statut==4) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut4'); - elseif ($statut==5) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut5'); + if ($statut==0 || $statut==5) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + elseif ($statut==1 || $statut==4) return ''.$langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); } } @@ -1010,6 +1039,7 @@ class Contact extends CommonObject $this->country_code = 'FR'; $this->country = 'France'; $this->email = 'specimen@specimen.com'; + $this->skype = 'tom.hanson'; $this->phone_pro = '0909090901'; $this->phone_perso = '0909090902'; @@ -1021,6 +1051,54 @@ class Contact extends CommonObject $socid = rand(1, $num_socs); $this->socid = $socids[$socid]; + $this->statut=1; + } + + /** + * Change status of a user + * + * @param int $statut Status to set + * @return int <0 if KO, 0 if nothing is done, >0 if OK + */ + function setstatus($statut) + { + global $conf,$langs,$user; + + $error=0; + + // Check parameters + if ($this->statut == $statut) return 0; + else $this->statut = $statut; + + $this->db->begin(); + + // Desactive utilisateur + $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople"; + $sql.= " SET statut = ".$this->statut; + $sql.= " WHERE rowid = ".$this->id; + $result = $this->db->query($sql); + + dol_syslog(get_class($this)."::setstatus sql=".$sql); + if ($result) + { + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('CONTACT_ENABLEDISABLE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } + + if ($error) + { + $this->db->rollback(); + return -$error; + } + else + { + $this->db->commit(); + return 1; + } } } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 78592dbd232..3519583d96c 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -1,10 +1,11 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Alexandre Spangaro * * 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 @@ -31,10 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - +require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $langs->load("companies"); $langs->load("users"); $langs->load("other"); @@ -129,6 +132,26 @@ if (empty($reshook)) } } + + // Confirmation desactivation + if ($action == 'disable') + { + $object->fetch($id); + $object->setstatus(0); + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + } + + // Confirmation activation + if ($action == 'enable') + { + $object->fetch($id); + $object->setstatus(1); + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + + } + // Add contact if ($action == 'add' && $user->rights->societe->contact->creer) { @@ -146,16 +169,18 @@ if (empty($reshook)) $object->town = $_POST["town"]; $object->country_id = $_POST["country_id"]; $object->state_id = $_POST["state_id"]; + $object->skype = $_POST["skype"]; $object->email = $_POST["email"]; $object->phone_pro = $_POST["phone_pro"]; $object->phone_perso = $_POST["phone_perso"]; $object->phone_mobile = $_POST["phone_mobile"]; $object->fax = $_POST["fax"]; $object->jabberid = $_POST["jabberid"]; - $object->no_email = $_POST["no_email"]; + $object->no_email = $_POST["no_email"]; $object->priv = $_POST["priv"]; $object->note_public = GETPOST("note_public"); $object->note_private = GETPOST("note_private"); + $object->statut = 1; //Defult status to Actif // Note: Correct date should be completed with location to have exact GM time of birth. $object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]); @@ -245,6 +270,7 @@ if (empty($reshook)) $object->country_id = $_POST["country_id"]; $object->email = $_POST["email"]; + $object->skype = $_POST["skype"]; $object->phone_pro = $_POST["phone_pro"]; $object->phone_perso = $_POST["phone_perso"]; $object->phone_mobile = $_POST["phone_mobile"]; @@ -320,8 +346,7 @@ else { if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); } } @@ -407,14 +432,14 @@ else if ($socid > 0) { print '
    '; - print ''; print ''; print ''; } else { - print ''; } @@ -449,13 +474,13 @@ else // Zip / Town if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) $object->zip = $objsoc->zip; // Predefined with third party if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) $object->town = $objsoc->town; // Predefined with third party - print ''; // Country - print ''; @@ -463,7 +488,7 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; print ''; @@ -492,7 +517,7 @@ else print ''; } else - { + { print ''; } print ''; @@ -500,28 +525,18 @@ else // Instant message and no email print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } + // Visibility print ''; - // Note Public - print ''; - print ''; - - // Note Private - print ''; - print ''; - // Other attributes $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -640,7 +655,7 @@ else if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { print ''; - print ''; print ''; @@ -665,13 +680,13 @@ else print ''; // Zip / Town - print ''; // Country - print ''; @@ -679,7 +694,7 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } @@ -696,7 +711,7 @@ else if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; + print ''; print ''; } else @@ -706,7 +721,7 @@ else print ''; // Jabberid - print ''; + print ''; if (! empty($conf->mailing->enabled)) { print ''; @@ -717,29 +732,35 @@ else } print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } + // Visibility print ''; - // Note Public + // Note Public print ''; - print ''; + print ''; - // Note Private - print ''; - print ''; + // Note Private + print ''; + + // Statut + print ''; + print ''; // Other attributes $parameters=array('colspan' => ' colspan="3"'); @@ -838,8 +859,8 @@ else if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); } - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); - if ($ret == 'html') print '
    '; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); + } print '
    '.$langs->trans("Ref").''.$langs->trans("Ref").'".$langs->trans("Label")."'.$langs->trans("DatePayment").''.$langs->trans("DatePayment").'".$langs->trans("PayedByThisPayment")."
    '.$objp->facnumber.'
    '.$objp->facnumber.''.stripslashes(nl2br($objp->description)).'  '; - print ''; + print ''; print '
    trans("Email"); ?> trans("NbOfEMailingsReceived"); ?>trans("NbOfEMailingsReceived"); ?> control->tpl['nb_emailing']; ?>  trans("EMail"); ?> control->tpl['email']; ?> trans("NbOfEMailingsReceived"); ?>trans("NbOfEMailingsReceived"); ?> control->tpl['nb_emailing']; ?>  
    '.$langs->trans("Company").''; + print ''; print $objsoc->getNomUrl(1); print '
    '.$langs->trans("Company").''; + print '
    '.$langs->trans("Company").''; print $form->select_company($socid,'socid','',1); print '
    '.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print '
    '.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print '
    '.$langs->trans("Country").''; + print '
    '.$langs->trans("Country").''; print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
    '.$langs->trans('State').''; + print '
    '.$langs->trans('State').''; if ($object->country_id) { print $formcompany->select_state(isset($_POST["state_id"])?$_POST["state_id"]:$object->state_id,$object->country_code,'state_id'); @@ -476,7 +501,7 @@ else } // Phone / Fax - if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->tel; // Predefined with third party + if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->phone; // Predefined with third party print '
    '.$langs->trans("PhonePro").'phone_pro).'">'.$langs->trans("PhonePerso").'phone_perso).'">
    '.$langs->trans("No_Email").''.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).' 
    '.$langs->trans("IM").'jabberid).'">
    '.$langs->trans("Skype").'skype).'">
    '.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('priv',$selectarray,(isset($_POST["priv"])?$_POST["priv"]:$object->priv),0); print '
    '.$langs->trans("NotePublic").''; - $doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); - print $doleditor->Create(1); - //print ''; - print '
    '.$langs->trans("NotePrivate").''; - $doleditor = new DolEditor('note_private', GETPOST('note_private'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); - print $doleditor->Create(1); - //print ''; - print '
    '.$langs->trans("Company").''; + print ''; print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1); print '
    '.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print '
    '.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print '
    '.$langs->trans("Country").''; + print '
    '.$langs->trans("Country").''; print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
    '.$langs->trans('State').''; + print '
    '.$langs->trans('State').''; print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'state_id'); print '
    '.$langs->trans("NbOfEMailingsReceived").''.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().'
    Jabberidjabberid).'">
    '.$langs->trans("Jabberid").'jabberid).'">'.$langs->trans("No_Email").''.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'
    '.$langs->trans("Skype").'skype).'">
    '.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('priv',$selectarray,$object->priv,0); print '
    '.$langs->trans("NotePublic").''; $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); - // print '
    '.$langs->trans("NotePrivate").''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); - print $doleditor->Create(1); - // print '
    '.$langs->trans("NotePrivate").''; + $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); + print $doleditor->Create(1); + print '
    '.$langs->trans("Status").''; + print $object->getLibStatut(5); + print '
    '; @@ -915,7 +936,7 @@ else if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; + print ''; print ''; } else @@ -936,6 +957,12 @@ else } print ''; + // Skype + if (!empty($conf->skype->enabled)) + { + print ''; + } + print ''; @@ -948,11 +975,17 @@ else // Note Private print ''; + // Statut + print ''; + print ''; + print ''."\n"; // Other attributes $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields); @@ -1021,15 +1054,28 @@ else { print ''.$langs->trans('Delete').''; } + // Activer + if ($object->statut == 0 && $user->rights->societe->contact->creer) + { + print ''.$langs->trans("Reactivate").''; + } + // Desactiver + if ($object->statut == 1 && $user->rights->societe->contact->creer) + { + print ''.$langs->trans("DisableUser").''; + } print "
    "; } - print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'',''); + if (! empty($conf->agenda->enabled)) + { + print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'',''); - print show_actions_todo($conf,$langs,$db,$objsoc,$object); + print show_actions_todo($conf,$langs,$db,$objsoc,$object); - print show_actions_done($conf,$langs,$db,$objsoc,$object); + print show_actions_done($conf,$langs,$db,$objsoc,$object); + } } } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index aa7923926e0..1c735d787b4 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -4,6 +4,8 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Raphaël Doursenaud + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013 Alexandre Spangaro * * 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 @@ -27,6 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("companies"); $langs->load("suppliers"); @@ -46,7 +49,12 @@ $search_phonepro=GETPOST("search_phonepro"); $search_phonemob=GETPOST("search_phonemob"); $search_fax=GETPOST("search_fax"); $search_email=GETPOST("search_email"); +$search_skype=GETPOST("search_skype"); $search_priv=GETPOST("search_priv"); +$search_categ = GETPOST("search_categ",'int'); +$search_status = GETPOST("search_status",'int'); +if ($search_status=='') $search_status=1; // always display activ customer first + $type=GETPOST("type"); $view=GETPOST("view"); @@ -94,8 +102,10 @@ if (GETPOST('button_removefilter')) $search_phonemob=""; $search_fax=""; $search_email=""; + $search_skype=""; $search_priv=""; $sall=""; + $seach_status=1; } if ($search_priv < 0) $search_priv=''; @@ -109,14 +119,16 @@ $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans(" llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); $form=new Form($db); +$formother=new FormOther($db); $sql = "SELECT s.rowid as socid, s.nom as name,"; -$sql.= " p.rowid as cidp, p.lastname as lastname, p.firstname, p.poste, p.email,"; +$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,"; $sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,"; $sql.= " cp.code as country_code"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; +if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cs ON p.rowid = cs.fk_socpeople"; // We need this table joined to the select in order to filter by categ if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql.= ' WHERE p.entity IN ('.getEntity('societe', 1).')'; if (!$user->rights->societe->client->voir && !$socid) //restriction @@ -139,21 +151,20 @@ else if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; } -if ($search_lastname) // filter on lastname -{ - $sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'"; +if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; +if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; + +if ($search_lastname) { // filter on lastname + $sql .= natural_search('p.lastname', $search_lastname); } -if ($search_firstname) // filter on firstname -{ - $sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'"; +if ($search_firstname) { // filter on firstname + $sql .= natural_search('p.firstname', $search_firstname); } -if ($search_societe) // filtre sur la societe -{ - $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'"; +if ($search_societe) { // filtre sur la societe + $sql .= natural_search('s.nom', $search_societe); } -if (strlen($search_poste)) // filtre sur la societe -{ - $sql .= " AND p.poste LIKE '%".$db->escape($search_poste)."%'"; +if (strlen($search_poste)) { // filtre sur la societe + $sql .= natural_search('p.poste', $search_poste); } if (strlen($search_phone)) { @@ -179,6 +190,11 @@ if (strlen($search_email)) // filtre sur l'email { $sql .= " AND p.email LIKE '%".$db->escape($search_email)."%'"; } +if (strlen($search_skype)) // filtre sur skype +{ + $sql .= " AND p.skype LIKE '%".$db->escape($search_skype)."%'"; +} +if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status); if ($type == "o") // filtre sur type { $sql .= " AND p.fk_soc IS NULL"; @@ -197,11 +213,7 @@ else if ($type == "p") // filtre sur type } if ($sall) { - // For natural search - $scrit = explode(' ', $sall); - foreach ($scrit as $crit) { - $sql .= " AND (p.lastname LIKE '%".$db->escape($crit)."%' OR p.firstname LIKE '%".$db->escape($crit)."%' OR p.email LIKE '%".$db->escape($crit)."%')"; - } + $sql .= natural_search(array('p.lastname', 'p.firstname', 'p.email'), $sall); } if (! empty($socid)) { @@ -235,7 +247,9 @@ if ($result) $param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall); $param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_lastname='.urlencode($search_lastname).'&search_firstname='.urlencode($search_firstname).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email); - if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); + if (!empty($search_categ)) $param.='&search_categ='.$search_categ; + if ($search_status != '') $param.='&search_status='.$search_status; + if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); $num = $db->num_rows($result); $i = 0; @@ -248,6 +262,19 @@ if ($result) print ''; print ''; + if (! empty($conf->categorie->enabled)) + { + $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.=$formother->select_categories(4,$search_categ,'search_categ',1); + $moreforfilter.='       '; + } + if ($moreforfilter) + { + print '
    '; + print $moreforfilter; + print '
    '; + } + if ($sall) { print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".$sall; @@ -265,8 +292,10 @@ if ($result) print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); + if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); } print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder); print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut", $begin, $param, 'align="center"', $sortfield,$sortorder); print '
    '; print "\n"; @@ -299,15 +328,24 @@ if ($result) print ''; + if (! empty($conf->skype->enabled)) + { + print ''; + } print ''; print ''; + print ''; print ''; print ''; @@ -315,16 +353,16 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - - $var=!$var; - - print ""; + + $var=!$var; + print ""; // Name print ''; @@ -358,12 +396,17 @@ if ($result) print ''; // EMail print ''; - + // Skype + if (! empty($conf->skype->enabled)) { print ''; } + // Date print ''; // Private/Public print ''; + + // Status + print ''; // Links Add action and Export vcard print '
    '.$langs->trans("NbOfEMailingsReceived").''.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().'
    '.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
    '.$langs->trans("ContactVisibility").''; print $object->LibPubPriv($object->priv); print '
    '.$langs->trans("NotePrivate").''; print nl2br($object->note_private); - print '
    '.$langs->trans("Status").''; + print $object->getLibStatut(5); + print '
     
    '; print ''; print ''; + print ''; + print ' '; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('search_priv',$selectarray,$search_priv,1); print ''; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print '
    '; $contactstatic->lastname=$obj->lastname; $contactstatic->firstname=''; $contactstatic->id=$obj->cidp; + $contactstatic->statut=$obj->statut; print $contactstatic->getNomUrl(1,'',20); print ''.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).''.dol_print_skype($obj->skype,$obj->cidp,$obj->socid,'AC_SKYPE',18).''.dol_print_date($db->jdate($obj->tms),"day").''.$contactstatic->LibPubPriv($obj->priv).''.$contactstatic->getLibStatut(3).''; diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php new file mode 100644 index 00000000000..27a56b48825 --- /dev/null +++ b/htdocs/contact/note.php @@ -0,0 +1,169 @@ + + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Florian Henry + * + * 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 . + */ + +/** + * \file htdocs/contact/note.php + * \brief Tab for notes on contact + * \ingroup societe + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + +$action = GETPOST('action'); + +$langs->load("companies"); + +// Security check +$id = GETPOST('id','int'); +if ($user->societe_id) $id=$user->societe_id; +$result = restrictedArea($user, 'societe', $id, '&societe'); + +$object = new Contact($db); +if ($id > 0) $object->fetch($id); + +/* + * Actions + */ + +/******************************************************************************/ +/* Actions */ +/******************************************************************************/ +if ($action == 'setnote_public' && $user->rights->societe->creer) +{ + $object->fetch($id); + $result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public'); + if ($result < 0) setEventMessage($object->error,'errors'); +} + +else if ($action == 'setnote_private' && $user->rights->societe->creer) +{ + $object->fetch($id); + $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private'); + if ($result < 0) setEventMessage($object->error,'errors'); +} + +/* + * View + */ + +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); + +$form = new Form($db); + +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$title,$help_url); + +if ($id > 0) +{ + /* + * Affichage onglets + */ + if (! empty($conf->notification->enabled)) $langs->load("mails"); + + $head = contact_prepare_head($object); + + dol_fiche_head($head, 'note', $title,0,'contact'); + + + print '
    '; + print ''; + + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Name + print ''; + print ''; + + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + if ($object->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($object->socid); + + print ''; + } + + else + { + print ''; + } + } + + // Civility + print ''; + + // Date To Birth + print ''; + if (! empty($object->birthday)) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + + print ''; + } + else + { + print '"; + } + print ""; + + print "
    '.$langs->trans("Ref").''; + print $form->showrefnav($object, 'id', $linkback); + print '
    '.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
    '.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
    '.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print '
    '.$langs->trans("UserTitle").''; + print $object->getCivilityLabel(); + print '
    '.$langs->trans("DateToBirth").''.dol_print_date($object->birthday,"day"); + + print '   '; + //var_dump($birthdatearray); + $ageyear=convertSecondToTime($now-$object->birthday,'year')-1970; + $agemonth=convertSecondToTime($now-$object->birthday,'month')-1; + if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')'; + else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')'; + else print '('.$agemonth.' '.$langs->trans("DurationMonth").')'; + + + print '   -   '; + if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn"); + else print $langs->trans("BirthdayAlertOff"); + print ''.$langs->trans("DateToBirth").''.$langs->trans("Unknown")."
    "; + + print '
    '; + + $colwidth='20'; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + + + dol_fiche_end(); +} + +llxFooter(); +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 48189eb60f6..76d73133e0f 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -70,7 +70,7 @@ $v->setTitle($contact->poste); if ($company->id) { $v->setURL($company->url, "WORK"); - if (! $contact->phone_pro) $v->setPhoneNumber($company->tel, "WORK;VOICE"); + if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE"); if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX"); if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL"); if ($company->email != $contact->email) $v->setEmail($company->email,'internet'); diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php new file mode 100644 index 00000000000..c50872beee4 --- /dev/null +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -0,0 +1,159 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Philippe Grand + * + * 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 . + */ + +/** + * \file htdocs/contrat/admin/contract_extrafields.php + * \ingroup contrat + * \brief Page to setup extra fields of contract + */ + + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + +$langs->load("companies"); +$langs->load("admin"); +$langs->load("contracts"); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); +$elementtype='contrat'; //Must be the $element of the class that manage extrafield + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + + + +/* + * View + */ + + +llxHeader(); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup'); + +print '
    '; +$head=contract_admin_prepare_head(); + +dol_fiche_head($head, 'attributes', $langs->trans("ModuleSetup"), 0, 'contrat'); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
    '."\n"; +print '
    '; + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; + // $i++; +} + +print "
    '.$langs->trans("Position").''.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
    ".$extrafields->attribute_pos[$key]."".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
    "; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
    '; + print "".$langs->trans("NewAttribute").""; + print "
    "; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel + /* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
    "; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
    "; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); +?> diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 07e8ded51aa..6eda2558daf 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -88,7 +88,7 @@ class Contrat extends CommonObject function getNextNumRef($soc) { global $db, $langs, $conf; - $langs->load("contract"); + $langs->load("contracts"); $dir = DOL_DOCUMENT_ROOT . "/core/modules/contract"; @@ -274,54 +274,63 @@ class Contrat extends CommonObject } /** - * Validate a contract + * Validate a contract * - * @param User $user Objet User - * @return int <0 if KO, >0 if OK + * @param User $user Objet User + * @param string $force_number Reference to force on contract (not implemented yet) + * @return int <0 if KO, >0 if OK */ - function validate($user) + function validate($user, $force_number='') { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; global $langs, $conf; + $now=dol_now(); + $error=0; + dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number); - // Definition du nom de module de numerotation de commande - $soc = new Societe($this->db); - $soc->fetch($this->socid); - // Class of company linked to order - $result=$soc->set_as_client(); + $this->db->begin(); + + $this->fetch_thirdparty(); + + // A contract is validated so we can move thirdparty to status customer + $result=$this->thirdparty->set_as_client(); // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) { - $num = $this->getNextNumRef($soc); + $num = $this->getNextNumRef($this->thirdparty); } else { $num = $this->ref; } - $sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET ref = '".$num."', statut = 1"; - $sql .= " WHERE rowid = ".$this->id . " AND statut = 0"; - - $resql = $this->db->query($sql); - if ($resql) + if ($num) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + $sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET ref = '".$num."', statut = 1"; + //$sql.= ", fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; + $sql .= " WHERE rowid = ".$this->id . " AND statut = 0"; + + dol_syslog(get_class($this)."::validate sql=".$sql); + $resql = $this->db->query($sql); + if (! $resql) + { + dol_syslog(get_class($this)."::validate Echec update - 10 - sql=".$sql, LOG_ERR); + dol_print_error($this->db); + $error++; + } if (! $error) { + $this->oldref = ''; + // Rename directory if dir was a temporary ref if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // Rename of propal directory ($this->ref = old ref, $num = new ref) + // Rename of object directory ($this->ref = old ref, $num = new ref) // to not lose the linked files $facref = dol_sanitizeFileName($this->ref); $snumfa = dol_sanitizeFileName($num); @@ -330,28 +339,56 @@ class Contrat extends CommonObject if (file_exists($dirsource)) { dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); - + if (@rename($dirsource, $dirdest)) { + $this->oldref = $facref; + dol_syslog("Rename ok"); // Deleting old PDF in new rep dol_delete_file($conf->contract->dir_output.'/'.$snumfa.'/'.$facref.'*.*'); } } } - - return 1; } - else + + // Set new ref and define current statut + if (! $error) { - return -1; + $this->ref = $num; + $this->statut=1; + $this->brouillon=0; + $this->date_validation=$now; + } + + // Trigger calls + if (! $error) + { + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('CONTRACT_VALIDATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers } } else { - $this->error=$this->db->error(); + $error++; + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + $this->error=$this->db->lasterror(); return -1; } + } @@ -532,7 +569,7 @@ class Contrat extends CommonObject if ($line->statut == 0) $this->nbofserviceswait++; if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++; - if ($line->statut == 4 && $line->date_fin_prevue < $now) $this->nbofservicesexpired++; + if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++; if ($line->statut == 5) $this->nbofservicesclosed++; $total_ttc+=$objp->total_ttc; // TODO Not saved into database @@ -617,7 +654,7 @@ class Contrat extends CommonObject if ($line->statut == 0) $this->nbofserviceswait++; if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++; - if ($line->statut == 4 && $line->date_fin_prevue < $now) $this->nbofservicesexpired++; + if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++; if ($line->statut == 5) $this->nbofservicesclosed++; $this->lines[] = $line; @@ -931,7 +968,7 @@ class Contrat extends CommonObject */ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0) { - global $user, $langs, $conf; + global $user, $langs, $conf, $mysoc; dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type, $pu_ttc, $info_bits"); @@ -962,16 +999,26 @@ class Contrat extends CommonObject $pu=$pu_ttc; } + // Check parameters + if (empty($remise_percent)) $remise_percent=0; + // Calcul du total TTC et de la TVA pour la ligne a partir de // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1); + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,'', $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; $total_localtax1= $tabprice[9]; $total_localtax2= $tabprice[10]; + + $localtax1_type=$localtaxes_type[0]; + $localtax2_type=$localtaxes_type[2]; + // TODO A virer // Anciens indicateurs: $price, $remise (a ne plus utiliser) $remise = 0; @@ -993,7 +1040,7 @@ class Contrat extends CommonObject // Insertion dans la base $sql = "INSERT INTO ".MAIN_DB_PREFIX."contratdet"; $sql.= " (fk_contrat, label, description, fk_product, qty, tva_tx,"; - $sql.= " localtax1_tx, localtax2_tx, remise_percent, subprice,"; + $sql.= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, remise_percent, subprice,"; $sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc,"; $sql.= " info_bits,"; $sql.= " price_ht, remise, fk_product_fournisseur_price, buy_price_ht"; @@ -1005,6 +1052,8 @@ class Contrat extends CommonObject $sql.= " '".$txtva."',"; $sql.= " '".$txlocaltax1."',"; $sql.= " '".$txlocaltax2."',"; + $sql.= " '".$localtax1_type."',"; + $sql.= " '".$localtax2_type."',"; $sql.= " ".price2num($remise_percent).",".price2num($pu_ht).","; $sql.= " ".price2num($total_ht).",".price2num($total_tva).",".price2num($total_localtax1).",".price2num($total_localtax2).",".price2num($total_ttc).","; $sql.= " '".$info_bits."',"; @@ -1073,7 +1122,7 @@ class Contrat extends CommonObject */ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0) { - global $user, $conf, $langs; + global $user, $conf, $langs, $mysoc; // Nettoyage parametres $qty=trim($qty); @@ -1102,15 +1151,22 @@ class Contrat extends CommonObject $this->db->begin(); // Calcul du total TTC et de la TVA pour la ligne a partir de - // qty, pu, remise_percent et txtva + // qty, pu, remise_percent et tvatx // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtaxtx1, $txlocaltaxtx2, 0, $price_base_type, $info_bits, 1); + + $localtaxes_type=getLocalTaxesFromRate($tvatx,0,$mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtaxtx1, $txlocaltaxtx2, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; $total_localtax1= $tabprice[9]; $total_localtax2= $tabprice[10]; + + $localtax1_type=$localtaxes_type[0]; + $localtax2_type=$localtaxes_type[2]; + // TODO A virer // Anciens indicateurs: $price, $remise (a ne plus utiliser) $remise = 0; @@ -1138,6 +1194,8 @@ class Contrat extends CommonObject $sql.= ",tva_tx='". price2num($tvatx)."'"; $sql.= ",localtax1_tx='". price2num($localtax1tx)."'"; $sql.= ",localtax2_tx='". price2num($localtax2tx)."'"; + $sql.= ",localtax1_type='".$localtax1_type."'"; + $sql.= ",localtax2_type='".$localtax2_type."'"; $sql.= ", total_ht='". price2num($total_ht)."'"; $sql.= ", total_tva='". price2num($total_tva)."'"; $sql.= ", total_localtax1='".price2num($total_localtax1)."'"; @@ -1211,7 +1269,7 @@ class Contrat extends CommonObject // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_LINE_DELETE',$this,$user,$langs,$conf); + $result=$interface->run_triggers('LINECONTRACT_DELETE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers @@ -1561,6 +1619,7 @@ class Contrat extends CommonObject { $this->nb["Contracts"]=$obj->nb; } + $this->db->free($resql); return 1; } else @@ -1695,6 +1754,8 @@ class ContratLigne var $tva_tx; var $localtax1_tx; var $localtax2_tx; + var $localtax1_type; // Local tax 1 type + var $localtax2_type; // Local tax 2 type var $qty; var $remise_percent; var $remise; @@ -1738,7 +1799,7 @@ class ContratLigne */ function getLibStatut($mode) { - return $this->LibStatut($this->statut,$mode,(isset($this->date_fin_validite)?($this->date_fin_validite < dol_now()?1:0):-1)); + return $this->LibStatut($this->statut,$mode,((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1)); } /** @@ -2028,7 +2089,7 @@ class ContratLigne $sql.= " total_localtax1='".$this->total_localtax1."',"; $sql.= " total_localtax2='".$this->total_localtax2."',"; $sql.= " total_ttc='".$this->total_ttc."',"; - $sql.= " fk_product_fournisseur_price='".$this->fk_fournprice."',"; + $sql.= " fk_product_fournisseur_price=".(!empty($this->fk_fournprice)?$this->fk_fournprice:"NULL").","; $sql.= " buy_price_ht='".price2num($this->pa_ht)."',"; $sql.= " info_bits='".$this->info_bits."',"; $sql.= " fk_user_author=".($this->fk_user_author >= 0?$this->fk_user_author:"NULL").","; @@ -2057,7 +2118,7 @@ class ContratLigne // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_LINE_MODIFY',$this,$user,$langs,$conf); + $result=$interface->run_triggers('LINECONTRACT_UPDATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers } @@ -2101,6 +2162,48 @@ class ContratLigne return -2; } } + + /** + * Load elements linked to contract (only intervention for the moment) + * + * @param string $type Object type + * @return array $elements array of linked elements + */ + function get_element_list($type) + { + $elements = array(); + + $sql = ''; + if ($type == 'intervention') + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "fichinter WHERE fk_contrat=" . $this->id; + if (! $sql) return -1; + + //print $sql; + dol_syslog(get_class($this)."::get_element_list sql=" . $sql); + $result = $this->db->query($sql); + if ($result) + { + $nump = $this->db->num_rows($result); + if ($nump) + { + $i = 0; + while ($i < $nump) + { + $obj = $this->db->fetch_object($result); + $elements[$i] = $obj->rowid; + $i++; + } + $this->db->free($result); + /* Return array */ + return $elements; + } + } + else + { + dol_print_error($this->db); + } + } + } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index a05ffb6f90d..d01f01e16cc 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -157,7 +157,7 @@ if ($id > 0 || ! empty($ref)) // Ligne info remises tiers print '
    '.$langs->trans('Discount').''; - if ($object->thirdparty->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_client); + if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$object->thirdparty->getAvailableDiscounts(); print '. '; @@ -169,9 +169,9 @@ if ($id > 0 || ! empty($ref)) print "
    "; print ''; - + print '
    '; - + // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 099befedb95..ea951f85941 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005 Simon TOSSER + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -74,28 +75,9 @@ $modulepart='contract'; /* - * Action envoie fichier + * Actions */ -if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) -{ - dol_add_file_process($upload_dir,0,1,'userfile'); -} - -// Delete -if ($action == 'confirm_deletefile' && $confirm == 'yes') -{ - if ($object->id) - { - $langs->load("other"); - - $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; - } -} +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; /* @@ -140,29 +122,15 @@ if ($object->id) print ''; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '
    '; - } - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->contrat->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'contract',$param); + $modulepart = 'contract'; + $permission = $user->rights->contrat->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { - print $langs->trans("UnkownError"); + print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index aba03ea5347..59a23bebd91 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -38,7 +38,7 @@ if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) requi if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } $langs->load("contracts"); @@ -88,17 +88,24 @@ if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat-> else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) { - $object->fetch($id); - $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment'))); - - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else { - $mesg=$object->error; - } + if (! GETPOST('dateend')) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),'errors'); + } + if (! $error) + { + $object->fetch($id); + $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment'))); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + $mesg=$object->error; + } + } } // Si ajout champ produit predefini @@ -158,9 +165,9 @@ if (GETPOST('remonth') && GETPOST('reday') && GETPOST('reyear')) $datecontrat = dol_mktime(GETPOST('rehour'), GETPOST('remin'), 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); } +// Add contract if ($action == 'add' && $user->rights->contrat->creer) { - // Check if (empty($datecontrat)) { @@ -242,7 +249,7 @@ if ($action == 'add' && $user->rights->contrat->creer) { $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); - if ($product_type == 1) { //only services + if ($product_type == 1) { //only services // TODO Exclude also deee // service prédéfini if ($lines[$i]->fk_product > 0) { @@ -286,8 +293,8 @@ if ($action == 'add' && $user->rights->contrat->creer) $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, - $date_start =0, - $date_end =0, + $lines[$i]->date_start, + $lines[$i]->date_end, 'HT', 0, $lines[$i]->info_bits, @@ -303,7 +310,6 @@ if ($action == 'add' && $user->rights->contrat->creer) } } - } else { @@ -339,9 +345,36 @@ else if ($action == 'classin' && $user->rights->contrat->creer) $object->setProject(GETPOST('projectid')); } +// Add a new line else if ($action == 'addline' && $user->rights->contrat->creer) { - if (! GETPOST('qty')) + // Set if we used free entry or predefined product + if (GETPOST('addline_libre')) + { + $predef=''; + $idprod=0; + $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + if (GETPOST('addline_predefined')) + { + $predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):'')); + $price_ht = ''; + $tva_tx = ''; + } + if (GETPOST('usenewaddlineform')) { + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } + $qty = GETPOST('qty'.$predef); + $remise_percent=GETPOST('remise_percent'.$predef); + + if ($qty == '') { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")),'errors'); $error++; @@ -362,41 +395,19 @@ else if ($action == 'addline' && $user->rights->contrat->creer) } $ret=$object->fetch_thirdparty(); - $date_start=''; - $date_end=''; - // Si ajout champ produit libre - if (GETPOST('mode') == 'libre') - { - if (GETPOST('date_start_slmonth') && GETPOST('date_start_slday') && GETPOST('date_start_slyear')) - { - $date_start=dol_mktime(GETPOST('date_start_slhour'), GETPOST('date_start_slmin'), 0, GETPOST('date_start_slmonth'), GETPOST('date_start_slday'), GETPOST('date_start_slyear')); - } - if (GETPOST('date_end_slmonth') && GETPOST('date_end_slday') && GETPOST('date_end_slyear')) - { - $date_end=dol_mktime(GETPOST('date_end_slhour'), GETPOST('date_end_slmin'), 0, GETPOST('date_end_slmonth'), GETPOST('date_end_slday'), GETPOST('date_end_slyear')); - } - } - // Si ajout champ produit predefini - if (GETPOST('mode') == 'predefined') - { - if (GETPOST('date_startmonth') && GETPOST('date_startday') && GETPOST('date_startyear')) - { - $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - } - if (GETPOST('date_endmonth') && GETPOST('date_endday') && GETPOST('date_endyear')) - { - $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); - } - } + // Clean parameters + $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); + $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); + $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit // Ecrase $base_price_type par celui du produit - if (GETPOST('idprod')) + if ($idprod > 0) { $prod = new Product($db); - $prod->fetch(GETPOST('idprod')); + $prod->fetch($idprod); $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id); $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id); @@ -426,22 +437,21 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); } else - { + { $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } - $desc = $prod->description; - $desc.= $prod->description && GETPOST('np_desc') ? "\n" : ""; - $desc.= GETPOST('np_desc'); + $desc=$prod->description; + $desc=dol_concatdesc($desc,$product_desc); } else - { + { $pu_ht=GETPOST('price_ht'); $price_base_type = 'HT'; $tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0 $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0; - $desc=GETPOST('dp_desc'); + $desc=$product_desc; } $localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty); @@ -457,23 +467,23 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) { - $object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)); + $object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); $result = -1 ; } else - { + { // Insert line $result = $object->addline( $desc, $pu_ht, - GETPOST('qty'), + $qty, $tva_tx, $localtax1_tx, $localtax2_tx, - GETPOST('idprod'), - GETPOST('remise_percent'), + $idprod, + $remise_percent, $date_start, $date_end, $price_base_type, @@ -506,7 +516,6 @@ else if ($action == 'addline' && $user->rights->contrat->creer) unset($_POST['qty']); unset($_POST['type']); - unset($_POST['idprod']); unset($_POST['remise_percent']); unset($_POST['price_ht']); unset($_POST['price_ttc']); @@ -516,6 +525,16 @@ else if ($action == 'addline' && $user->rights->contrat->creer) unset($_POST['product_desc']); unset($_POST['fournprice']); unset($_POST['buying_price']); + unset($_POST['dp_desc']); + + unset($_POST['idprod']); + unset($_POST['qty_predef']); + unset($_POST['remise_percent_predef']); + unset($_POST['fournprice_predef']); + unset($_POST['buying_price_predef']); + unset($_POST['np_marginRate_predef']); + unset($_POST['np_markRate_predef']); + unset($_POST['np_desc']); } else { @@ -838,7 +857,7 @@ if ($action == 'create') { // Ligne info remises tiers print '
    '.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; $absolute_discount=$soc->getAvailableDiscounts(); @@ -864,8 +883,10 @@ if ($action == 'create') if (! empty($conf->projet->enabled)) { + $formproject=new FormProjets($db); + print '
    '.$langs->trans("Project").''; - select_projects($soc->id,$projectid,"projectid"); + $formproject->select_projects($soc->id,$projectid,"projectid"); print "
    '.$langs->trans('Discount').''; - if ($object->thirdparty->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_client); + if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$object->thirdparty->getAvailableDiscounts(); print '. '; @@ -1079,7 +1094,6 @@ else } - $servicepos=(GETPOST('servicepos')?GETPOST('servicepos'):1); // FIXME : not used ? $colorb='666666'; $arrayothercontracts=$object->getListOfContracts('others'); @@ -1090,18 +1104,26 @@ else $productstatic=new Product($db); // Title line for service - print ''; // Array with (n*2)+1 lines + //print '
    '; // Array with (n*2)+1 lines $cursorline=1; while ($cursorline <= $nbofservices) { - print ''; - print ''; + //print ''; + //print ''; - print '
    '; - print $langs->trans("ServiceNb",$cursorline).'
    '; + //print $langs->trans("ServiceNb",$cursorline).''; + // print ''; + + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; // Area with common detail of line - print ''; + print '
    '; $sql = "SELECT cd.rowid, cd.statut, cd.label as label_det, cd.fk_product, cd.description, cd.price_ht, cd.qty,"; $sql.= " cd.tva_tx, cd.remise_percent, cd.info_bits, cd.subprice,"; @@ -1119,7 +1141,7 @@ else $total = 0; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -1234,15 +1256,9 @@ else } // Ligne en mode update else - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + { // Ligne carac - print ""; + print ""; print ''; // Ligne dates prevues - print ""; + print ""; print ''; print ''; - - print "\n"; } $db->free($result); } else - { + { dol_print_error($db); } @@ -1311,13 +1325,15 @@ else print "
    '.$langs->trans("Service").''.$langs->trans("ServiceNb",$cursorline).''.$langs->trans("VAT").''.$langs->trans("PriceUHT").''.$langs->trans("Qty").'
    '; if ($objp->fk_product) { @@ -1283,7 +1299,7 @@ else print '
    '; print '
    '; print $langs->trans("DateStartPlanned").' '; $form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update"); @@ -1291,14 +1307,12 @@ else $form->select_date($db->jdate($objp->date_fin),"date_end_update",$usehm,$usehm,($db->jdate($objp->date_fin)>0?0:1),"update"); print '
    "; + print "\n"; + /* * Confirmation to delete service line of contract */ if ($action == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid')) { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); if ($ret == 'html') print '
    '; } @@ -1475,6 +1491,7 @@ else * Desactiver la ligne de contrat */ print '
    '; + print ''; print ''; @@ -1504,7 +1521,7 @@ else if ($objp->statut == 4) { print $langs->trans("DateEndReal").' '; - $form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline"); + $form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",1,1); } } print ''; @@ -1519,21 +1536,31 @@ else print ''; } - print ''; // End td if line is 1 + /* print ''; // End td if line is 1 print ''; - print ''; + print '';*/ + $cursorline++; } - print '
     
     
    '; + //print '
    '; + // Form to add new line if ($user->rights->contrat->creer && ($object->statut >= 0)) { $dateSelector=1; - print '
    '; - print ''; // Array with (n*2)+1 lines + print "\n"; + print ' + + + + + '; + + print '
    '; + print '
    '; // Array with (n*2)+1 lines // Trick to not show product entries $savproductenabled=$conf->product->enabled; @@ -1569,13 +1596,12 @@ else // Restore correct setup $conf->product->enabled = $savproductenabled; - print ''; - print '
    '; + + print ''; } - - print ''; + dol_fiche_end(); /* @@ -1644,11 +1670,13 @@ llxFooter(); $db->close(); ?> + margin->enabled) { +if ($conf->margin->enabled && $action == 'editline') +{ ?> + - + + diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 845eaad86bb..05ee288b42c 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -80,9 +80,9 @@ if (! empty($conf->contrat->enabled)) print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print "
    '.$langs->trans("SearchAContract").'
    '.$langs->trans("Ref").':'.$langs->trans("Ref").':
    '.$langs->trans("Other").':
    '.$langs->trans("Other").':
    \n"; print "
    "; @@ -255,7 +255,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); - print '
    '; + print '
    '; $staticcontrat->ref=$obj->ref; $staticcontrat->id=$obj->rowid; print $staticcontrat->getNomUrl(1,''); diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 3140834b626..38576f7e764 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador * * 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 @@ -79,9 +80,15 @@ $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND c.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; -if ($search_contract) $sql.= " AND (".(is_numeric($search_contract)?"c.rowid = ".$db->escape($search_contract)." OR ":'')." c.ref LIKE '%".$db->escape($search_contract)."%')"; -if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR cd.label LIKE '%".$db->escape($sall)."%' OR cd.description LIKE '%".$db->escape($sall)."%')"; +if ($search_nom) { + $sql .= natural_search('s.nom', $search_nom); +} +if ($search_contract) { + $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); +} +if ($sall) { + $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall); +} $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,"; $sql.= " s.nom, s.rowid"; $sql.= " ORDER BY $sortfield $sortorder"; @@ -122,7 +129,7 @@ if ($resql) print '  '; + print ''; print "
    '.$langs->trans('Discount').''; - if ($object->thirdparty->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_client); + if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$object->thirdparty->getAvailableDiscounts(); print '. '; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index ea42df9e01d..2f42fc39c77 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -184,7 +184,7 @@ if ($resql) $filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year); print $form->select_date($filter_date2,'op2',0,0,1); print ''; + print ''; print "
    '."\n"; } // Show box title - if (! empty($head['text']) || ! empty($head['sublink'])) + if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto'])) { //print '
    '."\n"; //print '
    '."\n"; @@ -158,16 +158,16 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" $s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX); print $s; } - if (! empty($head['sublink'])) - { - print ' '.img_picto($head['subtext'],$head['subpicto']).''; - } + print ' '; + if (! empty($head['sublink'])) print ''; + if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); + if (! empty($head['sublink'])) ''; if ($conf->use_javascript_ajax) { print ''; print "\n"; -// print "
    '; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object - print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle hideonsmartphone" style="cursor:move;"'); - print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"'); + print img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"'); + print img_picto($langs->trans("Close",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"'); $label=$head['text']; if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; print ''; @@ -175,8 +175,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" } print '
    \n"; -// print "
    \n"; + //print "\n"; + //print "
    \n"; } // Show box lines @@ -203,19 +203,20 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td']; if (empty($contents[$i][$j]['text'])) $contents[$i][$j]['text']=""; - $texte=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; - $textewithnotags=preg_replace('/<([^>]+)>/i','',$texte); - $texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; - $texte2withnotags=preg_replace('/<([^>]+)>/i','',$texte2); - //print "xxx $textewithnotags y"; + $text=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; + $textwithnotags=preg_replace('/<([^>]+)>/i','',$text); + $text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; + $text2withnotags=preg_replace('/<([^>]+)>/i','',$text2); + $textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:''; + //print "xxx $textwithnotags y"; print ''; // Url if (! empty($contents[$i][$j]['url'])) { - print '" + print '" print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':''; print '>'; } @@ -230,15 +231,17 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" $maxlength=$MAXLENGTHBOX; if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; - if ($maxlength) $textewithnotags=dol_trunc($textewithnotags,$maxlength); - if (preg_match('/^'; - if (preg_match('/^"; } @@ -248,13 +251,13 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" } } - if (! empty($head['text']) || ! empty($head['sublink']) || $nblines) + if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines) { print "\n"; } // If invisible box with no contents - if (empty($head['text']) && empty($head['sublink']) && ! $nblines) print "
    \n"; + if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && ! $nblines) print "
    \n"; print "
    \n"; print "\n\n"; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 0f80563e293..20e12e47425 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -404,7 +404,7 @@ class CMailFile // le return-path dans les header ne fonctionne pas avec tous les MTA // Le passage par -f est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie. // La variable definie pose des pb avec certains sendmail securisee (option -f refusee car dangereuse) - $bounce .= ($bounce?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $conf->global->MAIN_MAIL_ERRORS_TO : ($this->addr_from != '' ? '-f' . $this->addr_from : '') ); + $bounce .= ($bounce?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') ); } if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender { @@ -962,8 +962,11 @@ class CMailFile $this->html_images[$i]["name"] = $img; // Content type - $ext = preg_replace('/^.*\.(\w{3,4})$/e', 'strtolower("$1")', $img); - $this->html_images[$i]["content_type"] = $this->image_types[$ext]; + if (preg_match('/^.+\.(\w{3,4})$/', $img, $reg)) + { + $ext=strtolower($reg[1]); + $this->html_images[$i]["content_type"] = $this->image_types[$ext]; + } // cid $this->html_images[$i]["cid"] = dol_hash(uniqid(time())); @@ -1076,4 +1079,4 @@ class CMailFile } } -?> \ No newline at end of file +?> diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 4dfdb636814..12348afbeaf 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -49,6 +49,7 @@ abstract class CommonDocGenerator return array( 'myuser_lastname'=>$user->lastname, 'myuser_firstname'=>$user->firstname, + 'myuser_fullname'=>$user->getFullName($outputlangs,1), 'myuser_login'=>$user->login, 'myuser_phone'=>$user->office_phone, 'myuser_address'=>$user->address, @@ -61,6 +62,7 @@ abstract class CommonDocGenerator 'myuser_fax'=>$user->office_fax, 'myuser_mobile'=>$user->user_mobile, 'myuser_email'=>$user->email, + 'myuser_logo'=>$logotouse, 'myuser_web'=>'' // url not exist in $user object ); } @@ -116,7 +118,10 @@ abstract class CommonDocGenerator 'mycompany_idprof5'=>$mysoc->idprof5, 'mycompany_idprof6'=>$mysoc->idprof6, 'mycompany_vatnumber'=>$mysoc->tva_intra, - 'mycompany_note'=>$mysoc->note + // Only private not exists for "mysoc" + 'mycompany_note'=>$mysoc->note_private + //'mycompany_note_private'=>$mysoc->note_private, + //'mycompany_note_public'=>$mysoc->note_public, ); } @@ -174,8 +179,7 @@ abstract class CommonDocGenerator // Retrieve extrafields if(is_array($object->array_options) && count($object->array_options)) { - if(!class_exists('Extrafields')) - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label('societe',true); $object->fetch_optionals($object->id,$extralabels); @@ -184,7 +188,7 @@ abstract class CommonDocGenerator { if($extrafields->attribute_type[$key] == 'price') { - $object->array_options['options_'.$key] = price($object->array_options['options_'.$key]).' '.$outputlangs->getCurrencySymbol($conf->currency); + $object->array_options['options_'.$key] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency); } else if($extrafields->attribute_type[$key] == 'select') { @@ -236,7 +240,8 @@ abstract class CommonDocGenerator $array_key.'_ref'=>$object->ref, $array_key.'_ref_ext'=>$object->ref_ext, $array_key.'_ref_customer'=>$object->ref_client, - $array_key.'_date'=>dol_print_date($object->date,'day'), + $array_key.'_hour'=>dol_print_date($object->date,'hour'), + $array_key.'_date'=>dol_print_date($object->date,'day'), $array_key.'_date_end'=>dol_print_date($object->fin_validite,'day'), $array_key.'_date_creation'=>dol_print_date($object->date_creation,'day'), $array_key.'_date_modification'=>dol_print_date($object->date_modification,'day'), @@ -245,10 +250,20 @@ abstract class CommonDocGenerator $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement), $array_key.'_payment_term_code'=>$object->cond_reglement_code, $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code)!='PaymentCondition'.$object->cond_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code):$object->cond_reglement), - $array_key.'_total_ht'=>price($object->total_ht), - $array_key.'_total_vat'=>price($object->total_tva), - $array_key.'_total_ttc'=>price($object->total_ttc), - $array_key.'_total_discount_ht' => price($object->getTotalDiscount()), + + $array_key.'_total_ht_locale'=>price($object->total_ht,0,$outputlangs), + $array_key.'_total_vat_locale'=>price($object->total_tva,0,$outputlangs), + $array_key.'_total_localtax1_locale'=>price($object->total_localtax1,0,$outputlangs), + $array_key.'_total_localtax2_locale'=>price($object->total_localtax2,0,$outputlangs), + $array_key.'_total_ttc_locale'=>price($object->total_ttc,0,$outputlangs), + $array_key.'_total_discount_ht_locale' => price($object->getTotalDiscount(),0,$outputlangs), + $array_key.'_total_ht'=>price2num($object->total_ht), + $array_key.'_total_vat'=>price2num($object->total_tva), + $array_key.'_total_localtax1'=>price2num($object->total_localtax1), + $array_key.'_total_localtax2'=>price2num($object->total_localtax2), + $array_key.'_total_ttc'=>price2num($object->total_ttc), + $array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()), + $array_key.'_vatrate'=>vatrate($object->tva), $array_key.'_note_private'=>$object->note, $array_key.'_note'=>$object->note_public, @@ -264,8 +279,7 @@ abstract class CommonDocGenerator // Retrieve extrafields if(is_array($object->array_options) && count($object->array_options)) { - if(!class_exists('Extrafields')) - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label('propal',true); $object->fetch_optionals($object->id,$extralabels); @@ -304,6 +318,99 @@ abstract class CommonDocGenerator ); } + /** + * Define array with couple substitution key => substitution value + * + * @param Object $object Main object to use as data source + * @param Translate $outputlangs Lang object to use for output + * @param array_key $array_key Name of the key for return array + * @return array Array of substitution + */ + function get_substitutionarray_shipment($object,$outputlangs,$array_key='object') + { + global $conf; + dol_include_once('/core/lib/product.lib.php'); + $object->list_delivery_methods($object->shipping_method_id); + $calculatedVolume=($object->trueWidth * $object->trueHeight * $object->trueDepth); + + $array_shipment=array( + $array_key.'_id'=>$object->id, + $array_key.'_ref'=>$object->ref, + $array_key.'_ref_ext'=>$object->ref_ext, + $array_key.'_ref_customer'=>$object->ref_customer, + $array_key.'_date_delivery'=>dol_print_date($object->date_delivery,'day'), + $array_key.'_hour_delivery'=>dol_print_date($object->date_delivery,'hour'), + $array_key.'_date_creation'=>dol_print_date($object->date_creation,'day'), + $array_key.'_total_ht'=>price($object->total_ht), + $array_key.'_total_vat'=>price($object->total_tva), + $array_key.'_total_ttc'=>price($object->total_ttc), + $array_key.'_total_discount_ht' => price($object->getTotalDiscount()), + $array_key.'_note_private'=>$object->note_private, + $array_key.'_note'=>$object->note_public, + $array_key.'_tracking_number'=>$object->tracking_number, + $array_key.'_tracking_url'=>$object->tracking_url, + $array_key.'_shipping_method'=>$object->listmeths[0]['libelle'], + $array_key.'_weight'=>$object->trueWeight.' '.measuring_units_string($object->weight_units, 'weight'), + $array_key.'_width'=>$object->trueWidth.' '.measuring_units_string($object->width_units, 'size'), + $array_key.'_height'=>$object->trueHeight.' '.measuring_units_string($object->height_units, 'size'), + $array_key.'_depth'=>$object->trueDepth.' '.measuring_units_string($object->depth_units, 'size'), + $array_key.'_size'=>$calculatedVolume.' '.measuring_units_string(0, 'volume'), + ); + + // Add vat by rates + foreach ($object->lines as $line) + { + if (empty($array_shipment[$array_key.'_total_vat_'.$line->tva_tx])) $array_shipment[$array_key.'_total_vat_'.$line->tva_tx]=0; + $array_shipment[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; + } + + // Retrieve extrafields + /*if(is_array($object->array_options) && count($object->array_options)) + { + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafields = new ExtraFields($this->db); + $extralabels = $extrafields->fetch_name_optionals_label('shipment',true); + $object->fetch_optionals($object->id,$extralabels); + + $array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs); + }*/ + return $array_shipment; + } + + + /** + * Define array with couple substitution key => substitution value + * + * @param array $line Array of lines + * @param Translate $outputlangs Lang object to use for output + * @return array Substitution array + */ + function get_substitutionarray_shipment_lines($line,$outputlangs) + { + global $conf; + dol_include_once('/core/lib/product.lib.php'); + + return array( + 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), + 'line_product_ref'=>$line->product_ref, + 'line_product_label'=>$line->product_label, + 'line_desc'=>$line->desc, + 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), + 'line_up'=>price($line->subprice), + 'line_qty'=>$line->qty, + 'line_qty_shipped'=>$line->qty_shipped, + 'line_qty_asked'=>$line->qty_asked, + 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), + 'line_price_ht'=>price($line->total_ht), + 'line_price_ttc'=>price($line->total_ttc), + 'line_price_vat'=>price($line->total_tva), + 'line_weight'=>empty($line->weight) ? '' : $line->weight*$line->qty_shipped.' '.measuring_units_string($line->weight_units, 'weight'), + 'line_length'=>empty($line->length) ? '' : $line->length*$line->qty_shipped.' '.measuring_units_string($line->length_units, 'size'), + 'line_surface'=>empty($line->surface) ? '' : $line->surface*$line->qty_shipped.' '.measuring_units_string($line->surface_units, 'surface'), + 'line_volume'=>empty($line->volume) ? '' : $line->volume*$line->qty_shipped.' '.measuring_units_string($line->volume_units, 'volume'), + ); + } + /** * Fill array with couple extrafield key => extrafield value * @@ -321,8 +428,8 @@ abstract class CommonDocGenerator { if($extrafields->attribute_type[$key] == 'price') { - $object->array_options['options_'.$key] = price2num($object->array_options['options_'.$key],2); - $object->array_options['options_'.$key.'_currency'] = $object->array_options['options_'.$key].' '.$outputlangs->getCurrencySymbol($conf->currency); + $object->array_options['options_'.$key] = price2num($object->array_options['options_'.$key]); + $object->array_options['options_'.$key.'_currency'] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency); //Add value to store price with currency $array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency'])); } diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 0359d9dde25..0314bf34413 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -289,4 +289,11 @@ abstract class CommonInvoice extends CommonObject } } +/** + * Parent class of all other business classes for details of elements (invoices, contracts, proposals, orders, ...) + */ +abstract class CommonInvoiceLine extends CommonObject +{ +} + ?> diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8343c219d31..bdffb1fc708 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1,9 +1,11 @@ +/* Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2012 Philippe Grand * Copyright (C) 2012 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -37,20 +39,30 @@ abstract class CommonObject public $errors; public $canvas; // Contains canvas name if it is + public $name; public $lastname; public $firstname; - public $name; - public $nom; public $civility_id; + public $import_key; public $array_options=array(); - public $linkedObjectsIds; - public $linkedObjects; + public $linkedObjectsIds; // Loaded by ->fetchObjectLinked + public $linkedObjects; // Loaded by ->fetchObjectLinked // No constructor as it is an abstract class + /** + * Method to output saved errors + * + * @return string String with errors + */ + function errorsToString() + { + return $this->error.(is_array($this->errors)?(($this->error!=''?' ':'').join(',',$this->errors)):''); + } + /** * Return full name (civility+' '+name+' '+lastname) * @@ -441,9 +453,10 @@ abstract class CommonObject * @param string $source 'internal', 'external' or 'all' * @param string $order Sort order by : 'code' or 'rowid' * @param string $option 0=Return array id->label, 1=Return array code->label + * @param string $activeonly 0=all type of contact, 1=only the active * @return array Array list of type of contacts (id->label if option=0, code->label if option=1) */ - function liste_type_contact($source='internal', $order='code', $option=0) + function liste_type_contact($source='internal', $order='code', $option=0, $activeonly=0) { global $langs; @@ -451,6 +464,9 @@ abstract class CommonObject $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql.= " WHERE tc.element='".$this->element."'"; + if ($activeonly == 1) + $sql.= " AND tc.active=1"; // only the active type + if (! empty($source)) $sql.= " AND tc.source='".$source."'"; $sql.= " ORDER by tc.".$order; @@ -726,31 +742,35 @@ abstract class CommonObject } /** - * Update a specific field from an object + * Update a specific field into database * * @param string $field Field to update * @param mixte $value New value - * @param string $table To force other table element or element line - * @param int $id To force other object id - * @param string $format Data format ('text' by default, 'date') - * @param string $id_field To force rowid field name + * @param string $table To force other table element or element line (should not be used) + * @param int $id To force other object id (should not be used) + * @param string $format Data format ('text', 'date'). 'text' is used if not defined + * @param string $id_field To force rowid field name. 'rowid' is used it not defined + * @param string $user Update last update fields also if user object provided * @return int <0 if KO, >0 if OK */ - function setValueFrom($field, $value, $table='', $id='', $format='text', $id_field='rowid') + function setValueFrom($field, $value, $table='', $id='', $format='', $id_field='', $user='') { global $conf; - if (empty($table)) $table=$this->table_element; - if (empty($id)) $id=$this->id; + if (empty($table)) $table=$this->table_element; + if (empty($id)) $id=$this->id; + if (empty($format)) $format='text'; + if (empty($id_field)) $id_field='rowid'; $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET "; if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'"; else if ($format == 'date') $sql.= $field." = '".$this->db->idate($value)."'"; + if (is_object($user)) $sql.=", fk_user_modif = ".$user->id; $sql.= " WHERE ".$id_field." = ".$id; - dol_syslog(get_class($this)."::setValueFrom sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::".__FUNCTION__." sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -902,6 +922,7 @@ abstract class CommonObject // TODO uniformize field name $fieldname = 'fk_mode_reglement'; if ($this->element == 'societe') $fieldname = 'mode_reglement'; + if (get_class($this) == 'Fournisseur') $fieldname = 'mode_reglement_supplier'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' SET '.$fieldname.' = '.$id; @@ -910,7 +931,6 @@ abstract class CommonObject if ($this->db->query($sql)) { $this->mode_reglement_id = $id; - $this->mode_reglement = $id; // for compatibility return 1; } else @@ -942,6 +962,7 @@ abstract class CommonObject // TODO uniformize field name $fieldname = 'fk_cond_reglement'; if ($this->element == 'societe') $fieldname = 'cond_reglement'; + if (get_class($this) == 'Fournisseur') $fieldname = 'cond_reglement_supplier'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' SET '.$fieldname.' = '.$id; @@ -1455,19 +1476,24 @@ abstract class CommonObject } /** - * Update total_ht, total_ttc and total_vat for an object (sum of lines) + * Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines). + * Must be called at end of methods addline or updateline. * * @param int $exclspec Exclude special product (product_type=9) - * @param int $roundingadjust -1=Use default method (MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND or 0), 0=Use total of rounding, 1=Use rounding of total + * @param int $roundingadjust -1=Use default method (MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND if defined, or 0), 0=Force use total of rounding, 1=Force use rounding of total * @param int $nodatabaseupdate 1=Do not update database. Update only properties of object. + * @param Societe $seller If roundingadjust is 0, it means we recalculate total for lines before calculating total for object. For this, we need seller object. * @return int <0 if KO, >0 if OK */ - function update_price($exclspec=0,$roundingadjust=-1,$nodatabaseupdate=0) + function update_price($exclspec=0,$roundingadjust=-1,$nodatabaseupdate=0,$seller='') { + global $conf; + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - if ($roundingadjust < 0 && isset($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)) $roundingadjust=$conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND; - if ($roundingadjust < 0) $roundingadjust=0; + $forcedroundingmode=$roundingadjust; + if ($forcedroundingmode < 0 && isset($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)) $forcedroundingmode=$conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND; + if ($forcedroundingmode < 0) $forcedroundingmode=0; $error=0; @@ -1475,10 +1501,15 @@ abstract class CommonObject $fieldtva='total_tva'; $fieldlocaltax1='total_localtax1'; $fieldlocaltax2='total_localtax2'; - if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='tva'; + $fieldup='subprice'; + if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') + { + $fieldtva='tva'; + $fieldup='pu_ht'; + } - $sql = 'SELECT qty, total_ht, '.$fieldtva.' as total_tva, total_ttc, '.$fieldlocaltax1.' as total_localtax1, '.$fieldlocaltax2.' as total_localtax2,'; - $sql.= ' tva_tx as vatrate, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type'; + $sql = 'SELECT rowid, qty, '.$fieldup.' as up, remise_percent, total_ht, '.$fieldtva.' as total_tva, total_ttc, '.$fieldlocaltax1.' as total_localtax1, '.$fieldlocaltax2.' as total_localtax2,'; + $sql.= ' tva_tx as vatrate, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, info_bits, product_type'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql.= ' WHERE '.$this->fk_element.' = '.$this->id; if ($exclspec) @@ -1487,6 +1518,7 @@ abstract class CommonObject if ($this->table_element_line == 'contratdet') $product_field=''; // contratdet table has no product_type field if ($product_field) $sql.= ' AND '.$product_field.' <> 9'; } + $sql.= ' ORDER by rowid'; // We want to be sure to always use same order of line to not change lines differently when option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND is used dol_syslog(get_class($this)."::update_price sql=".$sql); $resql = $this->db->query($sql); @@ -1497,8 +1529,9 @@ abstract class CommonObject $this->total_localtax1 = 0; $this->total_localtax2 = 0; $this->total_ttc = 0; - $vatrates = array(); - $vatrates_alllines = array(); + $total_ht_by_vats = array(); + $total_tva_by_vats = array(); + $total_ttc_by_vats = array(); $num = $this->db->num_rows($resql); $i = 0; @@ -1506,54 +1539,53 @@ abstract class CommonObject { $obj = $this->db->fetch_object($resql); - $this->total_ht += $obj->total_ht; + // By default, no adjustement is required ($forcedroundingmode = -1) + if ($forcedroundingmode == 0) // Check if we need adjustement onto line for vat + { + $localtax_array=array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx); + $tmpcal=calcul_price_total($obj->qty, $obj->up, $obj->remise_percent, $obj->vatrate, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->product_type, $seller, $localtax_array); + $diff=price2num($tmpcal[1] - $obj->total_tva, 'MT', 1); + if ($diff) + { + if (abs($diff) > 0.1) { dol_syslog('','A rounding difference was detected', LOG_WARNING); } + $sqlfix="UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".$tmpcal[1].", total_ttc = ".$tmpcal[2]." WHERE rowid = ".$obj->rowid; + dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the vat and total_ttc by running sqlfix = ".$sqlfix); + $resqlfix=$this->db->query($sqlfix); + if (! $resqlfix) dol_print_error($this->db,'Failed to update line'); + $obj->total_tva = $tmpcal[1]; + $obj->total_ttc = $tmpcal[2]; + // + } + } + + $this->total_ht += $obj->total_ht; // The only field visible at end of line detail $this->total_tva += $obj->total_tva; $this->total_localtax1 += $obj->total_localtax1; $this->total_localtax2 += $obj->total_localtax2; $this->total_ttc += $obj->total_ttc; + $total_ht_by_vats[$obj->vatrate] += $obj->total_ht; + $total_tva_by_vats[$obj->vatrate] += $obj->total_tva; + $total_ttc_by_vats[$obj->vatrate] += $obj->total_ttc; - // Check if there is a global invoice tax for this vat rate - // FIXME: We should have no database access into this function. Also localtax 7 seems to have problem so i add condition to avoid it into standard usage without loosing it. - if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) + if ($forcedroundingmode == 1) // Check if we need adjustement onto line for vat { - if ($this->total_localtax1 == 0) - { - // Search to know if there is a localtax of type 7 - // TODO : store local taxes types into object lines and remove this. We should use here $obj->localtax1_type but it is not yet filled into database, so we search into table of vat rate - global $mysoc; - $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); - if (empty($obj->localtax1_type)) - { - $obj->localtax1_type = $localtax1_array[0]; - $obj->localtax1_tx = $localtax1_array[1]; - } - //end TODO + $tmpvat=price2num($total_ht_by_vats[$obj->vatrate] * $obj->vatrate / 100, 'MT', 1); + $diff=price2num($total_tva_by_vats[$obj->vatrate]-$tmpvat, 'MT', 1); + //print 'Line '.$i.' rowid='.$obj->rowid.' vat_rate='.$obj->vatrate.' total_ht='.$obj->total_ht.' total_tva='.$obj->total_tva.' total_ttc='.$obj->total_ttc.' total_ht_by_vats='.$total_ht_by_vats[$obj->vatrate].' total_tva_by_vats='.$total_tva_by_vats[$obj->vatrate].' (new calculation = '.$tmpvat.') total_ttc_by_vats='.$total_ttc_by_vats[$obj->vatrate].($diff?" => DIFF":"")."
    \n"; + if ($diff) + { + if (abs($diff) > 0.1) { dol_syslog('','A rounding difference was detected but is too high to be corrected', LOG_WARNING); exit; } + $sqlfix="UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".($obj->total_tva - $diff).", total_ttc = ".($obj->total_ttc - $diff)." WHERE rowid = ".$obj->rowid; + //print 'We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". Run sqlfix = ".$sqlfix."
    \n"; + dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the vat and total_ttc by running sqlfix = ".$sqlfix); + $resqlfix=$this->db->query($sqlfix); + if (! $resqlfix) dol_print_error($this->db,'Failed to update line'); + $this->total_tva -= $diff; + $this->total_ttc -= $diff; + $total_tva_by_vats[$obj->vatrate] -= $diff; + $total_ttc_by_vats[$obj->vatrate] -= $diff; - if ($obj->localtax1_type == '7') - { - $this->total_localtax1 += $obj->localtax1_tx; - $this->total_ttc += $obj->localtax1_tx; - } - } - if ($this->total_localtax2 == 0) - { - // Search to know if there is a localtax of type 7 - // TODO : store local taxes types into object lines and remove this. We should use here $obj->localtax1_type but it is not yet filled into database, so we search into table of vat rate - global $mysoc; - $localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc); - if (empty($obj->localtax2_type)) - { - $obj->localtax2_type = $localtax2_array[0]; - $obj->localtax2_tx = $localtax2_array[1]; - } - //end TODO - - if ($obj->localtax2_type == '7') - { - $this->total_localtax2 += $obj->localtax2_tx; - $this->total_ttc += $obj->localtax2_tx; - } - } + } } $i++; @@ -1570,6 +1602,7 @@ abstract class CommonObject $fieldlocaltax1='localtax1'; $fieldlocaltax2='localtax2'; $fieldttc='total_ttc'; + // Specific code for backward compatibility with old field names if ($this->element == 'facture' || $this->element == 'facturerec') $fieldht='total'; if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva'; if ($this->element == 'propal') $fieldttc='total'; @@ -1658,7 +1691,7 @@ abstract class CommonObject * @param string $sourcetype Object source type * @param int $targetid Object target id * @param string $targettype Object target type - * @param string $clause OR, AND clause + * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided * @return void */ function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR') @@ -2012,6 +2045,7 @@ abstract class CommonObject /** * Function to get extra fields of a member into $this->array_options + * This method is in most cases called by method fetch of objects but you can call it separately. * * @param int $rowid Id of line * @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label() @@ -2049,7 +2083,7 @@ abstract class CommonObject foreach ($tab as $key => $value) { - //Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine) + // Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine) if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key)) { // we can add this attribute to adherent object @@ -2101,14 +2135,16 @@ abstract class CommonObject * Add/Update all extra fields values for the current object. * All data to describe values to insert are stored into $this->array_options=array('keyextrafield'=>'valueextrafieldtoadd') * - * @return void + * @return int -1=error, O=did nothing, 1=OK */ function insertExtraFields() { - global $langs; + global $conf,$langs; $error=0; + if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used + if (! empty($this->array_options)) { // Check parameters @@ -2200,18 +2236,20 @@ abstract class CommonObject /** * Function to show lines of extrafields with output datas * - * @param object $extrafields extrafield Object + * @param object $extrafields Extrafield Object * @param string $mode Show output (view) or input (edit) for extrafield + * @param array $params Optionnal parameters + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) * * @return string */ - function showOptionals($extrafields,$mode='view') + function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='') { global $_POST; $out = ''; - if(count($extrafields->attribute_label) > 0) + if (count($extrafields->attribute_label) > 0) { $out .= "\n"; $out .= ' '; @@ -2220,7 +2258,13 @@ abstract class CommonObject $e = 0; foreach($extrafields->attribute_label as $key=>$label) { - $colspan='3'; + if (is_array($params) && count($params)>0) { + if (array_key_exists('colspan',$params)) { + $colspan=$params['colspan']; + } + }else { + $colspan='3'; + } switch($mode) { case "view": $value=$this->array_options["options_".$key]; @@ -2235,14 +2279,20 @@ abstract class CommonObject } else { + $csstyle=''; + if (is_array($params) && count($params)>0) { + if (array_key_exists('style',$params)) { + $csstyle=$params['style']; + } + } if ( !empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { - $out .= ''; + $out .= ''; $colspan='0'; } else { - $out .= ''; + $out .= ''; } // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) @@ -2254,14 +2304,14 @@ abstract class CommonObject $label = ''.$label.''; $out .= ''.$label.''; - $out .=''; + $out .=''; switch($mode) { case "view": $out .= $extrafields->showOutputField($key,$value); break; case "edit": - $out .= $extrafields->showInputField($key,$value); + $out .= $extrafields->showInputField($key,$value,'',$keyprefix); break; } @@ -2274,13 +2324,43 @@ abstract class CommonObject } $out .= "\n"; $out .= ' '; + $out .= ' + '; } return $out; } /** - * Function to check if an object is used by others + * Function to check if an object is used by others. + * Check is done into this->childtables. There is no check into llx_element_element. * * @param int $id Id of object * @return int <0 if KO, 0 if not used, >0 if already used @@ -2473,87 +2553,6 @@ abstract class CommonObject // TODO: All functions here must be redesigned and moved as they are not business functions but output functions // -------------------- - - /** - * List urls of element - * - * @param int $objectid Id of record - * @param string $objecttype Type of object - * @param int $withpicto Picto to show - * @param string $option More options - * @return void - */ - function getElementUrl($objectid,$objecttype,$withpicto=0,$option='') - { - global $conf; - - // Parse element/subelement (ex: project_task) - $module = $element = $subelement = $objecttype; - if (preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs)) - { - $module = $element = $regs[1]; - $subelement = $regs[2]; - } - - $classpath = $element.'/class'; - - // To work with non standard path - if ($objecttype == 'facture' || $objecttype == 'invoice') { - $classpath = 'compta/facture/class'; $module='facture'; $subelement='facture'; - } - if ($objecttype == 'commande' || $objecttype == 'order') { - $classpath = 'commande/class'; $module='commande'; $subelement='commande'; - } - if ($objecttype == 'propal') { - $classpath = 'comm/propal/class'; - } - if ($objecttype == 'shipping') { - $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; - } - if ($objecttype == 'delivery') { - $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; - } - if ($objecttype == 'contract') { - $classpath = 'contrat/class'; $module='contrat'; $subelement='contrat'; - } - if ($objecttype == 'member') { - $classpath = 'adherents/class'; $module='adherent'; $subelement='adherent'; - } - if ($objecttype == 'cabinetmed_cons') { - $classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons'; - } - if ($objecttype == 'fichinter') { - $classpath = 'fichinter/class'; $module='ficheinter'; $subelement='fichinter'; - } - - //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; - - $classfile = strtolower($subelement); $classname = ucfirst($subelement); - if ($objecttype == 'invoice_supplier') { - $classfile = 'fournisseur.facture'; - $classname='FactureFournisseur'; - $classpath = 'fourn/class'; - $module='fournisseur'; - } - if ($objecttype == 'order_supplier') { - $classfile = 'fournisseur.commande'; - $classname='CommandeFournisseur'; - $classpath = 'fourn/class'; - $module='fournisseur'; - } - - if (! empty($conf->$module->enabled)) - { - $res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); - if ($res) - { - $object = new $classname($this->db); - $ret=$object->fetch($objectid); - if ($ret > 0) return $object->getNomUrl($withpicto,$option); - } - } - } - /* This is to show linked object block */ /** @@ -2630,6 +2629,7 @@ abstract class CommonObject } + /* This is to show add lines */ /** @@ -2647,6 +2647,11 @@ abstract class CommonObject { global $conf,$langs,$object,$hookmanager; global $form,$bcnd,$var; + global $user; + //Line extrafield + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafieldsline = new ExtraFields($this->db); + $extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line); // Use global variables + $dateSelector + $seller and $buyer include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_create.tpl.php'); @@ -2667,6 +2672,12 @@ abstract class CommonObject { global $conf,$langs,$object,$hookmanager; global $form,$bcnd,$var; + global $user; + + //Line extrafield + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafieldsline = new ExtraFields($this->db); + $extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line); // Use global variables + $dateSelector + $seller and $buyer include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_create.tpl.php'); @@ -2688,6 +2699,11 @@ abstract class CommonObject global $conf,$user,$langs,$object,$hookmanager; global $form,$bcnd,$var; + //Line extrafield + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafieldsline = new ExtraFields($this->db); + $extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line); + // Output template part (modules that overwrite templates must declare this into descriptor) // Use global variables + $dateSelector + $seller and $buyer $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); @@ -2753,9 +2769,9 @@ abstract class CommonObject else print ''.$langs->trans('CostPrice').''; - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) + if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) print ''.$langs->trans('MarginRate').''; - if (! empty($conf->global->DISPLAY_MARK_RATES)) + if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) print ''.$langs->trans('MarkRate').''; } @@ -2774,8 +2790,16 @@ abstract class CommonObject $var = true; $i = 0; + //Line extrafield + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafieldsline = new ExtraFields($this->db); + $extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line); + foreach ($this->lines as $line) { + //Line extrafield + $line->fetch_optionals($line->id,$extralabelslines); + $var=!$var; if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) @@ -2788,7 +2812,7 @@ abstract class CommonObject } else { - $this->printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$hookmanager); + $this->printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$extrafieldsline); } $i++; @@ -2808,9 +2832,10 @@ abstract class CommonObject * @param string $seller Object of seller third party * @param string $buyer Object of buyer third party * @param string $selected Object line selected + * @param object $extrafieldsline Object of extrafield line attribute * @return void */ - function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0) + function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0) { global $conf,$langs,$user,$hookmanager; global $form,$bc,$bcdd; @@ -2839,16 +2864,21 @@ abstract class CommonObject $text=$product_static->getNomUrl(1); // Define output language (TODO Does this works ?) - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + if (! empty($conf->global->MAIN_MULTILANGS)) { - $this->fetch_thirdparty(); + if (! is_object($this->client)) + { + // TODO Remove this + $this->fetch_thirdparty(); // The fetch_thirdparty should be done before calling $object->printObjectLines, not into function called for each line + } + $prod = new Product($this->db); $prod->fetch($line->fk_product); $outputlangs = $langs; $newlang=''; if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if (empty($newlang)) $newlang=$this->client->default_lang; + if (! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && empty($newlang)) $newlang=$this->client->default_lang; // For language to language of customer if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -3074,9 +3104,10 @@ abstract class CommonObject /** + * get Margin info * - * @param string $force_price - * @return multitype:number string NULL + * @param string $force_price True of not + * @return mixed Array with info */ function getMarginInfos($force_price=false) { global $conf; @@ -3209,8 +3240,10 @@ abstract class CommonObject if (! empty($user->societe_id)) return; + if (! $user->rights->margins->liretous) return; + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); - + $marginInfo = $this->getMarginInfos($force_price); print ''; @@ -3262,16 +3295,23 @@ abstract class CommonObject print '
    '; } + /** + * Overwrite magic function to solve problem of cloning object that are kept as references + * + * @return void + */ function __clone() { // Force a copy of this->lines, otherwise it will point to same object. if (isset($this->lines) && is_array($this->lines)) { - for($i=0; $i < count($this->lines); $i++) + $nboflines=count($this->lines); + for($i=0; $i < $nboflines; $i++) { $this->lines[$i] = dol_clone($this->lines[$i]); } } } + } ?> diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 54ce4230e55..302894009e5 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -32,4 +32,13 @@ abstract class CommonOrder extends CommonObject } +/** + * \class CommonOrderLine + * \brief Superclass for orders classes + */ +abstract class CommonOrderLine extends CommonObject +{ + +} + ?> diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 4ce1bbf8c3d..378d831861f 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -156,15 +156,19 @@ class Conf if ($value && preg_match('/^MAIN_MODULE_/',$key)) { - // If this is constant for a new tab page activated by a module. + // If this is constant for a new tab page activated by a module. It initializes modules_parts['tabs']. if (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i',$key)) { $partname = 'tabs'; $params=explode(':',$value,2); if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); } - $this->modules_parts[$partname][$params[0]][]=$value; + $this->modules_parts[$partname][$params[0]][]=$value; // $value may be a string or an array } - // If this is constant for all generic part activated by a module + // If this is constant for all generic part activated by a module. It initializes + // modules_parts['login'], modules_parts['menus'], modules_parts['substitutions'], modules_parts['triggers'], modules_parts['tpl'], + // modules_parts['models'], modules_parts['theme'] + // modules_parts['sms'], + // modules_parts['css'], ... elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i',$key,$reg)) { $modulename = strtolower($reg[1]); @@ -176,7 +180,7 @@ class Conf else if (in_array($partname,array('models','theme'))) $value = '/'.$modulename.'/'; else if (in_array($partname,array('sms'))) $value = $modulename; else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe - $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); + $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); // $value may be a string or an array } // If this is a module constant (must be at end) elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i',$key,$reg)) @@ -197,6 +201,20 @@ class Conf //var_dump($this->modules); //var_dump($this->modules_parts['theme']); + // If you can't set timezone of your PHP, set this constant. Better is to set it to UTC. + // In future, this constant will be forced to 'UTC' so PHP server timezone will not have effect anymore. + //$this->global->MAIN_SERVER_TZ='Europe/Paris'; + if (! empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ != 'auto') + { + try { + date_default_timezone_set($this->global->MAIN_SERVER_TZ); + } + catch(Exception $e) + { + dol_syslog("Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR); + } + } + // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { @@ -396,11 +414,14 @@ class Conf if (! isset($this->global->MAIN_MAX_DECIMALS_TOT)) $this->global->MAIN_MAX_DECIMALS_TOT=2; if (! isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) $this->global->MAIN_MAX_DECIMALS_SHOWN=8; + // Default pdf use dash between lines + if (! isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES=1; + // Default max file size for upload $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024); // Define list of limited modules - if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later. + if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later. // Timeouts if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10; diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index a45aaeb2423..39d27d9a332 100644 --- a/htdocs/core/class/cookie.class.php +++ b/htdocs/core/class/cookie.class.php @@ -91,7 +91,9 @@ class DolCookie $num = (count($this->cookiearray) - 2); for ($f = 0; $f <= $num; $f++) { - $this->myValue .= strval(chr($this->cookiearray[$f]/$this->myKey)); + if (!empty($this->myKey)) { + $this->myValue .= strval(chr($this->cookiearray[$f]/$this->myKey)); + } } return(base64_decode($this->myValue)); diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 468530303b8..ede7615a65a 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -154,7 +154,7 @@ class DiscountAbsolute $sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,"; $sql.= " fk_facture_source"; $sql.= ")"; - $sql.= " VALUES (".$this->db->idate($this->datec!=''?$this->datec:dol_now()).", ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; + $sql.= " VALUES ('".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; $sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.","; $sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null"); $sql.= ")"; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index d02f26e57a4..23fb8193fb9 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -60,7 +60,7 @@ class DolEditor * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. * @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor) * @param int $rows Size of rows for textarea tool - * @param int $cols Size of cols for textarea tool + * @param int $cols Size of cols for textarea tool (textarea number of cols or %) * @param int $readonly 0=Read/Edit, 1=Read only */ function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0) @@ -129,7 +129,7 @@ class DolEditor $this->toolbarname = $shorttoolbarname; $this->toolbarstartexpanded = $toolbarstartexpanded; $this->rows = max(ROWS_3,$rows); - $this->cols = max(40,$cols); + $this->cols = (preg_match('/%/',$cols)?$cols:max(40,$cols)); // If $cols is a percent, we keep it, otherwise, we take max $this->height = $height; $this->width = $width; } diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index f8ccd749bb3..14364ea7902 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -65,18 +65,18 @@ class DolGeoIP print $this->errorlabel; return 0; } - if (! file_exists($datfile)) + if (! file_exists($datfile) || ! is_readable($datfile)) { //dol_syslog("DolGeoIP::DolGeoIP datafile ".$datfile." can not be read", LOG_ERR); $this->error='ErrorGeoIPClassNotInitialized'; $this->errorlabel="Datafile ".$datfile." not found"; - print $this->errorlabel; + print $this->errorlabel; // To be sure to understand when it fails on screens return 0; } if (function_exists('geoip_open')) { - $this->gi = geoip_open($datfile,GEOIP_STANDARD); + $this->gi = geoip_open($datfile,GEOIP_STANDARD); } else { @@ -133,7 +133,7 @@ class DolGeoIP function getVersion() { if ($this->gi == 'NOGI') return geoip_database_info(); - return ''; + return 'Not available (not using PHP internal geo functions)'; } /** diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 529b420f961..f1e66695831 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1,914 +1,1051 @@ - * Copyright (c) 2004-2012 Laurent Destailleur -* -* 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 . -*/ + * Copyright (c) 2004-2013 Laurent Destailleur + * + * 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 . + */ /** * \file htdocs/core/class/dolgraph.class.php * \ingroup core * \brief File for class to generate graph - * - * Usage: - * $graph_data = array(array('labelxA',yA),array('labelxB',yB)); - * $graph_data = array(array('labelxA',yA1,...,yAn),array('labelxB',yB1,...yBn)); // when there is n value to show for each x - * $legend = array("Val1",...,"Valn"); // list of n series name - * $px = new DolGraph(); - * $px->SetData($graph_data); - * $px->SetMaxValue($px->GetCeilMaxValue()); - * $px->SetMinValue($px->GetFloorMinValue()); - * $px->SetTitle("title"); - * $px->SetLegend($legend); - * $px->SetWidth(width); - * $px->SetHeight(height); - * $px->draw("file.png","/viewdownload?..."); */ /** - * Parent class of graph classes + * Parent class of graph classes */ class DolGraph { - //! Type of graph - var $type=array('bars'); // bars, lines, ... - var $mode='side'; // Mode bars graph: side, depth - private $_library='jflot'; // Graphic library to use (jflot, artichow) - - //! Array of data - var $data; // array(array('abs1',valA1,valB1), array('abs2',valA2,valB2), ...) - var $title; - var $width=380; - var $height=200; - var $MaxValue=0; - var $MinValue=0; - var $SetShading=0; - - var $PrecisionY=-1; - - var $horizTickIncrement=-1; - var $SetNumXTicks=-1; - var $labelInterval=-1; - - var $hideXGrid=false; - var $hideYGrid=false; - - var $Legend=array(); - var $LegendWidthMin=0; - - var $graph; // Objet Graph (Artichow, Phplot...) - var $error; - - var $bordercolor; // array(R,G,B) - var $bgcolor; // array(R,G,B) - var $bgcolorgrid=array(255,255,255); // array(R,G,B) - var $datacolor; // array(array(R,G,B),...) - - private $_stringtoshow; // To store string to output graph into HTML page - - - /** - * Constructor - */ - function __construct() - { - global $conf; - global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; - - // To use old feature - if (isset($conf->global->MAIN_GRAPH_LIBRARY) && $conf->global->MAIN_GRAPH_LIBRARY == 'artichow') - { - $this->_library='artichow'; - - // Test if module GD present - $modules_list = get_loaded_extensions(); - $isgdinstalled=0; - foreach ($modules_list as $module) - { - if ($module == 'gd') $isgdinstalled=1; - } - if (! $isgdinstalled) - { - $this->error="Error: PHP GD module is not available. It is required to build graphics."; - return -1; - } - } - - $this->bordercolor = array(235,235,224); - $this->datacolor = array(array(120,130,150), array(160,160,180), array(190,190,220)); - $this->bgcolor = array(235,235,224); - - $color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/graph-color.php'; - if (is_readable($color_file)) - { - include_once $color_file; - if (isset($theme_bordercolor)) $this->bordercolor = $theme_bordercolor; - if (isset($theme_datacolor)) $this->datacolor = $theme_datacolor; - if (isset($theme_bgcolor)) $this->bgcolor = $theme_bgcolor; - } - //print 'bgcolor: '.join(',',$this->bgcolor).'
    '; - return 1; - } - - - /** - * Set Y precision - * - * @param float $which_prec Precision - * @return string - */ - function SetPrecisionY($which_prec) - { - $this->PrecisionY = $which_prec; - return true; - } - - /** - * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 - * - * @param float $xi Xi - * @return boolean True - */ - function SetHorizTickIncrement($xi) - { - $this->horizTickIncrement = $xi; - return true; - } - - /** - * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 - * - * @param float $xt Xt - * @return boolean True - */ - function SetNumXTicks($xt) - { - $this->SetNumXTicks = $xt; - return true; - } - - /** - * Set label interval to reduce number of labels - * - * @param float $x Label interval - * @return boolean True - */ - function SetLabelInterval($x) - { - $this->labelInterval = $x; - return true; - } - - /** - * Hide X grid - * - * @param boolean $bool XGrid or not - * @return boolean true - */ - function SetHideXGrid($bool) - { - $this->hideXGrid = $bool; - return true; - } - - /** - * Hide Y grid - * - * @param boolean $bool YGrid or not - * @return boolean true - */ - function SetHideYGrid($bool) - { - $this->hideYGrid = $bool; - return true; - } - - /** - * Set y label - * - * @param string $label Y label - * @return boolean True - */ - function SetYLabel($label) - { - $this->YLabel = $label; - } - - /** - * Set width - * - * @param int $w Width - * @return boolean True - */ - function SetWidth($w) - { - $this->width = $w; - } - - /** - * Set title - * - * @param string $title Title - * @return void - */ - function SetTitle($title) - { - $this->title = $title; - } - - /** - * Set data - * - * @param array $data Data - * @return void - */ - function SetData($data) - { - $this->data = $data; - //var_dump($this->data); - } - - /** - * Set type - * - * @param array $type Array with type for each serie - * @return void - */ - function SetType($type) - { - $this->type = $type; - } - - /** - * Set legend - * - * @param string $legend Legend - * @return void - */ - function SetLegend($legend) - { - $this->Legend = $legend; - } - - /** - * Set min width - * - * @param int $legendwidthmin Min width - * @return void - */ - function SetLegendWidthMin($legendwidthmin) - { - $this->LegendWidthMin = $legendwidthmin; - } - - /** - * Set max value - * - * @param int $max Max value - * @return void - */ - function SetMaxValue($max) - { - $this->MaxValue = $max; - } - - /** - * Get max value - * - * @return int Max value - */ - function GetMaxValue() - { - return $this->MaxValue; - } - - /** - * Set min value - * - * @param int $min Min value - * @return void - */ - function SetMinValue($min) - { - $this->MinValue = $min; - } - - /** - * Get min value - * - * @return int Max value - */ - function GetMinValue() - { - return $this->MinValue; - } - - /** - * Set height - * - * @param int $h Height - * @return void - */ - function SetHeight($h) - { - $this->height = $h; - } - - /** - * Set shading - * - * @param string $s Shading - * @return void - */ - function SetShading($s) - { - $this->SetShading = $s; - } - - /** - * Reset bg color - * - * @return void - */ - function ResetBgColor() - { - unset($this->bgcolor); - } - - /** - * Reset bgcolorgrid - * - * @return void - */ - function ResetBgColorGrid() - { - unset($this->bgcolorgrid); - } - - /** - * Is graph ko - * - * @return string Error - */ - function isGraphKo() - { - return $this->error; - } - - - /** - * Define background color of complete image - * - * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' - * @return void - */ - function SetBgColor($bg_color = array(255,255,255)) - { - global $theme_bgcolor,$theme_bgcoloronglet; - if (! is_array($bg_color)) - { - if ($bg_color == 'onglet') - { - //print 'ee'.join(',',$theme_bgcoloronglet); - $this->bgcolor = $theme_bgcoloronglet; - } - else - { - $this->bgcolor = $theme_bgcolor; - } - } - else - { - $this->bgcolor = $bg_color; - } - } - - /** - * Define background color of grid - * - * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' - * @return void - */ - function SetBgColorGrid($bg_colorgrid = array(255,255,255)) - { - global $theme_bgcolor,$theme_bgcoloronglet; - if (! is_array($bg_colorgrid)) - { - if ($bg_colorgrid == 'onglet') - { - //print 'ee'.join(',',$theme_bgcoloronglet); - $this->bgcolorgrid = $theme_bgcoloronglet; - } - else - { - $this->bgcolorgrid = $theme_bgcolor; - } - } - else - { - $this->bgcolorgrid = $bg_colorgrid; - } - } - - /** - * Reset data color - * - * @return void - */ - function ResetDataColor() - { - unset($this->datacolor); - } - - /** - * Get max value - * - * @return int Max value - */ - function GetMaxValueInData() - { - $k = 0; - $vals = array(); - - $nblines = count($this->data); - $nbvalues = count($this->data[0]) - 1; - - for ($j = 0 ; $j < $nblines ; $j++) - { - for ($i = 0 ; $i < $nbvalues ; $i++) - { - $vals[$k] = $this->data[$j][$i+1]; - $k++; - } - } - rsort($vals); - return $vals[0]; - } - - /** - * Return min value of all data - * - * @return int Min value of all data - */ - function GetMinValueInData() - { - $k = 0; - $vals = array(); - - $nblines = count($this->data); - $nbvalues = count($this->data[0]) - 1; - - for ($j = 0 ; $j < $nblines ; $j++) - { - for ($i = 0 ; $i < $nbvalues ; $i++) - { - $vals[$k] = $this->data[$j][$i+1]; - $k++; - } - } - sort($vals); - return $vals[0]; - } - - /** - * Return max value of all data - * - * @return int Max value of all data - */ - function GetCeilMaxValue() - { - $max = $this->GetMaxValueInData(); - if ($max != 0) $max++; - $size=dol_strlen(abs(ceil($max))); - $factor=1; - for ($i=0; $i < ($size-1); $i++) - { - $factor*=10; - } - - $res=0; - if (is_numeric($max)) $res=ceil($max/$factor)*$factor; - - //print "max=".$max." res=".$res; - return $res; - } - - /** - * Return min value of all data - * - * @return int Max value of all data - */ - function GetFloorMinValue() - { - $min = $this->GetMinValueInData(); - if ($min != 0) $min--; - $size=dol_strlen(abs(floor($min))); - $factor=1; - for ($i=0; $i < ($size-1); $i++) - { - $factor*=10; - } - - $res=floor($min/$factor)*$factor; - - //print "min=".$min." res=".$res; - return $res; - } - - /** - * Build a graph onto disk using correct library - * - * @param string $file Image file name to use if we save onto disk - * @param string $fileurl Url path to show image if saved onto disk - * @return void - */ - function draw($file,$fileurl='') - { - if (! is_array($this->data) || count($this->data) < 1) - { - $this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters"; - dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR); - return -1; - } - $call = "draw_".$this->_library; - call_user_func_array(array($this,$call), array($file,$fileurl)); - } - - - /** - * Build a graph onto disk using Artichow library - * - * @param string $file Image file name to use if we save onto disk - * @param string $fileurl Url path to show image if saved onto disk - * @return void - */ - private function draw_artichow($file,$fileurl) - { - global $artichow_defaultfont; - - dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type)); - - if (! defined('SHADOW_RIGHT_TOP')) define('SHADOW_RIGHT_TOP',3); - if (! defined('LEGEND_BACKGROUND')) define('LEGEND_BACKGROUND',2); - if (! defined('LEGEND_LINE')) define('LEGEND_LINE',1); - - // Create graph - $classname=''; - if ($this->type[0] == 'bars') $classname='BarPlot'; // Only first type of type is supported by artichow - if ($this->type[0] == 'lines') $classname='LinePlot'; - include_once ARTICHOW_PATH.$classname.'.class.php'; - - // Definition de couleurs - $bgcolor=new Color($this->bgcolor[0],$this->bgcolor[1],$this->bgcolor[2]); - $bgcolorgrid=new Color($this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]); - $colortrans=new Color(0,0,0,100); - $colorsemitrans=new Color(255,255,255,60); - $colorgradient= new LinearGradient(new Color(235, 235, 235),new Color(255, 255, 255),0); - $colorwhite=new Color(255,255,255); - - // Graph - $graph = new Graph($this->width, $this->height); - $graph->border->hide(); - $graph->setAntiAliasing(true); - if (isset($this->title)) - { - $graph->title->set($this->title); - //print $artichow_defaultfont;exit; - $graph->title->setFont(new $artichow_defaultfont(10)); - } - - if (is_array($this->bgcolor)) $graph->setBackgroundColor($bgcolor); - else $graph->setBackgroundGradient($colorgradient); - - $group = new PlotGroup; - //$group->setSpace(5, 5, 0, 0); - - $paddleft=50; - $paddright=10; - $strl=dol_strlen(max(abs($this->MaxValue),abs($this->MinValue))); - if ($strl > 6) $paddleft += ($strl * 4); - $group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values - $group->legend->setSpace(0); - $group->legend->setPadding(2,2,2,2); - $group->legend->setPosition(NULL,0.1); - $group->legend->setBackgroundColor($colorsemitrans); - - if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid); - else $group->grid->setBackgroundColor($colortrans); - - if ($this->hideXGrid) $group->grid->hideVertical(true); - if ($this->hideYGrid) $group->grid->hideHorizontal(true); - - // On boucle sur chaque lot de donnees - $legends=array(); - $i=0; - $nblot=count($this->data[0])-1; - - while ($i < $nblot) - { - $x=0; - $values=array(); - foreach($this->data as $key => $valarray) - { - $legends[$x] = $valarray[0]; - $values[$x] = $valarray[$i+1]; - $x++; - } - - // We fix unknown values to null - $newvalues=array(); - foreach($values as $val) - { - $newvalues[]=(is_numeric($val) ? $val : null); - } - - - if ($this->type[0] == 'bars') - { - //print "Lot de donnees $i
    "; - //print_r($values); - //print '
    '; - - $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20); - $colorbis=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),50); - - $colorgrey=new Color(100,100,100); - $colorborder=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]); - - if ($this->mode == 'side') $plot = new BarPlot($newvalues, $i+1, $nblot); - if ($this->mode == 'depth') $plot = new BarPlot($newvalues, 1, 1, ($nblot-$i-1)*5); - - $plot->barBorder->setColor($colorgrey); - //$plot->setBarColor($color); - $plot->setBarGradient(new LinearGradient($colorbis, $color, 90)); - - if ($this->mode == 'side') $plot->setBarPadding(0.1, 0.1); - if ($this->mode == 'depth') $plot->setBarPadding(0.1, 0.4); - if ($this->mode == 'side') $plot->setBarSpace(5); - if ($this->mode == 'depth') $plot->setBarSpace(2); - - $plot->barShadow->setSize($this->SetShading); - $plot->barShadow->setPosition(SHADOW_RIGHT_TOP); - $plot->barShadow->setColor(new Color(160, 160, 160, 50)); - $plot->barShadow->smooth(TRUE); - //$plot->setSize(1, 0.96); - //$plot->setCenter(0.5, 0.52); - - // Le mode automatique est plus efficace - $plot->SetYMax($this->MaxValue); - $plot->SetYMin($this->MinValue); - } - - if ($this->type[0] == 'lines') - { - $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20); - $colorbis=new Color(min($this->datacolor[$i][0]+20,255),min($this->datacolor[$i][1]+20,255),min($this->datacolor[$i][2]+20,255),60); - $colorter=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),90); - - $plot = new LinePlot($newvalues); - //$plot->setSize(1, 0.96); - //$plot->setCenter(0.5, 0.52); - - $plot->setColor($color); - $plot->setThickness(1); - - // Set line background gradient - $plot->setFillGradient(new LinearGradient($colorter, $colorbis, 90)); - - $plot->xAxis->setLabelText($legends); - - // Le mode automatique est plus efficace - $plot->SetYMax($this->MaxValue); - $plot->SetYMin($this->MinValue); - //$plot->setYAxis(0); - //$plot->hideLine(true); - } - - //$plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures - - $group->legend->setTextFont(new $artichow_defaultfont(10)); // This is to force Artichow to use awFileFontDriver to - // solve a bug in Artichow with UTF8 - if (count($this->Legend)) - { - if ($this->type[0] == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND); - if ($this->type[0] == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE); - } - $group->add($plot); - - $i++; - } - - $group->axis->bottom->setLabelText($legends); - $group->axis->bottom->label->setFont(new $artichow_defaultfont(7)); - - //print $group->axis->bottom->getLabelNumber(); - if ($this->labelInterval > 0) $group->axis->bottom->setLabelInterval($this->labelInterval); - - $graph->add($group); - - // Generate file - $graph->draw($file); - - $this->_stringtoshow=''.dol_escape_htmltag($this->title?$this->title:$this->YLabel).''; - } - - - /** - * Build a graph onto disk using JFlot library - * $graph_data = array(array('labelxA',yA),array('labelxB',yB)); - * $graph_data = array(array('labelxA',yA1,...,yAn),array('labelxB',yB1,...yBn)); // when there is n value to show for each x - * $legend = array("Val1",...,"Valn"); // list of n series name - * - * @param string $file Image file name to use if we save onto disk - * @param string $fileurl Url path to show image if saved onto disk - * @return void - */ - private function draw_jflot($file,$fileurl) - { - global $artichow_defaultfont; - - dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)); - - // On boucle sur chaque lot de donnees - $legends=array(); - $nblot=count($this->data[0])-1; // -1 to remove legend - $firstlot=0; - if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x - - $i=$firstlot; - $serie=array(); - while ($i < $nblot) - { - $x=0; - $values=array(); - foreach($this->data as $key => $valarray) - { - $legends[$x] = $valarray[0]; - $values[$x] = $valarray[$i+1]; - $x++; - } - - // We fix unknown values to null - $newvalues=array(); - foreach($values as $val) - { - $newvalues[]=(is_numeric($val) ? $val : null); - } - - //print "Lot de donnees $i
    "; - //print_r($values); - //print '
    '; - $serie[$i]="var d".$i." = [];\n"; - $x=0; - foreach($newvalues as $key => $val) - { - if (isset($val)) $serie[$i].="d".$i.".push([".$x.", ".$val."]);\n"; - $x++; - } - - $i++; - } - - $tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file),'_',array('-','.')))); - - $this->_stringtoshow =''."\n"; - $this->_stringtoshow.='
    '.$this->title.'

    '; - $this->_stringtoshow.='
    '."\n"; - $this->_stringtoshow.=''."\n"; - } - - - - /** - * Output HTML string to show graph - * - * @return string HTML string to show graph - */ - function show() - { - return $this->_stringtoshow; - } - - /** - * getDefaultGraphSizeForStats - * - * @param string $direction 'width' or 'height' - * @param string $defaultsize Value we want as default size - * @return int Value of width or height to use by default - */ - static function getDefaultGraphSizeForStats($direction,$defaultsize='') - { - global $conf; - - if ($direction == 'width') return ($conf->dol_optimize_smallscreen?(empty($_SESSION['dol_screen_width'])?'280':$_SESSION['dol_screen_width']-40):($defaultsize?$defaultsize:'500')); - if ($direction == 'height') return ($conf->dol_optimize_smallscreen?'160':($defaultsize?$defaultsize:'200')); - return 0; - } + var $type=array(); // Array with type of each series. Example: array('bars', 'lines', ...) + var $mode='side'; // Mode bars graph: side, depth + private $_library='jflot'; // Graphic library to use (jflot, artichow) + + //! Array of data + var $data; // Data of graph: array(array('abs1',valA1,valB1), array('abs2',valA2,valB2), ...) + var $title; // Title of graph + var $cssprefix=''; // To add into css styles + var $width=380; + var $height=200; + var $MaxValue=0; + var $MinValue=0; + var $SetShading=0; + + var $PrecisionY=-1; + + var $horizTickIncrement=-1; + var $SetNumXTicks=-1; + var $labelInterval=-1; + + var $hideXGrid=false; + var $hideYGrid=false; + + var $Legend=array(); + var $LegendWidthMin=0; + var $showlegend=1; + var $showpointvalue=1; + var $showpercent=0; + + var $graph; // Objet Graph (Artichow, Phplot...) + var $error; + + var $bordercolor; // array(R,G,B) + var $bgcolor; // array(R,G,B) + var $bgcolorgrid=array(255,255,255); // array(R,G,B) + var $datacolor; // array(array(R,G,B),...) + + private $_stringtoshow; // To store string to output graph into HTML page + + + /** + * Constructor + */ + function __construct() + { + global $conf; + global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; + + // To use old feature + if (isset($conf->global->MAIN_GRAPH_LIBRARY) && $conf->global->MAIN_GRAPH_LIBRARY == 'artichow') + { + $this->_library='artichow'; + + // Test if module GD present + $modules_list = get_loaded_extensions(); + $isgdinstalled=0; + foreach ($modules_list as $module) + { + if ($module == 'gd') $isgdinstalled=1; + } + if (! $isgdinstalled) + { + $this->error="Error: PHP GD module is not available. It is required to build graphics."; + return -1; + } + } + + $this->bordercolor = array(235,235,224); + $this->datacolor = array(array(120,130,150), array(160,160,180), array(190,190,220)); + $this->bgcolor = array(235,235,224); + + $color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/graph-color.php'; + if (is_readable($color_file)) + { + include_once $color_file; + if (isset($theme_bordercolor)) $this->bordercolor = $theme_bordercolor; + if (isset($theme_datacolor)) $this->datacolor = $theme_datacolor; + if (isset($theme_bgcolor)) $this->bgcolor = $theme_bgcolor; + } + //print 'bgcolor: '.join(',',$this->bgcolor).'
    '; + } + + + /** + * Set Y precision + * + * @param float $which_prec Precision + * @return string + */ + function SetPrecisionY($which_prec) + { + $this->PrecisionY = $which_prec; + return true; + } + + /** + * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 + * + * @param float $xi Xi + * @return boolean True + */ + function SetHorizTickIncrement($xi) + { + $this->horizTickIncrement = $xi; + return true; + } + + /** + * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 + * + * @param float $xt Xt + * @return boolean True + */ + function SetNumXTicks($xt) + { + $this->SetNumXTicks = $xt; + return true; + } + + /** + * Set label interval to reduce number of labels + * + * @param float $x Label interval + * @return boolean True + */ + function SetLabelInterval($x) + { + $this->labelInterval = $x; + return true; + } + + /** + * Hide X grid + * + * @param boolean $bool XGrid or not + * @return boolean true + */ + function SetHideXGrid($bool) + { + $this->hideXGrid = $bool; + return true; + } + + /** + * Hide Y grid + * + * @param boolean $bool YGrid or not + * @return boolean true + */ + function SetHideYGrid($bool) + { + $this->hideYGrid = $bool; + return true; + } + + /** + * Set y label + * + * @param string $label Y label + * @return boolean True + */ + function SetYLabel($label) + { + $this->YLabel = $label; + } + + /** + * Set width + * + * @param int $w Width + * @return boolean True + */ + function SetWidth($w) + { + $this->width = $w; + } + + /** + * Set title + * + * @param string $title Title + * @return void + */ + function SetTitle($title) + { + $this->title = $title; + } + + /** + * Set data + * + * @param array $data Data + * @return void + * @see draw_jflot for syntax of data array + */ + function SetData($data) + { + $this->data = $data; + } + + /** + * Set data + * + * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) + * @return void + */ + function SetDataColor($datacolor) + { + $this->datacolor = $datacolor; + } + + /** + * Set type + * + * @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars') + * @return void + */ + function SetType($type) + { + $this->type = $type; + } + + /** + * Set legend + * + * @param string $legend Legend + * @return void + */ + function SetLegend($legend) + { + $this->Legend = $legend; + } + + /** + * Set min width + * + * @param int $legendwidthmin Min width + * @return void + */ + function SetLegendWidthMin($legendwidthmin) + { + $this->LegendWidthMin = $legendwidthmin; + } + + /** + * Set max value + * + * @param int $max Max value + * @return void + */ + function SetMaxValue($max) + { + $this->MaxValue = $max; + } + + /** + * Get max value + * + * @return int Max value + */ + function GetMaxValue() + { + return $this->MaxValue; + } + + /** + * Set min value + * + * @param int $min Min value + * @return void + */ + function SetMinValue($min) + { + $this->MinValue = $min; + } + + /** + * Get min value + * + * @return int Max value + */ + function GetMinValue() + { + return $this->MinValue; + } + + /** + * Set height + * + * @param int $h Height + * @return void + */ + function SetHeight($h) + { + $this->height = $h; + } + + /** + * Set shading + * + * @param string $s Shading + * @return void + */ + function SetShading($s) + { + $this->SetShading = $s; + } + + /** + * Set shading + * + * @param string $s Shading + * @return void + */ + function SetCssPrefix($s) + { + $this->cssprefix = $s; + } + + /** + * Reset bg color + * + * @return void + */ + function ResetBgColor() + { + unset($this->bgcolor); + } + + /** + * Reset bgcolorgrid + * + * @return void + */ + function ResetBgColorGrid() + { + unset($this->bgcolorgrid); + } + + /** + * Is graph ko + * + * @return string Error + */ + function isGraphKo() + { + return $this->error; + } + + /** + * Show legend or not + * + * @param int $showlegend 1=Show legend (default), 0=Hide legend + * @return void + */ + function setShowLegend($showlegend) + { + $this->showlegend=$showlegend; + } + + /** + * Show pointvalue or not + * + * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value + * @return void + */ + function setShowPointValue($showpointvalue) + { + $this->showpointvalue=$showpointvalue; + } + + /** + * Show percent or not + * + * @param int $showpercent 1=Show percent for each point, as tooltip or inline, 0=Hide percent (default) + * @return void + */ + function setShowPercent($showpercent) + { + $this->showpercent=$showpercent; + } + + + + /** + * Define background color of complete image + * + * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' + * @return void + */ + function SetBgColor($bg_color = array(255,255,255)) + { + global $theme_bgcolor,$theme_bgcoloronglet; + + if (! is_array($bg_color)) + { + if ($bg_color == 'onglet') + { + //print 'ee'.join(',',$theme_bgcoloronglet); + $this->bgcolor = $theme_bgcoloronglet; + } + else + { + $this->bgcolor = $theme_bgcolor; + } + } + else + { + $this->bgcolor = $bg_color; + } + } + + /** + * Define background color of grid + * + * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' + * @return void + */ + function SetBgColorGrid($bg_colorgrid = array(255,255,255)) + { + global $theme_bgcolor,$theme_bgcoloronglet; + + if (! is_array($bg_colorgrid)) + { + if ($bg_colorgrid == 'onglet') + { + //print 'ee'.join(',',$theme_bgcoloronglet); + $this->bgcolorgrid = $theme_bgcoloronglet; + } + else + { + $this->bgcolorgrid = $theme_bgcolor; + } + } + else + { + $this->bgcolorgrid = $bg_colorgrid; + } + } + + /** + * Reset data color + * + * @return void + */ + function ResetDataColor() + { + unset($this->datacolor); + } + + /** + * Get max value + * + * @return int Max value + */ + function GetMaxValueInData() + { + $k = 0; + $vals = array(); + + $nblines = count($this->data); + $nbvalues = count($this->data[0]) - 1; + + for ($j = 0 ; $j < $nblines ; $j++) + { + for ($i = 0 ; $i < $nbvalues ; $i++) + { + $vals[$k] = $this->data[$j][$i+1]; + $k++; + } + } + rsort($vals); + return $vals[0]; + } + + /** + * Return min value of all data + * + * @return int Min value of all data + */ + function GetMinValueInData() + { + $k = 0; + $vals = array(); + + $nblines = count($this->data); + $nbvalues = count($this->data[0]) - 1; + + for ($j = 0 ; $j < $nblines ; $j++) + { + for ($i = 0 ; $i < $nbvalues ; $i++) + { + $vals[$k] = $this->data[$j][$i+1]; + $k++; + } + } + sort($vals); + return $vals[0]; + } + + /** + * Return max value of all data + * + * @return int Max value of all data + */ + function GetCeilMaxValue() + { + $max = $this->GetMaxValueInData(); + if ($max != 0) $max++; + $size=dol_strlen(abs(ceil($max))); + $factor=1; + for ($i=0; $i < ($size-1); $i++) + { + $factor*=10; + } + + $res=0; + if (is_numeric($max)) $res=ceil($max/$factor)*$factor; + + //print "max=".$max." res=".$res; + return $res; + } + + /** + * Return min value of all data + * + * @return int Max value of all data + */ + function GetFloorMinValue() + { + $min = $this->GetMinValueInData(); + if ($min != 0) $min--; + $size=dol_strlen(abs(floor($min))); + $factor=1; + for ($i=0; $i < ($size-1); $i++) + { + $factor*=10; + } + + $res=floor($min/$factor)*$factor; + + //print "min=".$min." res=".$res; + return $res; + } + + /** + * Build a graph onto disk using correct library + * + * @param string $file Image file name to use to save onto disk (also used as javascript unique id) + * @param string $fileurl Url path to show image if saved onto disk + * @return void + */ + function draw($file,$fileurl='') + { + if (empty($file)) + { + $this->error="Call to draw method was made with empty value for parameter file."; + dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR); + return -2; + } + if (! is_array($this->data) || count($this->data) < 1) + { + $this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters"; + dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR); + return -1; + } + $call = "draw_".$this->_library; + call_user_func_array(array($this,$call), array($file,$fileurl)); + } + + + /** + * Build a graph onto disk using Artichow library + * + * @param string $file Image file name to use if we save onto disk + * @param string $fileurl Url path to show image if saved onto disk + * @return void + */ + private function draw_artichow($file,$fileurl) + { + global $artichow_defaultfont; + + dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type)); + + if (! defined('SHADOW_RIGHT_TOP')) define('SHADOW_RIGHT_TOP',3); + if (! defined('LEGEND_BACKGROUND')) define('LEGEND_BACKGROUND',2); + if (! defined('LEGEND_LINE')) define('LEGEND_LINE',1); + + // Create graph + $classname=''; + if (! isset($this->type[0]) || $this->type[0] == 'bars') $classname='BarPlot'; // Only one type (first one) is supported by artichow + else if ($this->type[0] == 'lines') $classname='LinePlot'; + else $classname='TypeUnknown'; + include_once ARTICHOW_PATH.$classname.'.class.php'; + + // Definition de couleurs + $bgcolor=new Color($this->bgcolor[0],$this->bgcolor[1],$this->bgcolor[2]); + $bgcolorgrid=new Color($this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]); + $colortrans=new Color(0,0,0,100); + $colorsemitrans=new Color(255,255,255,60); + $colorgradient= new LinearGradient(new Color(235, 235, 235),new Color(255, 255, 255),0); + $colorwhite=new Color(255,255,255); + + // Graph + $graph = new Graph($this->width, $this->height); + $graph->border->hide(); + $graph->setAntiAliasing(true); + if (isset($this->title)) + { + $graph->title->set($this->title); + //print $artichow_defaultfont;exit; + $graph->title->setFont(new $artichow_defaultfont(10)); + } + + if (is_array($this->bgcolor)) $graph->setBackgroundColor($bgcolor); + else $graph->setBackgroundGradient($colorgradient); + + $group = new PlotGroup; + //$group->setSpace(5, 5, 0, 0); + + $paddleft=50; + $paddright=10; + $strl=dol_strlen(max(abs($this->MaxValue),abs($this->MinValue))); + if ($strl > 6) $paddleft += ($strl * 4); + $group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values + $group->legend->setSpace(0); + $group->legend->setPadding(2,2,2,2); + $group->legend->setPosition(NULL,0.1); + $group->legend->setBackgroundColor($colorsemitrans); + + if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid); + else $group->grid->setBackgroundColor($colortrans); + + if ($this->hideXGrid) $group->grid->hideVertical(true); + if ($this->hideYGrid) $group->grid->hideHorizontal(true); + + // On boucle sur chaque lot de donnees + $legends=array(); + $i=0; + $nblot=count($this->data[0])-1; + + while ($i < $nblot) + { + $x=0; + $values=array(); + foreach($this->data as $key => $valarray) + { + $legends[$x] = $valarray[0]; + $values[$x] = $valarray[$i+1]; + $x++; + } + + // We fix unknown values to null + $newvalues=array(); + foreach($values as $val) + { + $newvalues[]=(is_numeric($val) ? $val : null); + } + + + if ($this->type[0] == 'bars') + { + //print "Lot de donnees $i
    "; + //print_r($values); + //print '
    '; + + $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20); + $colorbis=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),50); + + $colorgrey=new Color(100,100,100); + $colorborder=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]); + + if ($this->mode == 'side') $plot = new BarPlot($newvalues, $i+1, $nblot); + if ($this->mode == 'depth') $plot = new BarPlot($newvalues, 1, 1, ($nblot-$i-1)*5); + + $plot->barBorder->setColor($colorgrey); + //$plot->setBarColor($color); + $plot->setBarGradient(new LinearGradient($colorbis, $color, 90)); + + if ($this->mode == 'side') $plot->setBarPadding(0.1, 0.1); + if ($this->mode == 'depth') $plot->setBarPadding(0.1, 0.4); + if ($this->mode == 'side') $plot->setBarSpace(5); + if ($this->mode == 'depth') $plot->setBarSpace(2); + + $plot->barShadow->setSize($this->SetShading); + $plot->barShadow->setPosition(SHADOW_RIGHT_TOP); + $plot->barShadow->setColor(new Color(160, 160, 160, 50)); + $plot->barShadow->smooth(TRUE); + //$plot->setSize(1, 0.96); + //$plot->setCenter(0.5, 0.52); + + // Le mode automatique est plus efficace + $plot->SetYMax($this->MaxValue); + $plot->SetYMin($this->MinValue); + } + + if ($this->type[0] == 'lines') + { + $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20); + $colorbis=new Color(min($this->datacolor[$i][0]+20,255),min($this->datacolor[$i][1]+20,255),min($this->datacolor[$i][2]+20,255),60); + $colorter=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),90); + + $plot = new LinePlot($newvalues); + //$plot->setSize(1, 0.96); + //$plot->setCenter(0.5, 0.52); + + $plot->setColor($color); + $plot->setThickness(1); + + // Set line background gradient + $plot->setFillGradient(new LinearGradient($colorter, $colorbis, 90)); + + $plot->xAxis->setLabelText($legends); + + // Le mode automatique est plus efficace + $plot->SetYMax($this->MaxValue); + $plot->SetYMin($this->MinValue); + //$plot->setYAxis(0); + //$plot->hideLine(true); + } + + //$plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures + + $group->legend->setTextFont(new $artichow_defaultfont(10)); // This is to force Artichow to use awFileFontDriver to + // solve a bug in Artichow with UTF8 + if (count($this->Legend)) + { + if ($this->type[0] == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND); + if ($this->type[0] == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE); + } + $group->add($plot); + + $i++; + } + + $group->axis->bottom->setLabelText($legends); + $group->axis->bottom->label->setFont(new $artichow_defaultfont(7)); + + //print $group->axis->bottom->getLabelNumber(); + if ($this->labelInterval > 0) $group->axis->bottom->setLabelInterval($this->labelInterval); + + $graph->add($group); + + // Generate file + $graph->draw($file); + + $this->_stringtoshow=''.dol_escape_htmltag($this->title?$this->title:$this->YLabel).''; + } + + + /** + * Build a graph onto disk using JFlot library. Input when calling this method should be: + * $this->data = array(array( 0=>'labelxA', 1=>yA), array('labelxB',yB)); or + * $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // TODO Syntax not supported. Removed when dol_print_graph_removed + * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // when there is n series to show for each x + * $this->legend= array("Val1",...,"Valn"); // list of n series name + * $this->type = array('bars',...'lines'); or array('pie') + * $this->mode = 'depth' ??? + * $this->bgcolorgrid + * $this->datacolor + * + * @param string $file Image file name to use to save onto disk (also used as javascript unique id) + * @param string $fileurl Url path to show image if saved onto disk + * @return void + */ + private function draw_jflot($file,$fileurl) + { + global $artichow_defaultfont; + + dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)); + + if (empty($this->width) && empty($this->height)) + { + print 'Error width or height not set'; + return; + } + + $legends=array(); + $nblot=count($this->data[0])-1; // -1 to remove legend + if ($nblot < 0) dol_print_error('Bad value for property ->data. Must be set by mydolgraph->SetData before callinf mydolgrapgh->draw'); + $firstlot=0; + // Works with line but not with bars + //if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x + + $i=$firstlot; + $serie=array(); + while ($i < $nblot) // Loop on each serie + { + $values=array(); // Array with horizontal y values (specific values of a serie) for each abscisse x + $serie[$i]="var d".$i." = [];\n"; + + // Fill array $values + $x=0; + foreach($this->data as $valarray) // Loop on each x + { + $legends[$x] = $valarray[0]; + $values[$x] = (is_numeric($valarray[$i+1]) ? $valarray[$i+1] : null); + $x++; + } + + // TODO Avoid push by adding generated long array... + if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie') + { + foreach($values as $x => $y) { + if (isset($y)) $serie[$i].='d'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n"; + } + } + else + { + foreach($values as $x => $y) { + if (isset($y)) $serie[$i].='d'.$i.'.push(['.$x.', '.$y.']);'."\n"; + } + } + + unset($values); + $i++; + } + $tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file),'_',array('-','.')))); + + $this->_stringtoshow =''."\n"; + if (! empty($this->title)) $this->_stringtoshow.='
    '.$this->title.'
    '; + $this->_stringtoshow.='
    '."\n"; + $this->_stringtoshow.=''."\n"; + } + + + + /** + * Output HTML string to show graph + * + * @return string HTML string to show graph + */ + function show() + { + return $this->_stringtoshow; + } + + + /** + * getDefaultGraphSizeForStats + * + * @param string $direction 'width' or 'height' + * @param string $defaultsize Value we want as default size + * @return int Value of width or height to use by default + */ + static function getDefaultGraphSizeForStats($direction,$defaultsize='') + { + global $conf; + + if ($direction == 'width') + { + if (empty($conf->dol_optimize_smallscreen)) return ($defaultsize ? $defaultsize : '500'); + else return (empty($_SESSION['dol_screen_width']) ? '280' : ($_SESSION['dol_screen_width']-40)); + } + if ($direction == 'height') + { + return (empty($conf->dol_optimize_smallscreen)?($defaultsize?$defaultsize:'200'):'160'); + } + return 0; + } + } -?> +?> \ No newline at end of file diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php index e7a0d051cb3..926f5c42b42 100644 --- a/htdocs/core/class/dolprintipp.class.php +++ b/htdocs/core/class/dolprintipp.class.php @@ -28,7 +28,7 @@ class dolprintIPP { var $host; var $port; - var $userid; + var $userid; /* user login */ var $user; var $password; var $error; @@ -72,14 +72,14 @@ class dolprintIPP $ipp->setHost($this->host); $ipp->setPort($this->port); $ipp->setUserName($this->userid); - //$ipp->setAuthentication($this->user,$this->password); + if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password); $ipp->getPrinters(); return $ipp->available_printers; } /** * Print selected file - * + * * @param string $file file * @param string $module module * @@ -95,7 +95,7 @@ class dolprintIPP $ipp->setPort($this->port); $ipp->setJobName($file,true); $ipp->setUserName($this->userid); - //$ipp->setAuthentication($this->user,$this->password); + if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password); // select printer uri for module order, propal,... $sql = 'SELECT rowid,printer_uri,copy FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"'; $result = $this->db->query($sql); @@ -111,6 +111,7 @@ class dolprintIPP $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); } } + // Set number of copy $ipp->setCopies($obj->copy); $ipp->setData(DOL_DATA_ROOT.'/'.$module.'/'.$file); $ipp->printJob(); @@ -132,6 +133,7 @@ class dolprintIPP $ipp->setHost($this->host); $ipp->setPort($this->port); $ipp->setUserName($this->userid); + if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password); // select printer uri for module order, propal,... $sql = 'SELECT rowid,printer_uri,printer_name FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"'; $result = $this->db->query($sql); @@ -148,10 +150,55 @@ class dolprintIPP $ipp->setPrinterURI("ipp://localhost:631/printers/"); } } - echo 'Jobs for : '.$this->userid.' module : '.$module.' Printer : '.$obj->printer_name.'
    '; - echo "Getting Jobs: ".$ipp->getJobs(true,3,"completed",true)."
    "; + // Getting Jobs + $ipp->getJobs(false,0,'completed',false); + print ''; + print ''; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "\n"; + $jobs = $ipp->jobs_attributes; + $var = True; + //print '
    '.print_r($jobs,true).'
    '; + foreach ($jobs as $value ) + { + $var=!$var; + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + print "
    IdOwnerPrinterFileStatusCancel
    '.$value->job_id->_value0.''.$value->job_originating_user_name->_value0.''.$value->printer_uri->_value0.''.$value->job_name->_value0.''.$value->job_state->_value0.''.$value->job_uri->_value0.'
    "; + } - echo "
    ";print_r($ipp->jobs_attributes); echo "
    "; + /** + * Get printer detail + * + * @param string $uri URI + * @return array List of attributes + */ + function get_printer_detail($uri) + { + global $conf,$db; + + include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; + $ipp = new CupsPrintIPP(); + $ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose + $ipp->setHost($this->host); + $ipp->setPort($this->port); + $ipp->setUserName($this->userid); + if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password); + $ipp->setPrinterURI($uri); + $ipp->getPrinterAttributes(); + return $ipp->printer_attributes; } } ?> diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 48a4c8020b3..451598a5830 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2012 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin +* Copyright (C) 2013 Florian Henry * * 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 @@ -22,13 +23,13 @@ /** * \file htdocs/core/class/extrafields.class.php -* \ingroup core -* \brief File of class to manage extra fields -*/ + * \ingroup core + * \brief File of class to manage extra fields + */ /** * Class to manage standard extra fields -*/ + */ class ExtraFields { var $db; @@ -515,7 +516,7 @@ class ExtraFields /** * Load array this->attribute_label * - * @param string $elementtype Type of element + * @param string $elementtype Type of element ('adherent', 'commande', societe', 'facture', 'propal', 'product', ...) * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED * @return array Array of attributes for all extra fields */ @@ -570,14 +571,15 @@ class ExtraFields /** - * Return HTML string to put an input field into a page + * Return HTML string to put an input field into a page * - * @param string $key Key of attribute - * @param string $value Value to show (for date type it must be in timestamp format) - * @param string $moreparam To add more parametes on html input tag - * @return void + * @param string $key Key of attribute + * @param string $value Value to show (for date type it must be in timestamp format) + * @param string $moreparam To add more parametes on html input tag + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @return void */ - function showInputField($key,$value,$moreparam='') + function showInputField($key,$value,$moreparam='',$keyprefix='') { global $conf,$langs; @@ -619,23 +621,23 @@ class ExtraFields if(!$required && $value == '') $value = '-1'; - $out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1); - //$out=''; + $out = $formstat->select_date($value, 'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1); + // TODO Missing to add $moreparam } elseif (in_array($type,array('int'))) { $tmp=explode(',',$size); $newsize=$tmp[0]; - $out=''; + $out=''; } elseif ($type == 'varchar') { - $out=''; + $out=''; } elseif ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); + $doleditor=new DolEditor('options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); $out=$doleditor->Create(1); } elseif ($type == 'boolean') @@ -646,55 +648,95 @@ class ExtraFields } else { $checked=' value="1" '; } - $out=''; + $out=''; } elseif ($type == 'mail') { - $out=''; + $out=''; } elseif ($type == 'phone') { - $out=''; + $out=''; } elseif ($type == 'price') { - $out=' '.$langs->getCurrencySymbol($conf->currency); + $out=' '.$langs->getCurrencySymbol($conf->currency); } elseif ($type == 'double') { - $out=' '; + if (!empty($value)) { + $value=price($value); + } + $out=' '; } elseif ($type == 'select') { - $out=''; foreach ($param['options'] as $key=>$val ) { + list($val, $parent) = explode('|', $val); $out.=''; $num = $this->db->num_rows($resql); $i = 0; - if ($num) + while ($i < $num) { - while ($i < $num) + $labeltoshow=''; + $obj = $this->db->fetch_object($resql); + + // Several field into label (eq table:code|libelle:rowid) + $fields_label = explode('|',$InfoFieldList[1]); + if(is_array($fields_label)) { - $obj = $this->db->fetch_object($resql); - $labeltoshow=dol_trunc($obj->$InfoFieldList[1],18); - if ($value==$obj->rowid) + foreach ($fields_label as $field_toshow) + { + $labeltoshow.= $obj->$field_toshow.' '; + } + } + else + { + $labeltoshow=$obj->$InfoFieldList[1]; + } + $labeltoshow=dol_trunc($labeltoshow,45); + + if ($value==$obj->rowid) + { + foreach ($fields_label as $field_toshow) + { + $translabel=$langs->trans($obj->$field_toshow); + if ($translabel!=$obj->$field_toshow) { + $labeltoshow=dol_trunc($translabel,18).' '; + }else { + $labeltoshow=dol_trunc($obj->$field_toshow,18).' '; + } + } + $out.=''; + } + else + { + $translabel=$langs->trans($obj->$InfoFieldList[1]); + if ($translabel!=$obj->$InfoFieldList[1]) { + $labeltoshow=dol_trunc($translabel,18); + } + else { + $labeltoshow=dol_trunc($obj->$InfoFieldList[1],18); + } + if (empty($labeltoshow)) $labeltoshow='(not defined)'; + if ($value==$obj->rowid) { $out.=''; } - else + + if (!empty($InfoFieldList[3])) { - $out.=''; + $parent = $parentName.':'.$obj->{$parentField}; } - $i++; + + $out.=''; } + + $i++; } $this->db->free($resql); } + else { + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.
    '; + } } $out.=''; } @@ -733,7 +822,7 @@ class ExtraFields foreach ($param['options'] as $keyopt=>$val ) { - $out.='$val ) { - $out.=''; @@ -798,7 +887,9 @@ class ExtraFields } elseif ($type == 'double') { - $value=price($value); + if (!empty($value)) { + $value=price($value); + } } elseif ($type == 'boolean') { @@ -818,7 +909,7 @@ class ExtraFields } elseif ($type == 'price') { - $value=price($value).' '.$langs->getCurrencySymbol($conf->currency); + $value=price($value,0,$langs,0,0,-1,$conf->currency); } elseif ($type == 'select') { @@ -826,26 +917,67 @@ class ExtraFields } elseif ($type == 'sellist') { - if (is_array($params['options'])) { - $param_list=array_keys($params['options']); - $InfoFieldList = explode(":", $param_list[0]); - $keyList='rowid'; - if (count($InfoFieldList)==3) - $keyList=$InfoFieldList[2]; + $param_list=array_keys($params['options']); + $InfoFieldList = explode(":", $param_list[0]); + $selectkey="rowid"; + $keyList='rowid'; - $sql = 'SELECT '.$InfoFieldList[1]; - $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - $sql.= ' WHERE '.$keyList.'=\''.$this->db->escape($value).'\''; - //$sql.= ' AND entity = '.$conf->entity; - dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); - $resql = $this->db->query($sql); - if ($resql) + if (count($InfoFieldList)==3) + { + $selectkey = $InfoFieldList[2]; + $keyList=$InfoFieldList[2].' as rowid'; + } + + $fields_label = explode('|',$InfoFieldList[1]); + if(is_array($fields_label)) { + $keyList .=', '; + $keyList .= implode(', ', $fields_label); + } + + $sql = 'SELECT '.$keyList; + $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; + if (strpos($InfoFieldList[4], 'extra')!==false) + { + $sql.= ' as main'; + } + $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; + //$sql.= ' AND entity = '.$conf->entity; + + dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); + $resql = $this->db->query($sql); + if ($resql) + { + $value=''; // value was used, so now we reste it to use it to build final output + + $obj = $this->db->fetch_object($resql); + + // Several field into label (eq table:code|libelle:rowid) + $fields_label = explode('|',$InfoFieldList[1]); + + if(is_array($fields_label)) { - $obj = $this->db->fetch_object($resql); - $value=$obj->$InfoFieldList[1]; + foreach ($fields_label as $field_toshow) + { + $translabel=$langs->trans($obj->$InfoFieldList[1]); + if ($translabel!=$obj->$InfoFieldList[1]) { + $value=dol_trunc($translabel,18).' '; + }else { + $value=$obj->$InfoFieldList[1].' '; + } + } + } + else + { + $translabel=$langs->trans($obj->$InfoFieldList[1]); + if ($translabel!=$obj->$InfoFieldList[1]) { + $value=dol_trunc($translabel,18); + }else { + $value=$obj->$InfoFieldList[1]; + } } } + else dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING); } elseif ($type == 'radio') { @@ -885,13 +1017,14 @@ class ExtraFields } /** - * Fill array_options array for object by extrafields value (using for data send by forms) + * Fill array_options property of object by extrafields value (using for data sent by forms) * * @param array $extralabels $array of extrafields - * @param object &$object object + * @param object &$object Object + * @param string $onlykey Only following key is filled * @return int 1 if array_options set / 0 if no value */ - function setOptionalsFromPost($extralabels,&$object) + function setOptionalsFromPost($extralabels,&$object,$onlykey='') { global $_POST, $langs; $nofillrequired='';// For error when required field left blank @@ -902,6 +1035,8 @@ class ExtraFields // Get extra fields foreach ($extralabels as $key => $value) { + if (! empty($onlykey) && $key != $onlykey) continue; + $key_type = $this->attribute_type[$key]; if($this->attribute_required[$key] && !GETPOST("options_$key",2)) { @@ -948,5 +1083,52 @@ class ExtraFields return 0; } } + /** + * return array_options array for object by extrafields value (using for data send by forms) + * + * @param array $extralabels $array of extrafields + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @return int 1 if array_options set / 0 if no value + */ + function getOptionalsFromPost($extralabels,$keyprefix='') + { + global $_POST; + + $array_options = array(); + if (is_array($extralabels)) + { + // Get extra fields + foreach ($extralabels as $key => $value) + { + $key_type = $this->attribute_type[$key]; + + if (in_array($key_type,array('date','datetime'))) + { + // Clean parameters + $value_key=dol_mktime($_POST["options_".$key.$keyprefix."hour"], $_POST["options_".$key.$keyprefix."min"], 0, $_POST["options_".$key.$keyprefix."month"], $_POST["options_".$key.$keyprefix."day"], $_POST["options_".$key.$keyprefix."year"]); + } + else if (in_array($key_type,array('checkbox'))) + { + $value_arr=GETPOST("options_".$key.$keyprefix); + $value_key=implode($value_arr,','); + } + else if (in_array($key_type,array('price','double'))) + { + $value_arr=GETPOST("options_".$key.$keyprefix); + $value_key=price2num($value_arr); + } + else + { + $value_key=GETPOST("options_".$key.$keyprefix); + } + + $array_options["options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read. + } + + return $array_options; + } + else { + return 0; + } + } } -?> diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 910ad55e0a0..ed091e74c83 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -329,14 +329,14 @@ class FileUpload $file->error = 'minFileSize'; return false; } - if (is_int($this->options['max_number_of_files']) && ( + if (is_numeric($this->options['max_number_of_files']) && ( count($this->getFileObjects()) >= $this->options['max_number_of_files']) ) { $file->error = 'maxNumberOfFiles'; return false; } list($img_width, $img_height) = @getimagesize($uploaded_file); - if (is_int($img_width)) { + if (is_numeric($img_width)) { if ($this->options['max_width'] && $img_width > $this->options['max_width'] || $this->options['max_height'] && $img_height > $this->options['max_height']) { $file->error = 'maxResolution'; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 2642fc7e165..849b6bb0370 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -131,11 +131,24 @@ class HookManager // Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated. $hooktype='output'; if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win. - if (in_array($method,array('doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices','printSearchForm'))) $hooktype='addreplace'; + if (in_array( + $method, + array( + 'addStatisticLine', + 'doActions', + 'formObjectOptions', + 'formattachOptions', + 'formBuilddocLineOptions', + 'moveUploadedFile', + 'pdf_writelinedesc', + 'paymentsupplierinvoices', + 'printSearchForm' + ) + )) $hooktype='addreplace'; // Loop on each hook to qualify modules that declared context $modulealreadyexecuted=array(); - $resaction=0; $error=0; + $resaction=0; $error=0; $result=''; $this->resPrint=''; $this->resArray=array(); foreach($this->hooks as $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context { @@ -143,8 +156,8 @@ class HookManager { foreach($modules as $module => $actionclassinstance) { - //print "Before hook ".get_class($actionclassinstance)." method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction."
    \n"; - + //print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."
    \n"; + //print 'class='.get_class($actionclassinstance).' method='.$method.' action='.$action; // jump to next class if method does not exists if (! method_exists($actionclassinstance,$method)) continue; @@ -159,19 +172,19 @@ class HookManager { $error++; $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); - - // TODO remove this. Change must be inside the method of hook if required + // TODO dead code to remove (do not enable this, but fix hook instead) + /* Change must be inside the method of hook if required. Only hook must decide if $action must be modified or not. if ($method == 'doActions') { if ($action=='add') $action='create'; if ($action=='update') $action='edit'; - } + }*/ } if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; } - // Generic hooks that return a string or array (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) + // Generic hooks that return a string or array (printSearchForm, printLeftBlock, formAddObjectLine, formBuilddocOptions, ...) else { // TODO. this should be done into the method of hook by returning nothing @@ -181,14 +194,18 @@ class HookManager if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; - - // TODO. remove this. array result must be set into $actionclassinstance->results - if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); - // TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string - if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; + // TODO dead code to remove (do not enable this, but fix hook instead) + //if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); + // TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string. we must use $actionclassinstance->resprints to return a string + if (! is_array($result) && ! is_numeric($result)) + { + //print 'Error: Bug into module '.get_class($actionclassinstance).' hook must not return a string but an int and set string into ->resprints'; + dol_syslog('Error: Bug into module '.get_class($actionclassinstance).' hook must not return a string but an int and set string into ->resprints', LOG_ERR); + if (empty($actionclassinstance->resprints)) { $this->resPrint.=$result; $result=0; } + } } - //print "After hook ".get_class($actionclassinstance)." method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction."
    \n"; + //print "After hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."
    \n"; unset($actionclassinstance->results); unset($actionclassinstance->resprints); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3e74876383b..43148045e81 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -121,8 +121,8 @@ class Form * @param string $value Value to show/edit * @param object $object Object * @param boolean $perm Permission to allow button to edit parameter - * @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) - * @param string $editvalue When in edit mode, use this value as $value instead of value + * @param string $typeofdata Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) + * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value) * @param object $extObject External object * @param string $success Success message * @param string $moreparam More param to add on a href URL @@ -134,8 +134,11 @@ class Form $ret=''; + // Check parameters + if (empty($typeofdata)) return 'ErrorBadParameter'; + // When option to edit inline is activated - if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // FIXME add jquery timepicker + if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker { $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $success); } @@ -150,7 +153,7 @@ class Form $ret.=''; $ret.=''; $ret.='"; - print ''; - if (empty($sectionid)) print '
    '; + if ($savingdocmask) + { + $out .= ''; + if (! empty($options)) $out .= ''; + $out .= ''; + $out .= ''; + } - print "\n\n\n"; + $out .= "
    '; - if (preg_match('/^(string|email|numeric)/',$typeofdata)) + if (preg_match('/^(string|email|numeric|amount)/',$typeofdata)) { $tmp=explode(':',$typeofdata); $ret.=''; @@ -191,8 +194,9 @@ class Form $ret.=''."\n"; } else - { - if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1); + { + if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1); + elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs) : ''); elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value); elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day'); elseif ($typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour'); @@ -345,9 +349,9 @@ class Form * * @param string $text Text to show * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. - * @param int $tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2 - * @param int $direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres - * @param string $img Code img du picto (use img_xxx() function to get it) + * @param int $tooltipon 1=tooltip on text, 2=tooltip on image, 3=tooltip sur les 2 + * @param int $direction -1=image is before, 0=no image, 1=image is after + * @param string $img Html code for image (use img_xxx() function to get it) * @param string $extracss Add a CSS style to td tags * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span * @param string $incbefore Include code before the text @@ -473,7 +477,7 @@ class Form $sql = "SELECT rowid, code as code_iso, libelle as label"; $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " WHERE active = 1"; - $sql.= " ORDER BY code ASC"; + //$sql.= " ORDER BY code ASC"; dol_syslog(get_class($this)."::select_country sql=".$sql); $resql=$this->db->query($sql); @@ -492,7 +496,7 @@ class Form $countryArray[$i]['rowid'] = $obj->rowid; $countryArray[$i]['code_iso'] = $obj->code_iso; $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:'')); - $label[$i] = $countryArray[$i]['label']; + $label[$i] = dol_string_unaccent($countryArray[$i]['label']); $i++; } @@ -507,7 +511,7 @@ class Form $out.= ''."\n"; $num = $this->db->num_rows($resql); $i = 0; if ($num) @@ -726,7 +804,21 @@ class Form while ($i < $num) { $obj = $this->db->fetch_object($resql); - $label=$obj->nom; + $label=''; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { + if (($obj->client) && (!empty($obj->code_client))) { + $label = $obj->code_client. ' - '; + } + if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { + $label .= $obj->code_fournisseur. ' - '; + } + $label.=' '.$obj->nom; + } + else + { + $label=$obj->nom; + } + if ($showtype) { if ($obj->client || $obj->fournisseur) $label.=' ('; @@ -740,19 +832,24 @@ class Form $out.= ''; } else - { + { $out.= ''; } + + array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->name, 'label'=>$obj->name)); + $i++; + if (($i % 10) == 0) $out.="\n"; } } - $out.= ''; + $out.= ''."\n"; } else { dol_print_error($this->db); } + if ($outputmode) return $outarray; return $out; } @@ -872,7 +969,7 @@ class Form $out=''; // On recherche les societes - $sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.poste"; + $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste"; if ($showsoc > 0) { $sql.= " , s.nom as company"; } @@ -882,6 +979,7 @@ class Form } $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid; + if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut<>0 "; $sql.= " ORDER BY sp.lastname ASC"; dol_syslog(get_class($this)."::select_contacts sql=".$sql); @@ -912,7 +1010,7 @@ class Form $contactstatic->id=$obj->rowid; $contactstatic->lastname=$obj->lastname; $contactstatic->firstname=$obj->firstname; - + if ($obj->statut == 1){ if ($htmlname != 'none') { $disabled=0; @@ -948,6 +1046,7 @@ class Form if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')'; } } + } $i++; } } @@ -982,6 +1081,7 @@ class Form * @param int $enableonly Array list of users id to be enabled. All other must be disabled * @param int $force_entity 0 or Id of environment to force * @return void + * @deprecated */ function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0) { @@ -997,11 +1097,13 @@ class Form * @param array $exclude Array list of users id to exclude * @param int $disabled If select list must be disabled * @param array $include Array list of users id to include - * @param int $enableonly Array list of users id to be enabled. All other must be disabled + * @param array $enableonly Array list of users id to be enabled. All other must be disabled * @param int $force_entity 0 or Id of environment to force + * @param int $maxlength Maximum length of string into list (0=no limit) + * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @return string HTML select string */ - function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0) + function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0) { global $conf,$user,$langs; @@ -1016,7 +1118,7 @@ class Form $out=''; // On recherche les utilisateurs - $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.login, u.admin, u.entity"; + $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity) { $sql.= ", e.label"; @@ -1044,6 +1146,7 @@ class Form if (! empty($user->societe_id)) $sql.= " AND u.fk_societe = ".$user->societe_id; if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')"; if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')"; + if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 "; $sql.= " ORDER BY u.lastname ASC"; dol_syslog(get_class($this)."::select_dolusers sql=".$sql); @@ -1082,17 +1185,44 @@ class Form if ($disableline) $out.= ' disabled="disabled"'; $out.= '>'; } - $out.= $userstatic->getFullName($langs); + $out.= $userstatic->getFullName($langs, 0, 0, $maxlength); + // Complete name with more info + $moreinfo=0; + if (! empty($conf->global->MAIN_SHOW_LOGIN)) + { + $out.= ($moreinfo?' - ':' (').$obj->login; + $moreinfo++; + } + if ($showstatus >= 0) + { + if ($obj->statut == 1 && $showstatus == 1) + { + $out.=($moreinfo?' - ':' (').$langs->trans('Enabled'); + $moreinfo++; + } + if ($obj->statut == 0) + { + $out.=($moreinfo?' - ':' (').$langs->trans('Disabled'); + $moreinfo++; + } + } if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { - if ($obj->admin && ! $obj->entity) $out.=" (".$langs->trans("AllEntities").")"; - else $out.=" (".$obj->label.")"; + if ($obj->admin && ! $obj->entity) + { + $out.=($moreinfo?' - ':' (').$langs->trans("AllEntities"); + $moreinfo++; + } + else + { + $out.=($moreinfo?' - ':' (').$obj->label; + $moreinfo++; + } } - - //if ($obj->admin) $out.= ' *'; - if (! empty($conf->global->MAIN_SHOW_LOGIN)) $out.= ' ('.$obj->login.')'; + $out.=($moreinfo?')':''); $out.= ''; + $i++; } } @@ -1113,7 +1243,7 @@ class Form /** - * Return list of products for customer in Ajax if Ajax activated or go to select_produits_do + * Return list of products for customer in Ajax if Ajax activated or go to select_produits_list * * @param int $selected Preselected products * @param string $htmlname Name of HTML seletc field (must be unique in page) @@ -1161,8 +1291,8 @@ class Form } } else - { - $this->select_produits_do($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0); + { + print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0); } } @@ -1177,13 +1307,16 @@ class Form * @param string $filterkey Filter on product * @param int $status -1=Return all products, 0=Products not on sell, 1=Products on sell * @param int $finished Filter on finished field: 2=No filter - * @param int $disableout Disable print output + * @param int $outputmode 0=HTML select string, 1=Array * @return array Array of keys for json */ - function select_produits_do($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$disableout=0) + function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0) { global $langs,$conf,$user,$db; + $out=''; + $outarray=array(); + $sql = "SELECT "; $sql.= " p.rowid, p.label, p.ref, p.description, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.stock"; // Multilang : we add translation @@ -1225,45 +1358,38 @@ class Form } if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; // Add criteria on ref/label - if ($filterkey && $filterkey != '') + if ($filterkey != '') { - if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) // Can use index + $sql.=' AND ('; + $prefix=empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)?'%':''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on + // For natural search + $scrit = explode(' ', $filterkey); + $i=0; + if (count($scrit) > 1) $sql.="("; + foreach ($scrit as $crit) { - $sql.=" AND (p.ref LIKE '".$filterkey."%' OR p.label LIKE '".$filterkey."%'"; - if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$filterkey."%'"; + if ($i > 0) $sql.=" AND "; + $sql.="(p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%'"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$prefix.$crit."%'"; $sql.=")"; + $i++; } - else - { - // For natural search - $scrit = explode(' ', $filterkey); - foreach ($scrit as $crit) { - $sql.=" AND (p.ref LIKE '%".$crit."%' OR p.label LIKE '%".$crit."%'"; - if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '%".$crit."%'"; - $sql.=")"; - } - } - - if (! empty($conf->barcode->enabled)) - { - $sql .= " OR p.barcode LIKE '".$filterkey."'"; - } + if (count($scrit) > 1) $sql.=")"; + if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'"; + $sql.=')'; } $sql.= $db->order("p.ref"); $sql.= $db->plimit($limit); // Build output string - $outselect=''; - $outjson=array(); - - dol_syslog(get_class($this)."::select_produits_do search product sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::select_produits_list search product sql=".$sql, LOG_DEBUG); $result=$this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); - $outselect.=''; + $out.=''; $i = 0; while ($num && $i < $num) @@ -1272,13 +1398,14 @@ class Form $optJson = array(); $objp = $this->db->fetch_object($result); - if(!empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product + if (!empty($objp->price_by_qty) && $objp->price_by_qty == 1) + { // Price by quantity will return many prices for the same product $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; $sql.= " WHERE fk_product_price=".$objp->price_rowid; $sql.= " ORDER BY quantity ASC"; - dol_syslog(get_class($this)."::select_produits_do search price by qty sql=".$sql); + dol_syslog(get_class($this)."::select_produits_list search price by qty sql=".$sql); $result2 = $this->db->query($sql); if ($result2) { @@ -1294,53 +1421,55 @@ class Form $objp->remise = $objp2->remise; $objp->price_by_qty_rowid = $objp2->rowid; - $this->_construct_product_list_option($objp, $opt, $optJson, 0, $selected); + $this->constructProductListOption($objp, $opt, $optJson, 0, $selected); $j++; // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box - $outselect.=$opt; - array_push($outjson, $optJson); + $out.=$opt; + array_push($outarray, $optJson); } } - } else { - $this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected); + } + else + { + $this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected); // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box - $outselect.=$opt; - array_push($outjson, $optJson); + $out.=$opt; + array_push($outarray, $optJson); } $i++; } - $outselect.=''; + $out.=''; $this->db->free($result); - if (empty($disableout)) print $outselect; - return $outjson; + if (empty($outputmode)) return $out; + return $outarray; } else - { + { dol_print_error($db); } } /** - * _construct_product_list_option + * constructProductListOption * - * @param resultset &$objp Resultset of fetch - * @param string $opt Option - * @param string $optJson Option + * @param resultset &$objp Resultset of fetch + * @param string &$opt Option + * @param string &$optJson Option * @param int $price_level Price level * @param string $selected Preselected value - * @return + * @return void */ - private function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected) + private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected) { global $langs,$conf,$user,$db; @@ -1383,10 +1512,6 @@ class Form $outval.=$objRef.' - '.dol_trunc($label,32).' - '; $found=0; - $currencytext=$langs->trans("Currency".$conf->currency); - $currencytextnoent=$langs->transnoentities("Currency".$conf->currency); - if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code - if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code // Multiprice if ($price_level >= 1) // If we need a particular price level (from 1 to 6) @@ -1399,7 +1524,7 @@ class Form $sql.= " ORDER BY date_price"; $sql.= " DESC LIMIT 1"; - dol_syslog(get_class($this)."::select_produits_do search price for level '.$price_level.' sql=".$sql); + dol_syslog(get_class($this)."::constructProductListOption search price for level '.$price_level.' sql=".$sql); $result2 = $this->db->query($sql); if ($result2) { @@ -1409,13 +1534,13 @@ class Form $found=1; if ($objp2->price_base_type == 'HT') { - $opt.= price($objp2->price,1).' '.$currencytext.' '.$langs->trans("HT"); - $outval.= price($objp2->price,1).' '.$currencytextnoent.' '.$langs->transnoentities("HT"); + $opt.= price($objp2->price,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT"); + $outval.= price($objp2->price,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("HT"); } else { - $opt.= price($objp2->price_ttc,1).' '.$currencytext.' '.$langs->trans("TTC"); - $outval.= price($objp2->price_ttc,1).' '.$currencytextnoent.' '.$langs->transnoentities("TTC"); + $opt.= price($objp2->price_ttc,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC"); + $outval.= price($objp2->price_ttc,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("TTC"); } $outprice_ht=price($objp2->price); $outprice_ttc=price($objp2->price_ttc); @@ -1430,21 +1555,22 @@ class Form } // Price by quantity - if (!empty($objp->quantity) && $objp->quantity >= 1) { + if (!empty($objp->quantity) && $objp->quantity >= 1) + { $found = 1; $outqty=$objp->quantity; $outdiscount=$objp->remise_percent; if ($objp->quantity == 1) { - $opt.= price($objp->unitprice).' '.$currencytext."/"; - $outval.= price($objp->unitprice).' '.$currencytextnoent."/"; + $opt.= price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/"; + $outval.= price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/"; $opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding $outval.=$langs->transnoentities("Unit"); } else { - $opt.= price($objp->price).' '.$currencytext."/".$objp->quantity; - $outval.= price($objp->price).' '.$currencytextnoent."/".$objp->quantity; + $opt.= price($objp->price,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity; + $outval.= price($objp->price,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity; $opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding $outval.=$langs->transnoentities("Units"); } @@ -1456,8 +1582,8 @@ class Form } if (!empty($objp->quantity) && $objp->quantity >= 1) { - $opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding - $outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding + $opt.=" (".price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding + $outval.=" (".price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding } if (!empty($objp->remise_percent) && $objp->remise_percent >= 1) { @@ -1470,13 +1596,13 @@ class Form { if ($objp->price_base_type == 'HT') { - $opt.= price($objp->price,1).' '.$currencytext.' '.$langs->trans("HT"); - $outval.= price($objp->price,1).' '.$currencytextnoent.' '.$langs->transnoentities("HT"); + $opt.= price($objp->price,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT"); + $outval.= price($objp->price,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("HT"); } else { - $opt.= price($objp->price_ttc,1).' '.$currencytext.' '.$langs->trans("TTC"); - $outval.= price($objp->price_ttc,1).' '.$currencytextnoent.' '.$langs->transnoentities("TTC"); + $opt.= price($objp->price_ttc,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC"); + $outval.= price($objp->price_ttc,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("TTC"); } $outprice_ht=price($objp->price); $outprice_ttc=price($objp->price_ttc); @@ -1511,7 +1637,7 @@ class Form } /** - * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_do) + * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list) * * @param int $socid Id third party * @param string $selected Preselected product @@ -1536,7 +1662,7 @@ class Form } else { - $this->select_produits_fournisseurs_do($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0); + print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0); } } @@ -1550,13 +1676,16 @@ class Form * @param string $filtre Pour filtre sql * @param string $filterkey Filtre des produits * @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell - * @param int $disableout Disable print output + * @param int $outputmode 0=HTML select string, 1=Array * @return array Array of keys for json */ - function select_produits_fournisseurs_do($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$disableout=0) + function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0) { global $langs,$conf; + $out=''; + $outarray=array(); + $langs->load('stocks'); $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; @@ -1571,39 +1700,39 @@ class Form if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; if (! empty($filtre)) $sql.=" ".$filtre; // Add criteria on ref/label - if ($filterkey && $filterkey != '') + if ($filterkey != '') { - if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) - { - $sql.=" AND (pfp.ref_fourn LIKE '".$filterkey."%' OR p.ref LIKE '".$filterkey."%' OR p.label LIKE '".$filterkey."%')"; - } - else - { - $sql.=" AND (pfp.ref_fourn LIKE '%".$filterkey."%' OR p.ref LIKE '%".$filterkey."%' OR p.label LIKE '%".$filterkey."%')"; - } - - if (! empty($conf->barcode->enabled)) - { - $sql .= " OR p.barcode LIKE '".$filterkey."'"; - } + $sql.=' AND ('; + $prefix=empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)?'%':''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on + // For natural search + $scrit = explode(' ', $filterkey); + $i=0; + if (count($scrit) > 1) $sql.="("; + foreach ($scrit as $crit) + { + if ($i > 0) $sql.=" AND "; + $sql.="(pfp.ref_fourn LIKE '".$prefix.$crit."%' OR p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%')"; + $i++; + } + if (count($scrit) > 1) $sql.=")"; + if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'"; + $sql.=')'; } $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; // Build output string - $outselect=''; - $outjson=array(); - dol_syslog(get_class($this)."::select_produits_fournisseurs_do sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::select_produits_fournisseurs_list sql=".$sql,LOG_DEBUG); $result=$this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); - //$outselect.=''; - if (! $selected) $outselect.=''; - else $outselect.=''; + //$out.=''; + if (! $selected) $out.=''; + else $out.=''; $i = 0; while ($i < $num) @@ -1639,33 +1768,27 @@ class Form if (! empty($objp->idprodfournprice)) { - $currencytext=$langs->trans("Currency".$conf->currency); - $currencytextnoent=$langs->transnoentities("Currency".$conf->currency); - if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code - if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code - - $outqty=$objp->quantity; $outdiscount=$objp->remise_percent; if ($objp->quantity == 1) { - $opt.= price($objp->fprice).' '.$currencytext."/"; - $outval.= price($objp->fprice).' '.$currencytextnoent."/"; + $opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/"; + $outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/"; $opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding $outval.=$langs->transnoentities("Unit"); } else { - $opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity; - $outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity; + $opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity; + $outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity; $opt.= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding $outval.= ' '.$langs->transnoentities("Units"); } if ($objp->quantity >= 1) { - $opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding - $outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding + $opt.=" (".price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding + $outval.=" (".price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding } if ($objp->remise_percent >= 1) { @@ -1694,9 +1817,9 @@ class Form // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box - $outselect.=$opt; - array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false))); - // Exemple of var_dump $outjson + $out.=$opt; + array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false))); + // Exemple of var_dump $outarray // array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp" // ["label"]=>string(76) "ppp (fff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)" // ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false) @@ -1707,12 +1830,12 @@ class Form $i++; } - $outselect.=''; + $out.=''; $this->db->free($result); - if (empty($disableout)) print $outselect; - return $outjson; + if (empty($outputmode)) return $out; + return $outarray; } else { @@ -1768,28 +1891,31 @@ class Form $objp = $this->db->fetch_object($result); $opt = '\n"; @@ -2238,7 +2364,7 @@ class Form * * @param string $selected Id account pre-selected * @param string $htmlname Name of select zone - * @param int $statut Status of searched accounts (0=open, 1=closed) + * @param int $statut Status of searched accounts (0=open, 1=closed, 2=both) * @param string $filtre To filter list * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @param string $moreattrib To add more attribute on select @@ -2250,10 +2376,10 @@ class Form $langs->load("admin"); - $sql = "SELECT rowid, label, bank"; + $sql = "SELECT rowid, label, bank, clos as status"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; - $sql.= " WHERE clos = '".$statut."'"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " WHERE entity IN (".getEntity('bank_account', 1).")"; + if ($statut != 2) $sql.= " AND clos = '".$statut."'"; if ($filtre) $sql.=" AND ".$filtre; $sql.= " ORDER BY label"; @@ -2283,6 +2409,7 @@ class Form print ''; $i++; } @@ -2302,7 +2429,7 @@ class Form * Return list of categories having choosed type * * @param int $type Type de categories (0=product, 1=supplier, 2=customer, 3=member) - * @param string $selected Id of category preselected + * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element) * @param string $htmlname HTML field name * @param int $maxlength Maximum length for labels * @param int $excludeafterid Exclude all categories after this leaf in category tree. @@ -2325,7 +2452,7 @@ class Form $output.= ''; foreach($cate_arbo as $key => $value) { - if ($cate_arbo[$key]['id'] == $selected) + if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1)) { $add = 'selected="selected" '; } @@ -2351,10 +2478,11 @@ class Form * @param string $action Action * @param array $formquestion An array with forms complementary inputs * @param string $selectedchoice "" or "no" or "yes" - * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No + * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of box * @return void + * @deprecated */ function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) { @@ -2362,7 +2490,15 @@ class Form } /** - * Show a confirmation HTML form or AJAX popup + * Show a confirmation HTML form or AJAX popup. + * Easiest way to use this is with useajax=1. + * If you use useajax='xxx', you must also add jquery code to trigger opening of box (with correct parameters) + * just after calling this method. For example: + * print ''."\n"; * * @param string $page Url of page to call if confirmation is OK * @param string $title Title @@ -2370,7 +2506,7 @@ class Form * @param string $action Action * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) * @param string $selectedchoice "" or "no" or "yes" - * @param int $useajax 0=No, 1 or 'xxx'=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx + * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of bow * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form @@ -2390,6 +2526,19 @@ class Form if (is_array($formquestion) && ! empty($formquestion)) { + // First add hidden fields and value + foreach ($formquestion as $key => $input) + { + if (is_array($input) && ! empty($input)) + { + if ($input['type'] == 'hidden') + { + $more.=''."\n"; + } + } + } + + // Now add questions $more.=''."\n"; $more.=''."\n"; foreach ($formquestion as $key => $input) @@ -2449,23 +2598,23 @@ class Form $more.=$input['value']; $more.=''."\n"; } - else if ($input['type'] == 'hidden') - { - $more.=''; - } } } $more.='
    '.(! empty($formquestion['text'])?$formquestion['text']:'').'
    '."\n"; } - if (! empty($conf->dol_use_jmobile)) $useajax=0; // JQUI method dialog is broken with jmobile, we use standard HTML. We also change code for button to have get on url with action=xxx and output confirm only when action=xxx + // JQUI method dialog is broken with jmobile, we use standard HTML. + // Note: When using dol_use_jmobile or no js, you must also check code for button use a GET url with action=xxx and check that you also output the confirm code when action=xxx + // See page product/fiche.php for example + if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; - if ($useajax && $conf->use_javascript_ajax) + if ($useajax) { $autoOpen=true; $dialogconfirm='dialog-confirm'; $button=''; - if (! is_int($useajax)) + if (! is_numeric($useajax)) { $button=$useajax; $useajax=1; @@ -2616,6 +2765,9 @@ class Form global $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + + $formproject=new FormProjets($this->db); $langs->load("project"); if ($htmlname != "none") @@ -2626,7 +2778,7 @@ class Form print ''; print ''; print ''; print '
    '; //print "$socid,$selected,$htmlname"; - select_projects($socid,$selected,$htmlname); + $formproject->select_projects($socid,$selected,$htmlname); print '
    '; @@ -2763,16 +2915,17 @@ class Form } /** - * Show a form to select a date + * Show a form + html select a date * * @param string $page Page * @param string $selected Date preselected - * @param string $htmlname Name of input html field + * @param string $htmlname Html name of date input fields or 'none' * @param int $displayhour Display hour selector * @param int $displaymin Display minutes selector * @return void + * @see select_date */ - function form_date($page, $selected, $htmlname,$displayhour=0,$displaymin=0) + function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0) { global $langs; @@ -2905,13 +3058,13 @@ class Form print '
    '; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice - else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; + if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; } else { - if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; - else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; + if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; } $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles if ($filter) $newfilter.=' AND ('.$filter.')'; @@ -3146,7 +3299,8 @@ class Form * Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle. * Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle. * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. - * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu autre que transport neuf alors la TVA par defaut=TVA du produit vendu. Fin de regle. + * Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TVA par défaut=TVA du produit vendu. Fin de règle. + * Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle. * Sinon la TVA proposee par defaut=0. Fin de regle. * @param bool $options_only Return options only (for ajax treatment) * @return void @@ -3236,12 +3390,14 @@ class Form // Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) { - $defaulttx = $this->cache_vatrates[$num-1]['txtva']; + if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) $defaulttx = $this->cache_vatrates[$num-1]['txtva']; + else $defaulttx=$conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS; } // Disabled if seller is not subject to VAT $disabled=false; $title=''; - if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0") { + if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0") + { $title=' title="'.$langs->trans('VATIsNotUsed').'"'; $disabled=true; } @@ -3282,13 +3438,13 @@ class Form /** - * Show a HTML widget to input a date or combo list for day, month, years and optionnaly hours and minutes + * Show a HTML widget to input a date or combo list for day, month, years and optionnaly hours and minutes. * Fields are preselected with : - * - set_time date (Local PHP server timestamps or date format YYYY-MM-DD or YYYY-MM-DD HH:MM) - * - local date of PHP server if set_time is '' - * - Empty (fields empty) if set_time is -1 (in this case, parameter empty must also have value 1) + * - set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM') + * - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location) + * - Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1) * - * @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp) + * @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date. * @param string $prefix Prefix for fields name * @param int $h 1=Show also hours * @param int $m 1=Show also minutes @@ -3300,6 +3456,7 @@ class Form * @param int $disabled Disable input fields * @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59 * @return mixed Nothing or string if nooutput is 1 + * @see form_date */ function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='') { @@ -3312,7 +3469,11 @@ class Form if($m == '') $m=0; if($empty == '') $empty=0; - if (! $set_time && $empty == 0) $set_time = dol_now('tzuser'); + if ($set_time === '' && $empty == 0) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $set_time = dol_now('tzuser')-(getServerTimeZoneInt('now')*3600); // set_time must be relative to PHP server timezone + } // Analysis of the pre-selection date if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/',$set_time,$reg)) @@ -3520,30 +3681,41 @@ class Form * @param string $prefix prefix * @param int $iSecond Default preselected duration (number of seconds) * @param int $disabled Disable the combo box + * @param string $typehour if 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo * @return void */ - function select_duration($prefix,$iSecond='',$disabled=0) + function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select') { + global $langs; + + $hourSelected=0; $minSelected=0; if ($iSecond) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $hourSelected = convertSecondToTime($iSecond,'hour'); + $hourSelected = convertSecondToTime($iSecond,'allhour'); $minSelected = convertSecondToTime($iSecond,'min'); } - print ''; + for ($hour = 0; $hour < 25; $hour++) // For a duration, we allow 24 hours + { + print '"; + } + print ""; } - print ""; - print "H  "; + elseif ($typehour=='text') + { + print ''; + } + print $langs->trans('Hours'). " "; print '"; - print "M "; + print $langs->trans('Minutes'). " "; } @@ -3569,15 +3741,17 @@ class Form * @param int $translate Translate and encode value * @param int $maxlen Length maximum for labels * @param int $disabled Html select box is disabled + * @param int $sort 'ASC' or 'DESC' =Sort on label, '' or 'NONE'=Do not sort + * @param string $morecss Add more class to css styles * @return string HTML select string */ - function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0) + function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='') { global $langs; if ($value_as_key) $array=array_combine($array, $array); - $out=''; if ($show_empty) { @@ -3586,28 +3760,30 @@ class Form if (is_array($array)) { + // Translate + if ($translate) + { + foreach($array as $key => $value) $array[$key]=$langs->trans($value); + } + + // Sort + if ($sort == 'ASC') asort($array); + elseif ($sort == 'DESC') arsort($array); + foreach($array as $key => $value) { $out.='\n"; @@ -3787,7 +3963,7 @@ class Form * Return a HTML area with the reference of object and a navigation bar for a business object * To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria. * - * @param Object $object Object to show + * @param object $object Object to show * @param string $paramid Name of parameter to use to name the id into the URL link * @param string $morehtml More html content to output just before the nav bar * @param int $shownav Show Condition (navigation is shown if value is 1) @@ -3904,6 +4080,11 @@ class Form if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo; if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; + }else { + $dir=$conf->$modulepart->dir_output; + if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo; + if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility + $email=$object->email; } if ($dir) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index ef8422a7dbc..43a06fead4e 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -144,7 +144,7 @@ class FormActions global $bc; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - + $listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement); if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions'); diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 59b69e1265c..76b2810d59b 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -191,7 +191,7 @@ class FormCompany * @param string $htmlname Id of department * @return void */ - function select_departement($selected='',$country_codeid=0, $htmlname='departement_id') + function select_departement($selected='',$country_codeid=0, $htmlname='state_id') { print $this->select_state($selected,$country_codeid, $htmlname); } @@ -203,12 +203,12 @@ class FormCompany * un code donnee mais dans ce cas, le champ pays differe). * Ainsi les liens avec les departements se font sur un departement independemment de son nom. * - * @param string $selected Code state preselected + * @param string $selected Code state preselected (mus be state id) * @param string $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show * @param string $htmlname Id of department - * @return void + * @return string String with HTML select */ - function select_state($selected='',$country_codeid=0, $htmlname='departement_id') + function select_state($selected='',$country_codeid=0, $htmlname='state_id') { global $conf,$langs,$user; @@ -257,7 +257,8 @@ class FormCompany } } - if ($selected > 0 && $selected == $obj->rowid) + if ((! empty($selected) && $selected == $obj->rowid) + || (empty($selected) && ! empty($conf->global->MAIN_FORCE_DEFAULT_STATE_ID) && $conf->global->MAIN_FORCE_DEFAULT_STATE_ID == $obj->rowid)) { $out.= ''; + $num = $db->num_rows($resql); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($resql); + // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && ! $user->rights->societe->lire) + { + // Do nothing + } + else + { + $labeltoshow=dol_trunc($obj->ref,18); + //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; + //else $labeltoshow.=' ('.$langs->trans("Private").')'; + if (!empty($selected) && $selected == $obj->rowid && $obj->statut > 0) + { + print ''; + } + else + { + $disabled=0; + if (! $obj->statut > 0) + { + $disabled=1; + $labeltoshow.=' ('.$langs->trans("Draft").')'; + } + if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid)) + { + $disabled=1; + $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany"); + } + + if ($hideunselectables && $disabled) + { + $resultat=''; + } + else + { + $resultat=''; + } + print $resultat; + } + } + $i++; + } + } + print ''; + $db->free($resql); + return $num; + } + else + { + dol_print_error($db); + return -1; + } + } +} +?> \ No newline at end of file diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index b6747e04a56..bce8d9f041e 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -1,30 +1,30 @@ -* -* 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 . -*/ + * + * 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 . + */ /** - * \file cron/class/html.formcron.class.php -* \brief Fichier de la classe des fonctions predefinie de composants html cron -*/ + * \file core/class/html.formcron.class.php + * \brief Fichier de la classe des fonctions predefinie de composants html cron + */ /** * Class to manage building of HTML components -*/ + */ class FormCron extends Form { var $db; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 997f73c4c71..88a931a3d8a 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1,7 +1,10 @@ +/* Copyright (c) 2008-2013 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (c) 2010 Juanjo Menent + * Copyright (c) 2013 Charles-Fr BENKE + * Copyright (C) 2013 Cédric Salvador + * Copyright (c) 2014 Marcos García * * 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 @@ -58,64 +61,71 @@ class FormFile * @param int $perm Value of permission to allow upload * @param int $size Length of input file area * @param Object $object Object to use (when attachment is done on an element) - * @param string $options Options - * @param boolean $useajax Use ajax if enabled + * @param string $options Add an option column + * @param boolean $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. + * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' + * @param string $linkfiles 1=Also add form to link files, 0=Do not show form to link files + * @param string $htmlname Name and id of HTML form * @return int <0 if KO, >0 if OK */ - function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=true) + function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile') { - global $conf,$langs; + global $conf,$langs, $hookmanager; + $hookmanager->initHooks(array('formfile')); if (! empty($conf->browser->phone)) return 0; - if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) + if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2)) { - return $this->_formAjaxFileUpload($object); + // TODO: Cheeck this works with 2 forms on same page + // TODO: Cheeck this works with GED module, otherwise, force useajax to 0 + // TODO: This does not support option savingdocmask + // TODO: This break feature to upload links too + return $this->_formAjaxFileUpload($object); } else - { + { $maxlength=$size; - print "\n\n\n"; + $out = "\n\n\n"; if (empty($title)) $title=$langs->trans("AttachANewFile"); if ($title != 'none') print_titre($title); - print '
    '; - print ''; - print ''; - print ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; - print ''; - print ''; + $out .= '
    '; + $out .= ''; - if (! empty($options)) print ''; + if (! empty($options)) $out .= ''; - print '"; - print "
    '.$options.''.$options.''; + $out .= ''; $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp=@ini_get('upload_max_filesize'); // En inconnu if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024; - if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp; // Now $max and $maxphp are in Kb if ($maxphp > 0) $max=min($max,$maxphp); if ($max > 0) { - print ''; + $out .= ''; } - print 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':''); - print '>'; - print '   '; - print 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':''); - print '>'; + $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':''); + $out .= '>'; + $out .= '   '; + $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':''); + $out .= '>'; if ($addcancel) { - print '   '; - print ''; + $out .= '   '; + $out .= ''; } if (! empty($conf->global->MAIN_UPLOAD_DOC)) @@ -123,22 +133,73 @@ class FormFile if ($perm) { $langs->load('other'); - print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); - print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); - print ')'; + $out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); + $out .= ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + $out .= ')'; } } else { - print ' ('.$langs->trans("UploadDisabled").')'; + $out .= ' ('.$langs->trans("UploadDisabled").')'; } - print "
    "; + $out .= "
    '.$options.''; + $out .= ' '.$langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/',$langs->transnoentitiesnoconv("OriginFileName"),$savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); + $out .= '
    "; + + $out .= ''; + if (empty($sectionid)) $out .= '
    '; + + $out .= "\n\n"; + + if ($linkfiles) + { + $out .= "\n\n"; + $langs->load('link'); + $title = $langs->trans("LinkANewFile"); + $out .= load_fiche_titre($title, null, null); + $out .= '
    '; + $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm); + $res = $hookmanager->executeHooks('formattachOptions',$parameters,$object); + + $out .= "\n\n"; + } + + if (empty($res)) + { + print $out; + } + + print $hookmanager->resPrint; return 1; } @@ -148,7 +209,7 @@ class FormFile * Show the box with list of available documents for object * * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $filename Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete) + * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Directory to scan * @param string $urlsource Url of origin page (for return) * @param int $genallowed Generation is allowed (1/0 or array of formats) @@ -163,13 +224,12 @@ class FormFile * @param string $title Title to show on top of form * @param string $buttonlabel Label on submit button * @param string $codelang Default language code to use on lang combo box if multilang is enabled - * @param boolean $printer Printer Icon * @return int <0 if KO, number of shown files if OK */ - function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$printer=false) + function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') { $this->numoffiles=0; - print $this->showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang,$printer); + print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang); return $this->numoffiles; } @@ -177,8 +237,8 @@ class FormFile * Return a string to show the box with list of available documents for object. * This also set the property $this->numoffiles * - * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $filename Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete) + * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...) + * @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Directory to scan * @param string $urlsource Url of origin page (for return) * @param int $genallowed Generation is allowed (1/0 or array list of templates) @@ -193,27 +253,27 @@ class FormFile * @param string $title Title to show on top of form * @param string $buttonlabel Label on submit button * @param string $codelang Default language code to use on lang combo box if multilang is enabled - * @param boolean $printer Printer Icon + * @param string $morepicto Add more HTML content into cell with picto * @return string Output string with HTML array of documents (might be empty string) */ - function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$printer=false) + function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='') { - // filedir = conf->...dir_ouput."/".get_exdir(id) - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - global $langs,$conf,$hookmanager; + global $langs,$conf,$user,$hookmanager; global $bc; + // filedir = $conf->...->dir_ouput."/".get_exdir(id) + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + // For backward compatibility if (! empty($iconPDF)) { - return $this->getDocumentsLink($modulepart, $filename, $filedir); + return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); } - + $printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false; + $hookmanager->initHooks(array('formfile')); $forname='builddoc'; $out=''; $var=true; - //$filename = dol_sanitizeFileName($filename); //Must be sanitized before calling show_documents $headershown=0; $showempty=0; $i=0; @@ -224,7 +284,7 @@ class FormFile $out.= "\n".''."\n"; //print 'filedir='.$filedir; - // Affiche en-tete tableau + // Show table if ($genallowed) { $modellist=array(); @@ -302,6 +362,15 @@ class FormFile $modellist=ModelePDFProjects::liste_modeles($this->db); } } + elseif ($modulepart == 'project_task') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php'; + $modellist=ModelePDFTask::liste_modeles($this->db); + } + } elseif ($modulepart == 'export') { if (is_array($genallowed)) $modellist=$genallowed; @@ -383,19 +452,6 @@ class FormFile $buttonlabeltoshow=$buttonlabel; if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); - -// Keep this. Used for test with jmobile -/*print ' -
    - -
    -';*/ - if (empty($noform)) $out.= '
    '; $out.= ''; $out.= ''; @@ -427,7 +483,7 @@ class FormFile // Language code (if multilang) $out.= ''; - if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang) + if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty)) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin=new FormAdmin($this->db); @@ -441,8 +497,9 @@ class FormFile $out.= ''; // Button - $out.= ''; - $genbutton = ''; + $genbutton = 'transnoentitiesnoconv("WarningNoDocumentModelActivated")); } if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; + if (empty($modellist) && ! $showempty && $modulepart != 'unpaid') $genbutton=''; $out.= $genbutton; $out.= ''; - if ($printer) $out.= ''; - + if($hookmanager->hooks['formfile']) + { + foreach($hookmanager->hooks['formfile'] as $module) + { + if(method_exists($module, 'formBuilddocLineOptions')) $out .= ''; + } + } $out.= ''; // Execute hooks @@ -486,16 +549,19 @@ class FormFile // Define relative path for download link (depends on module) $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... + if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture... // Autre cas - if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; } + if ($modulepart == 'donation') { $relativepath = get_exdir($modulesubdir,2).$file["name"]; } if ($modulepart == 'export') { $relativepath = $file["name"]; } $out.= ""; + $documenturl = DOL_URL_ROOT.'/document.php'; + if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) $documenturl=$conf->global->DOL_URL_ROOT_DOCUMENT_PHP; + // Show file name with link to download $out.= ''; - $out.= ''; - if ($delallowed) + if ($delallowed || $printer || $morepicto) { $out.= ''; - $out.= ''.img_delete().''; - } - // Printer Icon - if ($printer) - { - $out.= ''; - $out.= ' '.img_printer().''; + if ($delallowed) + { + $out.= ''.img_picto($langs->trans("Delete"), 'delete.png').''; + //$out.=''; + } + if ($printer) + { + //$out.= ''; + $out.= ' '.img_picto($langs->trans("Print"),'printer.png').''; + } + if ($morepicto) + { + $morepicto=preg_replace('/__FILENAMEURLENCODED__/',urlencode($relativepath),$morepicto); + $out.=$morepicto; + } + $out.=''; } - $out.= ''; + + if (is_object($hookmanager)) + { + $parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart,'relativepath'=>$relativepath); + $res = $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file); + if (empty($res)) + { + $out .= $hookmanager->resPrint; // Complete line + $out.= ''; + } + else $out = $hookmanager->resPrint; // Replace line + } } + if (count($file_list) == 0 && $headershown) + { + $out.=''.$langs->trans("None").''; + } + $this->numoffiles++; } } @@ -553,11 +644,11 @@ class FormFile * Show only Document icon with link * * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $filename Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete) + * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Directory to scan * @return string Output string with HTML link of documents (might be empty string) */ - function getDocumentsLink($modulepart, $filename, $filedir) + function getDocumentsLink($modulepart, $modulesubdir, $filedir) { if (! function_exists('dol_dir_list')) include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -565,10 +656,10 @@ class FormFile $this->numoffiles=0; - $file_list=dol_dir_list($filedir, 'files', 0, preg_quote($filename.'.pdf','/'), '\.meta$|\.png$'); + $file_list=dol_dir_list($filedir, 'files', 0, preg_quote($modulesubdir.'.pdf','/'), '\.meta$|\.png$'); // For ajax treatment - $out.= '
    '.img_picto('', 'refresh').'
    '."\n"; + $out.= '
    '.img_picto('', 'refresh').'
    '."\n"; if (! empty($file_list)) { @@ -577,10 +668,10 @@ class FormFile { // Define relative path for download link (depends on module) $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... + if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture... // Autre cas if ($modulepart == 'donation') { - $relativepath = get_exdir($filename,2).$file["name"]; + $relativepath = get_exdir($modulesubdir,2).$file["name"]; } if ($modulepart == 'export') { $relativepath = $file["name"]; @@ -614,12 +705,13 @@ class FormFile * @param int $permtodelete Permission to delete * @param int $useinecm Change output for use in ecm module * @param string $textifempty Text to show if filearray is empty ('NoFileFound' if not defined) - * @param int $maxlength Maximum length of file name shown + * @param int $maxlength Maximum length of file name shown * @param string $title Title before list * @param string $url Full url to use for click links ('' = autodetect) + * @param int $showrelpart 0=Show only filename (default), 1=Show first level 1 dir * @return int <0 if KO, nb of files shown if OK */ - function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='') + function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0) { global $user, $conf, $langs, $hookmanager; global $bc; @@ -675,7 +767,12 @@ class FormFile { // Define relative path used to store the file if (empty($relativepath)) + { $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; + if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath + if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath + if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.'; + } $var=!$var; print ''; @@ -684,8 +781,18 @@ class FormFile print ''; + $filepath=$relativepath.$file['name']; + /* Restore old code: When file is at level 2+, full relative path (and not only level1) must be into url + if ($file['level1name'] <> $object->id) + $filepath=$object->id.'/'.$file['level1name'].'/'.$file['name']; + else + $filepath=$object->id.'/'.$file['name']; + */ + print '&file='.urlencode($filepath); + print '">'; + print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' '; + if ($showrelpart == 1) print $relativepath; print dol_trunc($file['name'],$maxlength,'middle'); print ''; print "\n"; @@ -694,9 +801,10 @@ class FormFile // Preview if (empty($useinecm)) { + $fileinfo = pathinfo($file['name']); + print ''; - $tmp=explode('.',$file['name']); - $minifile=$tmp[0].'_mini.'.$tmp[1]; + $minifile=$fileinfo['filename'].'_mini.'.$fileinfo['extension']; // Thumbs are created with filename in lower case if (image_format_supported($file['name']) > 0) print ''; else print ' '; print ''; @@ -704,8 +812,22 @@ class FormFile // Delete or view link // ($param must start with &) print ''; - if ($useinecm) print ''.img_view().'   '; - if ($permtodelete) print ''.img_delete().''; + if ($useinecm) print ''.img_view().'   '; + if ($permtodelete) + { + /* + if ($file['level1name'] <> $object->id) + $filepath=$file['level1name'].'/'.$file['name']; + else + $filepath=$file['name']; + */ + $useajax=1; + if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; + if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; + + print ''.img_delete().''; + } else print ' '; print ""; print "\n"; @@ -728,7 +850,7 @@ class FormFile /** * Show list of documents in a directory * - * @param string $upload_dir Directory that was scanned + * @param string $upload_dir Directory that was scanned * @param array $filearray Array of files loaded by dol_dir_list function before calling this function * @param string $modulepart Value for modulepart used by download wrapper * @param string $param Parameters on sort links @@ -738,7 +860,7 @@ class FormFile * @param int $useinecm Change output for use in ecm module * @param int $textifempty Text to show if filearray is empty * @param int $maxlength Maximum length of file name shown - * @param string $url Full url to use for click links ('' = autodetect) + * @param string $url Full url to use for click links ('' = autodetect) * @return int <0 if KO, nb of files shown if OK */ function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$url='') @@ -930,6 +1052,141 @@ class FormFile } + /** + * Show array with linked files + * + * @param Object $object Object + * @param int $permtodelete Deletion is allowed + * @param string $action Action + * @param string $selected ??? + * @param string $param More param to add into URL + * @return int Number of links + */ + public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='') + { + global $user, $conf, $langs, $user; + global $bc; + global $sortfield, $sortorder; + + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $link = new Link($this->db); + $links = array(); + if ($sortfield == "name") { + $sortfield = "label"; + } elseif ($sortfield == "date") { + $sortfield = "datea"; + } else { + $sortfield = null; + } + $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); + $param .= (isset($object->id)?'&id=' . $object->id : ''); + + // Show list of associated links + print_titre($langs->trans("LinkedFiles")); + + print ''; + + print ''; + print ''; + print_liste_field_titre( + $langs->trans("Links"), + $_SERVER['PHP_SELF'], + "name", + "", + $param, + 'align="left"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + "", + "", + "", + "", + "", + 'align="right"' + ); + print_liste_field_titre( + $langs->trans("Date"), + $_SERVER['PHP_SELF'], + "date", + "", + $param, + 'align="center"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + '', + $_SERVER['PHP_SELF'], + "", + "", + $param, + 'align="center"' + ); + print_liste_field_titre('','',''); + print ''; + $nboflinks = count($links); + if ($nboflinks > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + + $var = true; + foreach ($links as $link) + { + $var =! $var; + print ''; + //edit mode + if ($action == 'update' && $selected === $link->id) + { + print ''; + print ''; + print ''; + print ''; + print ''; + } + else + { + print ''."\n"; + print ''; + print ''; + print ''; + print ''; + } + print "\n"; + } + if ($nboflinks == 0) + { + print ''; + } + print "
    '; + print ''; + print ''; + print ''; + print $langs->trans('Link') . ': '; + print ''; + print $langs->trans('Label') . ': '; + print '' . dol_print_date(dol_now(), "dayhour", "tzuser") . ''; + print ''; + print ''; + print ''; + print ''; + print $link->label; + print ''; + print '' . dol_print_date($link->datea, "dayhour", "tzuser") . ''; + print '' . img_edit() . ''; // id= is included into $param + if ($permtodelete) { + print '   ' . img_delete() . ''; // id= is included into $param + } else { + print ' '; + } + print '
    '; + print $langs->trans("NoLinkFound"); + print '
    "; + + print '
    '; + + return $nboflinks; + } + } ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 37ad8a6384c..c39c5f05277 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -46,8 +46,8 @@ class FormMail var $withsubstit; // Show substitution array var $withfrom; - var $withto; - var $withtofree; + var $withto; // Show recipient emails + var $withtofree; // Show free text for recipient emails var $withtocc; var $withtoccc; var $withtopic; @@ -76,7 +76,7 @@ class FormMail * @param DoliDB $db Database handler */ function __construct($db) - { + { $this->db = $db; $this->withform=1; @@ -432,7 +432,7 @@ class FormMail if (! empty($this->withtocc) && is_array($this->withtocc)) { $out.= " ".$langs->trans("or")." "; - $out.= $form->selectarray("receivercc", $this->withto, GETPOST("receivercc"), 1); + $out.= $form->selectarray("receivercc", $this->withtocc, GETPOST("receivercc"), 1); } } $out.= "\n"; @@ -454,7 +454,7 @@ class FormMail if (! empty($this->withtoccc) && is_array($this->withtoccc)) { $out.= " ".$langs->trans("or")." "; - $out.= $form->selectarray("receiverccc", $this->withto, GETPOST("receiverccc"), 1); + $out.= $form->selectarray("receiverccc", $this->withtoccc, GETPOST("receiverccc"), 1); } } //if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1); @@ -493,7 +493,7 @@ class FormMail } else { - $out.= 'withtopic) .'" />'; + $out.= 'withtopic)?'':$this->withtopic)) .'" />'; } $out.= "\n"; } @@ -554,7 +554,8 @@ class FormMail elseif ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } elseif ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } elseif ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; } + elseif ($this->param["models"]=='thirdparty') { $defaultmessage=$langs->transnoentities("PredefinedMailContentThirdparty"); } + elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; } // Complete substitution array if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) @@ -566,18 +567,26 @@ class FormMail if ($this->param["models"]=='order_send') { $url=getPaypalPaymentUrl(0,'order',$this->substit['__ORDERREF__']); - $this->substit['__PERSONALIZED__']=$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url); + $this->substit['__PERSONALIZED__']=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url)); } if ($this->param["models"]=='facture_send') { $url=getPaypalPaymentUrl(0,'invoice',$this->substit['__FACREF__']); - $this->substit['__PERSONALIZED__']=$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url); + $this->substit['__PERSONALIZED__']=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url)); } } + $defaultmessage=str_replace('\n',"\n",$defaultmessage); + + // Deal with format differences between message and signature (text / HTML) + if(dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) { + $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']); + } else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) { + $defaultmessage = dol_nl2br($defaultmessage); + } + $defaultmessage=make_substitutions($defaultmessage,$this->substit); if (isset($_POST["message"])) $defaultmessage=$_POST["message"]; - $defaultmessage=str_replace('\n',"\n",$defaultmessage); $out.= ''; $out.= ''.$langs->trans("MailText").''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index b45e4d0d308..5150f2d4e41 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -347,31 +347,34 @@ class FormOther * @param string $selected Preselected value * @param string $htmlname Name of combo list (example: 'search_sale') * @param User $user Object user + * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @return string Html combo list code */ - function select_salesrepresentatives($selected,$htmlname,$user) + function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0) { - global $conf; + global $conf,$langs; + $langs->load('users'); // Select each sales and print them in a select input $moreforfilter =''; } else @@ -435,17 +460,18 @@ class FormOther } /** - * Write all lines of a project (if parent = 0) + * Write lines of a project (all lines of a project if parent = 0) * * @param int &$inc Cursor counter - * @param int $parent Id parent - * @param Object $lines Line object + * @param int $parent Id of parent task we want to see + * @param array $lines Array of task lines * @param int $level Level * @param int $selectedtask Id selected task * @param int $selectedproject Id selected project + * @param int $disablechildoftaskid 1=Disable task that are child of the provided task id * @return void */ - private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0) + private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0) { global $langs, $user, $conf; @@ -454,14 +480,16 @@ class FormOther $numlines=count($lines); for ($i = 0 ; $i < $numlines ; $i++) { - if ($lines[$i]->fk_parent == $parent) + if ($lines[$i]->fk_parent == $parent) { $var = !$var; + //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines + // Break on a new project - if ($parent == 0) + if ($parent == 0) // We are on a task at first level { - if ($lines[$i]->fk_project != $lastprojectid) + if ($lines[$i]->fk_project != $lastprojectid) // Break found on project { if ($i > 0 && $conf->browser->firefox) print ''; print '