mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 17:02:34 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab2517d538 | ||
|
|
9fc440df7b | ||
|
|
f652a4d807 | ||
|
|
a6bb785b5f | ||
|
|
555a49d66e | ||
|
|
5a7fe6b4a7 | ||
|
|
0e54780377 | ||
|
|
7fc052ce19 | ||
|
|
a59a0151fb | ||
|
|
fce34301f9 | ||
|
|
1f3f6cc7b8 | ||
|
|
565fb615bc | ||
|
|
a7c246cec1 | ||
|
|
1ddf9f6ac5 | ||
|
|
a9d5363799 | ||
|
|
e654dac578 | ||
|
|
8653f3f026 | ||
|
|
5fbb967941 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,7 +3,7 @@ htdocs/conf/conf.php.old
|
||||
documents/
|
||||
custom/
|
||||
custom2/
|
||||
test/report/
|
||||
test/
|
||||
nbproject
|
||||
default.properties
|
||||
.settings/
|
||||
|
||||
@@ -41,7 +41,7 @@ before_script:
|
||||
- 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.3.0.sql; fi"
|
||||
- echo Create config file htdocs/conf/conf.php
|
||||
- echo '<?php ' > htdocs/conf/conf.php
|
||||
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
|
||||
|
||||
64
COPYRIGHT
64
COPYRIGHT
@@ -9,39 +9,36 @@ More information: http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
Dolibarr uses some external libraries released under different licences. This is compatibility summary:
|
||||
|
||||
Composant Version License Compatible GPL Usage
|
||||
Composant Version License Compatible GPL Usage
|
||||
----------------------------------------------------------------------------
|
||||
PHP libraries:
|
||||
AdoDb-Date 0.21 Modified BSD License Yes Date convertion (not into rpm package)
|
||||
CKEditor 3.6.4 LGPL-2.1+ Yes Editor WYSIWYG
|
||||
FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management (with FPDF_TPL 1.2)
|
||||
GeoIP 2004 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||
OdtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
|
||||
PHPExcel 1.7.6 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
||||
TCPDF 5.9.180 LGPL-3+ Yes PDF generation
|
||||
AdoDb-Date 0.21 Modified BSD License Yes Date convertion (not into rpm package)
|
||||
CKEditor 3.6.4 LGPL-2.1+ Yes Editor WYSIWYG
|
||||
FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management (with FPDF_TPL 1.2)
|
||||
GeoIP 2004 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||
OdtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
|
||||
PHPExcel 1.7.6 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||
TCPDF 5.9.180 LGPL-3+ Yes PDF generation
|
||||
|
||||
JS libraries:
|
||||
jQuery 1.8.2 MIT Licence Yes JS library
|
||||
jQuery UI 1.9.1 GPL and MIT Licence Yes JS library plugin UI
|
||||
jQuery blockUI 2.43 GPL and MIT Licence Yes JS library plugin blockUI (to use ajax popups)
|
||||
jQuery Colorpicker 1.1 MIT Licence Yes JS library for color picker for a defined list of colors
|
||||
jQuery DataTables 1.9.4 BSD Yes JS library for tables output
|
||||
jQuery FileUpload 5.0.3 GPL and MIT Licence Yes JS library to upload files
|
||||
jQuery Flot 0.7 MIT Licence Yes JS library to build graph
|
||||
jQuery JCrop 0.9.8 GPL and MIT Licence Yes JS library plugin Crop (to crop images)
|
||||
jQuery jeditable 1.7.1 GPL and MIT Licence Yes JS library plugin jeditable (to edit in place)
|
||||
jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups)
|
||||
jQuery jPicker 1.1.00 GPL and MIT Licence Yes JS library for color picker with not defined list of colors
|
||||
jQuery jqueryFileTree 1.0.1 GPL and MIT Licence Yes JS library for color picker with not defined list of colors
|
||||
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 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)
|
||||
jQuery 1.8.2 MIT Licence Yes JS library
|
||||
jQuery UI 1.9.1 GPL and MIT Licence Yes JS library plugin UI
|
||||
jQuery Timepicker 1.1.0 GPL and MIT Licence Yes JS library Timepicker addon for Datepicker
|
||||
jQuery Colorpicker 1.1 MIT Licence Yes JS library for color picker for a defined list of colors
|
||||
jQuery DataTables 1.9.1 BSD Yes JS library for tables output
|
||||
jQuery Flot 0.7 MIT Licence Yes JS library to build graph
|
||||
jQuery FileUpload 5.0.3 GPL and MIT Licence Yes JS library to upload files
|
||||
jQuery JCrop 0.9.8 GPL and MIT Licence Yes JS library plugin Crop (to crop images)
|
||||
jQuery jeditable 1.7.1 GPL and MIT Licence Yes JS library plugin jeditable (to edit in place)
|
||||
jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups)
|
||||
jQuery blockUI 2.43 GPL and MIT Licence Yes JS library plugin blockUI (to use ajax popups)
|
||||
jQuery jPicker 1.1.00 GPL and 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 TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows)
|
||||
jQuery Mobile 1.3.0 GPL and MIT Licence Yes JS library for smartphone (not used)
|
||||
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)
|
||||
|
||||
For licenses compatibility informations:
|
||||
http://www.fsf.org/licensing/licenses/index_html
|
||||
@@ -53,24 +50,20 @@ Copyright
|
||||
Copyright (C) 2013
|
||||
- Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Jean-François Ferry <jfefe@aternatik.fr>
|
||||
- Marcos García <marcosgdf@gmail.com>
|
||||
- Philippe Grand <philippe.grand@atoo-net.com>
|
||||
- Florian Henry <florian.henry@open-concept.pro>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Maxime Kohlhaas <mko@atm-consulting.fr>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
|
||||
Copyright (C) 2012
|
||||
- Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Jean-François Ferry <jfefe@aternatik.fr>
|
||||
- Marcos García <marcosgdf@gmail.com>
|
||||
- Philippe Grand <philippe.grand@atoo-net.com>
|
||||
- Jean Heimburger <jean@tiaris.info>
|
||||
- Florian Henry <florian.henry@open-concept.pro>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Maxime Kohlhaas <mko@atm-consulting.fr>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
- Nicolas Péré <nicolas@amarok2.net>
|
||||
|
||||
@@ -127,12 +120,11 @@ Copyright (C) 2005
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
|
||||
Copyright (C) 2004
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
- Eric Seigne <erics@rycks.com>
|
||||
- Benoit Mortier <benoit.mortier@opensides.be>
|
||||
- Christophe Combelles <ccomb@free.fr>
|
||||
- Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
- Christophe Combelles <ccomb@free.fr>
|
||||
|
||||
Copyright (C) 2003
|
||||
- Jean-Louis Bergamo <jlb@j1b.org>
|
||||
|
||||
160
ChangeLog
160
ChangeLog
@@ -2,143 +2,28 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
|
||||
Fix: Display buying price on line edit when no supplier price is defined
|
||||
Fix: Retrieving of margin info when invoice created automatically from order
|
||||
Fix: Reordering supplier products in list by supplier or supplier ref was crashing
|
||||
Fix: [ bug #1029 ] Tulip numbering mask
|
||||
Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card
|
||||
Fix: [ bug #1033 ] SUPPLIER REF disappeared
|
||||
Fix: update extrafield do not display immediatly after update
|
||||
Fix: Fix bug with canvas thirdparty
|
||||
Fix: [ bug #1037 ] Consumption> Supplier invoices related
|
||||
Fix: User group name do not display in card (view or edit mode)
|
||||
Fix: Link "Show all supplier invoice" on suplier card not working
|
||||
Fix: [ bug #1039 ] Pre-defined invoices conversion
|
||||
Fix: If only service module is activated, it's impossible to delete service
|
||||
Fix: [ bug #1043 ] Bad interventions ref numbering
|
||||
Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted
|
||||
Fix: Localtaxes balance not showing
|
||||
Fix: Intervention box links to contracts id
|
||||
Fix: Compatiblity with multicompany module
|
||||
Fix: Edit propal line was losing product supplier price id
|
||||
Fix: Delete linked element to supplier invoice when deleted
|
||||
Fix: [ bug #1061 ] Bad info shipped products
|
||||
Fix: [ bug #1062 ] Documents lost in propals and contracts validating
|
||||
Fix: Supplier price displayed on document lines and margin infos didnt take discount
|
||||
Fix: sorting on qty did not work in supplier product list
|
||||
Fix: there was no escaping on filter fields in supplier product list
|
||||
Fix: bugs on margin reports and better margin calculation on credit notes
|
||||
Qual: Add travis-ci integration
|
||||
|
||||
|
||||
***** ChangeLog for 3.4 compared to 3.3.* *****
|
||||
For users:
|
||||
- New: Can use ODS templates as document templates.
|
||||
- New: Add link to autofill/reset with quantity to ship when creating a
|
||||
delivery receipt.
|
||||
- New: Event into calendar use different colors for different users.
|
||||
- New: Support revenue stamp onto invoices.
|
||||
- New: Add a tab "consumption" on thirdparties to list products bought/sells.
|
||||
- New: Some performance enhancements.
|
||||
- New: Can attach files onto trip and expenses modules.
|
||||
- New: Add hidden option MAIN_PDF_TITLE_BACKGROUND_COLOR.
|
||||
- New: Merge tab customer and prospect.
|
||||
- New: Add ES formated address country rule.
|
||||
- New: Can define a hierarchical responsible on user and add a tree view to
|
||||
see hierarchy of users.
|
||||
- New: Can expand/collapse menus, categories and users list.
|
||||
- New: extra parameters are supported into ODT/ODS templates.
|
||||
- New: total per vat rate are available as tags for ODT/ODS templates.
|
||||
- New: Some part of interface use more CSS3 (ie: agenda)
|
||||
- New: [ task #707 ] Create option "ProfIdx is mandatory to validate a invoice".
|
||||
- New: Can define if we want to use VAT or not for subscriptions (foundation module).
|
||||
- New: Can define a default choice for "More action when recording a
|
||||
subscription" (foundation module).
|
||||
- New: Add link to check professional id for India.
|
||||
- New: [ task #731 ] Uniformize ref generation
|
||||
- New: [ task #748 ] Add a link "Dolibarr" into left menu
|
||||
- New: Script email_unpaid_invoices_to_representative accepts now a parameter "test"
|
||||
and a "late delay".
|
||||
- New: Can define different clicktodial setups for each user.
|
||||
- New: Add hidden option INVOICE_CAN_NEVER_BE_REMOVED.
|
||||
- New: Enhance agenda module to reach RFC2445 ("type" not enabled by default and add
|
||||
"busy" information).
|
||||
- New: Add module Opensurvey.
|
||||
- New: Default approver for holidays is set by default to hierchical parent.
|
||||
- First change to prepare feature "click to print" (IPP) for PDF.
|
||||
- New: [ task #350 ] Merge tab customer and prospect.
|
||||
- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid).
|
||||
- New: [ task #711 ] Add combobox for contact, as done for product/thirdparty.
|
||||
- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECEIPT.
|
||||
- New: [ task #743 ] GED : Add aministration option to disable autotree display.
|
||||
- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address.
|
||||
- New: [ task #768 ] WYSIWYG for all mails.
|
||||
- New: [ task #773 ] Add Project document in GED(ECM) modules.
|
||||
- New: [ task #783 ] Add more types for extra parameters (lists, phone, emails, checkbox,
|
||||
prices, radio).
|
||||
- New: [ task #798 ] Add range limit date on product/services as it is done on order
|
||||
and invoice.
|
||||
- New: [ task #814 ] Add extrafield feature for projects ands tasks.
|
||||
- New: [ task #770 ] Add ODT document generation for Projects module.
|
||||
- New: [ task #741 ] Add intervention box.
|
||||
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated.
|
||||
- New: [ task #823 ] Shipping_validate email notification.
|
||||
- New: [ task #900 ] Review code of ficheinter.class.php
|
||||
- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers
|
||||
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
|
||||
- Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
|
||||
- Fix: Expedition creation, can retreive product from other expedition
|
||||
|
||||
For translators:
|
||||
- Update language files.
|
||||
|
||||
For developers:
|
||||
- System of menu managers has been rewritten to reduce code to do same things.
|
||||
- An external module can force its theme.
|
||||
- Add function dol_set_focus('#xxx').
|
||||
- A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file.
|
||||
- Removed not used libraries.
|
||||
- More web services.
|
||||
- Renamed some database fields, code variables and parameters from french to english.
|
||||
- First change to manage margins on contracts.
|
||||
- Add hook getFormMail.
|
||||
- Function plimit of databases drivers accept -1 as value (it means default value set
|
||||
into conf->liste_limit).
|
||||
- New: Add option dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen,
|
||||
dol_no_mouse_hover and dol_use_jmobile onto login page (to support different terminal).
|
||||
- New: dol_syslog method accept a suffix to use different log files for log.
|
||||
- New: Type of fields are received by export format handlers.
|
||||
- New: when adding an action, we can define a free code to tag it for a specific need.
|
||||
- New: Enhance Dolibarr migration process to include migration script of external
|
||||
modules.
|
||||
- New: [ task #811 ] Uniformanize note field.
|
||||
|
||||
|
||||
WARNING: If you used external modules, some of them may need to be upgraded due to:
|
||||
- Fields of classes were renamed to be normalized (nom, prenom, cp, ville, adresse, tel
|
||||
were renamed into lastname, firstname, zip, town, address, phone).
|
||||
This may also be true for some fields into web services.
|
||||
- If module use hook pdf_writelinedesc, module may have to add return 1 at end of
|
||||
function to keep same behaviour.
|
||||
|
||||
TODO:
|
||||
backport commit 53672dff75f4fdaeeed037ff9d15f860968022ca to fix confirm with jmobile
|
||||
backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contract
|
||||
|
||||
***** ChangeLog for 3.3.5 compared to 3.3.4 *****
|
||||
|
||||
- Fix: Change to make debian package ok despite removal of ckeditor.
|
||||
- Fix: jcrop file to match debian rules
|
||||
- Fix: Add missing country UK.
|
||||
- Fix: Minor fix into package.
|
||||
- Fix: Add missing label on project field.
|
||||
|
||||
***** ChangeLog for 3.3.4 compared to 3.3.3 *****
|
||||
|
||||
- Fix: [ bug #1001 ] Social Contribution : State not correct
|
||||
- Fix: Better management of pdf generation when tcpdf is not available.
|
||||
- Fix: Change to be more debian compliant natively.
|
||||
|
||||
***** ChangeLog for 3.3.3 compared to 3.3.2 *****
|
||||
|
||||
- Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php
|
||||
- Fix: [ bug #934 ] Error on proformat invoice creation (pgsql)
|
||||
- Fix: [ bug #947 ] Can't create proposal lines with unit price = 0
|
||||
|
||||
***** ChangeLog for 3.3.2 compared to 3.3.1 *****
|
||||
|
||||
- Fix: Dutch (nl_NL) translation
|
||||
- Generalize fix: file with a specific mask not found, again
|
||||
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
|
||||
@@ -169,6 +54,7 @@ backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contrac
|
||||
- Fix: [ bug #806 ] Tasks are ordered alphabetically instead of chronological order
|
||||
|
||||
***** ChangeLog for 3.3.1 compared to 3.3 *****
|
||||
|
||||
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
|
||||
- Fix: Package for launchpad
|
||||
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
||||
@@ -176,7 +62,9 @@ backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contrac
|
||||
- Fix: [ bug #762 ] Bad profit calculation in Reporting
|
||||
- Fix: bug dictionnary with wrong prefix table
|
||||
|
||||
***** ChangeLog for 3.3 compared to 3.2.* *****
|
||||
|
||||
|
||||
***** ChangeLog for 3.3 compared to 3.2.3 *****
|
||||
For users:
|
||||
- New: Add holiday module, to declare and follow holidays of your employees.
|
||||
- New: Add margin management module.
|
||||
@@ -354,7 +242,7 @@ Dolibarr license has also been updated from GPLv2+ to GPLv3+.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.0 compared to 3.1.* *****
|
||||
***** ChangeLog for 3.2.0 compared to 3.1.3 *****
|
||||
WARNING: PHP lower than 5.x are no more supported.
|
||||
WARNING: Because of a major datastructure change onto supplier prices tables, be aware
|
||||
to make a backup of your database before making upgrade.
|
||||
@@ -595,7 +483,7 @@ For translators:
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.0 compared to 2.9.* *****
|
||||
***** ChangeLog for 3.0 compared to 2.9 *****
|
||||
|
||||
For users:
|
||||
- New: Can edit date of cheque receipts.
|
||||
@@ -691,7 +579,7 @@ For developers:
|
||||
- Qual: Removed deprecated code.
|
||||
|
||||
|
||||
***** ChangeLog for 2.9 compared to 2.8.* *****
|
||||
***** ChangeLog for 2.9 compared to 2.8 *****
|
||||
|
||||
For users:
|
||||
- New: POS module allow to choose which warehouse to use.
|
||||
@@ -809,7 +697,7 @@ For users:
|
||||
- Fix: bug #29526 : Numérotation Proposition Incorrecte après duplication
|
||||
|
||||
|
||||
***** ChangeLog for 2.8 compared to 2.7.* *****
|
||||
***** ChangeLog for 2.8 compared to 2.7 *****
|
||||
|
||||
For users:
|
||||
- New: Support note on trips module
|
||||
@@ -873,7 +761,7 @@ For users:
|
||||
- Fix: Update member photo.
|
||||
|
||||
|
||||
***** ChangeLog for 2.7 compared to 2.6.* *****
|
||||
***** ChangeLog for 2.7 compared to 2.6 *****
|
||||
|
||||
For users:
|
||||
- New: Add a print icon to show a page to print without menus.
|
||||
@@ -972,7 +860,7 @@ For developers:
|
||||
- All install files are now in same directory /install.
|
||||
|
||||
|
||||
***** ChangeLog for 2.6 compared to 2.5.* *****
|
||||
***** ChangeLog for 2.6 compared to 2.5 *****
|
||||
|
||||
For users:
|
||||
- New: Add filter on status in emailing selector for Dolibarr users.
|
||||
@@ -1055,7 +943,7 @@ For developers:
|
||||
- First change for future geoip module.
|
||||
|
||||
|
||||
***** ChangeLog for 2.5 compared to 2.4.* *****
|
||||
***** ChangeLog for 2.5 compared to 2.4 *****
|
||||
|
||||
For users:
|
||||
- Sessions timeout can be configured to overwrite PHP setup.
|
||||
@@ -1119,7 +1007,7 @@ For developers:
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 2.4 compared to 2.2.* *****
|
||||
***** ChangeLog for 2.4 compared to 2.2 *****
|
||||
|
||||
For users:
|
||||
- Add a calendar module (module agenda) with ical/vcal/rss export.
|
||||
@@ -1174,7 +1062,7 @@ For developers:
|
||||
Windows with Apache and Mysql included.
|
||||
|
||||
|
||||
***** ChangeLog for 2.2 compared to 2.1.* *****
|
||||
***** ChangeLog for 2.2 compared to 2.1 *****
|
||||
|
||||
- Add more statistics on main page.
|
||||
- Add option to add message on login page.
|
||||
@@ -1208,7 +1096,7 @@ For developers:
|
||||
- Can drag and drop boxes on main page.
|
||||
|
||||
|
||||
***** ChangeLog for 2.1 compared to 2.0.* *****
|
||||
***** ChangeLog for 2.1 compared to 2.0.1 *****
|
||||
|
||||
- Added a better installer.
|
||||
- Support user and groups permissions.
|
||||
@@ -1279,7 +1167,7 @@ Minor bug fixes
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 2.0 compared to 1.0.* *****
|
||||
***** ChangeLog for 2.0 compared to 1.0 *****
|
||||
|
||||
ChangeLog file size is so important, that it is not included inside Dolibarr
|
||||
package. You can find it at www.dolibarr.org
|
||||
|
||||
5
README
5
README
@@ -92,7 +92,7 @@ Main modules/features:
|
||||
- Payments management
|
||||
- Standing orders management
|
||||
- Shipping management
|
||||
- EDM (Electronic Document Management)
|
||||
- ECM (Electronic Content Management)
|
||||
- EMailings
|
||||
- Agenda with ical,vcal export for third tools integration
|
||||
- Management of foundation members
|
||||
@@ -107,7 +107,7 @@ Other modules:
|
||||
- ClickToDial phone numbers
|
||||
- RSS
|
||||
|
||||
Miscellaneous:
|
||||
Miscellanous:
|
||||
- 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
|
||||
@@ -132,6 +132,7 @@ This is features that Dolibarr does not support completely yet:
|
||||
- No accountancy (only bank management).
|
||||
- Dolibarr manage one currency at once (mono-currency).
|
||||
- Dolibarr manage one 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).
|
||||
- Does not support double VAT (Federal / provincial) for Canada.
|
||||
- Dolibarr does not contains Payroll module.
|
||||
- Tasks on module project can't have dependencies between each other.
|
||||
- Dolibarr does not include any Webmail.
|
||||
|
||||
28
README-FR
28
README-FR
@@ -78,34 +78,35 @@ IV - CE QUE DOLIBARR PEUT FAIRE
|
||||
-------------------------------
|
||||
|
||||
Modules principaux:
|
||||
- Annuaires des prospects et/ou client et/ou fournisseurs
|
||||
- Gestion de catalogue de produits et services
|
||||
- Gestion de stock
|
||||
- Gestion des comptes bancaires
|
||||
- Agenda partagé
|
||||
- Annuaires des prospects et/ou client et/ou fournisseurs
|
||||
- Annuaires des contacts
|
||||
- Gestion des actions/taches avec un agenda intégré (ou lien avec webcalendar)
|
||||
- Gestion des commandes
|
||||
- Gestion des devis, propositions commerciales
|
||||
- Gestion des factures clients et fournisseurs
|
||||
- Gestion des propositions commerciales
|
||||
- Gestion de contrats de services
|
||||
- Gestion des factures clients et fournisseurs
|
||||
- Gestion des paiements
|
||||
- Gestion des virements bancaires
|
||||
- Gestion des expéditions
|
||||
- GED (Gestion Electronique de Documents)
|
||||
- EMailings de masse
|
||||
- Réalisation de sondages
|
||||
- Point de vente/Caisse enregistreuse
|
||||
|
||||
Autres modules:
|
||||
- Gestion de marque-pages
|
||||
- Gestion des promesses de dons
|
||||
- Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM)
|
||||
- Gestion des adhérents d'association
|
||||
- Gestion des dons
|
||||
- Gestion de marque-pages
|
||||
- Agenda
|
||||
- Point de vente/Caisse enregistreuse
|
||||
- Fonctions d'EMailing de masses vers les clients, prospect ou utilisateurs Dolibarr
|
||||
- Rapports
|
||||
- Imports/Exports des données
|
||||
- Fonctions d'exports
|
||||
- Connectivité LDAP
|
||||
- Export PDF de tous les éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
|
||||
- De nombreuses autres fonctionnalités issues de modules officiels ou non (AWStats, Bittorrent, Gravatar, Google, Webcalendar...)
|
||||
|
||||
Divers:
|
||||
Miscellanous:
|
||||
- Application multi-utilisateurs avec différents niveaux de permissions par module.
|
||||
- Plusieurs gestionnaires de menus (possibilité de différencier les menus pour les utilisateurs internes ou externes comme les clients ou fournisseurs).
|
||||
- Application simple à utiliser.
|
||||
@@ -121,7 +122,8 @@ V - CE QUE DOLIBARR NE PEUT PAS FAIRE (TACHES A FAIRE)
|
||||
Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
|
||||
- Pas de compta analytique (uniquement gestion de trésorerie).
|
||||
- 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 gère en standard qu'une société/institution/association (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.
|
||||
- Ne gère pas la double tva (Fédérale / provinciale) du canada.
|
||||
- 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.
|
||||
- Dolibarr ne contient pas de Webmail.
|
||||
|
||||
33
README.md
33
README.md
@@ -75,37 +75,35 @@ See ChangeLog file found into package.
|
||||
|
||||
### Main modules/features:
|
||||
|
||||
- Customers, Prospects or Suppliers directory
|
||||
- Products and services catalog
|
||||
- Customers, Prospects or Suppliers directory
|
||||
- Address book
|
||||
- Stock management
|
||||
- Bank accounts management
|
||||
- Orders management with PDF export
|
||||
- Commercial proposals management
|
||||
- Commercial proposals management with PDF export
|
||||
- Contracts management
|
||||
- Invoices management
|
||||
- Invoices management with PDF export
|
||||
- Payments management
|
||||
- Standing orders management
|
||||
- Shipping management
|
||||
- ECM (Electronic Content Management)
|
||||
- EMailings
|
||||
- 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
|
||||
- Management of foundation members
|
||||
- Donation management
|
||||
|
||||
### Other modules:
|
||||
|
||||
- Bookmarks management
|
||||
- Donations management
|
||||
- Reporting
|
||||
- Data export/import tools
|
||||
- Can reports Dolibarr events inside Webcalendar or Phenix
|
||||
- Data export tools
|
||||
- LDAP connectivity
|
||||
- Third parties or products categories
|
||||
- ClickToDial phone numbers
|
||||
- RSS integration
|
||||
- RSS
|
||||
|
||||
### Miscellaneous:
|
||||
### Miscellanous:
|
||||
|
||||
- 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).
|
||||
@@ -125,10 +123,11 @@ See ChangeLog file found into package.
|
||||
|
||||
This is features that Dolibarr does not support completely yet:
|
||||
|
||||
- No double party accountancy (only bank management).
|
||||
- No accountancy (only bank 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 manage one 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).
|
||||
- Does not support double VAT (Federal / provincial) for Canada.
|
||||
- Dolibarr does not contains Payroll module.
|
||||
- Tasks on module project can't have dependencies between each other.
|
||||
- Dolibarr does not include any Webmail.
|
||||
- Dolibarr can't do coffee (not yet).
|
||||
- Dolibarr can't do coffee (not yet).
|
||||
70
build/README
70
build/README
@@ -7,10 +7,27 @@ All sub-directories of "build" directory contains files required to build
|
||||
automatically Dolibarr packages.
|
||||
There are several tools:
|
||||
|
||||
|
||||
|
||||
- To build full Dolibarr packages, launch the script
|
||||
> Edit version in makepack-dolibarr.pl file.
|
||||
> Launch command perl makepack-dolibarr.pl
|
||||
|
||||
Note: Prerequisites to build tgz, debian, rpm package
|
||||
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
||||
|
||||
Note: Prerequisites to build autoexe DoliWamp package:
|
||||
> Install InnoSetup
|
||||
For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
|
||||
> Install WampServer into "C:\Program Files\Wamp"
|
||||
For example by running wampserver2.2e-php5.4.3-httpd-2.4.2-mysql5.5.24-x64.exe (http://www.wampserver.com)
|
||||
> Install WampServer addon to have versions: Apache2.2.11, Mysql5.0.45, Php5.3.0
|
||||
For example by running WampServer2-APACHE2211.exe (http://www.wampserver.com)
|
||||
For example by running WampServer2-MYSQL5045.exe (http://www.wampserver.com)
|
||||
For example by running WampServer2-PHP530.exe (http://www.wampserver.com)
|
||||
> To build from Windows (running from makepack-dolibarr.pl script is however
|
||||
recommanded), open file build/exe/doliwamp.iss and click on button "Compile".
|
||||
The .exe file will be build into directory build.
|
||||
|
||||
- To build a translaction package, launch the script
|
||||
> perl makepack-dolibarrlang.pl
|
||||
|
||||
@@ -20,17 +37,6 @@ There are several tools:
|
||||
- To build a package for a module, launch the script
|
||||
> perl makepack-dolibarrmodule.pl
|
||||
|
||||
- To build an autoexe DoliWamp package:
|
||||
> Install InnoSetup (http://www.jrsoftware.org)
|
||||
> Install WampServer into "C:\Program Files\Wamp" (http://www.wampserver.com)
|
||||
> Install WampServer addon to have versions:
|
||||
Apache2.2.6, Mysql5.0.45, Php5.2.5
|
||||
> Modify file build/exe/doliwamp.iss to change variable SourceDir
|
||||
with value of Dolibarr repository.
|
||||
> Modify AppVerName and OutputBaseFilename.
|
||||
> Launch innosetup, open file build/exe/doliwamp.iss and click on
|
||||
button "Compile". The .exe file will be build into directory build.
|
||||
|
||||
- To build developper documentation, launch the script
|
||||
> perl dolybarr-doxygen-build.pl
|
||||
|
||||
@@ -43,24 +49,33 @@ generated packages will not contains this "build" directory.
|
||||
|
||||
We can find in "build", following sub-directories:
|
||||
|
||||
* deb:
|
||||
* aps:
|
||||
To build APS package.
|
||||
|
||||
* debian:
|
||||
To build Debian package.
|
||||
|
||||
* rpm:
|
||||
To build Redhat or Mandrake package.
|
||||
* dmg:
|
||||
To build Mac OS package (not ready yet).
|
||||
|
||||
* tgz:
|
||||
To build a tgz package.
|
||||
* doap:
|
||||
To build Doap descriptor to promote/describe Dolibarr releases.
|
||||
|
||||
* doxygen:
|
||||
Dir with config file to build doxygen documentation.
|
||||
|
||||
* exe:
|
||||
To build exe package for Windows that distribute Dolibarr sources or
|
||||
to build the complete DoliWamp package.
|
||||
|
||||
* tgz:
|
||||
To build a zip package.
|
||||
* launchpad:
|
||||
Doc file to explain how to use launchpad.
|
||||
|
||||
* doap:
|
||||
To build Doap descriptor to promote/describe Dolibarr releases.
|
||||
* live:
|
||||
Doc file to explain how to create a demo live CD.
|
||||
|
||||
* obs:
|
||||
Doc file to explain how to push release onto OBS.
|
||||
|
||||
* pad:
|
||||
To build a PAD file descriptor to promote/describe Dolibarr releases.
|
||||
@@ -68,5 +83,14 @@ To build a PAD file descriptor to promote/describe Dolibarr releases.
|
||||
* patch:
|
||||
Script file to generate a patch file to distribute a Dolibarr mod.
|
||||
|
||||
* dmg:
|
||||
To build dmg DoliMamp package for Mac OS X
|
||||
* perl:
|
||||
Tool to install dolibarr when using virtualmin pro
|
||||
|
||||
* rpm:
|
||||
To build Redhat, Opensuse or Mandriva package.
|
||||
|
||||
* tgz:
|
||||
To build a tgz package.
|
||||
|
||||
* zip:
|
||||
To build a zip package.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dolibarr (3.4.1) unstable; urgency=low
|
||||
dolibarr (3.3.5) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 22 Apr 2013 12:00:00 +0100
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 30 Dec 2013 12:00:00 +0100
|
||||
|
||||
@@ -6,8 +6,7 @@ Section: web
|
||||
Priority: optional
|
||||
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
|
||||
|
||||
|
||||
Package: dolibarr
|
||||
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5,
|
||||
php5-mysql | php5-mysqli,
|
||||
@@ -15,7 +14,6 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
||||
libphp-adodb,
|
||||
libnusoap-php,
|
||||
libphp-pclzip,
|
||||
libfpdi-php, libfpdf-tpl-php, php-fpdf,
|
||||
libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor,
|
||||
ttf-dejavu-core,
|
||||
xdg-utils,
|
||||
@@ -61,4 +59,4 @@ Description: Web based software to manage a small company or foundation
|
||||
PDF exports,
|
||||
And a lot of more modules...
|
||||
.
|
||||
You can also add third parties external modules or develop yours.
|
||||
You can also add third parties external modules or develop yours.
|
||||
@@ -1,6 +1,5 @@
|
||||
debian/dolibarr.desktop usr/share/applications
|
||||
debian/dolibarr.xpm usr/share/pixmaps
|
||||
ChangeLog usr/share/doc/dolibarr
|
||||
README usr/share/doc/dolibarr
|
||||
doc/install usr/share/doc/dolibarr
|
||||
doc/user usr/share/doc/dolibarr
|
||||
|
||||
@@ -104,6 +104,7 @@ clean:
|
||||
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/jquery/plugins/mobile
|
||||
rm -fr htdocs/includes/jquery/plugins/multiselect
|
||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
|
||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
|
||||
@@ -121,4 +122,4 @@ clean:
|
||||
dh $@
|
||||
|
||||
binary-arch:
|
||||
|
||||
|
||||
@@ -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 = 3.3.2
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
@@ -611,7 +611,7 @@ RECURSIVE = YES
|
||||
# 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 ../../document ../../documents ../../htdocs/conf/conf.php ../../htdocs/custom ../../htdocs/document ../../htdocs/documents ../../htdocs/includes
|
||||
EXCLUDE = ../../build ../../dev ../../doc ../../documents ../../htdocs/conf/conf.php ../../htdocs/includes ../../htdocs/document ../../htdocs/documents
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -48,8 +48,8 @@ If you want to build/test package locally:
|
||||
~eldy/dolibarr/stable
|
||||
or
|
||||
Use URL pattern (beta or stable):
|
||||
For stable: http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz
|
||||
For beta: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz
|
||||
http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz
|
||||
http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz
|
||||
|
||||
- For Dev, you can also add link serie to GIT HEAD.
|
||||
- For beta and stable, you can init from command line
|
||||
@@ -71,6 +71,7 @@ If you want to build/test package locally:
|
||||
bzr commit -m "Description of change"
|
||||
bzr push
|
||||
|
||||
|
||||
# Init debian dir repository into launchpad (when repository for sources does not exist)
|
||||
#----------------------------------
|
||||
- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
@@ -111,26 +112,17 @@ If you want to build/test package locally:
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
|
||||
lp:dolibarr
|
||||
merge packaging lp:~yourlogin/+junk/debian-dev
|
||||
For beta:
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-1~{revno}
|
||||
lp:dolibarr/beta
|
||||
merge packaging lp:~yourlogin/+junk/debian-beta
|
||||
For stable:
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-2~{revno}
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
|
||||
lp:dolibarr/stable
|
||||
merge packaging lp:~yourlogin/+junk/debian-stable
|
||||
- Run command
|
||||
cd bzr
|
||||
bzr dailydeb dolibarr.recipe working-dir
|
||||
This will create a directory "working-dir" with dolibarr sources and will add sources from ~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
This will create a directory "working-dir" with dolibarr sources and will add sources from ~yourlogin/+junk/debian-[dev|stable]
|
||||
- Test package sources
|
||||
sudo pbuilder build <working-dir>/<project>_<version>.dsc
|
||||
|
||||
List of recipes created
|
||||
https://code.launchpad.net/~eldy/+recipe/dolibarr-dev
|
||||
https://code.launchpad.net/~eldy/+recipe/dolibarr-beta
|
||||
https://code.launchpad.net/~eldy/+recipe/dolibarr-stable
|
||||
|
||||
|
||||
# To get/download package from PPA:
|
||||
#----------------------------------
|
||||
@@ -143,9 +135,6 @@ https://code.launchpad.net/~eldy/+recipe/dolibarr-stable
|
||||
For the development snapshot version:
|
||||
deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
|
||||
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
|
||||
For the beta version:
|
||||
deb http://ppa.launchpad.net/yourlogin/dolibarr-beta/ubuntu precise main
|
||||
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-beta/ubuntu precise main
|
||||
For the stable version:
|
||||
deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
|
||||
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
|
||||
|
||||
@@ -2,20 +2,27 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# \file build/makepack-dolibarr.pl
|
||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
||||
# \author (c)2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
# \author (c)2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
#
|
||||
# This is list of constant you can set to have generated packages moved into a specific dir:
|
||||
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
||||
#DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'
|
||||
#DESTIMODULES='/media/HDDATA1_LD/Mes Sites/Web/Admin1/wwwroot/files/modules'
|
||||
#DESTIDOLIMEDBETARC='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/lastbuild'
|
||||
#DESTIDOLIMEDMODULES='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/modules'
|
||||
#DESTIDOLIMEDSTABLE='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/stable'
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
use Cwd;
|
||||
|
||||
$PROJECT="dolibarr";
|
||||
$MAJOR="3";
|
||||
$MINOR="4";
|
||||
$BUILD="1"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
%REQUIREMENTPUBLISH=(
|
||||
"SF"=>"git ssh rsync"
|
||||
);
|
||||
%REQUIREMENTTARGET=( # Tool requirement for each package
|
||||
"SNAPSHOT"=>"tar",
|
||||
"TGZ"=>"tar",
|
||||
"ZIP"=>"7z",
|
||||
"XZ"=>"xz",
|
||||
@@ -25,22 +32,14 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
"RPM_OPENSUSE"=>"rpmbuild",
|
||||
"DEB"=>"dpkg",
|
||||
"APS"=>"zip",
|
||||
"EXEDOLIWAMP"=>"ISCC.exe"
|
||||
"EXEDOLIWAMP"=>"ISCC.exe",
|
||||
"SNAPSHOT"=>"tar"
|
||||
);
|
||||
%ALTERNATEPATH=(
|
||||
"7z"=>"7-ZIP",
|
||||
"makensis.exe"=>"NSIS"
|
||||
);
|
||||
|
||||
$FILENAME="$PROJECT";
|
||||
$FILENAMESNAPSHOT="$PROJECT-snapshot";
|
||||
$FILENAMETGZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEZIP="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEXZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMERPM="$PROJECT-$MAJOR.$MINOR.$BUILD-$RPMSUBVERSION";
|
||||
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${BUILD}";
|
||||
$FILENAMEAPS="$PROJECT-$MAJOR.$MINOR.$BUILD.app";
|
||||
$FILENAMEEXEDOLIWAMP="DoliWamp-$MAJOR.$MINOR.$BUILD";
|
||||
if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat
|
||||
if (-d "/usr/src/packages") { $RPMDIR="/usr/src/packages"; } # opensuse
|
||||
if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake
|
||||
@@ -59,6 +58,24 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
|
||||
|
||||
$SOURCE="$DIR/..";
|
||||
$DESTI="$SOURCE/build";
|
||||
$PUBLISH="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
|
||||
{
|
||||
print "Error: Missing environment variables.\n";
|
||||
print "You must define the environment variable DESTIBETARC and DESTISTABLE to point to the\ndirectories where you want to save the generated packages.\n";
|
||||
print "Example: DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'\n";
|
||||
print "Example: DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"})
|
||||
{
|
||||
print "Error: Directory of environment variable DESTIBETARC or DESTISTABLE does not exist.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Detect OS type
|
||||
# --------------
|
||||
@@ -66,7 +83,7 @@ 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 "$PROG.$Extension was not able to detect your OS.\n";
|
||||
print "Error: Can't detect your OS.\n";
|
||||
print "Can't continue.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
@@ -95,7 +112,57 @@ if (! $TEMP || ! -d $TEMP) {
|
||||
$BUILDROOT="$TEMP/buildroot";
|
||||
|
||||
|
||||
my $copyalreadydone=0; # Use "-" before number of choice to avoid copy
|
||||
# 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 (<IN>) {
|
||||
if ( $_ =~ /define\('DOL_VERSION','([\d\.]+)'\)/ ) { $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"; }
|
||||
|
||||
# Set vars for packaging
|
||||
$FILENAME = "$PROJECT";
|
||||
$FILENAMESNAPSHOT = "$PROJECT-snapshot";
|
||||
$FILENAMETGZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEZIP = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEXZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEDEB = "see later";
|
||||
$FILENAMEAPS = "$PROJECT-$MAJOR.$MINOR.$BUILD.app";
|
||||
$FILENAMEEXEDOLIWAMP = "DoliWamp-$MAJOR.$MINOR.$BUILD";
|
||||
# For RPM
|
||||
$ARCH='noarch';
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev (fedora)
|
||||
$newbuild =~ s/beta/0.2.beta1/gi; # beta (fedora)
|
||||
$newbuild =~ s/rc./0.3.rc1/gi; # rc (fedora)
|
||||
if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale (fedora)
|
||||
#$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||
#$newbuild =~ s/beta/1/gi; # beta
|
||||
#$newbuild =~ s/rc./2/gi; # rc
|
||||
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
|
||||
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
|
||||
$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
|
||||
$FILENAMERPM=$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm";
|
||||
# For Deb
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/1/gi; # dev
|
||||
$newbuild =~ s/beta/2/gi; # beta
|
||||
$newbuild =~ s/rc./3/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale is same than rc.
|
||||
# now newbuild is 0-1 or 0-3 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management
|
||||
$build = $newbuild;
|
||||
$build =~ s/-.*$//g;
|
||||
# now build is 0 for example
|
||||
# $build .= '+nmu1';
|
||||
# now build is 0+nmu1 for example
|
||||
$FILENAMEDEBNATIVE="${PROJECT}_${MAJOR}.${MINOR}.${build}";
|
||||
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
|
||||
|
||||
|
||||
my $copyalreadydone=0;
|
||||
my $batch=0;
|
||||
for (0..@ARGV-1) {
|
||||
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
||||
@@ -105,41 +172,47 @@ for (0..@ARGV-1) {
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
}
|
||||
}
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
|
||||
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTISTABLE is defined
|
||||
if ($ENV{"PUBLISHBETARC"} && $BUILD =~ /[a-z]/i) { $PUBLISH = $ENV{"PUBLISHBETARC"}; } # Force target site for publishing if env PUBLISHBETARC is defined
|
||||
if ($ENV{"PUBLISHSTABLE"} && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $ENV{"PUBLISHSTABLE"}; } # Force target site for publishing if env PUBLISHSTABLE is defined
|
||||
|
||||
print "Makepack version $VERSION\n";
|
||||
print "Building package name: $PROJECT\n";
|
||||
print "Building package version: $MAJOR.$MINOR.$BUILD\n";
|
||||
print "Building/publishing package name: $PROJECT\n";
|
||||
print "Building/publishing package version: $MAJOR.$MINOR.$BUILD\n";
|
||||
print "Source directory (SOURCE): $SOURCE\n";
|
||||
print "Target directory (DESTI) : $DESTI\n";
|
||||
print "Publishing target (PUBLISH): $PUBLISH\n";
|
||||
|
||||
|
||||
# Choose package targets
|
||||
#-----------------------
|
||||
if ($target) {
|
||||
$CHOOSEDTARGET{uc($target)}=1;
|
||||
if ($target eq "ALL") {
|
||||
foreach my $key (@LISTETARGET) {
|
||||
if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
|
||||
}
|
||||
}
|
||||
if ($target ne "ALL" && $target ne "SF") { $CHOOSEDTARGET{uc($target)}=1; }
|
||||
if ($target eq "SF") { $CHOOSEDPUBLISH{"SF"}=1; }
|
||||
}
|
||||
else {
|
||||
my $found=0;
|
||||
my $NUM_SCRIPT;
|
||||
my $cpt=0;
|
||||
while (! $found) {
|
||||
my $cpt=0;
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,"All (Except SNAPSHOT)","Need ".join(",",values %REQUIREMENTTARGET));
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET));
|
||||
foreach my $target (@LISTETARGET) {
|
||||
$cpt++;
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
|
||||
}
|
||||
$cpt=99;
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH));
|
||||
|
||||
# On demande de choisir le fichier à passer
|
||||
# Ask which target to build
|
||||
print "Choose one package number or several separated with space (0 - ".$cpt."): ";
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
chomp($NUM_SCRIPT);
|
||||
if ($NUM_SCRIPT =~ s/-//g) {
|
||||
# Do not do copy
|
||||
$copyalreadydone=1;
|
||||
}
|
||||
if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
|
||||
{
|
||||
print "This is not a valid package number list.\n";
|
||||
@@ -151,15 +224,20 @@ else {
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
if ($NUM_SCRIPT) {
|
||||
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
|
||||
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
|
||||
}
|
||||
if ($NUM_SCRIPT eq "99") {
|
||||
$CHOOSEDPUBLISH{"SF"}=1;
|
||||
}
|
||||
else {
|
||||
foreach my $key (@LISTETARGET) {
|
||||
if ($key ne 'SNAPSHOT') { $CHOOSEDTARGET{$key}=1; }
|
||||
}
|
||||
if ($NUM_SCRIPT eq "0") {
|
||||
foreach my $key (@LISTETARGET) {
|
||||
if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
|
||||
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +254,8 @@ foreach my $target (keys %CHOOSEDTARGET) {
|
||||
}
|
||||
$atleastonerpm=1;
|
||||
}
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
|
||||
{
|
||||
# Test
|
||||
print "Test requirement for target $target: Search '$req'... ";
|
||||
$newreq=$req; $newparam='';
|
||||
@@ -200,7 +279,7 @@ foreach my $target (keys %CHOOSEDTARGET) {
|
||||
last;
|
||||
} else {
|
||||
# Pas erreur ou erreur autre que programme absent
|
||||
print " Found ".$REQUIREMENTTARGET{$target}."\n";
|
||||
print " Found ".$req."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,16 +290,20 @@ print "\n";
|
||||
#----------------------------------------------
|
||||
$nboftargetok=0;
|
||||
$nboftargetneedbuildroot=0;
|
||||
$nboftargetneedcvs=0;
|
||||
$nbofpublishneedtag=0;
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP')
|
||||
{
|
||||
$nboftargetneedbuildroot++;
|
||||
}
|
||||
if ($target eq 'SNAPSHOT')
|
||||
$nboftargetok++;
|
||||
}
|
||||
foreach my $target (keys %CHOOSEDPUBLISH) {
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
if ($target eq 'SF')
|
||||
{
|
||||
$nboftargetneedcvs++;
|
||||
$nbofpublishneedtag++;
|
||||
}
|
||||
$nboftargetok++;
|
||||
}
|
||||
@@ -229,13 +312,26 @@ if ($nboftargetok) {
|
||||
|
||||
# Update CVS if required
|
||||
#-----------------------
|
||||
if ($nboftargetneedcvs)
|
||||
if ($nbofpublishneedtag)
|
||||
{
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
print "Run cvs update -P -d\n";
|
||||
$ret=`cvs update -P -d 2>&1`;
|
||||
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
|
||||
if ($ret =~ /already exists/)
|
||||
{
|
||||
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
|
||||
$QUESTIONOVERWRITETAG=<STDIN>;
|
||||
chomp($QUESTIONOVERWRITETAG);
|
||||
if ($QUESTIONOVERWRITETAG =~ /(o|y)/)
|
||||
{
|
||||
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
}
|
||||
print 'Run git push --tags'."\n";
|
||||
$ret=`git push --tags`;
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
@@ -253,15 +349,20 @@ 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 "Clean $BUILDROOT\n";
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.git`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitmodules`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/quickbuild.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
||||
@@ -291,6 +392,8 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codetemplates`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`;
|
||||
@@ -327,7 +430,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
@@ -336,8 +441,12 @@ 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 -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
|
||||
@@ -347,7 +456,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
|
||||
}
|
||||
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
foreach my $target (keys %CHOOSEDTARGET)
|
||||
@@ -370,7 +479,6 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
|
||||
print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
|
||||
#$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||
$cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.xz --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||
print $cmd."\n";
|
||||
$ret=`$cmd`;
|
||||
@@ -384,6 +492,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'TGZ')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
|
||||
print "Remove target $FILENAMETGZ.tgz...\n";
|
||||
@@ -410,6 +519,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'XZ')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
|
||||
print "Remove target $FILENAMEXZ.xz...\n";
|
||||
@@ -440,6 +550,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'ZIP')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
|
||||
print "Remove target $FILENAMEZIP.zip...\n";
|
||||
@@ -474,31 +585,18 @@ if ($nboftargetok) {
|
||||
if ($target =~ /FEDO/i) { $subdir="package_rpm_redhat-fedora"; }
|
||||
if ($target =~ /MAND/i) { $subdir="package_rpm_mandriva"; }
|
||||
if ($target =~ /OPEN/i) { $subdir="package_rpm_opensuse"; }
|
||||
mkdir($DESTI.'/'.$subdir);
|
||||
if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
|
||||
|
||||
$ARCH='noarch';
|
||||
if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
|
||||
$newbuild = $BUILD;
|
||||
# For fedora
|
||||
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev
|
||||
$newbuild =~ s/beta/0.2.beta1/gi; # beta
|
||||
$newbuild =~ s/rc./0.3.rc1/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
#$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||
#$newbuild =~ s/beta/1/gi; # beta
|
||||
#$newbuild =~ s/rc./2/gi; # rc
|
||||
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
|
||||
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
|
||||
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
|
||||
|
||||
$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
|
||||
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
|
||||
|
||||
#print "Create directory $RPMDIR\n";
|
||||
#$ret=`mkdir -p "$RPMDIR"`;
|
||||
|
||||
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm...\n";
|
||||
unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm");
|
||||
print "Remove target ".$FILENAMERPM."...\n";
|
||||
unlink("$NEWDESTI/".$FILENAMERPM);
|
||||
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
|
||||
unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm");
|
||||
|
||||
@@ -509,8 +607,8 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
|
||||
# Set owners
|
||||
print "Set owners on files/dir\n";
|
||||
$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
|
||||
#print "Set owners on files/dir\n";
|
||||
#$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
|
||||
|
||||
print "Set permissions on files/dir\n";
|
||||
$ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
|
||||
@@ -553,11 +651,9 @@ if ($nboftargetok) {
|
||||
|
||||
# Move to final dir
|
||||
print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm\n";
|
||||
#$cmd="mv \"$RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\"";
|
||||
$cmd="mv $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm \"$NEWDESTI/\"";
|
||||
$ret=`$cmd`;
|
||||
print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm\n";
|
||||
#$cmd="mv \"$RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\"";
|
||||
$cmd="mv $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm \"$NEWDESTI/\"";
|
||||
$ret=`$cmd`;
|
||||
print "Move $RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz into $NEWDESTI/".$FILENAMETGZ2.".tgz\n";
|
||||
@@ -569,23 +665,11 @@ if ($nboftargetok) {
|
||||
if ($target eq 'DEB')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/package_debian-ubuntu');
|
||||
if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; }
|
||||
|
||||
$olddir=getcwd();
|
||||
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/1/gi; # dev
|
||||
$newbuild =~ s/beta/2/gi; # beta
|
||||
$newbuild =~ s/rc./3/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale
|
||||
# now newbuild is 0-1 or 0-4 for example
|
||||
print "Version is $MAJOR.$MINOR.$newbuild\n";
|
||||
$build = $newbuild;
|
||||
$build =~ s/-.*$//g;
|
||||
# now build is 0 for example
|
||||
# $build .= '+nmu1';
|
||||
# now build is 0+nmu1 for example
|
||||
|
||||
print "Remove target ${FILENAMEDEB}_all.deb...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}_all.deb");
|
||||
print "Remove target ${FILENAMEDEB}.dsc...\n";
|
||||
@@ -594,6 +678,8 @@ if ($nboftargetok) {
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.tar.gz");
|
||||
print "Remove target ${FILENAMEDEB}.changes...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
|
||||
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`;
|
||||
@@ -601,6 +687,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`;
|
||||
|
||||
print "Remove other files\n";
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`;
|
||||
@@ -628,7 +716,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/rules`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/wash`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/watch`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/launchpad`;
|
||||
@@ -637,13 +725,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`;
|
||||
# We remove embedded libraries or fonts (this is also inside rules file, target clean)
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`,
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`;
|
||||
|
||||
# Rename upstream changelog to match debian rules
|
||||
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;
|
||||
|
||||
# Prepare source package (init debian dir)
|
||||
print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n";
|
||||
$ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
@@ -660,18 +744,24 @@ if ($nboftargetok) {
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/README.source" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/rules" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/watch" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$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"`;
|
||||
# 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"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
|
||||
# Set owners and permissions
|
||||
print "Set owners on files/dir\n";
|
||||
$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
|
||||
#print "Set owners on files/dir\n";
|
||||
#$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
|
||||
|
||||
print "Set permissions on files/dir\n";
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`;
|
||||
$cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; ";
|
||||
@@ -700,6 +790,16 @@ if ($nboftargetok) {
|
||||
$cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
||||
$ret=`$cmd`;
|
||||
|
||||
|
||||
print "Go into directory $BUILDROOT\n";
|
||||
chdir("$BUILDROOT");
|
||||
|
||||
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
|
||||
print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
|
||||
print $cmd."\n";
|
||||
$ret=`$cmd`;
|
||||
|
||||
# Creation of source package
|
||||
print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
|
||||
chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
|
||||
@@ -711,11 +811,14 @@ if ($nboftargetok) {
|
||||
|
||||
chdir("$olddir");
|
||||
|
||||
print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
|
||||
print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n";
|
||||
|
||||
# Move to final dir
|
||||
print "Move *_all.deb to $NEWDESTI\n";
|
||||
print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n";
|
||||
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
|
||||
next;
|
||||
}
|
||||
@@ -723,6 +826,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'APS')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/package_aps');
|
||||
if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; }
|
||||
|
||||
$newbuild = $BUILD;
|
||||
@@ -807,6 +911,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'EXEDOLIWAMP')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/package_windows');
|
||||
if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; }
|
||||
|
||||
print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n";
|
||||
@@ -828,6 +933,81 @@ if ($nboftargetok) {
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
foreach my $target (keys %CHOOSEDPUBLISH)
|
||||
{
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
|
||||
print "\nList of files to publish\n";
|
||||
%filestoscan=(
|
||||
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
||||
"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
|
||||
);
|
||||
foreach my $file (sort keys %filestoscan)
|
||||
{
|
||||
$found=0;
|
||||
my $filesize = -s $file;
|
||||
print $file." ".($filesize?"(found)":"(not found)");
|
||||
print ($filesize?" - ".$filesize:"");
|
||||
print "\n";
|
||||
}
|
||||
|
||||
if ($target eq 'SF')
|
||||
{
|
||||
print "\n";
|
||||
|
||||
$NEWPUBLISH=$PUBLISH;
|
||||
print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n";
|
||||
|
||||
# Ask which target to build
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
chomp($NUM_SCRIPT);
|
||||
|
||||
print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
|
||||
$ret=`mkdir -p "/tmp/emptydir/"`;
|
||||
|
||||
foreach my $file (sort keys %filestoscan)
|
||||
{
|
||||
$found=0;
|
||||
my $filesize = -s $file;
|
||||
if (! $filesize) { next; }
|
||||
|
||||
print "\n";
|
||||
print "Publish file ".$file." to ".$filestoscan{$file}."\n";
|
||||
|
||||
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
||||
|
||||
# mkdir
|
||||
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
|
||||
#$ssh->login("$user","$pass");
|
||||
#use String::ShellQuote qw( shell_quote );
|
||||
#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
|
||||
|
||||
#use Net::SFTP::Foreign;
|
||||
#my $sftp = Net::SFTP::Foreign->new($ip, user => $user, password => $pass, autodie => 1);
|
||||
#$sftp->mkdir($destFolder)
|
||||
|
||||
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
|
||||
#print "$command\n";
|
||||
#my $ret=`$command 2>&1`;
|
||||
$command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\"";
|
||||
print "$command\n";
|
||||
my $ret=`$command 2>&1`;
|
||||
|
||||
$command="rsync -s $OPTIONUPDATEDIST -e 'ssh' \"$file\" \"".$destFolder."\"";
|
||||
print "$command\n";
|
||||
my $ret=`$command 2>&1`;
|
||||
print "$ret\n";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n----- Summary -----\n";
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.4</Program_Version>
|
||||
<Program_Release_Month>07</Program_Release_Month>
|
||||
<Program_Release_Day>07</Program_Release_Day>
|
||||
<Program_Release_Year>2013</Program_Release_Year>
|
||||
<Program_Version>3.3.5</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.4</Program_Version>
|
||||
<Program_Release_Month>07</Program_Release_Month>
|
||||
<Program_Release_Day>07</Program_Release_Day>
|
||||
<Program_Release_Year>2013</Program_Release_Year>
|
||||
<Program_Version>3.3.5</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
|
||||
@@ -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.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
|
||||
@@ -26,9 +26,8 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...).
|
||||
# restorecon -R -v /file Restore values into files (cancel chcon, validate semanage)
|
||||
#
|
||||
# On OpenSuse
|
||||
# zypper install dolibarr-...rpm To install package and dependencies
|
||||
# zypper remove dolibarr To remove package
|
||||
# zypper search xxx To search a package
|
||||
# yast --install dolibarr-...rpm To install package and dependencies
|
||||
# yast --remove dolibarr To remove package
|
||||
#
|
||||
# On Mageia (after su - root)
|
||||
# urpmi dolibarr-...rpm To install package and dependencies
|
||||
|
||||
@@ -14,7 +14,7 @@ Summary(es): Software ERP y CRM para pequeñas y medianas empresas, asociaciones
|
||||
Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, auto-entrepreneurs ou associations
|
||||
Summary(it): Programmo gestionale per piccole imprese, fondazioni e liberi professionisti
|
||||
|
||||
License: GPLv3+
|
||||
License: GPL-3.0+
|
||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||
Vendor: Dolibarr dev team
|
||||
|
||||
@@ -186,10 +186,8 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/livraison
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printipp
|
||||
%_datadir/dolibarr/htdocs/product
|
||||
%_datadir/dolibarr/htdocs/projet
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
@@ -279,11 +277,18 @@ echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
||||
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
/sbin/service httpd restart
|
||||
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
|
||||
|
||||
# Restart mysql server
|
||||
echo Restart mysql server
|
||||
/sbin/service mysqld restart
|
||||
# Restart mysql
|
||||
echo Restart mysql
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
fi
|
||||
|
||||
# Show result
|
||||
echo
|
||||
@@ -328,7 +333,7 @@ else
|
||||
echo "No remove ation 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
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.4.1-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -18,11 +18,7 @@ Summary(es): Software ERP y CRM para pequeñas y medianas empresas, asociaciones
|
||||
Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, auto-entrepreneurs ou associations
|
||||
Summary(it): Programmo gestionale per piccole imprese, fondazioni e liberi professionisti
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
License: GPLv3+
|
||||
%else
|
||||
License: GPL-3.0+
|
||||
%endif
|
||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||
Vendor: Dolibarr dev team
|
||||
|
||||
@@ -266,10 +262,8 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/livraison
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printipp
|
||||
%_datadir/dolibarr/htdocs/product
|
||||
%_datadir/dolibarr/htdocs/projet
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
@@ -382,7 +376,7 @@ fi
|
||||
# If a conf already exists and its content was already completed by installer
|
||||
export config=%{_sysconfdir}/dolibarr/conf.php
|
||||
if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
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 "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
@@ -447,16 +441,12 @@ echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
||||
|
||||
# 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
|
||||
|
||||
# Restart mysql server
|
||||
echo Restart mysql server
|
||||
@@ -464,7 +454,11 @@ echo Restart mysql server
|
||||
/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
|
||||
fi
|
||||
%else
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
@@ -552,7 +546,7 @@ else
|
||||
echo "No remove ation 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
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.4.1-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -183,10 +183,8 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/livraison
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printipp
|
||||
%_datadir/dolibarr/htdocs/product
|
||||
%_datadir/dolibarr/htdocs/projet
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
@@ -333,7 +331,7 @@ else
|
||||
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
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.4.1-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -194,10 +194,8 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/livraison
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printipp
|
||||
%_datadir/dolibarr/htdocs/product
|
||||
%_datadir/dolibarr/htdocs/projet
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
@@ -288,7 +286,11 @@ fi
|
||||
|
||||
# Restart mysql
|
||||
echo Restart mysql
|
||||
/sbin/service mysql restart
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
else
|
||||
/sbin/service mysql restart
|
||||
fi
|
||||
|
||||
# Show result
|
||||
echo
|
||||
@@ -339,7 +341,6 @@ else
|
||||
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
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.4.1-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -18,6 +18,4 @@ $force_install_dolibarrlogin='admin';
|
||||
$force_install_nophpinfo='1';
|
||||
$force_install_lockinstall='444';
|
||||
|
||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||
// We don't force any external lib with generic package
|
||||
?>
|
||||
@@ -19,10 +19,10 @@ $force_install_nophpinfo='1';
|
||||
$force_install_lockinstall='444';
|
||||
|
||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||
//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
$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_lib_TCPDF_PATH='';
|
||||
|
||||
@@ -2,7 +2,7 @@ README (English)
|
||||
--------------------------------
|
||||
This directory contains sub-directories to provide tools or
|
||||
documentation for developers.
|
||||
Note: All files in this directory are in VCS only and are not
|
||||
Note: All files in this directory are in CVS only and are not
|
||||
provided with a standard release.
|
||||
|
||||
|
||||
|
||||
@@ -48,3 +48,8 @@ with
|
||||
//var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
|
||||
window.location.href=pRef
|
||||
* Replace hard coded string with i18n["String"];
|
||||
|
||||
|
||||
JCROP:
|
||||
------
|
||||
* Remove analytics tag into file index.html
|
||||
|
||||
@@ -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
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------
|
||||
# Script to find files that are not Unix encoded
|
||||
#
|
||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||
#------------------------------------------------------
|
||||
# Usage: fixdosfiles.sh [list|fix]
|
||||
#------------------------------------------------------
|
||||
|
||||
# Syntax
|
||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||
then
|
||||
echo "Usage: fixdosfiles.sh [list|fix]"
|
||||
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
|
||||
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 }' `
|
||||
do
|
||||
echo "Fix file $fic"
|
||||
dos2unix $fic
|
||||
done;
|
||||
fi
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------
|
||||
# Script to set/fix permissions on files
|
||||
#
|
||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||
#------------------------------------------------------
|
||||
# Usage: fixperms.sh (list|fix)
|
||||
#------------------------------------------------------
|
||||
|
||||
# Syntax
|
||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||
then
|
||||
echo "Usage: fixperms.sh (list|fix)"
|
||||
fi
|
||||
|
||||
# To detect
|
||||
if [ "x$1" = "xlist" ]
|
||||
then
|
||||
echo Feature not yet available
|
||||
fi
|
||||
|
||||
# To convert
|
||||
if [ "x$1" = "xfix" ]
|
||||
then
|
||||
find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \;
|
||||
chmod a+x ./scripts/*/*.php
|
||||
chmod a+x ./scripts/*/*.sh
|
||||
fi
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Checks of fix files contains UTF-8 BOM in dolibarr source tree,
|
||||
# excluding git repository, custom modules and included libraries.
|
||||
#
|
||||
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||
# Laurent Destailleur eldy@users.sourceforge.net
|
||||
#------------------------------------------------------
|
||||
# Usage: fixutf8bomfiles.sh [list|fix]
|
||||
#------------------------------------------------------
|
||||
|
||||
# Syntax
|
||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||
then
|
||||
echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]"
|
||||
fi
|
||||
|
||||
if [ "x$2" != "xaddincludes" ]
|
||||
then
|
||||
export moreoptions="--exclude-dir='includes'"
|
||||
fi
|
||||
|
||||
# To detec
|
||||
if [ "x$1" = "xlist" ]
|
||||
then
|
||||
#find . \( -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' \) -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
|
||||
echo "grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'"
|
||||
grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
|
||||
fi
|
||||
|
||||
# To convert
|
||||
if [ "x$1" = "xfix" ]
|
||||
then
|
||||
for fic in `grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'`
|
||||
do
|
||||
echo "Fixing $fic"
|
||||
sed -i '1s/^\xEF\xBB\xBF//' $fic
|
||||
done;
|
||||
fi
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,8 +41,8 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
|
||||
$listoftown = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono");
|
||||
$listoflastname = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie");
|
||||
$villes = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono");
|
||||
$prenoms = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie");
|
||||
|
||||
|
||||
/*
|
||||
@@ -90,7 +90,7 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++)
|
||||
print "Company $s\n";
|
||||
$soc = new Societe($db);
|
||||
$soc->nom = "Company num ".time()."$s";
|
||||
$soc->town = $listoftown[rand(0, count($listoftown)-1)];
|
||||
$soc->ville = $villes[rand(0, count($villes)-1)];
|
||||
$soc->client = rand(1,2); // Une societe sur 2 est prospect, l'autre client
|
||||
$soc->fournisseur = rand(0,1); // Une societe sur 2 est fournisseur
|
||||
$soc->code_client='CU'.time()."$s";
|
||||
@@ -112,8 +112,8 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++)
|
||||
{
|
||||
$contact = new Contact($db);
|
||||
$contact->socid = $soc->id;
|
||||
$contact->lastname = "Lastname".$c;
|
||||
$contact->firstname = $listoflastname[rand(0, count($listoflastname)-1)];
|
||||
$contact->name = "Lastname".$c;
|
||||
$contact->firstname = $prenoms[rand(0, count($prenoms)-1)];
|
||||
if ( $contact->create($user) )
|
||||
{
|
||||
|
||||
|
||||
@@ -5619,69 +5619,6 @@ INSERT INTO `llx_stock_mouvement` VALUES (1,'2010-07-08 22:43:51','2010-07-09 00
|
||||
/*!40000 ALTER TABLE `llx_stock_mouvement` 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`
|
||||
--
|
||||
|
||||
@@ -5528,69 +5528,6 @@ INSERT INTO `llx_stock_mouvement` (`rowid`, `tms`, `datem`, `fk_product`, `fk_en
|
||||
/*!40000 ALTER TABLE `llx_stock_mouvement` 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` (`rowid`, `label`, `targetcode`, `langcode`, `url`, `login`, `pass`, `comment`, `position`, `titlelength`, `descshortlength`, `desclonglength`) 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`
|
||||
--
|
||||
|
||||
@@ -2874,7 +2874,7 @@ CREATE TABLE `llx_element_tag` (
|
||||
`element` varchar(64) NOT NULL,
|
||||
PRIMARY KEY (`rowid`),
|
||||
UNIQUE KEY `uk_element_tag` (`entity`,`lang`,`tag`,`fk_element`,`element`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -3698,7 +3698,7 @@ CREATE TABLE `llx_holiday` (
|
||||
KEY `idx_holiday_fk_user` (`fk_user`),
|
||||
KEY `idx_holiday_date_debut` (`date_debut`),
|
||||
KEY `idx_holiday_date_fin` (`date_fin`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -3723,7 +3723,7 @@ CREATE TABLE `llx_holiday_config` (
|
||||
`value` text,
|
||||
PRIMARY KEY (`rowid`),
|
||||
UNIQUE KEY `name` (`name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -3750,7 +3750,7 @@ CREATE TABLE `llx_holiday_events` (
|
||||
`value` text NOT NULL,
|
||||
PRIMARY KEY (`rowid`),
|
||||
UNIQUE KEY `uk_holiday_name` (`name`,`entity`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -3778,7 +3778,7 @@ CREATE TABLE `llx_holiday_logs` (
|
||||
`prev_solde` varchar(255) NOT NULL,
|
||||
`new_solde` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -3801,7 +3801,7 @@ 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;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -4877,7 +4877,7 @@ CREATE TABLE `llx_product_price_by_qty` (
|
||||
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;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -5631,7 +5631,7 @@ CREATE TABLE `llx_socpeople_extrafields` (
|
||||
`import_key` varchar(14) DEFAULT NULL,
|
||||
PRIMARY KEY (`rowid`),
|
||||
KEY `idx_socpeople_extrafields` (`fk_object`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@@ -5677,69 +5677,6 @@ INSERT INTO `llx_stock_mouvement` VALUES (1,'2010-07-08 22:43:51','2010-07-09 00
|
||||
/*!40000 ALTER TABLE `llx_stock_mouvement` 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`
|
||||
--
|
||||
@@ -5931,7 +5868,7 @@ CREATE TABLE `llx_user_extrafields` (
|
||||
`import_key` varchar(14) DEFAULT NULL,
|
||||
PRIMARY KEY (`rowid`),
|
||||
KEY `idx_user_extrafields` (`fk_object`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -188,7 +188,6 @@ export list="
|
||||
--ignore-table=$base.llx_cabinetmed_examenprescrit
|
||||
--ignore-table=$base.llx_cabinetmed_motifcons
|
||||
--ignore-table=$base.llx_cabinetmed_patient
|
||||
--ignore-table=$base.llx_cabinetmed_societe
|
||||
--ignore-table=$base.llx_publi_c_contact_list
|
||||
--ignore-table=$base.llx_publi_c_dnd_list
|
||||
--ignore-table=$base.llx_publi_c_method_list
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
21
dev/phpcheckstyle/README
Normal file
21
dev/phpcheckstyle/README
Normal file
@@ -0,0 +1,21 @@
|
||||
README (English)
|
||||
--------------------------------
|
||||
|
||||
This directory contains example of PHPCheckStyle configuration
|
||||
to use for quality assurance on PHP developpement.
|
||||
|
||||
To run PHPCheckstyle in eclipse, you must:
|
||||
- install plugin PHP Tools integration http://www.phpsrc.org/eclipse/pti/
|
||||
- Unzip PHPCheckStyle archive into a directory.
|
||||
- Go in Eclipse - Window - Preferences - Dynamic Languages - Validator
|
||||
Choose External PHP Script,
|
||||
Set path ro run.php file for localhost
|
||||
Choose a PHP version,
|
||||
Set parameter string with
|
||||
--src %f --config "phpstandard.cfg.xml" --format console
|
||||
Choose php as Filename extension
|
||||
Check Print PHP output to console
|
||||
Then add patern
|
||||
* %f INFO Line:%n - %m Warning
|
||||
* %f WARNING Line:%n - %m Warning
|
||||
* %f ERROR Line:%n - %m Error
|
||||
316
dev/phpcheckstyle/phpstandard.cfg.xml
Normal file
316
dev/phpcheckstyle/phpstandard.cfg.xml
Normal file
@@ -0,0 +1,316 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE phpstandard SYSTEM "phpstandard.dtd">
|
||||
<!-- somewhat inspired by java checkstyle -->
|
||||
<phpcheckstyle-configuration>
|
||||
|
||||
<!-- **************** -->
|
||||
<!-- Naming -->
|
||||
<!-- **************** -->
|
||||
|
||||
<!-- Check Constant Naming -->
|
||||
<!-- Disabled to avoid warning with $sql="SELECT ..."
|
||||
<test name="constantNaming" regexp="/^[A-Z_][A-Z_]*[A-Z_]$/" level="ERROR"/>
|
||||
-->
|
||||
|
||||
<!-- Check Variable Naming -->
|
||||
<test name="variableNaming" regexp="/^[a-zA-Z_][a-zA-Z0-9_]*$/" />
|
||||
|
||||
<!-- Check Function Naming -->
|
||||
<test name="functionNaming" regexp="/^[a-z_]/" level="WARNING"/>
|
||||
|
||||
<!-- Check Private Function Naming -->
|
||||
<test name="privateFunctionNaming" regexp="/^[a-z_]/" level="ERROR"/>
|
||||
|
||||
<!-- Checks the constuctor naming -->
|
||||
<!-- old = old style (constructor = name of the class) -->
|
||||
<!-- new = "__construct()" -->
|
||||
<test name="constructorNaming">
|
||||
<property name="naming" value="old"/>
|
||||
</test>
|
||||
|
||||
<!-- Check Class Naming -->
|
||||
<test name="classNaming" regexp="/^[A-Z]/" level="WARNING"/>
|
||||
|
||||
|
||||
<!-- **************** -->
|
||||
<!-- PHP Tags -->
|
||||
<!-- **************** -->
|
||||
|
||||
|
||||
<!-- Test if a short php code open tag is used (? instead of ?php ). -->
|
||||
<test name="noShortPhpCodeTag"/>
|
||||
|
||||
<!-- Test if a PHP closing file is present at the end of a file -->
|
||||
<!-- <test name="noFileCloseTag"/> -->
|
||||
|
||||
<!-- Test if a file finish with some inner HTML (OK for some view but could provoque "header already sent" error) -->
|
||||
<!-- <test name="noFileFinishHTML" level="ERROR" /> -->
|
||||
|
||||
|
||||
<!-- **************** -->
|
||||
<!-- Comments -->
|
||||
<!-- **************** -->
|
||||
|
||||
<!-- Check if some C style comments are used (#) -->
|
||||
<test name="noShellComments"/>
|
||||
|
||||
<!-- Tests that every function and class is immediately preceded by a docblock. A property "excludePrivateMembers" can be set if you want to disable docblocks for private member functions. -->
|
||||
<test name="docBlocks">
|
||||
<property name="excludePrivateMembers" value="true"/>
|
||||
<property name="testReturn" value="true"/>
|
||||
<property name="testParam" value="true"/>
|
||||
<property name="testThrow" value="true"/>
|
||||
</test>
|
||||
|
||||
|
||||
<!-- **************** -->
|
||||
<!-- Indentation -->
|
||||
<!-- **************** -->
|
||||
|
||||
<!-- Tests to make sure that a line does not contain the tab character. -->
|
||||
<!-- <test name="noTabs"/> -->
|
||||
|
||||
<!-- Test to make sure that every control structure is included within a {} block, even if it is syntactically optional. -->
|
||||
<!-- <test name="controlStructNeedCurly"/> -->
|
||||
|
||||
<!-- Check the position of the open curly brace in a control structure (if) -->
|
||||
<!-- sl = same line -->
|
||||
<!-- nl = new line -->
|
||||
<test name="controlStructOpenCurly">
|
||||
<property name="position" value="nl"/>
|
||||
</test>
|
||||
|
||||
<!-- Check the position of the close curly brace -->
|
||||
<test name="controlCloseCurly" level="INFO">
|
||||
</test>
|
||||
|
||||
<!-- Check the position of the open curly brace after a function -->
|
||||
<!-- sl = same line -->
|
||||
<!-- nl = new line -->
|
||||
<test name="funcDefinitionOpenCurly">
|
||||
<property name="position" value="nl"/>
|
||||
</test>
|
||||
|
||||
<!-- Check the position of the else -->
|
||||
<!-- sl = same line -->
|
||||
<!-- nl = new line -->
|
||||
<test name="controlStructElse">
|
||||
<property name="position" value="nl"/>
|
||||
</test>
|
||||
|
||||
|
||||
<!-- **************** -->
|
||||
<!-- Spaces -->
|
||||
<!-- **************** -->
|
||||
|
||||
<!-- Tests that the control statements ("if", "else", "while", "for", etc.)
|
||||
are followed by a space before the opening parenthesis.
|
||||
PEAR standard stipulates this to distinguish it from function calls.
|
||||
-->
|
||||
<!--
|
||||
<test name="spaceAfterControlStmt"/>
|
||||
-->
|
||||
|
||||
<!-- Check that there is no space after a function name in a function call -->
|
||||
<!-- <test name="noSpaceAfterFunctionName" level="INFO"></test> -->
|
||||
|
||||
|
||||
<!-- Check for the (required) presence of a white space after some tokens (like ,) -->
|
||||
<!--
|
||||
<test name="checkWhiteSpaceAfter">
|
||||
<exception value="."/>
|
||||
</test>
|
||||
-->
|
||||
|
||||
<!-- Check for the (required) presence of a white space before some tokens -->
|
||||
<!--
|
||||
<test name="checkWhiteSpaceBefore">
|
||||
<exception value="."/>
|
||||
<exception value=":"/>
|
||||
</test>
|
||||
-->
|
||||
|
||||
<!-- Check that there is no space before before some tokens -->
|
||||
<!--
|
||||
<test name="noSpaceBeforeToken" level="INFO">
|
||||
</test>
|
||||
-->
|
||||
|
||||
<!-- Check that there is no space after some tokens -->
|
||||
<!--
|
||||
<test name="noSpaceAfterToken" level="INFO">
|
||||
</test>
|
||||
-->
|
||||
|
||||
<!-- **************** -->
|
||||
<!-- Metrics -->
|
||||
<!-- **************** -->
|
||||
|
||||
<!-- Check that the lenght of the line doesn't pass the max value -->
|
||||
<test name="lineLength" level="INFO">
|
||||
<property name="maxLineLength" value="160"/>
|
||||
</test>
|
||||
|
||||
<!-- Checks that the lenght (in lines) of a function doesn't pass the max value -->
|
||||
<test name="functionLength" level="INFO">
|
||||
<property name="maxLength" value="500"/>
|
||||
</test>
|
||||
|
||||
<!-- Checks for excessive parameters in a function declaration -->
|
||||
<!-- <test name="functionMaxParameters">
|
||||
<property name="maxParameters" value="4"/>
|
||||
</test> -->
|
||||
|
||||
<!-- Check Cyclomatic Complexity -->
|
||||
<!-- see http://www.aivosto.com/project/help/pm-complexity.html -->
|
||||
<test name="cyclomaticComplexity">
|
||||
<!-- Level raising a warning -->
|
||||
<property name="warningLevel" value="10"/>
|
||||
<!-- Level raising an error -->
|
||||
<property name="errorLevel" value="20"/>
|
||||
</test>
|
||||
|
||||
<!-- **************** -->
|
||||
<!-- Other -->
|
||||
<!-- **************** -->
|
||||
|
||||
<!-- All arguments with default values should be at the end -->
|
||||
<test name="defaultValuesOrder"/>
|
||||
|
||||
<!-- Check for prohibited functions -->
|
||||
<!-- @see http://www.php.net/manual/en/indexes.php -->
|
||||
<test name="checkProhibitedFunctions">
|
||||
<item value="echo"/>
|
||||
<item value="system"/>
|
||||
<item value="print_r"/>
|
||||
<item value="var_dump"/>
|
||||
<item value="dl"/>
|
||||
<!--<item value="exec"/>-->
|
||||
<item value="passthru"/>
|
||||
<!-- <item value="delete"/> We disable because of false report when using method delete -->
|
||||
<item value="ereg_replace"/>
|
||||
<item value="ereg"/>
|
||||
<item value="eregi"/>
|
||||
<!-- <item value="copy"/> -->
|
||||
<!-- <item value="fwrite"/> -->
|
||||
</test>
|
||||
|
||||
<!-- Check for prohibited tokens -->
|
||||
<!-- @see http://www.php.net/manual/en/tokens.php -->
|
||||
<test name="checkProhibitedTokens">
|
||||
<item value="T_BAD_CHARACTER"/>
|
||||
<item value="T_DECLARE"/>
|
||||
<item value="T_ENDDECLARE"/>
|
||||
<item value="T_ENDFOR"/>
|
||||
<item value="T_ENDFOREACH"/>
|
||||
<item value="T_ENDIF"/>
|
||||
<item value="T_ENDSWITCH"/>
|
||||
<item value="T_ENDWHILE"/>
|
||||
<item value="T_HALT_COMPILER"/>
|
||||
<item value="T_OLD_FUNCTION"/>
|
||||
<!-- <item value="T_PRINT"/> -->
|
||||
|
||||
<!-- Same thing as the noShortPhpCodeTag rule -->
|
||||
<!-- <item value="T_OPEN_TAG_WITH_ECHO"/> -->
|
||||
|
||||
<!-- <item value="T_INLINE_HTML"/> -->
|
||||
<!-- <item value="T_ECHO"/> -->
|
||||
|
||||
|
||||
</test>
|
||||
|
||||
<!-- Check for silenced errors before function calls (@function) -->
|
||||
<test name="checkSilencedError">
|
||||
<exception value="rename"/> <!-- Exceptions to this rule -->
|
||||
<exception value="mkdir"/>
|
||||
<exception value="chmod"/>
|
||||
</test>
|
||||
|
||||
<!-- Check for encapsed variables inside a String ("$a") -->
|
||||
<test name="encapsedVariablesInsideString">
|
||||
</test>
|
||||
|
||||
<!-- Avoid passing parameters by reference -->
|
||||
<test name="avoidPassingReferences">
|
||||
</test>
|
||||
|
||||
<test name="showTODOs">
|
||||
</test>
|
||||
|
||||
<!-- Use boolean operators (&&) instead of logical operators (AND) -->
|
||||
<test name="useBooleanOperators">
|
||||
</test>
|
||||
|
||||
<!-- Check empty block like if ($a) {} -->
|
||||
<test name="checkEmptyBlock">
|
||||
<!-- <exception value="catch"/> -->
|
||||
</test>
|
||||
|
||||
<!-- Check empty statement ( ;; ) -->
|
||||
<test name="checkEmptyStatement">
|
||||
</test>
|
||||
|
||||
<!-- Check for the presence of heredoc -->
|
||||
<test name="checkHeredoc">
|
||||
</test>
|
||||
|
||||
<!-- Check for braces around code blocs (if, else, elseif, do, while, for, foreach) -->
|
||||
<!--
|
||||
<test name="needBraces">
|
||||
</test>
|
||||
-->
|
||||
|
||||
<!-- Switch need a default value -->
|
||||
<test name="switchNeedDefault">
|
||||
</test>
|
||||
|
||||
<!-- Switch case should have a break -->
|
||||
<!-- <test name="switchCaseNeedBreak">
|
||||
</test> -->
|
||||
|
||||
<!-- Switch default value should be at the end -->
|
||||
<test name="switchDefaultOrder">
|
||||
</test>
|
||||
|
||||
|
||||
<!--
|
||||
Avoid using unary operators (++) inside a control statement
|
||||
With the exception of for iterators, all variable incrementation or decrementation should occur in their own toplevel statement to increase readability.
|
||||
-->
|
||||
<test name="checkUnaryOperator">
|
||||
<exception value="for"/>
|
||||
</test>
|
||||
|
||||
<!--
|
||||
With inner assignments it is difficult to see all places where a variable is set.
|
||||
With the exception of for iterators, all assignments should occur in their own toplevel statement to increase readability.
|
||||
-->
|
||||
<test name="checkInnerAssignment">
|
||||
<exception value="for"/>
|
||||
</test>
|
||||
|
||||
<!-- Detect unused private functions (detecting unused public ones is more difficult) -->
|
||||
<test name="checkUnusedPrivateFunctions">
|
||||
</test>
|
||||
|
||||
<!-- Detect unused variables -->
|
||||
<test name="checkUnusedVariables">
|
||||
</test>
|
||||
|
||||
<!-- Detect unused function parameters -->
|
||||
<test name="checkUnusedFunctionParameters">
|
||||
</test>
|
||||
|
||||
<!-- Only one class declaration per PHP file -->
|
||||
<test name="oneClassPerFile">
|
||||
</test>
|
||||
|
||||
<!-- ******************* -->
|
||||
<!-- Optimisation -->
|
||||
<!-- ******************* -->
|
||||
|
||||
<!-- Only one class declaration per PHP file -->
|
||||
<test name="functionInsideLoop">
|
||||
</test>
|
||||
|
||||
</phpcheckstyle-configuration>
|
||||
13
dev/phpcheckstyle/phpstandard.dtd
Normal file
13
dev/phpcheckstyle/phpstandard.dtd
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!ELEMENT phpcheckstyle-configuration (test+)>
|
||||
<!ELEMENT test (property*,item*,exception*)>
|
||||
<!ATTLIST test name CDATA "">
|
||||
<!ATTLIST test regexp CDATA "">
|
||||
<!ATTLIST test level CDATA "">
|
||||
<!ELEMENT property (#PCDATA)>
|
||||
<!ATTLIST property value CDATA "">
|
||||
<!ATTLIST property name CDATA "">
|
||||
<!ELEMENT item (#PCDATA)>
|
||||
<!ATTLIST item value CDATA "">
|
||||
<!ELEMENT exception (#PCDATA)>
|
||||
<!ATTLIST exception value CDATA "">
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/bin/sh
|
||||
#----------------------------------------------------
|
||||
# Script to resize browser window to 1280x1024 to
|
||||
# be able to make size fixed screenshots using
|
||||
# ALT+Print screen.
|
||||
#----------------------------------------------------
|
||||
|
||||
# Syntax
|
||||
if [ "x$1" = "x" ]
|
||||
then
|
||||
echo "resize_windows.sh (list|0x99999999)"
|
||||
fi
|
||||
|
||||
# To list all windows
|
||||
if [ "x$1" = "xlist" ]
|
||||
then
|
||||
wmctrl -l
|
||||
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
|
||||
fi
|
||||
|
||||
8
dev/skeletons/build_class_from_table.php
Executable file → Normal file
8
dev/skeletons/build_class_from_table.php
Executable file → Normal file
@@ -120,7 +120,7 @@ else
|
||||
}
|
||||
//var_dump($property);
|
||||
|
||||
// Define substitute fetch/select parameters
|
||||
// Define substitute select parameters
|
||||
$varpropselect="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
@@ -313,7 +313,7 @@ foreach($property as $key => $prop)
|
||||
$targetcontent=preg_replace('/\$sql.= " field1=".\(isset\(\$this->field1\)\?"\'".\$this->db->escape\(\$this->field1\)."\'":"null"\).",";/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$sql.= " field2=".\(isset\(\$this->field2\)\?"\'".\$this->db->escape\(\$this->field2\)."\'":"null"\)."";/', '', $targetcontent);
|
||||
|
||||
// Substitute fetch/select parameters
|
||||
// Substitute select parameters
|
||||
$targetcontent=preg_replace('/\$sql\.= " t\.field1,";/', $varpropselect, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$sql\.= " t\.field2";/', '', $targetcontent);
|
||||
|
||||
@@ -445,10 +445,6 @@ $targetcontent=preg_replace('/Put here some comments/','Initialy built by build_
|
||||
// Substitute table name
|
||||
$targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent);
|
||||
|
||||
// Substitute fetch/select parameters
|
||||
$targetcontent=preg_replace('/\$sql\.= " t\.field1,";/', $varpropselect, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$sql\.= " t\.field2";/', '', $targetcontent);
|
||||
|
||||
// Build file
|
||||
$fp=fopen($outfile,"w");
|
||||
if ($fp)
|
||||
|
||||
@@ -46,7 +46,7 @@ class modMyModule extends DolibarrModules
|
||||
|
||||
// Id for module (must be unique).
|
||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||
$this->numero = 100000;
|
||||
$this->numero = 10000;
|
||||
// Key text used to identify module (for permissions, menus, etc...)
|
||||
$this->rights_class = 'mymodule';
|
||||
|
||||
@@ -106,7 +106,7 @@ class modMyModule extends DolibarrModules
|
||||
// Constants
|
||||
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
|
||||
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
|
||||
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
|
||||
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0)
|
||||
// );
|
||||
$this->const = array();
|
||||
|
||||
@@ -133,11 +133,7 @@ class modMyModule extends DolibarrModules
|
||||
$this->tabs = array();
|
||||
|
||||
// Dictionnaries
|
||||
if (! isset($conf->mymodule->enabled))
|
||||
{
|
||||
$conf->mymodule=new stdClass();
|
||||
$conf->mymodule->enabled=0;
|
||||
}
|
||||
if (! isset($conf->mymodule->enabled)) $conf->mymodule->enabled=0;
|
||||
$this->dictionnaries=array();
|
||||
/* Example:
|
||||
if (! isset($conf->mymodule->enabled)) $conf->mymodule->enabled=0; // This is to avoid warnings
|
||||
@@ -158,8 +154,14 @@ class modMyModule extends DolibarrModules
|
||||
// Boxes
|
||||
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
|
||||
$this->boxes = array(); // List of boxes
|
||||
$r=0;
|
||||
// Example:
|
||||
//$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>'')););
|
||||
/*
|
||||
$this->boxes[$r][1] = "myboxa.php";
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "myboxb.php";
|
||||
$r++;
|
||||
*/
|
||||
|
||||
// Permissions
|
||||
$this->rights = array(); // Permission array used by this module
|
||||
@@ -220,8 +222,8 @@ class modMyModule extends DolibarrModules
|
||||
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
// $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled.
|
||||
// $this->export_permission[$r]=array(array("facture","facture","export"));
|
||||
// $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef');
|
||||
// $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product');
|
||||
// $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef');
|
||||
// $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product');
|
||||
// $this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
|
||||
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
// Put here all includes required by your class file
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
//require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
|
||||
@@ -32,13 +32,13 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
/**
|
||||
* Put here description of your class
|
||||
*/
|
||||
class Skeleton_Class extends CommonObject
|
||||
class Skeleton_Class // extends CommonObject
|
||||
{
|
||||
var $db; //!< To store db handler
|
||||
var $error; //!< To return error code (or message)
|
||||
var $errors=array(); //!< To return several error codes (or messages)
|
||||
var $element='skeleton'; //!< Id that identify managed objects
|
||||
var $table_element='skeleton'; //!< Name of table without prefix where object is stored
|
||||
//var $element='skeleton'; //!< Id that identify managed objects
|
||||
//var $table_element='skeleton'; //!< Name of table without prefix where object is stored
|
||||
|
||||
var $id;
|
||||
var $prop1;
|
||||
|
||||
@@ -27,13 +27,12 @@
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1');
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show
|
||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
||||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||
|
||||
// Change this following line to use the correct relative path (../, ../../, etc)
|
||||
$res=0;
|
||||
@@ -72,17 +71,17 @@ if ($user->societe_id > 0)
|
||||
|
||||
if ($action == 'add')
|
||||
{
|
||||
$object=new Skeleton_Class($db);
|
||||
$object->prop1=$_POST["field1"];
|
||||
$object->prop2=$_POST["field2"];
|
||||
$result=$object->create($user);
|
||||
$myobject=new Skeleton_Class($db);
|
||||
$myobject->prop1=$_POST["field1"];
|
||||
$myobject->prop2=$_POST["field2"];
|
||||
$result=$myobject->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Creation OK
|
||||
}
|
||||
{
|
||||
// Creation KO
|
||||
$mesg=$object->error;
|
||||
$mesg=$myobject->error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,22 +119,19 @@ jQuery(document).ready(function() {
|
||||
|
||||
|
||||
// Example 2 : Adding links to objects
|
||||
// The class must extends CommonObject class to have this method available
|
||||
//$somethingshown=$object->showLinkedObjectBlock();
|
||||
$somethingshown=$myobject->showLinkedObjectBlock();
|
||||
|
||||
|
||||
// Example 3 : List of data
|
||||
if ($action == 'list')
|
||||
{
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
$sql.= " t.field1,";
|
||||
$sql.= " t.field2";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."skeleton as t";
|
||||
$sql.= " WHERE field3 = 'xxx'";
|
||||
$sql.= " ORDER BY field1 ASC";
|
||||
|
||||
print '<table class="noborder">'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
|
||||
@@ -169,8 +165,6 @@ if ($action == 'list')
|
||||
$error++;
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/* Copyright (C) 2007-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file dev/skeletons/skeleton_script.php
|
||||
* \ingroup mymodule
|
||||
* \ingroup mymodule othermodule1 othermodule2
|
||||
* \brief This file is an example for a command line script
|
||||
* Put here some comments
|
||||
*/
|
||||
@@ -34,22 +34,19 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Init global variables
|
||||
$version='1.0';
|
||||
// Global variables
|
||||
$version='1.29';
|
||||
$error=0;
|
||||
|
||||
|
||||
// -------------------- START OF YOUR CODE HERE --------------------
|
||||
@set_time_limit(0); // No timeout for this script
|
||||
define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only".
|
||||
|
||||
// Include and load Dolibarr environment variables
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
|
||||
// $user is created but empty.
|
||||
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
|
||||
|
||||
//$langs->setDefaultLang('en_US'); // To change default language of $langs
|
||||
$langs->load("main"); // To load language file for default language
|
||||
@set_time_limit(0); // No timeout for this script
|
||||
|
||||
// Load user and its permissions
|
||||
$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||
@@ -161,7 +158,7 @@ else
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
$db->close(); // Close $db database opened handler
|
||||
$db->close(); // Close database opened handler
|
||||
|
||||
return $error;
|
||||
?>
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<meta name="author" content="Dolibarr Development Team">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/dolibarrnew/theme/eldy/img/favicon.ico"/>
|
||||
<title>Login Dolibarr 3.4.0-alpha</title>
|
||||
<!-- Includes for JQuery (Ajax library) -->
|
||||
<link rel="stylesheet" type="text/css" href="/dolibarrnew/includes/jquery/css/smoothness/jquery-ui-latest.custom.css" />
|
||||
<link rel="stylesheet" type="text/css" title="default" href="/dolibarrnew/custom/filemanager/css/filemanager.css.php"><!-- Added by module filemanager-->
|
||||
<!-- Includes JS for JQuery -->
|
||||
<script type="text/javascript" src="/dolibarrnew/includes/jquery/js/jquery-latest.min.js"></script>
|
||||
<script type="text/javascript" src="/dolibarrnew/core/js/dst.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/dolibarrnew/theme/eldy/style.css.php?lang=fr_FR" />
|
||||
<!-- HTTP_USER_AGENT = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22 -->
|
||||
</head>
|
||||
<body class="body">
|
||||
|
||||
<center>
|
||||
|
||||
<div class="login_table" align="center">
|
||||
|
||||
<!-- <tr><td colspan="2" valign="middle"> -->
|
||||
<div id="login_line1" align="center">
|
||||
|
||||
<div id="login_left" style="display: inline-block; min-width: 250px; margin: 0 auto;"><center>
|
||||
|
||||
<table class="none" summary="Login pass" cellpadding="2" align="center">
|
||||
|
||||
<!-- Login -->
|
||||
<tr>
|
||||
<td valign="bottom"> <strong><label for="username">Login</label></strong>fds fs df sdf gdsfgsdf r </td>
|
||||
<td valign="bottom" class="nowrap">
|
||||
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="" tabindex="1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Password -->
|
||||
<tr><td valign="top" class="nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
||||
<td valign="top" class="nowrap">
|
||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</div> <!-- end div left -->
|
||||
|
||||
<!-- </td>
|
||||
<td align="center" valign="middle">-->
|
||||
<div id="login_right" style="display: inline-block; min-width: 250px; margin: 0 auto;">
|
||||
|
||||
<img alt="Logo" title="" src="/dolibarrnew/theme/dolibarr_logo.png" id="img_logo" />
|
||||
|
||||
</div>
|
||||
</div> <!-- end div line1 -->
|
||||
<!--</td>
|
||||
|
||||
</tr>-->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<!-- END PHP TEMPLATE -->
|
||||
@@ -1,4 +1,4 @@
|
||||
README (English)
|
||||
README (English)
|
||||
--------------------------------
|
||||
|
||||
* Most screen captures and icons are Dolibarr contributions, however,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 130 KiB |
14
htdocs/.gitignore
vendored
14
htdocs/.gitignore
vendored
@@ -1,9 +1,11 @@
|
||||
/test.php
|
||||
/custom*
|
||||
/bootstrap
|
||||
/multicompany
|
||||
/ovh
|
||||
/numberingpack
|
||||
/google
|
||||
/skincoloreditor
|
||||
/extensions*
|
||||
/nltechno*
|
||||
/bootstrap*
|
||||
/google*
|
||||
/multicompany*
|
||||
/numberingpack*
|
||||
/ovh*
|
||||
/pos
|
||||
/ultimatepdf*
|
||||
|
||||
@@ -138,7 +138,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_LOGIN_NOT_REQUIRED">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1);
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?$conf->global->ADHERENT_LOGIN_NOT_REQUIRED:1),1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
@@ -171,52 +171,29 @@ print '<input type="submit" class="button" value="'.$langs->trans("Update").'" n
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Insert subscription into bank account
|
||||
// Insertion cotisations dans compte financier
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
||||
$arraychoices=array('0'=>$langs->trans("None"));
|
||||
if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans("MoreActionBankDirect");
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly");
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
|
||||
print '<td>';
|
||||
print $form->selectarray('constvalue',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right" colspan="2">';
|
||||
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name")).' '.img_warning("","");
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Use vat for invoice creation
|
||||
if ($conf->facture->enabled)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_VAT_FOR_SUBSCRIPTIONS">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('constvalue', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right" colspan="2">';
|
||||
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
@@ -239,7 +216,7 @@ form_constantes($constantes);
|
||||
|
||||
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%, ';
|
||||
print '%YEAR%, %MONTH%, %DAY%';
|
||||
print '<br>';
|
||||
|
||||
@@ -257,7 +234,7 @@ form_constantes($constantes);
|
||||
|
||||
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%, ';
|
||||
print '%YEAR%, %MONTH%, %DAY%';
|
||||
print '<br>';
|
||||
|
||||
@@ -287,7 +264,7 @@ form_constantes($constantes);
|
||||
|
||||
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%, ';
|
||||
//print '%YEAR%, %MONTH%, %DAY%'; // Not supported
|
||||
print '<br>';
|
||||
|
||||
|
||||
13
htdocs/adherents/admin/adherent_extrafields.php
Normal file → Executable file
13
htdocs/adherents/admin/adherent_extrafields.php
Normal file → Executable file
@@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='adherent'; //Must be the $table_element of the class that manage extrafield
|
||||
$elementtype='member';
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
@@ -68,12 +68,14 @@ print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Members"), 0, 'user');
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Members")).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
@@ -103,6 +105,7 @@ foreach($extrafields->attribute_type as $key => $value)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=".$key."\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
// $i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
@@ -114,15 +117,15 @@ dol_fiche_end();
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute").'</a></div>';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/adherents/admin/adherent_type_extrafields.php
|
||||
* \ingroup member
|
||||
* \brief Page to setup extra fields of members
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("admin");
|
||||
|
||||
$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='adherent_type'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("MembersTypes");
|
||||
|
||||
$help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
llxHeader('',$langs->trans("MembersSetup"),$help_url);
|
||||
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_type', $langs->trans("Members"), 0, 'user');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Unique").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Required").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
foreach($extrafields->attribute_type as $key => $value)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
||||
print "<td>".$key."</td>\n";
|
||||
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
|
||||
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
|
||||
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
|
||||
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=".$key."\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute").'</a></div>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
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 "<br>";
|
||||
print_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@@ -51,17 +51,14 @@ $testunsubscribeemail = GETPOST("testunsubscribeemail");
|
||||
// Action mise a jour ou ajout d'une constante
|
||||
if ($action == 'update' || $action == 'add')
|
||||
{
|
||||
foreach($_POST['constname'] as $key => $val)
|
||||
{
|
||||
$constname=$_POST["constname"][$key];
|
||||
$constvalue=$_POST["constvalue"][$key];
|
||||
$consttype=$_POST["consttype"][$key];
|
||||
$constnote=$_POST["constnote"][$key];
|
||||
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
|
||||
$constname=GETPOST("constname");
|
||||
$constvalue=GETPOST("constvalue");
|
||||
$consttype=GETPOST("consttype");
|
||||
$constnote=GETPOST("constnote");
|
||||
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
@@ -162,6 +159,9 @@ dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
/*
|
||||
* Mailman
|
||||
*/
|
||||
$var=!$var;
|
||||
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
|
||||
{
|
||||
@@ -180,8 +180,6 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
|
||||
|
||||
print_fiche_titre($langs->trans('MailmanTitle'), $lien,'');
|
||||
|
||||
print '<br>';
|
||||
|
||||
// JQuery activity
|
||||
print '<script type="text/javascript">
|
||||
var i1=0;
|
||||
@@ -198,7 +196,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
|
||||
});
|
||||
</script>';
|
||||
|
||||
form_constantes($constantes,1);
|
||||
form_constantes($constantes);
|
||||
|
||||
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>';
|
||||
@@ -219,12 +217,12 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="action" value="testsubscribe">';
|
||||
print $langs->trans("TestSubscribe").'<br>';
|
||||
print $langs->trans("EMail").' <input type="email" class="flat" name="testsubscribeemail" value="'.GETPOST('testsubscribeemail').'"> <input class="button" type="submit" value="'.$langs->trans("Test").'"><br>';
|
||||
print $langs->trans("EMail").' <input type="email" name="testsubscribeemail" value="'.GETPOST('testsubscribeemail').'"> <input class="button" type="submit" value="'.$langs->trans("Test").'"><br>';
|
||||
print '</form>';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="action" value="testunsubscribe">';
|
||||
print $langs->trans("TestUnSubscribe").'<br>';
|
||||
print $langs->trans("EMail").' <input type="email" class="flat" name="testunsubscribeemail" value="'.GETPOST('testunsubscribeemail').'"> <input class="button" type="submit" value="'.$langs->trans("Test").'"><br>';
|
||||
print $langs->trans("EMail").' <input type="email" name="testunsubscribeemail" value="'.GETPOST('testunsubscribeemail').'"> <input class="button" type="submit" value="'.$langs->trans("Test").'"><br>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
78
htdocs/adherents/admin/public.php
Normal file → Executable file
78
htdocs/adherents/admin/public.php
Normal file → Executable file
@@ -48,13 +48,11 @@ if ($action == 'update')
|
||||
$amount=GETPOST('MEMBER_NEWFORM_AMOUNT');
|
||||
$editamount=GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
|
||||
$payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||
$email=GETPOST('MEMBER_PAYONLINE_SENDEMAIL');
|
||||
|
||||
$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_PAYONLINE_SENDEMAIL",$email,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@@ -92,39 +90,22 @@ if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print 'jQuery(document).ready(function () {
|
||||
function initemail()
|
||||
{
|
||||
if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\')
|
||||
{
|
||||
jQuery("#tremail").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery("#tremail").show();
|
||||
}
|
||||
}
|
||||
function initfields()
|
||||
{
|
||||
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\')
|
||||
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\')
|
||||
{
|
||||
jQuery("#tramount").hide();
|
||||
jQuery("#tredit").hide();
|
||||
jQuery("#trpayment").hide();
|
||||
jQuery("#tremail").hide();
|
||||
jQuery(".drag").hide();
|
||||
}
|
||||
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'1\')
|
||||
{
|
||||
jQuery("#tramount").show();
|
||||
jQuery("#tredit").show();
|
||||
jQuery("#trpayment").show();
|
||||
if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\') jQuery("#tremail").hide();
|
||||
else jQuery("#tremail").show();
|
||||
}
|
||||
}
|
||||
initfields();
|
||||
jQuery("#MEMBER_ENABLE_PUBLIC").change(function() { initfields(); });
|
||||
jQuery("#MEMBER_NEWFORM_PAYONLINE").change(function() { initemail(); });
|
||||
})';
|
||||
jQuery(".drag").show();
|
||||
}
|
||||
}
|
||||
initfields();
|
||||
jQuery("#MEMBER_ENABLE_PUBLIC").change(function() {
|
||||
initfields();
|
||||
});
|
||||
})';
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
@@ -138,7 +119,7 @@ print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Value").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=true;
|
||||
|
||||
@@ -147,14 +128,14 @@ $var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("EnablePublicSubscriptionForm");
|
||||
print '</td><td align="right">';
|
||||
print '</td><td width="60" align="right">';
|
||||
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Type
|
||||
/*$var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].' class="drag"><td>';
|
||||
print '<tr '.$bcdd[$var].'><td>';
|
||||
print $langs->trans("EnablePublicSubscriptionForm");
|
||||
print '</td><td width="60" align="center">';
|
||||
print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1);
|
||||
@@ -163,43 +144,32 @@ print "</td></tr>\n"; */
|
||||
// Amount
|
||||
$var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].' id="tramount"><td>';
|
||||
print '<tr '.$bcdd[$var].'><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td align="right">';
|
||||
print '</td><td width="60" align="right">';
|
||||
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';;
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Can edit
|
||||
$var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].' id="tredit"><td>';
|
||||
print '<tr '.$bcdd[$var].'><td>';
|
||||
print $langs->trans("CanEditAmount");
|
||||
print '</td><td align="right">';
|
||||
print '</td><td width="60" align="right">';
|
||||
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
{
|
||||
// Jump to an online payment page
|
||||
$var=! $var;
|
||||
print '<tr '.$bc[$var].' id="trpayment"><td>';
|
||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||
print '</td><td align="right">';
|
||||
$listofval=array();
|
||||
if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox';
|
||||
if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal';
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
{
|
||||
// Jump to an online payment page
|
||||
$var=! $var;
|
||||
print '<tr '.$bc[$var].' id="tremail"><td>';
|
||||
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
|
||||
print '</td><td align="right">';
|
||||
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';;
|
||||
print '<tr '.$bcdd[$var].'><td>';
|
||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||
print '</td><td width="60" align="right">';
|
||||
$listofval=array();
|
||||
if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox';
|
||||
if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal';
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,6 @@ if (! empty($conf->global->ADHERENT_USE_SPIP))
|
||||
);
|
||||
|
||||
print_fiche_titre($langs->trans('SPIPTitle'), $lien, '');
|
||||
print '<br>';
|
||||
form_constantes($constantes);
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@@ -139,7 +139,9 @@ if ($object->id > 0)
|
||||
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create">'.$langs->trans("AddAction").'</a></div>';
|
||||
// FIXME socid parameters is not valid, a member is not a thirparty
|
||||
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@@ -286,10 +286,10 @@ abstract class ActionsAdherentCardCommon
|
||||
}
|
||||
|
||||
// Zip
|
||||
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
|
||||
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
|
||||
|
||||
// Town
|
||||
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id'));
|
||||
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id'));
|
||||
|
||||
if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id;
|
||||
|
||||
@@ -300,7 +300,7 @@ abstract class ActionsAdherentCardCommon
|
||||
if ($user->admin) $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
|
||||
// State
|
||||
if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id,$this->object->country_code);
|
||||
if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->fk_departement,$this->object->country_code);
|
||||
else $this->tpl['select_state'] = $countrynotdefined;
|
||||
|
||||
// Physical or Moral
|
||||
@@ -364,10 +364,10 @@ abstract class ActionsAdherentCardCommon
|
||||
|
||||
if ($action == 'create_user')
|
||||
{
|
||||
// Full firstname and lastname separated with a dot : firstname.lastname
|
||||
// Full firstname and name separated with a dot : firstname.name
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
$login=dol_buildlogin($this->object->lastname, $this->object->firstname);
|
||||
$login=dol_buildlogin($this->object->nom, $this->object->prenom);
|
||||
|
||||
$generated_password=getRandomPassword('');
|
||||
$password=$generated_password;
|
||||
@@ -394,14 +394,16 @@ abstract class ActionsAdherentCardCommon
|
||||
$this->object->old_firstname = $_POST["old_firstname"];
|
||||
|
||||
$this->object->fk_soc = $_POST["fk_soc"];
|
||||
$this->object->lastname = $_POST["lastname"];
|
||||
$this->object->name = $_POST["name"];
|
||||
$this->object->firstname = $_POST["firstname"];
|
||||
$this->object->civilite_id = $_POST["civilite_id"];
|
||||
$this->object->address = $_POST["address"];
|
||||
$this->object->zip = $_POST["zipcode"];
|
||||
$this->object->town = $_POST["town"];
|
||||
$this->object->fk_pays = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
|
||||
$this->object->fk_departement = $_POST["departement_id"];
|
||||
$this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
|
||||
$this->object->state_id = $_POST["state_id"];
|
||||
$this->object->state_id = $_POST["departement_id"];
|
||||
$this->object->phone_perso = $_POST["phone_perso"];
|
||||
$this->object->phone_mobile = $_POST["phone_mobile"];
|
||||
$this->object->email = $_POST["email"];
|
||||
@@ -421,6 +423,8 @@ abstract class ActionsAdherentCardCommon
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
$this->object->pays_code = $obj->code;
|
||||
$this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
$this->object->country_code = $obj->code;
|
||||
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['town']; ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['ville']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -76,7 +76,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans('State'); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['state']; ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -362,11 +362,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
|
||||
// Add line to draft invoice
|
||||
$idprodsubscription=0;
|
||||
$vattouse=0;
|
||||
if (isset($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) && $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS == 'defaultforfoundationcountry')
|
||||
{
|
||||
$vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription);
|
||||
}
|
||||
$vattouse=get_default_tva($mysoc, $customer, $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);
|
||||
if ($result <= 0)
|
||||
@@ -479,6 +475,8 @@ if ($rowid)
|
||||
{
|
||||
$res=$object->fetch($rowid);
|
||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||
//$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
//if ($res < 0) { dol_print_error($db); exit; }
|
||||
|
||||
$adht->fetch($object->typeid);
|
||||
|
||||
@@ -503,7 +501,7 @@ if ($rowid)
|
||||
print $form->showrefnav($object, 'rowid', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
$showphoto='<td rowspan="'.$rowspan.'" class="hideonsmartphone" align="center" valign="middle" width="25%">'.$form->showphoto('memberphoto',$object).'</td>';
|
||||
$showphoto='<td rowspan="'.$rowspan.'" align="center" valign="middle" width="25%">'.$form->showphoto('memberphoto',$object).'</td>';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
@@ -640,8 +638,8 @@ if ($rowid)
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($object->statut > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription">'.$langs->trans("AddSubscription")."</a></div>";
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a></div>';
|
||||
if ($object->statut > 0) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription">'.$langs->trans("AddSubscription")."</a>";
|
||||
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a>';
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
@@ -656,9 +654,8 @@ if ($rowid)
|
||||
*/
|
||||
if ($action != 'addsubscription' && $action != 'create_thirdparty')
|
||||
{
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,";
|
||||
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||
$sql.= " c.datec,";
|
||||
$sql.= " c.dateadh,";
|
||||
$sql.= " c.datef,";
|
||||
$sql.= " c.fk_bank,";
|
||||
@@ -682,8 +679,7 @@ if ($rowid)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateCreation").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateStart").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateSubscription").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateEnd").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
@@ -701,7 +697,6 @@ if ($rowid)
|
||||
$cotisationstatic->ref=$objp->crowid;
|
||||
$cotisationstatic->id=$objp->crowid;
|
||||
print '<td>'.$cotisationstatic->getNomUrl(1).'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datec),'dayhour')."</td>\n";
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dateadh),'day')."</td>\n";
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
|
||||
print '<td align="right">'.price($objp->cotisation).'</td>';
|
||||
@@ -761,9 +756,9 @@ if ($rowid)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1;
|
||||
if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled)) $bankdirect=1;
|
||||
else if (empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1;
|
||||
}
|
||||
|
||||
print "\n\n<!-- Form add subscription -->\n";
|
||||
@@ -830,7 +825,7 @@ if ($rowid)
|
||||
print '<input type="hidden" name="action" value="cotisation">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
|
||||
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->societe).'">';
|
||||
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->name).'">';
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
|
||||
$today=dol_now();
|
||||
@@ -900,18 +895,16 @@ if ($rowid)
|
||||
// Title payments
|
||||
//print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
|
||||
|
||||
// No more action
|
||||
// Define a way to write payment
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('MoreActions');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
|
||||
// Add entry into bank accoun
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(! empty($bankdirect)?' checked="checked"':'');
|
||||
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
|
||||
}
|
||||
// Add invoice with no payments
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
|
||||
{
|
||||
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(! empty($invoiceonly)?' checked="checked"':'');
|
||||
@@ -919,16 +912,14 @@ if ($rowid)
|
||||
print '> '.$langs->trans("MoreActionInvoiceOnly");
|
||||
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
||||
else
|
||||
{
|
||||
{
|
||||
print ' ('.$langs->trans("NoThirdPartyAssociatedToMember");
|
||||
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">';
|
||||
print $langs->trans("CreateDolibarrThirdParty");
|
||||
print '</a>)';
|
||||
}
|
||||
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0).'.';
|
||||
print '<br>';
|
||||
}
|
||||
// Add invoice with payments
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
|
||||
{
|
||||
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(! empty($bankviainvoice)?' checked="checked"':'');
|
||||
@@ -936,13 +927,12 @@ if ($rowid)
|
||||
print '> '.$langs->trans("MoreActionBankViaInvoice");
|
||||
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
||||
else
|
||||
{
|
||||
{
|
||||
print ' ('.$langs->trans("NoThirdPartyAssociatedToMember");
|
||||
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">';
|
||||
print $langs->trans("CreateDolibarrThirdParty");
|
||||
print '</a>)';
|
||||
}
|
||||
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0).'.';
|
||||
print '<br>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
@@ -1035,4 +1025,4 @@ else
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
|
||||
21
htdocs/adherents/cartes/carte.php
Normal file → Executable file
21
htdocs/adherents/cartes/carte.php
Normal file → Executable file
@@ -61,12 +61,12 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
$arrayofmembers=array();
|
||||
|
||||
// requete en prenant que les adherents a jour de cotisation
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,";
|
||||
$sql.= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,";
|
||||
$sql = "SELECT d.rowid, d.prenom as firstname, d.nom as lastname, d.login, d.societe as company, d.datefin,";
|
||||
$sql.= " d.adresse as address, d.cp as zip, d.ville as town, d.naiss, d.email, d.photo,";
|
||||
$sql.= " t.libelle as type,";
|
||||
$sql.= " p.code as country_code, p.libelle as country";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
||||
if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid;
|
||||
if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'";
|
||||
@@ -101,14 +101,23 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
'%COUNTRY%'=>$objp->country,
|
||||
'%COUNTRY_CODE%'=>$objp->country_code,
|
||||
'%EMAIL%'=>$objp->email,
|
||||
'%BIRTH%'=>dol_print_date($objp->birth,'day'),
|
||||
'%NAISS%'=>dol_print_date($objp->naiss,'day'),
|
||||
'%TYPE%'=>$objp->type,
|
||||
'%YEAR%'=>$year,
|
||||
'%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"]."/", // deprecated
|
||||
// For backward compatibility
|
||||
'%PRENOM%'=>$objp->firstname,
|
||||
'%NOM%'=>$objp->lastname,
|
||||
'%SOCIETE%'=>$objp->company,
|
||||
'%ADRESSE%'=>$objp->address,
|
||||
'%CP%'=>$objp->zip,
|
||||
'%VILLE%'=>$objp->town,
|
||||
'%PAYS%'=>$objp->country,
|
||||
'%ANNEE%'=>$year,
|
||||
'%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/" // deprecated
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
|
||||
@@ -41,30 +41,36 @@ class Adherent extends CommonObject
|
||||
public $table_element='adherent';
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $error;
|
||||
var $errors;
|
||||
var $mesgs;
|
||||
|
||||
var $id;
|
||||
var $ref;
|
||||
var $civilite_id;
|
||||
var $firstname;
|
||||
var $prenom; // deprecated
|
||||
var $lastname;
|
||||
var $nom; // deprecated
|
||||
var $login;
|
||||
var $pass;
|
||||
var $societe;
|
||||
var $company;
|
||||
var $adresse;
|
||||
var $address;
|
||||
var $cp;
|
||||
var $zip;
|
||||
var $ville;
|
||||
var $town;
|
||||
|
||||
var $state_id; // Id of department
|
||||
var $state_code; // Code of department
|
||||
var $state; // Label of department
|
||||
var $fk_departement; // deprecated
|
||||
var $departement_code; // deprecated
|
||||
var $departement; // deprecated
|
||||
|
||||
var $country_id;
|
||||
var $country_code;
|
||||
var $country;
|
||||
var $pays_id; // deprecated
|
||||
var $pays_code; // deprecated
|
||||
var $pays; // deprecated
|
||||
|
||||
var $email;
|
||||
var $phone;
|
||||
@@ -81,7 +87,7 @@ class Adherent extends CommonObject
|
||||
var $datem;
|
||||
var $datefin;
|
||||
var $datevalid;
|
||||
var $birth;
|
||||
var $naiss;
|
||||
|
||||
var $typeid; // Id type adherent
|
||||
var $type; // Libelle type adherent
|
||||
@@ -179,7 +185,7 @@ class Adherent extends CommonObject
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$birthday = dol_print_date($this->birth,'day');
|
||||
$birthday = dol_print_date($this->naiss,'day');
|
||||
|
||||
$msgishtml = 0;
|
||||
if (dol_textishtml($text,1)) $msgishtml = 1;
|
||||
@@ -218,15 +224,16 @@ class Adherent extends CommonObject
|
||||
'%TOWN%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'%BIRTH%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
// For backward compatibility
|
||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
@@ -387,21 +394,21 @@ class Adherent extends CommonObject
|
||||
*/
|
||||
function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
global $conf, $langs;
|
||||
|
||||
$nbrowsaffected=0;
|
||||
$error=0;
|
||||
|
||||
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass." nosyncthirdparty=".$nosyncthirdparty.", email=".$this->email);
|
||||
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass.", email=".$this->email);
|
||||
|
||||
// Clean parameters
|
||||
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname);
|
||||
$this->firstname=trim($this->firstname)?trim($this->firstname):trim($this->firstname);
|
||||
$this->address=($this->address?$this->address:$this->address);
|
||||
$this->zip=($this->zip?$this->zip:$this->zip);
|
||||
$this->town=($this->town?$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->state_id);
|
||||
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->nom);
|
||||
$this->firstname=trim($this->firstname)?trim($this->firstname):trim($this->prenom);
|
||||
$this->address=($this->address?$this->address:$this->adresse);
|
||||
$this->zip=($this->zip?$this->zip:$this->cp);
|
||||
$this->town=($this->town?$this->town:$this->ville);
|
||||
$this->country_id=($this->country_id > 0?$this->country_id:$this->fk_pays);
|
||||
$this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement);
|
||||
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords(trim($this->lastname));
|
||||
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords(trim($this->firstname));
|
||||
|
||||
@@ -417,16 +424,16 @@ class Adherent extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql.= " civilite = ".(!is_null($this->civilite_id)?"'".$this->civilite_id."'":"null");
|
||||
$sql.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
|
||||
$sql.= ", lastname=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
|
||||
$sql.= ", prenom = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
|
||||
$sql.= ", nom=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
|
||||
$sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null");
|
||||
$sql.= ", societe=" .($this->societe?"'".$this->db->escape($this->societe)."'":"null");
|
||||
$sql.= ", fk_soc=" .($this->fk_soc > 0?"'".$this->fk_soc."'":"null");
|
||||
$sql.= ", address=" .($this->address?"'".$this->db->escape($this->address)."'":"null");
|
||||
$sql.= ", zip=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null");
|
||||
$sql.= ", town=" .($this->town?"'".$this->db->escape($this->town)."'":"null");
|
||||
$sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null");
|
||||
$sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null");
|
||||
$sql.= ", adresse=" .($this->address?"'".$this->db->escape($this->address)."'":"null");
|
||||
$sql.= ", cp=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null");
|
||||
$sql.= ", ville=" .($this->town?"'".$this->db->escape($this->town)."'":"null");
|
||||
$sql.= ", pays=" .($this->country_id>0?"'".$this->country_id."'":"null");
|
||||
$sql.= ", fk_departement=".($this->state_id>0?"'".$this->state_id."'":"null");
|
||||
$sql.= ", email='".$this->email."'";
|
||||
$sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null");
|
||||
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
|
||||
@@ -437,7 +444,7 @@ class Adherent extends CommonObject
|
||||
$sql.= ", statut=" .$this->statut;
|
||||
$sql.= ", fk_adherent_type=".$this->typeid;
|
||||
$sql.= ", morphy='".$this->morphy."'";
|
||||
$sql.= ", birth=" .($this->birth?"'".$this->db->idate($this->birth)."'":"null");
|
||||
$sql.= ", naiss=" .($this->naiss?"'".$this->db->idate($this->naiss)."'":"null");
|
||||
if ($this->datefin) $sql.= ", datefin='".$this->db->idate($this->datefin)."'"; // Ne doit etre modifie que par effacement cotisation
|
||||
if ($this->datevalid) $sql.= ", datevalid='".$this->db->idate($this->datevalid)."'"; // Ne doit etre modifie que par validation adherent
|
||||
$sql.= ", fk_user_mod=".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest
|
||||
@@ -455,6 +462,8 @@ class Adherent extends CommonObject
|
||||
$nbrowsaffected+=$this->db->affected_rows($resql);
|
||||
|
||||
// Actions on extra fields (by external module)
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
$hookmanager->initHooks(array('memberdao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
$action='';
|
||||
@@ -519,6 +528,8 @@ class Adherent extends CommonObject
|
||||
$luser->civilite_id=$this->civilite_id;
|
||||
$luser->firstname=$this->firstname;
|
||||
$luser->lastname=$this->lastname;
|
||||
$luser->prenom=$this->firstname; // deprecated
|
||||
$luser->nom=$this->lastname; // deprecated
|
||||
$luser->login=$this->user_login;
|
||||
$luser->pass=$this->pass;
|
||||
$luser->societe_id=$this->societe;
|
||||
@@ -565,7 +576,7 @@ class Adherent extends CommonObject
|
||||
$lthirdparty->tel=$this->phone;
|
||||
$lthirdparty->state_id=$this->state_id;
|
||||
$lthirdparty->country_id=$this->country_id;
|
||||
$lthirdparty->country_id=$this->country_id;
|
||||
$lthirdparty->pays_id=$this->country_id;
|
||||
//$lthirdparty->phone_mobile=$this->phone_mobile;
|
||||
|
||||
$result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates
|
||||
@@ -690,9 +701,6 @@ class Adherent extends CommonObject
|
||||
$error=0;
|
||||
$errorflag=0;
|
||||
|
||||
// Check parameters
|
||||
if (empty($rowid)) $rowid=$this->id;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Remove category
|
||||
@@ -940,7 +948,7 @@ class Adherent extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Remove link to third party onto any other members
|
||||
// Update link to third party
|
||||
if ($thirdpartyid > 0)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = null";
|
||||
@@ -950,7 +958,7 @@ class Adherent extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
|
||||
// Add link to third party for current member
|
||||
// Update link to third party
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = ".($thirdpartyid>0 ? $thirdpartyid : 'null');
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
@@ -1013,23 +1021,23 @@ class Adherent extends CommonObject
|
||||
{
|
||||
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 = "SELECT d.rowid, d.civilite, d.prenom as firstname, d.nom as lastname, d.societe, d.fk_soc, d.statut, d.public, d.adresse as address, d.cp as zip, d.ville as town, d.note,";
|
||||
$sql.= " d.email, 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,";
|
||||
$sql.= " d.datefin as datefin,";
|
||||
$sql.= " d.birth as birthday,";
|
||||
$sql.= " d.naiss as datenaiss,";
|
||||
$sql.= " d.datevalid as datev,";
|
||||
$sql.= " d.country,";
|
||||
$sql.= " d.state_id,";
|
||||
$sql.= " d.pays,";
|
||||
$sql.= " d.fk_departement,";
|
||||
$sql.= " p.rowid as country_id, p.code as country_code, p.libelle as country,";
|
||||
$sql.= " dep.nom as state, dep.code_departement as state_code,";
|
||||
$sql.= " t.libelle as type, t.cotisation as cotisation,";
|
||||
$sql.= " u.rowid as user_id, u.login as user_login";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.fk_departement = dep.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid";
|
||||
if ($rowid) $sql.= " AND d.rowid=".$rowid;
|
||||
@@ -1050,22 +1058,28 @@ class Adherent extends CommonObject
|
||||
$this->entity = $obj->entity;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->civilite_id = $obj->civilite;
|
||||
$this->prenom = $obj->firstname; // deprecated
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->nom = $obj->lastname; // deprecated
|
||||
$this->lastname = $obj->lastname;
|
||||
$this->login = $obj->login;
|
||||
$this->pass = $obj->pass;
|
||||
$this->societe = $obj->company;
|
||||
$this->company = $obj->company;
|
||||
$this->societe = $obj->societe;
|
||||
$this->fk_soc = $obj->fk_soc;
|
||||
$this->adresse = $obj->address; // deprecated
|
||||
$this->address = $obj->address;
|
||||
$this->cp = $obj->zip; // deprecated
|
||||
$this->zip = $obj->zip;
|
||||
$this->ville = $obj->town; // deprecated
|
||||
$this->town = $obj->town;
|
||||
|
||||
$this->state_id = $obj->state_id;
|
||||
$this->state_code = $obj->state_id?$obj->state_code:'';
|
||||
$this->state = $obj->state_id?$obj->state:'';
|
||||
$this->state_id = $obj->fk_departement;
|
||||
$this->state_code = $obj->fk_departement?$obj->state_code:'';
|
||||
$this->state = $obj->fk_departement?$obj->state:'';
|
||||
$this->fk_departement = $obj->fk_departement; // deprecated
|
||||
$this->departement_code = $obj->fk_departement?$obj->state_code:''; // deprecated
|
||||
$this->departement = $obj->fk_departement?$obj->state:''; // deprecated
|
||||
|
||||
$this->country_id = $obj->country_id;
|
||||
$this->country_code = $obj->country_code;
|
||||
@@ -1073,6 +1087,9 @@ class Adherent extends CommonObject
|
||||
$this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code);
|
||||
else
|
||||
$this->country=$obj->country;
|
||||
$this->pays_id = $obj->country_id; // deprecated
|
||||
$this->pays_code = $obj->country_code; // deprecated
|
||||
$this->pays = $this->country; // deprecated
|
||||
|
||||
$this->phone = $obj->phone;
|
||||
$this->phone_perso = $obj->phone_perso;
|
||||
@@ -1087,7 +1104,7 @@ class Adherent extends CommonObject
|
||||
$this->datem = $this->db->jdate($obj->datem);
|
||||
$this->datefin = $this->db->jdate($obj->datefin);
|
||||
$this->datevalid = $this->db->jdate($obj->datev);
|
||||
$this->birth = $this->db->jdate($obj->birthday);
|
||||
$this->naiss = $this->db->jdate($obj->datenaiss);
|
||||
|
||||
$this->note = $obj->note;
|
||||
$this->morphy = $obj->morphy;
|
||||
@@ -1099,15 +1116,6 @@ class Adherent extends CommonObject
|
||||
$this->user_id = $obj->user_id;
|
||||
$this->user_login = $obj->user_login;
|
||||
|
||||
// Retreive all extrafield for thirdparty
|
||||
// fetch optionals attributes and labels
|
||||
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);
|
||||
}
|
||||
|
||||
// Load other properties
|
||||
$result=$this->fetch_subscriptions();
|
||||
|
||||
@@ -1195,7 +1203,7 @@ class Adherent extends CommonObject
|
||||
* Insert subscription into database and eventually add links to banks, mailman, etc...
|
||||
*
|
||||
* @param timestamp $date Date d'effet de la cotisation
|
||||
* @param amount $montant Montant cotisation (accepte 0 pour les adherents non soumis a cotisation)
|
||||
* @param amount $montant Montant cotisation (accepte 0 pour les adherents non soumis e cotisation)
|
||||
* @param int $accountid Id compte bancaire
|
||||
* @param string $operation Type operation (si Id compte bancaire fourni)
|
||||
* @param string $label Label operation (si Id compte bancaire fourni)
|
||||
@@ -1380,17 +1388,17 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Fonction qui ajoute l'adherent aux abonnements automatiques mailing-list, spip, etc.
|
||||
* Fonction qui ajoute l'adherent au abonnements automatiques mailing-list, spip, etc.
|
||||
* TODO Move this into member creation trigger (trigger of mailmanspip module)
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function add_to_abo()
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||
$mailmanspip=new MailmanSpip($this->db);
|
||||
$mailmanspip=new MailmanSpip($db);
|
||||
|
||||
$err=0;
|
||||
|
||||
@@ -1403,16 +1411,6 @@ class Adherent extends CommonObject
|
||||
$this->error=$mailmanspip->error;
|
||||
$err+=1;
|
||||
}
|
||||
foreach ($mailmanspip->mladded_ko as $tmplist => $tmpemail)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->errors[]=$langs->trans("ErrorFailedToAddToMailmanList",$tmpemail,$tmplist);
|
||||
}
|
||||
foreach ($mailmanspip->mladded_ok as $tmplist => $tmpemail)
|
||||
{
|
||||
$langs->load("mailmanspip");
|
||||
$this->mesgs[]=$langs->trans("SuccessToAddToMailmanList",$tmpemail,$tmplist);
|
||||
}
|
||||
}
|
||||
|
||||
// spip
|
||||
@@ -1427,10 +1425,11 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($err)
|
||||
{
|
||||
// error
|
||||
return -$err;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1444,10 +1443,10 @@ class Adherent extends CommonObject
|
||||
*/
|
||||
function del_to_abo()
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||
$mailmanspip=new MailmanSpip($this->db);
|
||||
$mailmanspip=new MailmanSpip($db);
|
||||
|
||||
$err=0;
|
||||
|
||||
@@ -1457,20 +1456,8 @@ class Adherent extends CommonObject
|
||||
$result=$mailmanspip->del_to_mailman($this);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$mailmanspip->error;
|
||||
$err+=1;
|
||||
}
|
||||
|
||||
foreach ($mailmanspip->mlremoved_ko as $tmplist => $tmpemail)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->errors[]=$langs->trans("ErrorFailedToRemoveToMailmanList",$tmpemail,$tmplist);
|
||||
}
|
||||
foreach ($mailmanspip->mlremoved_ok as $tmplist => $tmpemail)
|
||||
{
|
||||
$langs->load("mailmanspip");
|
||||
$this->mesgs[]=$langs->trans("SuccessToRemoveToMailmanList",$tmpemail,$tmplist);
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled))
|
||||
@@ -1494,18 +1481,19 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Return civility label of a member
|
||||
* Return label of a civility of a contact
|
||||
*
|
||||
* @return string Translated name of civility
|
||||
* @param int $nohtmlentities 0=Encode with htmlentities for HTML output, 1=No htmlentities for memory translation
|
||||
* @return string Name translated of civility
|
||||
*/
|
||||
function getCivilityLabel()
|
||||
function getCivilityLabel($nohtmlentities=0)
|
||||
{
|
||||
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);
|
||||
global $langs;
|
||||
$langs->load("dict");
|
||||
|
||||
$code=$this->civilite_id;
|
||||
if ($nohtmlentities) return $langs->transnoentities("Civility".$code)!="Civility".$code ? $langs->transnoentities("Civility".$code) : $code;
|
||||
else return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : $code;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1532,11 +1520,6 @@ class Adherent extends CommonObject
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
if ($option == 'category')
|
||||
{
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
|
||||
$picto='user';
|
||||
$label=$langs->trans("ShowMember");
|
||||
@@ -1547,6 +1530,40 @@ class Adherent extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return full address of member
|
||||
*
|
||||
* @param int $withcountry 1=Add country into address string
|
||||
* @param string $sep Separator to use to build string
|
||||
* @return string Full address string
|
||||
*/
|
||||
function getFullAddress($withcountry=0,$sep="\n")
|
||||
{
|
||||
$ret='';
|
||||
if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country)))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php';
|
||||
$tmparray=getCountry($this->country_id,'all');
|
||||
$this->country_code=$tmparray['code'];
|
||||
$this->country =$tmparray['label'];
|
||||
}
|
||||
|
||||
if (in_array($this->country_code,array('US')))
|
||||
{
|
||||
$ret.=($this->address?$this->address.$sep:'');
|
||||
$ret.=trim($this->zip.' '.$this->town);
|
||||
if ($withcountry) $ret.=($this->country?$sep.$this->country:'');
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.=($this->address?$this->address.$sep:'');
|
||||
$ret.=trim($this->zip.' '.$this->town);
|
||||
if ($withcountry) $ret.=($this->country?$sep.$this->country:'');
|
||||
}
|
||||
return trim($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le libelle du statut d'un adherent (brouillon, valide, resilie)
|
||||
*
|
||||
@@ -1631,11 +1648,11 @@ class Adherent extends CommonObject
|
||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||
if ($statut >= 1)
|
||||
{
|
||||
if (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActive").' </span>'.img_picto($langs->trans('MemberStatusActive'),'statut1');
|
||||
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLate").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
|
||||
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaid").' </span>'.img_picto($langs->trans('MemberStatusPaid'),'statut4');
|
||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'),'statut1');
|
||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
|
||||
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4');
|
||||
}
|
||||
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
||||
if ($statut == 0) return $langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1747,7 +1764,7 @@ class Adherent extends CommonObject
|
||||
$this->phone_perso = '0999999998';
|
||||
$this->phone_mobile = '0999999997';
|
||||
$this->note='No comment';
|
||||
$this->birth=time();
|
||||
$this->naiss=time();
|
||||
$this->photo='';
|
||||
$this->public=1;
|
||||
$this->statut=0;
|
||||
@@ -1804,14 +1821,14 @@ class Adherent extends CommonObject
|
||||
|
||||
// Member
|
||||
if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;
|
||||
if ($this->lastname && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->lastname;
|
||||
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
||||
if ($this->nom && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom;
|
||||
if ($this->prenom && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom;
|
||||
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
|
||||
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
||||
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
||||
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
||||
if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town;
|
||||
if ($this->adresse && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse;
|
||||
if ($this->cp && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp;
|
||||
if ($this->ville && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville;
|
||||
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->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
|
||||
@@ -1819,7 +1836,7 @@ class Adherent extends CommonObject
|
||||
if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
|
||||
if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;
|
||||
if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note;
|
||||
if ($this->birth && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->birth,'dayhourldap');
|
||||
if ($this->naiss && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap');
|
||||
if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
|
||||
if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
class AdherentType extends CommonObject
|
||||
{
|
||||
public $table_element = 'adherent_type';
|
||||
public $element = 'adherent_type';
|
||||
|
||||
var $id;
|
||||
var $libelle;
|
||||
@@ -44,6 +43,7 @@ class AdherentType extends CommonObject
|
||||
var $mail_valid; //mail envoye lors de la validation
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -99,8 +99,6 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
function update($user)
|
||||
{
|
||||
global $hookmanager;
|
||||
|
||||
$this->libelle=trim($this->libelle);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
|
||||
@@ -116,24 +114,6 @@ class AdherentType extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
$hookmanager->initHooks(array('membertypedao'));
|
||||
$parameters=array('membertype'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$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=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($reshook < 0) $error++;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
0
htdocs/adherents/class/adherentstats.class.php
Normal file → Executable file
0
htdocs/adherents/class/adherentstats.class.php
Normal file → Executable file
@@ -46,8 +46,8 @@ if (! $sortfield) { $sortfield="c.dateadh"; }
|
||||
$msg='';
|
||||
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent','','','cotisation');
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent','','','cotisation');
|
||||
|
||||
|
||||
/*
|
||||
@@ -64,7 +64,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu
|
||||
if ($msg) print $msg.'<br>';
|
||||
|
||||
// Liste des cotisations
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,";
|
||||
$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||
$sql.= " c.dateadh,";
|
||||
$sql.= " c.datef,";
|
||||
@@ -88,8 +88,6 @@ if ($result)
|
||||
|
||||
$title=$langs->trans("ListOfSubscriptions");
|
||||
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
|
||||
|
||||
$param="";
|
||||
$param.="&statut=$statut&date_select=$date_select";
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
|
||||
|
||||
@@ -98,7 +96,7 @@ if ($result)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"cotisations.php","c.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled))
|
||||
@@ -143,7 +141,7 @@ if ($result)
|
||||
// Ref
|
||||
print '<td>'.$cotisation->getNomUrl(1).'</td>';
|
||||
|
||||
// Lastname
|
||||
// Nom
|
||||
print '<td>'.$adherent->getNomUrl(1).'</td>';
|
||||
|
||||
// Login
|
||||
|
||||
@@ -93,15 +93,15 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$object=new Adherent($db);
|
||||
$member=new Adherent($db);
|
||||
$membert=new AdherentType($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$result=$object->fetch($id);
|
||||
$result=$membert->fetch($object->typeid);
|
||||
$result=$member->fetch($id);
|
||||
$result=$membert->fetch($member->typeid);
|
||||
if ($result > 0)
|
||||
{
|
||||
/*
|
||||
@@ -110,7 +110,7 @@ if ($id > 0)
|
||||
if (! empty($conf->notification->enabled))
|
||||
$langs->load("mails");
|
||||
|
||||
$head = member_prepare_head($object);
|
||||
$head = member_prepare_head($member);
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
@@ -133,19 +133,19 @@ if ($id > 0)
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->showrefnav($object, 'rowid', $linkback);
|
||||
print $form->showrefnav($member, 'rowid', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$member->login.' </td></tr>';
|
||||
}
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$member->getmorphylib().'</td>';
|
||||
/*print '<td rowspan="'.$rowspan.'" align="center" valign="middle" width="25%">';
|
||||
print $form->showphoto('memberphoto',$object);
|
||||
print $form->showphoto('memberphoto',$member);
|
||||
print '</td>';*/
|
||||
print '</tr>';
|
||||
|
||||
@@ -153,22 +153,22 @@ if ($id > 0)
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$membert->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$member->societe.'</td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.' </td>';
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.' </td>';
|
||||
// Prenom
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$member->getLibStatut(4).'</td></tr>';
|
||||
|
||||
// Nbre fichiers
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
@@ -185,18 +185,18 @@ if ($id > 0)
|
||||
*/
|
||||
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);
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$member->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/adherents/document.php?id='.$object->id,'',0,0,$user->rights->adherent->creer,50,$object);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/adherents/document.php?id='.$member->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.'/');
|
||||
$formfile->list_of_documents($filearray,$member,'member','', 0, get_exdir($member->id,2,0,1).'/'.$member->id.'/');
|
||||
|
||||
print "<br><br>";
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -64,11 +64,8 @@ if (! empty($conf->mailmanspip->enabled))
|
||||
$object = new Adherent($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($rowid);
|
||||
$object->getCanvas($socid);
|
||||
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
||||
$objcanvas='';
|
||||
if (! empty($canvas))
|
||||
@@ -101,15 +98,17 @@ if ($rowid > 0)
|
||||
}
|
||||
}
|
||||
|
||||
// Define variables to determine what the current user can do on the members
|
||||
// Define variables to know what current user can do on members
|
||||
$canaddmember=$user->rights->adherent->creer;
|
||||
// Define variables to determine what the current user can do on the properties of a member
|
||||
// Define variables to know what current user can do on properties of a member
|
||||
if ($rowid)
|
||||
{
|
||||
$caneditfieldmember=$user->rights->adherent->creer;
|
||||
}
|
||||
|
||||
// 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('membercard'));
|
||||
|
||||
|
||||
@@ -117,7 +116,7 @@ $hookmanager->initHooks(array('membercard'));
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas);
|
||||
$parameters=array('socid'=>$socid, 'objcanvas'=>$objcanvas);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
|
||||
@@ -239,53 +238,45 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$birthdate='';
|
||||
if (isset($_POST["birthday"]) && $_POST["birthday"]
|
||||
&& isset($_POST["birthmonth"]) && $_POST["birthmonth"]
|
||||
&& isset($_POST["birthyear"]) && $_POST["birthyear"])
|
||||
$datenaiss='';
|
||||
if (isset($_POST["naissday"]) && $_POST["naissday"]
|
||||
&& isset($_POST["naissmonth"]) && $_POST["naissmonth"]
|
||||
&& isset($_POST["naissyear"]) && $_POST["naissyear"])
|
||||
{
|
||||
$birthdate=dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
|
||||
}
|
||||
$lastname=$_POST["lastname"];
|
||||
$firstname=$_POST["firstname"];
|
||||
$morphy=$morphy=$_POST["morphy"];;
|
||||
if ($morphy != 'mor' && empty($lastname)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."<br>\n";
|
||||
}
|
||||
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."<br>\n";
|
||||
$datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
|
||||
}
|
||||
|
||||
// Create new object
|
||||
if ($result > 0 && ! $error)
|
||||
if ($result > 0)
|
||||
{
|
||||
$object->oldcopy=dol_clone($object);
|
||||
|
||||
// Change values
|
||||
$object->civilite_id = trim($_POST["civilite_id"]);
|
||||
$object->firstname = trim($_POST["firstname"]);
|
||||
$object->lastname = trim($_POST["lastname"]);
|
||||
$object->prenom = trim($_POST["prenom"]); // deprecated
|
||||
$object->nom = trim($_POST["nom"]); // deprecated
|
||||
$object->firstname = trim($_POST["prenom"]);
|
||||
$object->lastname = trim($_POST["nom"]);
|
||||
$object->login = trim($_POST["login"]);
|
||||
$object->pass = trim($_POST["pass"]);
|
||||
|
||||
$object->societe = trim($_POST["societe"]);
|
||||
$object->company = trim($_POST["societe"]);
|
||||
|
||||
$object->adresse = trim($_POST["address"]); // deprecated
|
||||
$object->address = trim($_POST["address"]);
|
||||
$object->cp = trim($_POST["zipcode"]); // deprecated
|
||||
$object->zip = trim($_POST["zipcode"]);
|
||||
$object->ville = trim($_POST["town"]); // deprecated
|
||||
$object->town = trim($_POST["town"]);
|
||||
$object->state_id = $_POST["state_id"];
|
||||
$object->state_id = $_POST["departement_id"];
|
||||
$object->country_id = $_POST["country_id"];
|
||||
$object->fk_departement = $_POST["departement_id"]; // deprecated
|
||||
$object->pays_id = $_POST["country_id"]; // deprecated
|
||||
|
||||
$object->phone = trim($_POST["phone"]);
|
||||
$object->phone_perso = trim($_POST["phone_perso"]);
|
||||
$object->phone_mobile= trim($_POST["phone_mobile"]);
|
||||
$object->email = trim($_POST["email"]);
|
||||
$object->birth = $birthdate;
|
||||
$object->naiss = $datenaiss;
|
||||
|
||||
$object->typeid = $_POST["typeid"];
|
||||
//$object->note = trim($_POST["comment"]);
|
||||
@@ -300,8 +291,14 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
$object->statut = $_POST["statut"];
|
||||
$object->public = $_POST["public"];
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
// Get extra fields
|
||||
foreach($_POST as $key => $value)
|
||||
{
|
||||
if (preg_match("/^options_/",$key))
|
||||
{
|
||||
$object->array_options[$key]=$_POST[$key];
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we need to also synchronize user information
|
||||
$nosyncuser=0;
|
||||
@@ -368,23 +365,14 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
{
|
||||
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');
|
||||
// error
|
||||
$errmsgs[]= $langs->trans("FailedToCleanMailmanList").': '.$object->error."<br>\n";
|
||||
}
|
||||
}
|
||||
// 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
|
||||
if ($object->add_to_abo() < 0) // We add subscription if new email or new type (new type may means more mailing-list to subscribe)
|
||||
{
|
||||
setEventMessage($object->mesgs, 'mesgs');
|
||||
// error
|
||||
$errmsgs[]= $langs->trans("FailedToAddToMailmanList").': '.$object->error."<br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,21 +392,17 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$action='edit';
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'add' && $user->rights->adherent->creer)
|
||||
{
|
||||
if ($canvas) $object->canvas=$canvas;
|
||||
$birthdate='';
|
||||
if (isset($_POST["birthday"]) && $_POST["birthday"]
|
||||
&& isset($_POST["birthmonth"]) && $_POST["birthmonth"]
|
||||
&& isset($_POST["birthyear"]) && $_POST["birthyear"])
|
||||
$datenaiss='';
|
||||
if (isset($_POST["naissday"]) && $_POST["naissday"]
|
||||
&& isset($_POST["naissmonth"]) && $_POST["naissmonth"]
|
||||
&& isset($_POST["naissyear"]) && $_POST["naissyear"])
|
||||
{
|
||||
$birthdate=dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
|
||||
$datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
|
||||
}
|
||||
$datecotisation='';
|
||||
if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"]))
|
||||
@@ -428,13 +412,13 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
|
||||
$typeid=$_POST["typeid"];
|
||||
$civilite_id=$_POST["civilite_id"];
|
||||
$lastname=$_POST["lastname"];
|
||||
$firstname=$_POST["firstname"];
|
||||
$nom=$_POST["nom"];
|
||||
$prenom=$_POST["prenom"];
|
||||
$societe=$_POST["societe"];
|
||||
$address=$_POST["address"];
|
||||
$zip=$_POST["zipcode"];
|
||||
$town=$_POST["town"];
|
||||
$state_id=$_POST["state_id"];
|
||||
$state_id=$_POST["departement_id"];
|
||||
$country_id=$_POST["country_id"];
|
||||
|
||||
$phone=$_POST["phone"];
|
||||
@@ -453,13 +437,20 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$socid=$_POST["socid"];
|
||||
|
||||
$object->civilite_id = $civilite_id;
|
||||
$object->firstname = $firstname;
|
||||
$object->lastname = $lastname;
|
||||
$object->prenom = $prenom; // deprecated
|
||||
$object->nom = $nom; // deprecated
|
||||
$object->firstname = $prenom;
|
||||
$object->lastname = $nom;
|
||||
$object->societe = $societe;
|
||||
$object->adresse = $address; // deprecated
|
||||
$object->address = $address;
|
||||
$object->cp = $zip; // deprecated
|
||||
$object->zip = $zip;
|
||||
$object->ville = $town; // deprecated
|
||||
$object->town = $town;
|
||||
$object->fk_departement = $state_id;
|
||||
$object->state_id = $state_id;
|
||||
$object->pays_id = $country_id;
|
||||
$object->country_id = $country_id;
|
||||
$object->phone = $phone;
|
||||
$object->phone_perso = $phone_perso;
|
||||
@@ -467,7 +458,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$object->email = $email;
|
||||
$object->login = $login;
|
||||
$object->pass = $pass;
|
||||
$object->naiss = $birthdate;
|
||||
$object->naiss = $datenaiss;
|
||||
$object->photo = $photo;
|
||||
$object->typeid = $typeid;
|
||||
//$object->note = $comment;
|
||||
@@ -476,8 +467,14 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$object->fk_soc = $socid;
|
||||
$object->public = $public;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
// Get extra fields
|
||||
foreach($_POST as $key => $value)
|
||||
{
|
||||
if (preg_match("/^options_/",$key))
|
||||
{
|
||||
$object->array_options[$key]=$_POST[$key];
|
||||
}
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (empty($morphy) || $morphy == "-1") {
|
||||
@@ -508,12 +505,12 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Password"))."<br>\n";
|
||||
}
|
||||
}
|
||||
if ($morphy != 'mor' && empty($lastname)) {
|
||||
if (empty($nom)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."<br>\n";
|
||||
}
|
||||
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
|
||||
if ($morphy != 'mor' && (!isset($prenom) || $prenom=='')) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."<br>\n";
|
||||
@@ -703,6 +700,9 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm
|
||||
$form = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('member');
|
||||
|
||||
$help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
llxHeader('',$langs->trans("Member"),$help_url);
|
||||
|
||||
@@ -713,14 +713,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
// -----------------------------------------
|
||||
// When used with CANVAS
|
||||
// -----------------------------------------
|
||||
if (empty($object->error) && $rowid)
|
||||
if (empty($object->error) && $socid)
|
||||
{
|
||||
$object = new Adherent($db);
|
||||
$result=$object->fetch($rowid);
|
||||
if ($result <= 0) dol_print_error('',$object->error);
|
||||
$object->fetch($socid);
|
||||
}
|
||||
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||
$objcanvas->display_canvas($action); // Show template
|
||||
$objcanvas->assign_values($action, $socid); // Set value for templates
|
||||
$objcanvas->display_canvas($action); // Show template
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -736,13 +735,15 @@ else
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
$object->canvas=$canvas;
|
||||
$object->state_id = GETPOST('departement_id', 'int');
|
||||
$object->fk_departement = GETPOST('departement_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;
|
||||
if ($object->country_id)
|
||||
{
|
||||
$tmparray=getCountry($object->country_id,'all');
|
||||
$object->pays_code=$tmparray['code'];
|
||||
$object->pays=$tmparray['code'];
|
||||
$object->country_code=$tmparray['code'];
|
||||
$object->country=$tmparray['label'];
|
||||
}
|
||||
@@ -824,11 +825,11 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.(GETPOST('lastname','alpha')?GETPOST('lastname','alpha'):$object->lastname).'" size="40"></td>';
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" value="'.(GETPOST('nom','alpha')?GETPOST('nom','alpha'):$object->lastname).'" size="40"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(GETPOST('firstname','alpha')?GETPOST('firstname','alpha'):$object->firstname).'"></td>';
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(GETPOST('prenom','alpha')?GETPOST('prenom','alpha'):$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Password
|
||||
@@ -848,9 +849,9 @@ else
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||
print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
|
||||
print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','departement_id'),6);
|
||||
print ' ';
|
||||
print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','departement_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
@@ -866,7 +867,7 @@ else
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($object->country_id)
|
||||
{
|
||||
print $formcompany->select_state(GETPOST('state_id','int')?GETPOST('state_id','int'):$object->state_id,$object->country_code);
|
||||
print $formcompany->select_state(GETPOST('departement_id','int')?GETPOST('departement_id','int'):$object->fk_departement,$object->country_code);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -902,7 +903,15 @@ else
|
||||
$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,'edit');
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
$value=(isset($_POST["options_".$key])?GETPOST('options_'.$key,'alpha'):(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:''));
|
||||
print '<tr><td';
|
||||
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
|
||||
print '>'.$label.'</td><td>';
|
||||
print $extrafields->showInputField($key,$value);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -916,7 +925,7 @@ else
|
||||
|
||||
// Login Dolibarr
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td class="valeur">';
|
||||
print $form->select_dolusers($object->user_id,'userid',1);
|
||||
print $form->select_users($object->user_id,'userid',1);
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
@@ -949,8 +958,8 @@ else
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($object->typeid);
|
||||
|
||||
$country=GETPOST('pays','int');
|
||||
// We set country_id, and country_code, country of the chosen country
|
||||
$country=GETPOST('country','int');
|
||||
if (!empty($country) || $object->country_id)
|
||||
{
|
||||
$sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(!empty($country)?$country:$object->country_id);
|
||||
@@ -963,6 +972,9 @@ else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$object->pays_id=$obj->rowid;
|
||||
$object->pays_code=$obj->code;
|
||||
$object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label;
|
||||
$object->country_id=$obj->rowid;
|
||||
$object->country_code=$obj->code;
|
||||
$object->country=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label;
|
||||
@@ -1035,7 +1047,7 @@ else
|
||||
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
|
||||
print "</td>";
|
||||
// Photo
|
||||
print '<td align="center" class="hideonsmartphone" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||
print $form->showphoto('memberphoto',$object)."\n";
|
||||
if ($caneditfieldmember)
|
||||
{
|
||||
@@ -1070,12 +1082,12 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'"></td>';
|
||||
// Name
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->lastname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td>';
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Password
|
||||
@@ -1091,9 +1103,9 @@ else
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||
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["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','departement_id'),6);
|
||||
print ' ';
|
||||
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','departement_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
@@ -1107,7 +1119,7 @@ else
|
||||
if (empty($conf->global->MEMBER_DISABLE_STATE))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id);
|
||||
print $formcompany->select_state($object->fk_departement,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -1123,9 +1135,9 @@ else
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
|
||||
|
||||
// Birthday
|
||||
// Date naissance
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
||||
$form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Profil public
|
||||
@@ -1138,7 +1150,15 @@ else
|
||||
$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,'edit');
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
||||
print '<tr><td';
|
||||
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
|
||||
print '>'.$label.'</td><td>';
|
||||
print $extrafields->showInputField($key,$value);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Third party Dolibarr
|
||||
@@ -1376,7 +1396,7 @@ else
|
||||
print $form->showrefnav($object, 'rowid', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
$showphoto='<td rowspan="'.$rowspan.'" align="center" class="hideonsmartphone" valign="middle" width="25%">';
|
||||
$showphoto='<td rowspan="'.$rowspan.'" align="center" valign="middle" width="25%">';
|
||||
$showphoto.=$form->showphoto('memberphoto',$object);
|
||||
$showphoto.='</td>';
|
||||
|
||||
@@ -1384,7 +1404,6 @@ else
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td>';
|
||||
// Photo
|
||||
print $showphoto; $showphoto='';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -1423,7 +1442,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td class="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td></tr>';
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">';
|
||||
@@ -1433,7 +1452,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td class="valeur">'.$object->state.'</td>';
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td class="valeur">'.$object->departement.'</td>';
|
||||
|
||||
// Tel pro.
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td class="valeur">'.dol_print_phone($object->phone,$object->country_code,0,$object->fk_soc,1).'</td></tr>';
|
||||
@@ -1447,8 +1466,8 @@ else
|
||||
// EMail
|
||||
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
|
||||
|
||||
// Birthday
|
||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||
// Date naissance
|
||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->naiss,'day').'</td></tr>';
|
||||
|
||||
// Public
|
||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||
@@ -1461,7 +1480,13 @@ else
|
||||
$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);
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
$value=$object->array_options["options_$key"];
|
||||
print "<tr><td>".$label."</td><td>";
|
||||
print $extrafields->showOutputField($key,$value);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Third party Dolibarr
|
||||
@@ -1550,11 +1575,11 @@ else
|
||||
// Modify
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=edit">'.$langs->trans("Modify")."</a></div>";
|
||||
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=edit\">".$langs->trans("Modify")."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</font></div>';
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("Modify")."</font>";
|
||||
}
|
||||
|
||||
// Valider
|
||||
@@ -1562,11 +1587,11 @@ else
|
||||
{
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=valid">'.$langs->trans("Validate")."</a></div>\n";
|
||||
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Validate")."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</font></div>';
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("Validate")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1575,11 +1600,11 @@ else
|
||||
{
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=valid">'.$langs->trans("Reenable")."</a></div>\n";
|
||||
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Reenable")."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable")."</font></div>";
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("Reenable")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1588,17 +1613,17 @@ else
|
||||
{
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
if ($object->email) print "<a class=\"butAction\" href=\"fiche.php?rowid=$object->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n";
|
||||
else print "<a class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NoEMail"))."\">".$langs->trans("SendCardByMail")."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("ValidateBefore"))."\">".$langs->trans("SendCardByMail")."</font>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("SendCardByMail")."</font>";
|
||||
}
|
||||
|
||||
// Resilier
|
||||
@@ -1606,11 +1631,11 @@ else
|
||||
{
|
||||
if ($user->rights->adherent->supprimer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=resign">'.$langs->trans("Resiliate")."</a></div>\n";
|
||||
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=resign\">".$langs->trans("Resiliate")."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate")."</font></div>";
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("Resiliate")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1619,12 +1644,12 @@ else
|
||||
{
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
if ($object->statut != -1) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>';
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>';
|
||||
if ($object->statut != -1) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a>';
|
||||
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrThirdParty")."</font></div>";
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("CreateDolibarrThirdParty")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1633,23 +1658,23 @@ else
|
||||
{
|
||||
if ($user->rights->user->user->creer)
|
||||
{
|
||||
if ($object->statut != -1) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a></div>';
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a></div>';
|
||||
if ($object->statut != -1) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrLogin")."</font></div>";
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("CreateDolibarrLogin")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->adherent->supprimer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="fiche.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>\n";
|
||||
print "<a class=\"butActionDelete\" href=\"fiche.php?rowid=$object->id&action=delete\">".$langs->trans("Delete")."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete")."</font></div>";
|
||||
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("Delete")."</font>";
|
||||
}
|
||||
|
||||
// Action SPIP
|
||||
@@ -1659,22 +1684,21 @@ else
|
||||
|
||||
if ($isinspip == 1)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$object->id.'&action=del_spip">'.$langs->trans("DeleteIntoSpip")."</a></div>\n";
|
||||
print "<a class=\"butAction\" href=\"fiche.php?rowid=$object->id&action=del_spip\">".$langs->trans("DeleteIntoSpip")."</a>\n";
|
||||
}
|
||||
if ($isinspip == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$object->id.'&action=add_spip">'.$langs->trans("AddIntoSpip")."</a></div>\n";
|
||||
print "<a class=\"butAction\" href=\"fiche.php?rowid=$object->id&action=add_spip\">".$langs->trans("AddIntoSpip")."</a>\n";
|
||||
}
|
||||
if ($isinspip == -1)
|
||||
{
|
||||
print '<br><br><font class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</font>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
if ($isinspip == -1)
|
||||
{
|
||||
print '<br><br><font class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</font>';
|
||||
}
|
||||
print "<br>\n";
|
||||
|
||||
}
|
||||
|
||||
@@ -371,18 +371,18 @@ if ($rowid && $action != 'edit')
|
||||
{
|
||||
if (! $bankline->rappro)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$subscription->id."&action=edit\">".$langs->trans("Modify")."</a></div>";
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?rowid=".$subscription->id."&action=edit\">".$langs->trans("Modify")."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.$langs->trans("BankLineConciliated")."\" href=\"#\">".$langs->trans("Modify")."</a></div>";
|
||||
print "<a class=\"butActionRefused\" title=\"".$langs->trans("BankLineConciliated")."\" href=\"#\">".$langs->trans("Modify")."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
// Supprimer
|
||||
if ($user->rights->adherent->cotisation->creer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"]."?rowid=".$subscription->id."&action=delete\">".$langs->trans("Delete")."</a></div>\n";
|
||||
print "<a class=\"butActionDelete\" href=\"".$_SERVER["PHP_SELF"]."?rowid=".$subscription->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@@ -27,13 +27,12 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("members");
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent');
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent');
|
||||
|
||||
|
||||
/*
|
||||
@@ -48,6 +47,7 @@ $subscriptionstatic=new Cotisation($db);
|
||||
|
||||
print_fiche_titre($langs->trans("MembersArea"));
|
||||
|
||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
|
||||
$var=True;
|
||||
|
||||
@@ -122,8 +122,7 @@ if ($result)
|
||||
}
|
||||
|
||||
|
||||
//print '<tr><td width="30%" class="notopnoleft" valign="top">';
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<tr><td width="30%" class="notopnoleft" valign="top">';
|
||||
|
||||
|
||||
// Formulaire recherche adherent
|
||||
@@ -141,7 +140,7 @@ print $langs->trans("Ref").':</td><td><input type="text" name="search_ref" class
|
||||
print '</td><td rowspan="3"><input class="button" type="submit" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
print $langs->trans("Name").':</td><td><input type="text" name="search_lastname" class="flat" size="16">';
|
||||
print $langs->trans("Name").':</td><td><input type="text" name="search_nom" class="flat" size="16">';
|
||||
print '</td></tr>';
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
@@ -196,9 +195,7 @@ if ($conf->use_javascript_ajax)
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
//print '</td><td class="notopnoleftnoright" valign="top">';
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
print '</td><td class="notopnoleftnoright" valign="top">';
|
||||
|
||||
|
||||
$var=true;
|
||||
@@ -208,7 +205,7 @@ $var=true;
|
||||
*/
|
||||
$max=5;
|
||||
|
||||
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
|
||||
$sql.= " a.tms as datem, datefin as date_end_subscription,";
|
||||
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
|
||||
@@ -268,7 +265,7 @@ else
|
||||
*/
|
||||
$max=5;
|
||||
|
||||
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
|
||||
$sql.= " datefin as date_end_subscription,";
|
||||
$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."cotisation as c";
|
||||
@@ -419,8 +416,8 @@ print "<td align=\"right\">".price(price2num($numb>0?($tot/$numb):0,'MT'))."</td
|
||||
print "</tr>\n";
|
||||
print "</table><br>\n";
|
||||
|
||||
//print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -108,11 +108,11 @@ print '<td class="valeur">';
|
||||
print $form->showrefnav($adh,'id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Lastname
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
// Prenom
|
||||
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -169,7 +169,7 @@ print '<div class="tabsAction">';
|
||||
|
||||
if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE != 'ldap2dolibarr')
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$adh->id.'&action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$adh->id.'&action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,16 +31,16 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent');
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent');
|
||||
|
||||
$action=GETPOST("action");
|
||||
$filter=GETPOST("filter");
|
||||
$statut=GETPOST("statut");
|
||||
$search=GETPOST("search");
|
||||
$search_ref=GETPOST("search_ref");
|
||||
$search_lastname=GETPOST("search_lastname");
|
||||
$search_firstname=GETPOST("search_firstname");
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_prenom=GETPOST("search_prenom");
|
||||
$search_login=GETPOST("search_login");
|
||||
$type=GETPOST("type");
|
||||
$search_email=GETPOST("search_email");
|
||||
@@ -57,14 +56,14 @@ $offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder=($filter=='outofdate'?"ASC":"DESC"); }
|
||||
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); }
|
||||
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.nom"); }
|
||||
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$search="";
|
||||
$search_ref="";
|
||||
$search_lastname="";
|
||||
$search_firstname="";
|
||||
$search_nom="";
|
||||
$search_prenom="";
|
||||
$search_login="";
|
||||
$type="";
|
||||
$search_email="";
|
||||
@@ -87,7 +86,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhé
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,";
|
||||
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe as company, d.fk_soc,";
|
||||
$sql.= " d.datefin,";
|
||||
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||
$sql.= " t.libelle as type, t.cotisation";
|
||||
@@ -102,15 +101,11 @@ if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL";
|
||||
$sql.= " AND d.entity = ".$conf->entity;
|
||||
if ($sall)
|
||||
{
|
||||
// For natural search
|
||||
$scrit = explode(' ', $sall);
|
||||
foreach ($scrit as $crit) {
|
||||
$sql.=" AND (";
|
||||
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR ";
|
||||
$sql.=" d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
}
|
||||
$sql.=" AND (";
|
||||
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR ";
|
||||
$sql.=" d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.adresse LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
}
|
||||
if ($type > 0)
|
||||
{
|
||||
@@ -125,9 +120,9 @@ if ($search_ref)
|
||||
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$search_ref.")";
|
||||
else $sql.=" AND 1 = 2"; // Always wrong
|
||||
}
|
||||
if ($search_lastname)
|
||||
if ($search_nom)
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
|
||||
$sql.= " AND (d.prenom LIKE '%".$search_nom."%' OR d.nom LIKE '%".$search_nom."%')";
|
||||
}
|
||||
if ($search_login)
|
||||
{
|
||||
@@ -221,7 +216,7 @@ if ($resql)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"t.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
@@ -238,7 +233,7 @@ if ($resql)
|
||||
print '<input class="flat" type="text" name="search_ref" value="'.$search_ref.'" size="4"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_nom" value="'.$search_nom.'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
|
||||
@@ -304,7 +299,7 @@ if ($resql)
|
||||
// Type
|
||||
$membertypestatic->id=$objp->type_id;
|
||||
$membertypestatic->libelle=$objp->type;
|
||||
print '<td class="nowrap">';
|
||||
print '<td nowrap="nowrap">';
|
||||
print $membertypestatic->getNomUrl(1,32);
|
||||
print '</td>';
|
||||
|
||||
@@ -315,21 +310,21 @@ if ($resql)
|
||||
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
|
||||
|
||||
// Statut
|
||||
print '<td class="nowrap">';
|
||||
print '<td nowrap="nowrap">';
|
||||
print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
|
||||
print "</td>";
|
||||
|
||||
// End of subscription date
|
||||
if ($datefin)
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td align="center" nowrap="nowrap">';
|
||||
print dol_print_date($datefin,'day');
|
||||
if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate"));
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="left" class="nowrap">';
|
||||
print '<td align="left" nowrap="nowrap">';
|
||||
if ($objp->cotisation == 'yes')
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
|
||||
@@ -54,7 +54,7 @@ if ($action == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$res=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
|
||||
$res=$object->update_note($_POST["note"],$user);
|
||||
if ($res < 0)
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
@@ -167,7 +167,7 @@ if ($id)
|
||||
|
||||
if ($user->rights->adherent->creer && $action != 'edit')
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="note.php?id='.$object->id.'&action=edit">'.$langs->trans('Modify')."</a></div>";
|
||||
print "<a class=\"butAction\" href=\"note.php?id=".$object->id."&action=edit\">".$langs->trans('Modify')."</a>";
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
|
||||
2
htdocs/adherents/stats/byproperties.php
Normal file → Executable file
2
htdocs/adherents/stats/byproperties.php
Normal file → Executable file
@@ -44,8 +44,6 @@ $year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
/*
|
||||
|
||||
26
htdocs/adherents/stats/geo.php
Normal file → Executable file
26
htdocs/adherents/stats/geo.php
Normal file → Executable file
@@ -23,9 +23,8 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
|
||||
$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700);
|
||||
$graphwidth = 700;
|
||||
$mapratio = 0.5;
|
||||
$graphheight = round($graphwidth * $mapratio);
|
||||
|
||||
@@ -38,23 +37,20 @@ if ($user->societe_id > 0)
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result=restrictedArea($user,'adherent','','','cotisation');
|
||||
$result=restrictedArea($user,'adherent','','','cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$arrayjs=array('http://www.google.com/jsapi');
|
||||
if (! empty($conf->dol_use_jmobile)) $arrayjs=array();
|
||||
llxHeader('','','','',0,0,$arrayjs);
|
||||
|
||||
llxHeader('','','','',0,0,array('http://www.google.com/jsapi'));
|
||||
|
||||
$title=$langs->trans("Statistics");
|
||||
if ($mode == 'memberbycountry') $title=$langs->trans("MembersStatisticsByCountries");
|
||||
@@ -75,7 +71,7 @@ if ($mode)
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.libelle as label";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.country = c.rowid";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.pays = c.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY c.libelle, c.code";
|
||||
@@ -89,9 +85,9 @@ if ($mode)
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, c.nom as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.fk_departement = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY p.libelle, p.code, c.nom";
|
||||
@@ -104,12 +100,12 @@ if ($mode)
|
||||
$tab='statstown';
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.town as label2";
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.ville as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY p.libelle, p.code, d.town";
|
||||
$sql.=" GROUP BY p.libelle, p.code, d.ville";
|
||||
//print $sql;
|
||||
}
|
||||
|
||||
@@ -198,7 +194,7 @@ else
|
||||
|
||||
|
||||
// Show graphics
|
||||
if (count($arrayjs) && $mode == 'memberbycountry')
|
||||
if ($mode == 'memberbycountry')
|
||||
{
|
||||
$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/graph-color.php';
|
||||
if (is_readable($color_file)) include_once $color_file;
|
||||
|
||||
@@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
|
||||
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
|
||||
$WIDTH=500;
|
||||
$HEIGHT=200;
|
||||
|
||||
$userid=GETPOST('userid','int'); if ($userid < 0) $userid=0;
|
||||
$socid=GETPOST('socid','int'); if ($socid < 0) $socid=0;
|
||||
@@ -46,9 +46,6 @@ $year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -56,6 +53,8 @@ $langs->load("companies");
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$langs->load("propal");
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("SubscriptionsStatistics"), $mesg);
|
||||
@@ -144,7 +143,8 @@ $head = member_stats_prepare_head($adh);
|
||||
dol_fiche_head($head, 'statssubscription', $langs->trans("Statistics"), 0, 'user');
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||
print '<td align="center" valign="top">';
|
||||
|
||||
// Show filter box
|
||||
/*print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@@ -155,7 +155,7 @@ $filter='s.client in (1,2,3)';
|
||||
print $form->select_company($id,'memberid',$filter,1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||
print $form->select_dolusers($userid,'userid',1);
|
||||
print $form->select_users($userid,'userid',1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '</table>';
|
||||
@@ -210,8 +210,8 @@ foreach ($data as $val)
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
print '</td>';
|
||||
print '<td align="center" valign="top">';
|
||||
|
||||
// Show graphs
|
||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||
@@ -223,10 +223,7 @@ else {
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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,14 +27,13 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
$langs->load("members");
|
||||
|
||||
$rowid = GETPOST('rowid','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
$search_lastname = GETPOST('search_lastname','alpha');
|
||||
$search_lastname = GETPOST('search_nom','alpha');
|
||||
$search_login = GETPOST('search_login','alpha');
|
||||
$search_email = GETPOST('search_email','alpha');
|
||||
$type = GETPOST('type','alpha');
|
||||
@@ -49,16 +47,11 @@ $offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="d.lastname"; }
|
||||
if (! $sortfield) { $sortfield="d.nom"; }
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('adherent_type');
|
||||
|
||||
if (GETPOST('button_removefilter'))
|
||||
{
|
||||
$search_lastname="";
|
||||
@@ -69,8 +62,6 @@ if (GETPOST('button_removefilter'))
|
||||
}
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('membertypecard'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -87,9 +78,6 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
||||
$adht->mail_valid = trim($_POST["mail_valid"]);
|
||||
$adht->vote = trim($_POST["vote"]);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
||||
|
||||
if ($adht->libelle)
|
||||
{
|
||||
$id=$adht->create($user->id);
|
||||
@@ -124,9 +112,6 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
$adht->mail_valid = trim($_POST["mail_valid"]);
|
||||
$adht->vote = trim($_POST["vote"]);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
||||
|
||||
$adht->update($user->id);
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]);
|
||||
@@ -146,7 +131,7 @@ if ($action == 'commentaire' && $user->rights->adherent->configurer)
|
||||
{
|
||||
$don = new Don($db);
|
||||
$don->fetch($rowid);
|
||||
$don->update_note(dol_html_entity_decode(GETPOST('commentaire'), ENT_QUOTES));
|
||||
$don->update_note($_POST["commentaire"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +203,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
// New type
|
||||
if ($user->rights->adherent->configurer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=create">'.$langs->trans("NewType").'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=create">'.$langs->trans("NewType").'</a>';
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
@@ -234,7 +219,6 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
$form = new Form($db);
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
print_fiche_titre($langs->trans("NewMemberType"));
|
||||
|
||||
@@ -265,13 +249,6 @@ if ($action == 'create')
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $adht->showOptionals($extrafields,'edit');
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
print '<br>';
|
||||
@@ -292,7 +269,6 @@ if ($rowid > 0)
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($rowid);
|
||||
$adht->fetch_optionals($rowid,$extralabels);
|
||||
|
||||
$h=0;
|
||||
|
||||
@@ -331,16 +307,8 @@ if ($rowid > 0)
|
||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print nl2br($adht->mail_valid)."</td></tr>";
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$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))
|
||||
{
|
||||
// View extrafields
|
||||
print $adht->showOptionals($extrafields);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
@@ -352,16 +320,16 @@ if ($rowid > 0)
|
||||
// Edit
|
||||
if ($user->rights->adherent->configurer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&rowid='.$adht->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&rowid='.$adht->id.'">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
// Add
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?action=create&typeid='.$adht->id.'">'.$langs->trans("AddMember").'</a></div>';
|
||||
print '<a class="butAction" href="fiche.php?action=create&typeid='.$adht->id.'">'.$langs->trans("AddMember").'</a>';
|
||||
|
||||
// Delete
|
||||
if ($user->rights->adherent->configurer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$adht->id.'">'.$langs->trans("DeleteType").'</a></div>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$adht->id.'">'.$langs->trans("DeleteType").'</a>';
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
@@ -370,10 +338,10 @@ if ($rowid > 0)
|
||||
// Show list of members (nearly same code than in page liste.php)
|
||||
|
||||
$membertypestatic=new AdherentType($db);
|
||||
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, ";
|
||||
$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe, ";
|
||||
$sql.= " d.datefin,";
|
||||
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||
$sql.= " t.libelle as type, t.cotisation";
|
||||
@@ -383,9 +351,9 @@ if ($rowid > 0)
|
||||
$sql.= " AND t.rowid = ".$adht->id;
|
||||
if ($sall)
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
$sql.= " AND (d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.adresse LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
@@ -395,12 +363,12 @@ if ($rowid > 0)
|
||||
{
|
||||
if (isset($_POST['search']) && $_POST['search'] != '')
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$_POST['search']."%' OR d.lastname LIKE '%".$_POST['search']."%')";
|
||||
$sql.= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')";
|
||||
}
|
||||
}
|
||||
if (! empty($search_lastname))
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
|
||||
$sql.= " AND (d.prenom LIKE '%".$search_lastname."%' OR d.nom LIKE '%".$search_lastname."%')";
|
||||
}
|
||||
if (! empty($search_login))
|
||||
{
|
||||
@@ -460,8 +428,8 @@ if ($rowid > 0)
|
||||
|
||||
$param="&rowid=".$rowid;
|
||||
if (! empty($status)) $param.="&status=".$status;
|
||||
if (! empty($search_lastname)) $param.="&search_lastname=".$search_lastname;
|
||||
if (! empty($search_firstname)) $param.="&search_firstname=".$search_firstname;
|
||||
if (! empty($search_lastname)) $param.="&search_nom=".$search_lastname;
|
||||
if (! empty($search_firstname)) $param.="&search_prenom=".$search_firstname;
|
||||
if (! empty($search_login)) $param.="&search_login=".$search_login;
|
||||
if (! empty($search_email)) $param.="&search_email=".$search_email;
|
||||
if (! empty($filter)) $param.="&filter=".$filter;
|
||||
@@ -476,7 +444,7 @@ if ($rowid > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
|
||||
@@ -492,7 +460,7 @@ if ($rowid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_nom" value="'.$search_lastname.'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
|
||||
@@ -524,7 +492,7 @@ if ($rowid > 0)
|
||||
$adh->lastname=$objp->lastname;
|
||||
$adh->firstname=$objp->firstname;
|
||||
|
||||
// Lastname
|
||||
// Nom
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
if ($objp->societe != '')
|
||||
@@ -540,7 +508,7 @@ if ($rowid > 0)
|
||||
print "<td>".$objp->login."</td>\n";
|
||||
|
||||
// Type
|
||||
/*print '<td class="nowrap">';
|
||||
/*print '<td nowrap="nowrap">';
|
||||
$membertypestatic->id=$objp->type_id;
|
||||
$membertypestatic->libelle=$objp->type;
|
||||
print $membertypestatic->getNomUrl(1,12);
|
||||
@@ -554,14 +522,14 @@ if ($rowid > 0)
|
||||
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
|
||||
|
||||
// Statut
|
||||
print '<td class="nowrap">';
|
||||
print '<td nowrap="nowrap">';
|
||||
print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
|
||||
print "</td>";
|
||||
|
||||
// Date fin cotisation
|
||||
if ($datefin)
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td align="center" nowrap="nowrap">';
|
||||
if ($datefin < time() && $objp->statut > 0)
|
||||
{
|
||||
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
|
||||
@@ -574,7 +542,7 @@ if ($rowid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="left" class="nowrap">';
|
||||
print '<td align="left" nowrap="nowrap">';
|
||||
if ($objp->cotisation == 'yes')
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
@@ -625,7 +593,7 @@ if ($rowid > 0)
|
||||
$adht = new AdherentType($db);
|
||||
$adht->id = $rowid;
|
||||
$adht->fetch($rowid);
|
||||
$adht->fetch_optionals($rowid,$extralabels);
|
||||
|
||||
|
||||
$h=0;
|
||||
|
||||
@@ -663,26 +631,8 @@ if ($rowid > 0)
|
||||
$doleditor->Create();
|
||||
print "</td></tr>";
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
||||
//Extra field
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print '<br><br><table class="border" width="100%">';
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($adht->array_options['options_'.$key])?$adht->array_options['options_'.$key]:''));
|
||||
print '<tr><td width="30%">'.$label.'</td><td>';
|
||||
print $extrafields->showInputField($key,$value);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
print '</table><br><br>';
|
||||
}
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
|
||||
@@ -212,6 +212,26 @@ $list=array('COMPTA_PRODUCT_BUY_ACCOUNT','COMPTA_PRODUCT_SOLD_ACCOUNT','COMPTA_S
|
||||
'COMPTA_VAT_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER'
|
||||
);
|
||||
|
||||
/*$sql = "SELECT rowid, name, value, type, note";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.= " WHERE name LIKE 'COMPTA_%'";
|
||||
$sql.= " AND name NOT IN ('COMPTA_MODE')";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
$list[$obj->name]=$obj->value;
|
||||
$i++;
|
||||
}
|
||||
}*/
|
||||
|
||||
$num=count($list);
|
||||
if ($num)
|
||||
{
|
||||
|
||||
@@ -65,8 +65,8 @@ else
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
* Actions
|
||||
*/
|
||||
if ($action == "save" && empty($cancel))
|
||||
{
|
||||
$i=0;
|
||||
@@ -125,7 +125,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
||||
|
||||
|
||||
/**
|
||||
* View
|
||||
* Affichage du formulaire de saisie
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
@@ -134,14 +134,13 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
|
||||
print "<br>\n";
|
||||
|
||||
print $langs->trans("AgendaAutoActionDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'autoactions', $langs->trans("Agenda"));
|
||||
|
||||
print $langs->trans("AgendaAutoActionDesc")."<br>\n";
|
||||
print $langs->trans("OnlyActiveElementsAreShown").'<br>';
|
||||
print "<br>\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@@ -180,17 +179,59 @@ print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print "</center>";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* Other options
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("OtherOptions"));
|
||||
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder allwidth">'."\n";
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
||||
print '<td align="center" width="20"> </td>'."\n";
|
||||
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Manual or automatic
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>'."\n";
|
||||
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n";
|
||||
print '<td align="center" width="20"> </td>'."\n";
|
||||
|
||||
print '<td align="center" width="100">'."\n";
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print ajax_constantonoff('AGENDA_USE_EVENT_TYPE');
|
||||
}
|
||||
else
|
||||
{
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE == 0)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
else if($conf->global->BUSINESS_VISIBLE_TO_ALL_BY_DEFAULT == 1)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
print "<br>";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -35,7 +35,6 @@ if (!$user->admin)
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
$langs->load("agenda");
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
@@ -47,7 +46,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='actioncomm'; //Must be the $table_element of the class that manage extrafield
|
||||
$elementtype='actioncomm';
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
@@ -64,14 +63,15 @@ require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Agenda");
|
||||
|
||||
llxHeader('',$langs->trans("AgendaSetup"));
|
||||
llxHeader();
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Agenda"));
|
||||
@@ -79,6 +79,8 @@ dol_fiche_head($head, 'attributes', $langs->trans("Agenda"));
|
||||
print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Agenda")).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
@@ -108,6 +110,7 @@ foreach($extrafields->attribute_type as $key => $value)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
// $i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
@@ -126,8 +129,8 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
@@ -154,4 +157,4 @@ if ($action == 'edit' && ! empty($attrname))
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
@@ -54,45 +54,32 @@ if ($actionsave)
|
||||
$db->begin();
|
||||
|
||||
$disableext=GETPOST('AGENDA_DISABLE_EXT','alpha');
|
||||
$res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0,'',$conf->entity);
|
||||
if ($disableext) $disableext=0; else $disableext=1;
|
||||
$res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0);
|
||||
|
||||
$i=1; $errorsaved=0;
|
||||
$i=1;
|
||||
$error=0;
|
||||
|
||||
// Save agendas
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
$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))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors');
|
||||
$error++;
|
||||
$errorsaved++;
|
||||
break;
|
||||
}
|
||||
|
||||
//print 'color='.$color;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,trim(GETPOST('agenda_ext_name'.$i),'alpha'),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,trim(GETPOST('agenda_ext_src'.$i,'alpha')),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Save nb of agenda
|
||||
if (! $error)
|
||||
{
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||
}
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@@ -102,7 +89,7 @@ if ($actionsave)
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
if (empty($errorsaved)) $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,55 +110,32 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("AgendaExtSitesDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'extsites', $langs->trans("Agenda"));
|
||||
|
||||
print $langs->trans("AgendaExtSitesDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
||||
$selectedvalue=$conf->global->AGENDA_DISABLE_EXT;
|
||||
$selectedvalue=(GETPOST('AGENDA_DISABLE_AGENDA','alpha'))?GETPOST('AGENDA_DISABLE_EXT','alpha'):$conf->global->AGENDA_DISABLE_EXT;
|
||||
if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
|
||||
print $langs->trans("ExtSitesEnableThisTool").' '.$form->selectyesno("AGENDA_DISABLE_EXT",$selectedvalue,1).'<br><br>';
|
||||
|
||||
$var=true;
|
||||
$var=false;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<td>'.$langs->trans("Parameter")."</td>";
|
||||
print '<td align="center">'.$langs->trans("Value")."</td>";
|
||||
print "</tr>";
|
||||
|
||||
// Show external agenda
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("ExtSitesEnableThisTool")."</td>";
|
||||
print '<td align="center">';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print ajax_constantonoff('AGENDA_DISABLE_EXT',array('enabled'=>array(0=>'.hideifnotset')),null,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($conf->global->AGENDA_DISABLE_EXT == 0)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=1">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=0">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
print '<td width="180">'.$langs->trans("Parameter")."</td>";
|
||||
print "<td>".$langs->trans("Value")."</td>";
|
||||
print "</tr>";
|
||||
|
||||
// Nb of agenda
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("ExtSitesNbOfAgenda")."</td>";
|
||||
print '<td align="center">';
|
||||
print '<input class="flat hideifnotset" type="text" size="2" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="'.$conf->global->AGENDA_EXT_NB.'">';
|
||||
print "<td>";
|
||||
print '<input class="flat" type="text" size="2" name="AGENDA_EXT_NB" value="'.$conf->global->AGENDA_EXT_NB.'">';
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
|
||||
@@ -184,7 +148,7 @@ print "<tr class=\"liste_titre\">";
|
||||
print "<td>".$langs->trans("Parameter")."</td>";
|
||||
print "<td>".$langs->trans("Name")."</td>";
|
||||
print "<td>".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)</td>';
|
||||
print '<td align="right">'.$langs->trans("Color").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Color").'</td>';
|
||||
print "</tr>";
|
||||
|
||||
$i=1;
|
||||
@@ -192,22 +156,18 @@ $var=true;
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
$key=$i;
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="180" nowrap="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
$name='AGENDA_EXT_NAME'.$key;
|
||||
$src='AGENDA_EXT_SRC'.$key;
|
||||
$color='AGENDA_EXT_COLOR'.$key;
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat hideifnotset" name="agenda_ext_name'.$key.'" value="'. (GETPOST('agenda_ext_name'.$key)?GETPOST('agenda_ext_name'.$key):$conf->global->$name) . '" size="28"></td>';
|
||||
// URL
|
||||
print '<td><input type="url" class="flat hideifnotset" name="agenda_ext_src'.$key.'" value="'. (GETPOST('agenda_ext_src'.$key)?GETPOST('agenda_ext_src'.$key):$conf->global->$src) . '" size="60"></td>';
|
||||
// Color (Possible colors are limited by Google)
|
||||
print '<td class="nowrap" align="right">';
|
||||
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
|
||||
print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset');
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"agenda_ext_name".$key."\" value=\"". $conf->global->$name . "\" size=\"28\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"agenda_ext_src".$key."\" value=\"". $conf->global->$src . "\" size=\"60\"></td>";
|
||||
print '<td nowrap="nowrap" align="center">';
|
||||
// Possible colors are limited by Google
|
||||
//print $formadmin->select_colors($conf->global->$color, "google_agenda_color".$key, $colorlist);
|
||||
print $formother->select_color($conf->global->$color, "agenda_ext_color".$key, 'extsitesconfig', 1, '');
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
@@ -227,8 +187,7 @@ dol_fiche_end();
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@@ -1,135 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/agenda.php
|
||||
* \ingroup agenda
|
||||
* \brief Autocreate actions for agenda module setup page
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
$value=(GETPOST($code) ? GETPOST($code) : 1);
|
||||
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'other', $langs->trans("Agenda"));
|
||||
|
||||
print_titre($langs->trans("OtherOptions"));
|
||||
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder allwidth">'."\n";
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
||||
print '<td align="center" width="20"> </td>'."\n";
|
||||
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Manual or automatic
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>'."\n";
|
||||
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n";
|
||||
print '<td align="center" width="20"> </td>'."\n";
|
||||
|
||||
print '<td align="center" width="100">'."\n";
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print ajax_constantonoff('AGENDA_USE_EVENT_TYPE');
|
||||
}
|
||||
else
|
||||
{
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE == 0)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
else if($conf->global->BUSINESS_VISIBLE_TO_ALL_BY_DEFAULT == 1)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print "<br>";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@@ -75,13 +75,13 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("AgendaSetupOtherDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'xcal', $langs->trans("Agenda"));
|
||||
|
||||
print $langs->trans("AgendaSetupOtherDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,7 +28,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("boxes");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@@ -36,8 +35,9 @@ $rowid = GETPOST('rowid','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
$errmesg='';
|
||||
|
||||
// Define possible position of boxes
|
||||
$pos_name = getStaticMember('InfoBox','listOfPages');
|
||||
// Definition des positions possibles pour les boites
|
||||
$pos_array = array(0); // Positions possibles pour une boite (0,1,2,...)
|
||||
$pos_name = array(0=>$langs->trans("Home")); // Nom des positions 0=Homepage, 1=...
|
||||
$boxes = array();
|
||||
|
||||
|
||||
@@ -236,14 +236,12 @@ $sql.= " AND b.box_id = bd.rowid";
|
||||
$sql.= " AND b.fk_user=0";
|
||||
$sql.= " ORDER by b.position, b.box_order";
|
||||
|
||||
dol_syslog("Search available boxes sql=".$sql, LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$decalage=0;
|
||||
$var=false;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = ! $var;
|
||||
@@ -315,7 +313,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
|
||||
// Available boxes to activate
|
||||
// Available boxes
|
||||
$boxtoadd=InfoBox::listBoxes($db,'available',-1,null,$actives);
|
||||
|
||||
print "<br>\n";
|
||||
@@ -346,22 +344,13 @@ foreach($boxtoadd as $box)
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||
if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($box->note == '(WarningUsingThisBoxSlowDown)')
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("WarningUsingThisBoxSlowDown");
|
||||
}
|
||||
else print ($box->note?$box->note:' ');
|
||||
print '</td>';
|
||||
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';
|
||||
print '<td>' . ($box->note?$box->note:' ') . '</td>';
|
||||
print '<td>' . $box->sourcefile . '</td>';
|
||||
|
||||
// Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position
|
||||
print '<td>';
|
||||
print $form->selectarray("pos",$pos_name,0,0,0,0,'',1);
|
||||
print $form->selectarray("pos",$pos_name);
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="boxid" value="'.$box->box_id.'">';
|
||||
print ' <input type="submit" class="button" name="button" value="'.$langs->trans("Activate").'">';
|
||||
@@ -407,18 +396,9 @@ foreach($boxactivated as $key => $box)
|
||||
|
||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||
if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($box->note == '(WarningUsingThisBoxSlowDown)')
|
||||
{
|
||||
$langs->load("errors");
|
||||
print img_warning('',0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
|
||||
}
|
||||
else print ($box->note?$box->note:' ');
|
||||
print '</td>';
|
||||
print '<td align="center">' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . '</td>';
|
||||
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';
|
||||
print '<td>' . ($box->note?$box->note:' ') . '</td>';
|
||||
print '<td align="center">' . (isset($pos_name[$box->position])?$pos_name[$box->position]:'') . '</td>';
|
||||
$hasnext=($key < (count($boxactivated)-1));
|
||||
$hasprevious=($key != 0);
|
||||
print '<td align="center">'.($key+1).'</td>';
|
||||
|
||||
@@ -38,7 +38,7 @@ $action = GETPOST("action");
|
||||
*/
|
||||
if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity);
|
||||
$result=dolibarr_set_const($db, "CLICKTODIAL_URL",GETPOST("url"),'chaine',0,'',$conf->entity);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
@@ -54,8 +54,6 @@ if ($action == 'setvalue' && $user->admin)
|
||||
* View
|
||||
*/
|
||||
|
||||
$user->fetch_clicktodial();
|
||||
|
||||
$wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es';
|
||||
llxHeader('',$langs->trans("ClickToDialSetup"),$wikihelp);
|
||||
|
||||
@@ -71,67 +69,33 @@ print '<input type="hidden" name="action" value="setvalue">';
|
||||
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="120">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td valign="top">';
|
||||
print $langs->trans("DefaultLink").'</td><td>';
|
||||
print $langs->trans("URL").'</td><td>';
|
||||
print '<input size="92" type="text" name="url" value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
|
||||
print '<br>';
|
||||
print $langs->trans("ClickToDialUrlDesc").'<br>';
|
||||
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
|
||||
|
||||
//if (! empty($user->clicktodial_url))
|
||||
//{
|
||||
print '<br>';
|
||||
print info_admin($langs->trans("ValueOverwrittenByUserSetup"));
|
||||
//}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<tr><td colspan="3" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
||||
print '</table></form>';
|
||||
|
||||
print '<center><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center>';
|
||||
|
||||
print '</form><br><br>';
|
||||
|
||||
|
||||
if (! empty($conf->global->CLICKTODIAL_URL))
|
||||
{
|
||||
$user->fetch_clicktodial();
|
||||
|
||||
$phonefortest=$mysoc->phone;
|
||||
if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print $langs->trans("LinkToTestClickToDial",$user->login).' : ';
|
||||
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
|
||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
|
||||
print '</form>';
|
||||
|
||||
$setupcomplete=1;
|
||||
if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0;
|
||||
if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0;
|
||||
if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0;
|
||||
|
||||
if ($setupcomplete)
|
||||
{
|
||||
print $langs->trans("LinkToTest",$user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<div class="warning">'.$langs->trans("WarningClickToDialUserSetupNotComplete").'</div>';
|
||||
}
|
||||
}
|
||||
/*if (! empty($conf->global->CLICKTODIAL_URL))
|
||||
{
|
||||
print $langs->trans("Test");
|
||||
// Add a phone number to test
|
||||
}
|
||||
*/
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -33,7 +32,6 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("errors");
|
||||
@@ -44,10 +42,6 @@ if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type = 'order';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -120,13 +114,30 @@ else if ($action == 'specimen')
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$type='order';
|
||||
$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))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
$type='order';
|
||||
$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))
|
||||
{
|
||||
if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
@@ -135,18 +146,41 @@ else if ($action == 'del')
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "COMMANDE_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->COMMANDE_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
$type='order';
|
||||
|
||||
$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)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Error ".$db->lasterror(), LOG_ERR);
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,14 +234,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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -224,12 +250,10 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$head = order_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("ModuleSetup"), 0, 'order');
|
||||
|
||||
/*
|
||||
* Orders Numbering model
|
||||
* Numbering module
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("OrdersNumberingModules"));
|
||||
@@ -238,7 +262,7 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td nowrap="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Infos").'</td>';
|
||||
print '</tr>'."\n";
|
||||
@@ -262,23 +286,23 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
|
||||
require_once $dir.$file.'.php';
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$file.'.php';
|
||||
|
||||
$module = new $file;
|
||||
|
||||
// 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 '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
@@ -494,14 +518,11 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
//Autres Options
|
||||
print "<br>";
|
||||
|
||||
/*
|
||||
* Other options
|
||||
*
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("OtherOptions"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
@@ -61,14 +61,14 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
$mysoc->country_label=$tmparray['label'];
|
||||
|
||||
$s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label;
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_PAYS", $s,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS",$_POST["address"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN",$_POST["town"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP",$_POST["zipcode"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE",$_POST["state_id"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADRESSE",$_POST["address"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_VILLE",$_POST["ville"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_CP",$_POST["cp"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_DEPARTEMENT",$_POST["departement_id"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"],'chaine',0,'',$conf->entity);
|
||||
@@ -268,7 +268,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th width="35%">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("CompanyName").'</td><td>';
|
||||
@@ -276,27 +276,27 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyAddress").'</td><td>';
|
||||
print '<textarea name="address" cols="80" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:$_POST["address"]) . '</textarea></td></tr>'."\n";
|
||||
print '<textarea name="address" cols="80" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADRESSE?$conf->global->MAIN_INFO_SOCIETE_ADRESSE:$_POST["address"]) . '</textarea></td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyZip").'</td><td>';
|
||||
print '<input name="zipcode" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:$_POST["zipcode"]) . '" size="10"></td></tr>'."\n";
|
||||
print '<input name="cp" value="'. ($conf->global->MAIN_INFO_SOCIETE_CP?$conf->global->MAIN_INFO_SOCIETE_CP:$_POST["cp"]) . '" size="10"></td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyTown").'</td><td>';
|
||||
print '<input name="town" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:$_POST["town"]) . '"></td></tr>'."\n";
|
||||
print '<input name="ville" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_VILLE?$conf->global->MAIN_INFO_SOCIETE_VILLE:$_POST["ville"]) . '"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td>';
|
||||
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
|
||||
//if (empty($pays_selected)) $pays_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 '</td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>';
|
||||
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id');
|
||||
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT,$mysoc->country_code,'departement_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
@@ -336,7 +336,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
// Logo
|
||||
$var=!$var;
|
||||
print '<tr'.dol_bc($var,'hideonsmartphone').'><td>'.$langs->trans("Logo").' (png,jpg)</td><td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Logo").' (png,jpg)</td><td>';
|
||||
print '<table width="100%" class="nocellnopadd"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print '<input type="file" class="flat" name="logo" size="50">';
|
||||
print '</td><td valign="middle" align="right">';
|
||||
@@ -366,7 +366,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Identifiants de la societe (country-specific)
|
||||
// Identifiants de la societe (propre au pays)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
$var=true;
|
||||
@@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
/*
|
||||
* Local Taxes
|
||||
*/
|
||||
if ($mysoc->useLocalTax(1))
|
||||
if ($mysoc->hasLocalTax(1))
|
||||
{
|
||||
// Local Tax 1
|
||||
print '<br>';
|
||||
@@ -579,7 +579,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</td></tr>\n";
|
||||
print "</table>";
|
||||
}
|
||||
if ($mysoc->useLocalTax(2))
|
||||
if ($mysoc->hasLocalTax(2))
|
||||
{
|
||||
// Local Tax 2
|
||||
print '<br>';
|
||||
@@ -646,13 +646,13 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyAddress").'</td><td>' . nl2br($conf->global->MAIN_INFO_SOCIETE_ADRESSE) . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyZip").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_CP . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyTown").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_VILLE . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyCountry").'</td><td>';
|
||||
@@ -667,14 +667,14 @@ else
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE);
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyCurrency").'</td><td>';
|
||||
print currency_name($conf->currency,1);
|
||||
print ' ('.$langs->getCurrencySymbol($conf->currency).')';
|
||||
print ' ('.getCurrencySymbol($conf->currency).')';
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
@@ -731,7 +731,7 @@ else
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Identifiants de la societe (country-specific)
|
||||
// Identifiants de la societe (propre au pays)
|
||||
print '<form name="formsoc" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -860,7 +860,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
$s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
|
||||
$s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
|
||||
}
|
||||
}
|
||||
print $s;
|
||||
@@ -927,7 +927,7 @@ else
|
||||
/*
|
||||
* Local Taxes
|
||||
*/
|
||||
if ($mysoc->useLocalTax(1))
|
||||
if ($mysoc->hasLocalTax(1))
|
||||
{
|
||||
// Local Tax 1
|
||||
print '<br>';
|
||||
@@ -960,7 +960,7 @@ else
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
if ($mysoc->useLocalTax(2))
|
||||
if ($mysoc->hasLocalTax(2))
|
||||
{
|
||||
// Local Tax 2
|
||||
print '<br>';
|
||||
@@ -997,7 +997,7 @@ else
|
||||
|
||||
// Actions buttons
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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,10 +35,6 @@ accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES';
|
||||
|
||||
if ($action == 'setcomptamode')
|
||||
@@ -92,7 +87,7 @@ if ($action == 'update' || $action == 'add')
|
||||
}*/
|
||||
|
||||
/*
|
||||
* View
|
||||
* Affichage page
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
@@ -102,18 +97,9 @@ $form=new Form($db);
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans('ComptaSetup'),$linkback,'setup');
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/compta.php";
|
||||
$head[$h][1] = $langs->trans("Accountancy");
|
||||
$head[$h][2] = 'Compta';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Cas du parametre COMPTA_MODE
|
||||
|
||||
@@ -122,7 +122,7 @@ if (! empty($consts) && $action == 'delete')
|
||||
}
|
||||
}
|
||||
if ($nbdeleted > 0) setEventMessage($langs->trans("RecordDeleted"));
|
||||
$action='';
|
||||
$action='';
|
||||
}
|
||||
|
||||
// Delete line from delete picto
|
||||
@@ -130,7 +130,7 @@ if ($action == 'delete')
|
||||
{
|
||||
if (dolibarr_del_const($db, $rowid, $entity) >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans("RecordDeleted"));
|
||||
setEventMessage($langs->trans("RecordDeleted"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -222,8 +222,8 @@ print '</form>';
|
||||
print "\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
|
||||
// Show constants
|
||||
$sql = "SELECT";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,7 +27,6 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("errors");
|
||||
$langs->load("contracts");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
@@ -90,20 +88,6 @@ print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup');
|
||||
|
||||
print "<br>";
|
||||
|
||||
$h = 0;
|
||||
|
||||
$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"));
|
||||
|
||||
/*
|
||||
* Contracts Numbering model
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("ContractsNumberingModules"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -145,8 +129,8 @@ if (is_resource($handle))
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
||||
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -64,13 +64,15 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// 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('admin'));
|
||||
|
||||
// This page is a generic page to edit dictionnaries
|
||||
// Put here declaration of dictionnaries properties
|
||||
|
||||
// Sort order to show dictionnary (0 is space). All other dictionnaries (added by modules) will be at end of this.
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,25,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23);
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23);
|
||||
|
||||
// Name of SQL tables of dictionnaries
|
||||
$tabname=array();
|
||||
@@ -98,7 +100,6 @@ $tabname[21]= MAIN_DB_PREFIX."c_availability";
|
||||
$tabname[22]= MAIN_DB_PREFIX."c_input_reason";
|
||||
$tabname[23]= MAIN_DB_PREFIX."accountingaccount";
|
||||
$tabname[24]= MAIN_DB_PREFIX."accounting_system";
|
||||
$tabname[25]= MAIN_DB_PREFIX."c_revenuestamp";
|
||||
|
||||
// Dictionary labels
|
||||
$tablib=array();
|
||||
@@ -126,52 +127,50 @@ $tablib[21]= "DictionnaryAvailability";
|
||||
$tablib[22]= "DictionnarySource";
|
||||
$tablib[23]= "DictionnaryAccountancyplan";
|
||||
$tablib[24]= "DictionnaryAccountancysystem";
|
||||
$tablib[25]= "DictionnaryRevenueStamp";
|
||||
|
||||
// Requete pour extraction des donnees des dictionnaires
|
||||
$tabsql=array();
|
||||
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
|
||||
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as country_code, p.libelle as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
|
||||
$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
|
||||
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as pays_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
|
||||
$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays";
|
||||
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c";
|
||||
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
|
||||
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as country_code, p.libelle as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent";
|
||||
$tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
|
||||
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
$tabsql[9] = "SELECT code_iso as code, label as libelle, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
|
||||
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
|
||||
$tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
|
||||
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
|
||||
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
|
||||
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
||||
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
|
||||
$tabsql[18]= "SELECT rowid as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
|
||||
$tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
|
||||
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
|
||||
$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_input_method";
|
||||
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
|
||||
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
||||
$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount";
|
||||
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[25]= "SELECT t.rowid, t.taux, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
|
||||
|
||||
// Critere de tri du dictionnaire
|
||||
$tabsqlsort=array();
|
||||
$tabsqlsort[1] ="country ASC, code ASC";
|
||||
$tabsqlsort[2] ="country ASC, code ASC";
|
||||
$tabsqlsort[3] ="country ASC, code ASC";
|
||||
$tabsqlsort[1] ="pays ASC, code ASC";
|
||||
$tabsqlsort[2] ="pays ASC, code ASC";
|
||||
$tabsqlsort[3] ="pays ASC, code ASC";
|
||||
$tabsqlsort[4] ="code ASC";
|
||||
$tabsqlsort[5] ="libelle ASC";
|
||||
$tabsqlsort[6] ="a.type ASC, a.module ASC, a.position ASC, a.code ASC";
|
||||
$tabsqlsort[7] ="country ASC, code ASC, a.libelle ASC";
|
||||
$tabsqlsort[7] ="pays ASC, code ASC, a.libelle ASC";
|
||||
$tabsqlsort[8] ="libelle ASC";
|
||||
$tabsqlsort[9] ="label ASC";
|
||||
$tabsqlsort[10]="country ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
|
||||
$tabsqlsort[9] ="libelle ASC";
|
||||
$tabsqlsort[10]="pays ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
|
||||
$tabsqlsort[11]="element ASC, source ASC, code ASC";
|
||||
$tabsqlsort[12]="sortorder ASC, code ASC";
|
||||
$tabsqlsort[13]="code ASC";
|
||||
$tabsqlsort[14]="country ASC, e.organization ASC, code ASC";
|
||||
$tabsqlsort[14]="pays ASC, e.organization ASC, code ASC";
|
||||
$tabsqlsort[15]="rowid ASC";
|
||||
$tabsqlsort[16]="sortorder ASC";
|
||||
$tabsqlsort[17]="code ASC";
|
||||
@@ -182,63 +181,60 @@ $tabsqlsort[21]="code ASC, label ASC";
|
||||
$tabsqlsort[22]="code ASC, label ASC";
|
||||
$tabsqlsort[23]="fk_pcg_version ASC, accountancy_code ASC";
|
||||
$tabsqlsort[24]="pcg_version ASC";
|
||||
$tabsqlsort[25]="country ASC, taux ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield=array();
|
||||
$tabfield[1] = "code,libelle,country";
|
||||
$tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country"
|
||||
$tabfield[3] = "code,libelle,country_id,country";
|
||||
$tabfield[1] = "code,libelle,pays";
|
||||
$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,pays_code-pays"
|
||||
$tabfield[3] = "code,libelle,pays_id,pays";
|
||||
$tabfield[4] = "code,libelle";
|
||||
$tabfield[5] = "code,libelle";
|
||||
$tabfield[6] = "code,libelle,type,position";
|
||||
$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible";
|
||||
$tabfield[7] = "code,libelle,pays_id,pays,accountancy_code,deductible";
|
||||
$tabfield[8] = "code,libelle";
|
||||
$tabfield[9] = "code,label,unicode";
|
||||
$tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfield[9] = "code,libelle,unicode";
|
||||
$tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfield[11]= "element,source,code,libelle";
|
||||
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
|
||||
$tabfield[13]= "code,libelle,type";
|
||||
$tabfield[14]= "code,libelle,price,organization,country_id,country";
|
||||
$tabfield[14]= "code,libelle,price,organization,pays_id,pays";
|
||||
$tabfield[15]= "code,libelle,width,height,unit";
|
||||
$tabfield[16]= "code,libelle";
|
||||
$tabfield[17]= "code,libelle";
|
||||
$tabfield[18]= "code,libelle,tracking";
|
||||
$tabfield[18]= "code,libelle";
|
||||
$tabfield[19]= "code,libelle";
|
||||
$tabfield[20]= "code,libelle";
|
||||
$tabfield[21]= "code,label";
|
||||
$tabfield[22]= "code,label";
|
||||
$tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
|
||||
$tabfield[24]= "pcg_version,country_id,country,label";
|
||||
$tabfield[25]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfield[24]= "pcg_version,pays_id,pays,label";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue=array();
|
||||
$tabfieldvalue[1] = "code,libelle,country";
|
||||
$tabfieldvalue[1] = "code,libelle,pays";
|
||||
$tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region"
|
||||
$tabfieldvalue[3] = "code,libelle,country";
|
||||
$tabfieldvalue[3] = "code,libelle,pays";
|
||||
$tabfieldvalue[4] = "code,libelle";
|
||||
$tabfieldvalue[5] = "code,libelle";
|
||||
$tabfieldvalue[6] = "code,libelle,type,position";
|
||||
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
|
||||
$tabfieldvalue[7] = "code,libelle,pays,accountancy_code,deductible";
|
||||
$tabfieldvalue[8] = "code,libelle";
|
||||
$tabfieldvalue[9] = "code,label,unicode";
|
||||
$tabfieldvalue[10]= "country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfieldvalue[9] = "code,libelle,unicode";
|
||||
$tabfieldvalue[10]= "pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfieldvalue[11]= "element,source,code,libelle";
|
||||
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
|
||||
$tabfieldvalue[13]= "code,libelle,type";
|
||||
$tabfieldvalue[14]= "code,libelle,price,organization,country";
|
||||
$tabfieldvalue[14]= "code,libelle,price,organization,pays";
|
||||
$tabfieldvalue[15]= "code,libelle,width,height,unit";
|
||||
$tabfieldvalue[16]= "code,libelle";
|
||||
$tabfieldvalue[17]= "code,libelle";
|
||||
$tabfieldvalue[18]= "code,libelle,tracking";
|
||||
$tabfieldvalue[18]= "code,libelle";
|
||||
$tabfieldvalue[19]= "code,libelle";
|
||||
$tabfieldvalue[20]= "code,libelle";
|
||||
$tabfieldvalue[21]= "code,label";
|
||||
$tabfieldvalue[22]= "code,label";
|
||||
$tabfieldvalue[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
|
||||
$tabfieldvalue[24]= "pcg_version,country,label";
|
||||
$tabfieldvalue[25]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfieldvalue[24]= "pcg_version,pays,label";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
$tabfieldinsert=array();
|
||||
@@ -259,14 +255,13 @@ $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
|
||||
$tabfieldinsert[15]= "code,label,width,height,unit";
|
||||
$tabfieldinsert[16]= "code,label";
|
||||
$tabfieldinsert[17]= "code,libelle";
|
||||
$tabfieldinsert[18]= "code,libelle,tracking";
|
||||
$tabfieldinsert[18]= "code,libelle";
|
||||
$tabfieldinsert[19]= "code,libelle";
|
||||
$tabfieldinsert[20]= "code,libelle";
|
||||
$tabfieldinsert[21]= "code,label";
|
||||
$tabfieldinsert[22]= "code,label";
|
||||
$tabfieldinsert[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label";
|
||||
$tabfieldinsert[24]= "pcg_version,fk_pays,label";
|
||||
$tabfieldinsert[25]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
@@ -296,7 +291,6 @@ $tabrowid[21]= "rowid";
|
||||
$tabrowid[22]= "rowid";
|
||||
$tabrowid[23]= "";
|
||||
$tabrowid[24]= "";
|
||||
$tabrowid[25]= "";
|
||||
|
||||
// Condition to show dictionnary in setup page
|
||||
$tabcond=array();
|
||||
@@ -324,7 +318,6 @@ $tabcond[21]= ! empty($conf->propal->enabled);
|
||||
$tabcond[22]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled));
|
||||
$tabcond[23]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy plan should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
|
||||
$tabcond[24]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
|
||||
$tabcond[25]= true;
|
||||
|
||||
// List of help for fields
|
||||
$tabhelp=array();
|
||||
@@ -352,7 +345,6 @@ $tabhelp[21] = array();
|
||||
$tabhelp[22] = array();
|
||||
$tabhelp[23] = array();
|
||||
$tabhelp[24] = array();
|
||||
$tabhelp[25] = array();
|
||||
|
||||
// Complete all arrays with entries found into modules
|
||||
complete_dictionnary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp);
|
||||
@@ -419,7 +411,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$ok=1;
|
||||
foreach ($listfield as $f => $value)
|
||||
{
|
||||
if ($value == 'country' && in_array('region_id',$listfield)) continue; // For region page, we do not require the country input
|
||||
if ($value == 'pays' && in_array('region_id',$listfield)) continue; // For region page, we do not require the country input
|
||||
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
||||
@@ -440,7 +432,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($fieldnamekey == 'type') $fieldnamekey = 'Type';
|
||||
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
|
||||
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
|
||||
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
|
||||
|
||||
$msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'<br>';
|
||||
}
|
||||
@@ -464,7 +455,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
|
||||
}*/
|
||||
}
|
||||
if (isset($_POST["country"]) && $_POST["country"]=='0') {
|
||||
if (isset($_POST["pays"]) && $_POST["pays"]=='0') {
|
||||
$ok=0;
|
||||
$msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'<br>';
|
||||
}
|
||||
@@ -695,8 +686,8 @@ if ($id)
|
||||
|
||||
if ($sortfield)
|
||||
{
|
||||
// If sort order is "country", we use country_code instead
|
||||
if ($sortfield == 'country') $sortfield='country_code';
|
||||
// If sort order is "pays", we use pays_code instead
|
||||
if ($sortfield == 'pays') $sortfield='pays_code';
|
||||
$sql.= " ORDER BY ".$sortfield;
|
||||
if ($sortorder)
|
||||
{
|
||||
@@ -739,11 +730,7 @@ if ($id)
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='right';
|
||||
}
|
||||
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2";}
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
@@ -754,18 +741,18 @@ if ($id)
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
|
||||
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
||||
if ($fieldlist[$field]=='country') {
|
||||
if ($fieldlist[$field]=='pays') {
|
||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||
$valuetoshow=$langs->trans("Country");
|
||||
}
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; $align="center"; }
|
||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
|
||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
|
||||
@@ -860,11 +847,7 @@ if ($id)
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='right';
|
||||
}
|
||||
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
@@ -875,15 +858,15 @@ if ($id)
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
|
||||
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
||||
if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); }
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
||||
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; $align="center"; }
|
||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
|
||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
|
||||
@@ -952,15 +935,15 @@ if ($id)
|
||||
else if ($valuetoshow=='all') {
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='country') {
|
||||
if (empty($obj->country_code))
|
||||
else if ($fieldlist[$field]=='pays') {
|
||||
if (empty($obj->pays_code))
|
||||
{
|
||||
$valuetoshow='-';
|
||||
}
|
||||
else
|
||||
{
|
||||
$key=$langs->trans("Country".strtoupper($obj->country_code));
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||
$key=$langs->trans("Country".strtoupper($obj->pays_code));
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->pays_code)?$obj->pays_code." - ".$key:$obj->pays);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
|
||||
@@ -989,7 +972,7 @@ if ($id)
|
||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
|
||||
else if (! empty($obj->code_iso) && $fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
|
||||
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
||||
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
@@ -1045,11 +1028,11 @@ if ($id)
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
else if ($fieldlist[$field]=='unicode') {
|
||||
$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
|
||||
$valuetoshow = getCurrencySymbol($obj->code);
|
||||
}
|
||||
|
||||
else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||
@@ -1097,23 +1080,15 @@ if ($id)
|
||||
}
|
||||
|
||||
// Est-ce une entree du dictionnaire qui peut etre desactivee ?
|
||||
// True by default
|
||||
$iserasable=1;
|
||||
|
||||
if (isset($obj->code))
|
||||
{
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable = 0;
|
||||
else if ($obj->code == 'RECEP') $iserasable = 0;
|
||||
else if ($obj->code == 'EF0') $iserasable = 0;
|
||||
}
|
||||
|
||||
$iserasable=1; // Oui par defaut
|
||||
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0;
|
||||
if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0;
|
||||
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
|
||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
|
||||
|
||||
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&';
|
||||
|
||||
// Active
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
print '<td align="center" nowrap="nowrap">';
|
||||
if ($iserasable) print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
else
|
||||
{
|
||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
|
||||
@@ -1122,11 +1097,11 @@ if ($id)
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($iserasable) print '<td align="center"><a href="'.$url.'action=edit#'.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'">'.img_edit().'</a></td>';
|
||||
if ($iserasable) print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&action=edit#'.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'">'.img_edit().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
|
||||
// Delete link
|
||||
if ($iserasable) print '<td align="center"><a href="'.$url.'action=delete">'.img_delete().'</a></td>';
|
||||
if ($iserasable) print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&action=delete">'.img_delete().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
@@ -1174,7 +1149,7 @@ else
|
||||
|
||||
$var=!$var;
|
||||
$value=$tabname[$i];
|
||||
print '<tr '.$bc[$var].'><td width="50%">';
|
||||
print '<tr '.$bc[$var].'><td width="30%">';
|
||||
if (! empty($tabcond[$i]))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
|
||||
@@ -1232,15 +1207,15 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($fieldlist[$field] == 'country') {
|
||||
if ($fieldlist[$field] == 'pays') {
|
||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||
print '<td>';
|
||||
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28);
|
||||
print $form->select_country((! empty($obj->pays_code)?$obj->pays_code:(! empty($obj->pays)?$obj->pays:'')), 'pays', '', 28);
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'country_id') {
|
||||
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||
elseif ($fieldlist[$field] == 'pays_id') {
|
||||
$pays_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$pays_id.'">';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region') {
|
||||
print '<td>';
|
||||
@@ -1320,7 +1295,6 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
||||
print '<td>';
|
||||
$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" ';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -48,7 +47,7 @@ if ($action == 'specimen')
|
||||
$don = new Don($db);
|
||||
$don->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
// Charge le modele
|
||||
$dir = DOL_DOCUMENT_ROOT . "/core/modules/dons/";
|
||||
$file = $modele.".modules.php";
|
||||
if (file_exists($dir.$file))
|
||||
@@ -76,39 +75,67 @@ if ($action == 'specimen')
|
||||
}
|
||||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "DON_ADDON_MODEL",$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->DON_ADDON_MODEL = $value;
|
||||
}
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
if (dolibarr_set_const($db, "DON_ADDON_MODEL",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->DON_ADDON_MODEL = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='donation';
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."' AND type = '".$type."'";
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$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.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$type='donation';
|
||||
$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.= ")";
|
||||
$resql=$db->query($sql);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
if ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->DON_ADDON_MODEL == "$value") dolibarr_del_const($db, 'DON_ADDON_MODEL',$conf->entity);
|
||||
}
|
||||
$value = GETPOST('value','alpha');
|
||||
|
||||
$type='donation';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql .= " WHERE nom = '".$value."' AND type = '".$type."'";
|
||||
$resql=$db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -120,17 +147,6 @@ llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration');
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/dons.php";
|
||||
$head[$h][1] = $langs->trans("Donations");
|
||||
$head[$h][2] = 'Donation';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
|
||||
// Document templates
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/ecm.php
|
||||
* \ingroup core
|
||||
* \brief Page to setup ECM (GED) module
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
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
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$help_url='';
|
||||
llxHeader('',$langs->trans("ECMSetup"),$help_url);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("ECMSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ecm.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'general';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="20"> </td>';
|
||||
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
||||
print '</tr>';
|
||||
|
||||
$var=true;
|
||||
$form = new Form($db);
|
||||
|
||||
// Mail required for members
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("ECMAutoTree").'</td>';
|
||||
print '<td align="center" width="20"> </td>';
|
||||
|
||||
print '<td align="center" width="100">';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
|
||||
}
|
||||
else
|
||||
{
|
||||
if($conf->global->ECM_AUTO_TREE_ENABLED == 0)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
else if($conf->global->USER_MAIL_REQUIRED == 1)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -64,10 +64,10 @@ if ($action == 'updateMask')
|
||||
|
||||
if (isset($res))
|
||||
{
|
||||
if ($res > 0)
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
else
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ else if ($action == 'set_SHIPPING_FREE_TEXT')
|
||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
else
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
|
||||
else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
||||
@@ -88,9 +88,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
||||
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
else
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
@@ -173,7 +173,12 @@ else if ($action == 'setdoc')
|
||||
|
||||
else if ($action == 'setmodel')
|
||||
{
|
||||
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
|
||||
|
||||
@@ -208,16 +213,17 @@ $h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$h++;
|
||||
}
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
/*
|
||||
* Expedition numbering model
|
||||
*/
|
||||
* Numbering module
|
||||
*/
|
||||
//print "<br>";
|
||||
|
||||
print_titre($langs->trans("SendingsNumberingModules"));
|
||||
|
||||
@@ -249,16 +255,16 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
|
||||
require_once $dir.$file.'.php';
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/expedition/".$file.'.php';
|
||||
|
||||
$module = new $file;
|
||||
|
||||
|
||||
// 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 '<tr '.$bc[$var].'><td>'.$module->nom."</td>\n";
|
||||
print '<td>';
|
||||
@@ -266,11 +272,9 @@ foreach ($dirmodels as $reldir)
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
}
|
||||
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
@@ -325,7 +329,7 @@ print '</table><br>';
|
||||
|
||||
|
||||
/*
|
||||
* Documents models for Sendings Receipt
|
||||
* Modeles de documents
|
||||
*/
|
||||
print_titre($langs->trans("SendingsReceiptModel"));
|
||||
|
||||
@@ -361,7 +365,7 @@ print '<td width="140">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="80" class="nowrap">'.$langs->trans("Infos").'</td>';
|
||||
print '<td align="center" width="80" nowrap="nowrap">'.$langs->trans("Infos").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
@@ -28,13 +28,11 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("errors");
|
||||
$langs->load('other');
|
||||
$langs->load('bills');
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@@ -306,8 +304,6 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$head = invoice_admin_prepare_head(null);
|
||||
dol_fiche_head($head, 'general', $langs->trans("Invoices"), 0, 'invoice');
|
||||
|
||||
/*
|
||||
* Numbering module
|
||||
@@ -319,7 +315,7 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td nowrap="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Infos").'</td>';
|
||||
print '</tr>'."\n";
|
||||
@@ -371,7 +367,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
|
||||
@@ -41,8 +41,6 @@ $modules = array(
|
||||
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||
'MAILING' => 'FCKeditorForMailing',
|
||||
'DETAILS' => 'FCKeditorForProductDetails',
|
||||
'USERSIGN' => 'FCKeditorForUserSignature',
|
||||
'MAIL' => 'FCKeditorForMail'
|
||||
);
|
||||
// Conditions pour que l'option soit proposee
|
||||
$conditions = array(
|
||||
@@ -50,8 +48,6 @@ $conditions = array(
|
||||
'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)),
|
||||
'MAILING' => ! empty($conf->mailing->enabled),
|
||||
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)),
|
||||
'USERSIGN' => 1,
|
||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
||||
);
|
||||
// Picto
|
||||
$picto = array(
|
||||
@@ -59,8 +55,6 @@ $picto = array(
|
||||
'PRODUCTDESC' => 'product',
|
||||
'MAILING' => 'email',
|
||||
'DETAILS' => 'generic',
|
||||
'USERSIGN' => 'user',
|
||||
'MAIL' => 'email'
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -67,7 +67,42 @@ if ($action == 'updateMask')
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For fiche inter
|
||||
if ($action == 'set_FICHINTER_FREE_TEXT')
|
||||
{
|
||||
$freetext= GETPOST('FICHINTER_FREE_TEXT','alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele= GETPOST('module','alpha');
|
||||
|
||||
@@ -112,13 +147,12 @@ else if ($action == 'specimen') // For fiche inter
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
if ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
@@ -127,8 +161,7 @@ else if ($action == 'del')
|
||||
}
|
||||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
@@ -145,7 +178,7 @@ else if ($action == 'setdoc')
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
if ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
@@ -153,41 +186,6 @@ else if ($action == 'setmod')
|
||||
dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'set_FICHINTER_FREE_TEXT')
|
||||
{
|
||||
$freetext= GETPOST('FICHINTER_FREE_TEXT','alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -204,17 +202,6 @@ print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup');
|
||||
|
||||
print "<br>";
|
||||
|
||||
$h = 0;
|
||||
|
||||
$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"));
|
||||
|
||||
// Interventions numbering model
|
||||
|
||||
print_titre($langs->trans("FicheinterNumberingModules"));
|
||||
|
||||
@@ -247,23 +234,23 @@ foreach ($dirmodels as $reldir)
|
||||
$file = $reg[1];
|
||||
$classname = substr($file,4);
|
||||
|
||||
require_once $dir.$file.'.php';
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/fichinter/".$file.'.php';
|
||||
|
||||
$module = new $file;
|
||||
|
||||
|
||||
// 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 '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
@@ -308,9 +295,6 @@ foreach ($dirmodels as $reldir)
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
/*
|
||||
* Documents models for Interventions
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("TemplatePDFInterventions"));
|
||||
|
||||
@@ -393,7 +377,7 @@ foreach ($dirmodels as $reldir)
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Default
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
|
||||
{
|
||||
@@ -429,14 +413,11 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
//Autres Options
|
||||
print "<br>";
|
||||
|
||||
/*
|
||||
* Other options
|
||||
*
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("OtherOptions"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -22,20 +22,19 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/supplier_order.php
|
||||
* \file htdocs/admin/fournisseur.php
|
||||
* \ingroup fournisseur
|
||||
* \brief Page d'administration-configuration du module Fournisseur
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
$langs->load("orders");
|
||||
$langs->load('other');
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
@@ -55,9 +54,9 @@ $specimenthirdparty->initAsSpecimen();
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstorder=GETPOST('maskconstorder','alpha');
|
||||
$maskvalue=GETPOST('maskorder','alpha');
|
||||
$maskorder=GETPOST('maskorder','alpha');
|
||||
|
||||
if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@@ -71,7 +70,7 @@ if ($action == 'updateMask')
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For orders
|
||||
if ($action == 'specimen') // For orders
|
||||
{
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
@@ -117,58 +116,143 @@ else if ($action == 'specimen') // For orders
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
if ($action == 'specimenfacture') // For invoices
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$facture = new FactureFournisseur($db);
|
||||
$facture->initAsSpecimen();
|
||||
$facture->thirdparty=$specimenthirdparty; // Define who should has build the invoice (so the supplier)
|
||||
|
||||
// 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/supplier_invoice/pdf/pdf_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db,$facture);
|
||||
|
||||
if ($module->write_file($facture,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_SUPPLIER_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$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.= ")";
|
||||
$res=$db->query($sql);
|
||||
if ($res)
|
||||
{
|
||||
|
||||
}
|
||||
// else dol_print_error($db);
|
||||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
if ($action == 'del')
|
||||
{
|
||||
if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_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->COMMANDE_SUPPLIER_ADDON_PDF = $value;
|
||||
}
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE nom = '".$value."'";
|
||||
$sql.= " AND type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$db->query($sql);
|
||||
if ($res)
|
||||
{
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
// else dol_print_error($db);
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
if ($type == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
if ($type == 'invoice_supplier' && dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$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;
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$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.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
||||
dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'addcat')
|
||||
if ($action == 'addcat')
|
||||
{
|
||||
$fourn = new Fournisseur($db);
|
||||
$fourn->CreateCategory($user,$_POST["cat"]);
|
||||
}
|
||||
|
||||
else if ($action == 'set_SUPPLIER_ORDER_FREE_TEXT')
|
||||
if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
|
||||
{
|
||||
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string
|
||||
$freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT'); // No alpha here, we want exact string
|
||||
|
||||
$res = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@@ -189,7 +273,7 @@ else if ($action == 'set_SUPPLIER_ORDER_FREE_TEXT')
|
||||
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader("","");
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
@@ -198,10 +282,6 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
|
||||
|
||||
print "<br>";
|
||||
|
||||
$head = supplierorder_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'order', $langs->trans("ModuleSetup"));
|
||||
|
||||
|
||||
// Supplier order numbering module
|
||||
|
||||
@@ -251,7 +331,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
@@ -261,7 +341,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file")
|
||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON == "$file")
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
}
|
||||
@@ -307,8 +387,10 @@ foreach ($dirmodels as $reldir)
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Documents models for supplier orders
|
||||
* Modeles documents for supplier orders
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("OrdersModelModule"));
|
||||
@@ -349,14 +431,17 @@ print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$var=true;
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = dol_buildpath($reldir."core/modules/supplier_order/pdf/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$var=true;
|
||||
|
||||
$handle=opendir($dir);
|
||||
|
||||
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
@@ -398,7 +483,7 @@ foreach ($dirmodels as $reldir)
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Default
|
||||
// Defaut
|
||||
print '<td align="center">';
|
||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name")
|
||||
{
|
||||
@@ -435,13 +520,138 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
|
||||
print '</table><br/>';
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Other options
|
||||
*
|
||||
* Modeles documents for supplier invoices
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("BillsPDFModules"));
|
||||
|
||||
// Defini tableau def de modele
|
||||
$def = array();
|
||||
|
||||
$sql = "SELECT nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE type = 'invoice_supplier'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num_rows=$db->num_rows($resql);
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
|
||||
print '<td>'.$langs->trans("Description").'</td>'."\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
|
||||
print '<td align="center" width="40" colspan="2">'.$langs->trans("Info").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = dol_buildpath($reldir."core/modules/supplier_invoice/pdf/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$var=true;
|
||||
|
||||
$handle=opendir($dir);
|
||||
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle)) !== false)
|
||||
{
|
||||
if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_')
|
||||
{
|
||||
$name = substr($file, 4, dol_strlen($file) -16);
|
||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">\n";
|
||||
print "<td>".$name."</td>\n";
|
||||
print "<td>";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db,$specimenthirdparty);
|
||||
print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_picto($langs->trans("Default"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimenfacture&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br/>';
|
||||
|
||||
print_titre($langs->trans("OtherOptions"));
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@@ -452,10 +662,10 @@ print "</tr>\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_FREE_TEXT">';
|
||||
print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
|
||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
||||
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')<br>';
|
||||
print '<textarea name="SUPPLIER_ORDER_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_ORDER_FREE_TEXT.'</textarea>';
|
||||
print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
|
||||
print '<textarea name="SUPPLIER_INVOICE_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_INVOICE_FREE_TEXT.'</textarea>';
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user