Compare commits

..

65 Commits

Author SHA1 Message Date
Laurent Destailleur
7856b7f613 Removed warning 2013-05-22 15:52:26 +02:00
Laurent Destailleur
469ae91e70 Fix: regression 2013-05-22 12:02:39 +02:00
Laurent Destailleur
d5d4bc33ba Merge pull request #971 from cbattarel/3.3
fix wrong construction of description when creating from orders
2013-05-22 02:57:34 -07:00
Laurent Destailleur
1109527528 Merge pull request #968 from FHenry/3.3
3.3
2013-05-22 02:56:06 -07:00
Christophe Battarel
992600664e fix wrong construction of description when creatin from orders (it was putting a mess on update) 2013-05-22 10:29:31 +02:00
fhenry
b36a16ed43 Change-Id: I2e25d4b82388f6a0fc83b97f9162a095247e3fa1 2013-05-21 14:32:30 +02:00
fhenry
f08ce6d96a Fix bug on DDLCreateDb in Mysql 2013-05-21 14:28:42 +02:00
Laurent Destailleur
416cdd2f9c Merge pull request #956 from cbattarel/3.3
fix bug : external users should not see costprice and margin infos
2013-05-20 07:39:39 -07:00
Christophe Battarel
f8ca842685 fix typo error 2013-05-20 10:10:34 +02:00
Christophe Battarel
fea0e6de54 Fix - external users should not see costprice and margin infos 2013-05-19 14:06:51 +02:00
Christophe Battarel
347fc6d714 fix unauthorized access to margins for external user 2013-05-19 14:04:21 +02:00
simnandez
e2f2ad30ae Fix: Remove windows CR/LF 2013-05-18 09:15:18 +02:00
simnandez
2879a09a03 Fix: Remove windows CR/LF 2013-05-18 09:11:24 +02:00
Christophe Battarel
7efe39495a french translation for CostPrice 2013-05-17 15:18:50 +02:00
Christophe Battarel
e3615d43bd fix bug : external users should not see costprice and margin infos 2013-05-17 15:02:27 +02:00
Regis Houssin
047aa8ea29 Fix: avoid error when multiple files uploaded 2013-05-14 15:59:47 +02:00
simnandez
5fe70e0bee Fix: Some bugs on withdrawal rejects 2013-05-13 17:15:23 +02:00
Laurent Destailleur
8a90598b23 Fix: Escape entities 2013-05-11 15:12:42 +02:00
Laurent Destailleur
e4dda125d8 Merge branch '3.3' of git@github.com:Dolibarr/dolibarr.git into 3.3 2013-05-11 15:04:56 +02:00
Laurent Destailleur
526a80dd20 Sec: Param not escaped
Fix: Bad return error
2013-05-11 15:04:17 +02:00
Laurent Destailleur
cb3b0996ce Merge pull request #941 from FHenry/3.3
Fix security breach (SQL injection)
2013-05-10 07:28:22 -07:00
Laurent Destailleur
9992fc803d Merge pull request #937 from marcosgdf/skeleton
Typo in skeleton module class
2013-05-10 07:26:06 -07:00
fhenry
9427e32e2e Fix security breach (SQL injection) 2013-05-10 15:04:16 +02:00
Marcos García
661071286e Typo in skeleton module class 2013-05-08 17:23:41 +02:00
Regis Houssin
3aa049b661 Fix: regression 2013-05-06 17:57:33 +02:00
Juanjo Menent
934657cc2f Merge pull request #916 from FHenry/3.3
Fix margin calculation problem
2013-05-06 06:57:14 -07:00
fhenry
0bb9ee158a Fix trigger call ficher inter create 2013-05-06 13:47:33 +02:00
fhenry
8bd7c6a763 Fix Trad Fr 2013-05-06 09:53:23 +02:00
fhenry
bdb81803bd Merge branch '3.3' of https://github.com/Dolibarr/dolibarr.git into 3.3 2013-05-04 09:06:32 +02:00
fhenry
95e4474906 Fix bug on PgSQL if user in on another entity than 1 2013-05-03 20:56:58 +02:00
Laurent Destailleur
1c9caeb0d3 Fix: CRLF 2013-05-03 18:33:23 +02:00
Laurent Destailleur
c8ef07a889 Merge branch '3.3' of https://github.com/Dolibarr/dolibarr.git into 3.3 2013-05-03 16:14:27 +02:00
Laurent Destailleur
723bd6f750 Fix: [ bug #872 ] Erreur sur page Accueil Commerciale avec pgsql
(3.4-beta).
Fix: Permission tab was not visible for external users.
2013-05-03 16:10:28 +02:00
fhenry
a35a44b23e Fix margin calculation problem 2013-05-03 15:22:41 +02:00
Laurent Destailleur
7428c11489 Merge pull request #909 from marcosgdf/bug-866
Fixed bug #866: Standing order from an invoice suggests invoice total am...
2013-05-03 01:09:07 -07:00
Marcos García
c65620ab62 Merge branch '3.3' of git://github.com/Dolibarr/dolibarr into bug-866
Conflicts:
	ChangeLog
2013-05-03 08:17:58 +02:00
Marcos García
f8f4fd3a6f Enhanced fix 2013-05-03 08:16:31 +02:00
Laurent Destailleur
4687350337 Merge pull request #910 from marcosgdf/3.3-translations
Translation improvements + fixed statut image of returned prelevement
2013-05-02 10:42:53 -07:00
Laurent Destailleur
3a531f048a Merge pull request #906 from grandoc/3.3
fix: undefined property
2013-05-02 10:42:13 -07:00
Laurent Destailleur
36479db0fd Merge pull request #908 from FHenry/3.3
Fix bug [ bug #861 ] Erreur de droit groupe et utilisateur
2013-05-02 10:41:31 -07:00
fhenry
7e47b37ade Fix [ bug #788 ] Date of linked interventions are not shown 2013-05-02 13:56:14 +02:00
Marcos García
97478ccbf2 Error statut image + not translated strings 2013-05-01 20:54:45 +02:00
Marcos García
95f63a8171 Corrected some es_ES translations and fixed problems with translations not being translated 2013-05-01 20:43:08 +02:00
Marcos García
a9e63610ae Fixed bug #866: Standing order from an invoice suggests invoice total amount instead of remaining to pay 2013-05-01 20:40:29 +02:00
fhenry
f3480bf502 Merge branch '3.3' of https://github.com/Dolibarr/dolibarr.git into 3.3 2013-05-01 14:38:43 +02:00
Grand Philippe
7f27801c3c fix: Undefined property: stdClass::$xxx 2013-05-01 09:41:36 +02:00
philippe
8d844a1094 Merge branch '3.3' of https://github.com/Dolibarr/dolibarr.git into 3.3 2013-05-01 09:08:15 +02:00
Laurent Destailleur
7d71be2227 Fix: Import of contact/address not complete and not working with pgsql
Conflicts:
	htdocs/core/modules/modSociete.class.php
2013-04-30 22:56:52 +02:00
Laurent Destailleur
c84427bd22 Fix: delete of files with [ and glob.
Conflicts:
	test/phpunit/FilesLibTest.php
2013-04-30 22:52:56 +02:00
fhenry
3933fb318c update change log 2013-04-30 21:57:34 +02:00
fhenry
e9f02ebacf Update change log 2013-04-30 21:45:40 +02:00
fhenry
440912a4d3 fix [ bug #827 ] AJAX search does not respect multiprice level 2013-04-30 21:35:27 +02:00
fhenry
ac6e56f058 Fix bug [ bug #861 ] Erreur de droit groupe et utilisateur 2013-04-30 21:10:26 +02:00
Regis Houssin
f8b133dad4 Merge pull request #907 from FHenry/3.3
[ bug #865 ] Dolibarr navigation array in project/task do not work
2013-04-30 09:12:20 -07:00
fhenry
59f218ab42 [ bug #865 ] Dolibarr navigation array in project/task do not work 2013-04-30 16:00:30 +02:00
Grand Philippe
114ace6499 fix: undefined property 2013-04-30 15:22:39 +02:00
Juanjo Menent
74abde0233 Merge pull request #902 from marcosgdf/3.3
Removed duplicated changelog entries and ordered fixes by bug ID
2013-04-30 03:02:34 -07:00
Laurent Destailleur
4a9ed428f0 Fix: isset on scalar value 2013-04-30 09:58:30 +02:00
Marcos García
947bda1af8 Removed duplicated entries and ordered fixes by bug ID 2013-04-29 21:37:25 +02:00
Laurent Destailleur
4274a1aa21 Merge pull request #897 from grandoc/3.3
fix some indefined index
2013-04-29 10:27:25 -07:00
Grand Philippe
63c474e2cc fix: Undefined index 2013-04-28 22:29:50 +02:00
Grand Philippe
c4a064d104 fix: Undefined property: mod_codeclient_monkey::$prefixIsRequired 2013-04-28 19:35:10 +02:00
Grand Philippe
1d52d50ac1 fix: issue from last commit 2013-04-28 12:17:04 +02:00
Grand Philippe
0661f9f1f8 fix: Assigning the return value of new by reference is deprecated 2013-04-28 10:40:25 +02:00
Grand Philippe
647956576d fix some indefined index 2013-04-28 08:21:46 +02:00
1677 changed files with 47382 additions and 74298 deletions

2
.gitignore vendored
View File

@@ -3,7 +3,7 @@ htdocs/conf/conf.php.old
documents/
custom/
custom2/
test/report/
test/
nbproject
default.properties
.settings/

View File

@@ -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.0rc2 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>

111
ChangeLog
View File

@@ -2,118 +2,37 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 3.4 compared to 3.3.2 *****
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.
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 some 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.
***** ChangeLog for 3.3.2 compared to 3.3.1 *****
- Fix: Dutch (nl_NL) translation
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
- Generalize fix: file with a specific mask not found, again
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
- Fix: Can't reset payment due date
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: Some bugs on withdrawal rejects
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #789 ] VAT not being calculated in POS
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
- Fix: [ bug #855 ] Holiday approval email in French
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount
- Fix: [ bug #861 ] Impossible to create a new event in agenda
- Fix: [ bug #827 ] AJAX search does not respect multiprice level
- Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work
- Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay
- Fix: [ bug #788 ] Date of linked interventions are not shown
- Fix: external users should not see costprice and margin infos
***** ChangeLog for 3.3.1 compared to 3.3 *****

2
README
View File

@@ -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

View File

@@ -106,7 +106,7 @@ Autres modules:
- 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.

View File

@@ -103,7 +103,7 @@ See ChangeLog file found into package.
- 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 another menu and permissions).

View File

@@ -1,4 +1,4 @@
dolibarr (3.4.0+nmu1) unstable; urgency=low
dolibarr (3.3.2+nmu1) unstable; urgency=low
* Non-maintainer upload.
* New upstream release.
@@ -6,4 +6,4 @@ dolibarr (3.4.0+nmu1) unstable; urgency=low
-- Dolibarr team <contact@dolibarr.org> Mon, 22 Apr 2013 12:00:00 +0100
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz

View File

@@ -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:

View File

@@ -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.0
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

View File

@@ -17,12 +17,13 @@
; ----- Change this -----
AppName=DoliWamp
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
AppVerName=DoliWamp-3.4.0-alpha
AppVerName=DoliWamp-3.3.2
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
OutputBaseFilename=DoliWamp-3.4.0-alpha
OutputBaseFilename=DoliWamp-3.3.2
; Define full path from wich all relative path are defined
; You must modify this to put here your dolibarr root directory
;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx
;SourceDir=C:\Documents and Settings\ldestailleur\git\dolibarr_old
;SourceDir=Z:\home\ldestailleur\git\dolibarr_veryold
SourceDir=..\..\..
; ----- End of change
;OutputManifestFile=build\doliwampbuild.log
@@ -87,12 +88,12 @@ Name: "{app}\bin\apache\apache2.2.11\logs"
; Stop/start
Source: "build\exe\doliwamp\stopdoliwamp.bat"; DestDir: "{app}\"; Flags: ignoreversion; AfterInstall: close()
Source: "build\exe\doliwamp\startdoliwamp.bat"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\uninstall_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\removefiles.bat"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\rundoliwamp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\rundolihelp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\rundoliadmin.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\uninstall_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\mysqlinitpassword.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\mysqltestinstall.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "build\exe\doliwamp\startdoliwamp_manual_donotuse.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;

View File

@@ -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

View File

@@ -9,8 +9,8 @@ use Cwd;
$PROJECT="dolibarr";
$MAJOR="3";
$MINOR="4";
$BUILD="0-alpha"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
$MINOR="3";
$BUILD="2"; # 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
@@ -320,10 +320,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
$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/pos*`;
$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`;

View File

@@ -23,10 +23,13 @@ To submit a snapshot for building, we should have a service file with content
<service name="download_src_package">
<param name="host">www.dolibarr.org</param>
<param name="protocol">http</param>
<param name="path">/files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm</param>
<param name="path">/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm</param>
</service>
</services>
How to have such a service ?
Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm
Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm
Then add into advanded - attributes
OBS:Screenshots http://www.dolibarr.org/images/phocagallery/dolibarr_screenshot1.png
OBS:QualityCategory Testing

View File

@@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions()
sub script_dolibarr_versions
{
return ( "3.4.0", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
return ( "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
}
sub script_dolibarr_category

View File

@@ -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

View File

@@ -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
@@ -334,5 +332,5 @@ fi
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3
- Initial version (#723326)

View File

@@ -262,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
@@ -523,5 +521,5 @@ fi
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3
- Initial version (#723326)

View File

@@ -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
@@ -323,5 +321,5 @@ fi
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3
- Initial version (#723326)

View File

@@ -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
@@ -334,5 +332,5 @@ fi
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3
- Initial version (#723326)

View File

@@ -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
?>

View File

@@ -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='';

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -1,33 +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]"
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}'
grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='includes' --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='includes' --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

View File

@@ -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) )
{

File diff suppressed because one or more lines are too long

View File

@@ -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
View 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

View 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>

View 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 "">

View File

@@ -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
View 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)

View File

@@ -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
@@ -176,7 +178,7 @@ class modMyModule extends DolibarrModules
// Main menu entries
$this->menus = array(); // List of menus to add
$this->menu = array(); // List of menus to add
$r=0;
// Add here entries to declare new menus
@@ -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)';

View File

@@ -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;

View File

@@ -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";
}

View File

@@ -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;
?>

View File

@@ -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"> &nbsp; <strong><label for="username">Login</label></strong>fds fs df sdf gdsfgsdf r &nbsp; </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"> &nbsp; <strong><label for="password">Mot de passe</label></strong> &nbsp; </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 -->

View File

@@ -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

4
htdocs/.gitignore vendored
View File

@@ -2,8 +2,4 @@
/custom*
/bootstrap
/multicompany
/ovh
/numberingpack
/google
/skincoloreditor
/pos

View File

@@ -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>';

View 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 "&nbsp; <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')

View File

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

View 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";
}

View File

@@ -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>';

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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.'&amp;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.'&amp;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();
?>
?>

View 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);

View File

@@ -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,7 +394,7 @@ 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;
@@ -395,13 +402,13 @@ class Adherent extends CommonObject
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
@@ -937,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";
@@ -947,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;
@@ -1010,23 +1021,23 @@ class Adherent extends CommonObject
{
global $langs;
$sql = "SELECT d.rowid, 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;
@@ -1048,20 +1059,27 @@ class Adherent extends CommonObject
$this->ref = $obj->rowid;
$this->id = $obj->rowid;
$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;
@@ -1069,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;
@@ -1083,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;
@@ -1095,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();
@@ -1191,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)
@@ -1376,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;
@@ -1399,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
@@ -1423,10 +1425,11 @@ class Adherent extends CommonObject
}
if ($err)
{
// error
return -$err;
}
else
{
{
return 1;
}
}
@@ -1440,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;
@@ -1453,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))
@@ -1490,7 +1481,7 @@ class Adherent extends CommonObject
/**
* Return civility label of a contact
* Return label of a civility of a contact
*
* @param int $nohtmlentities 0=Encode with htmlentities for HTML output, 1=No htmlentities for memory translation
* @return string Name translated of civility
@@ -1529,12 +1520,7 @@ 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");
@@ -1544,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)
*
@@ -1628,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');
}
}
@@ -1744,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;
@@ -1801,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;
@@ -1816,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');

View File

@@ -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

View 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,";
@@ -96,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))
@@ -141,7 +141,7 @@ if ($result)
// Ref
print '<td>'.$cotisation->getNomUrl(1).'</td>';
// Lastname
// Nom
print '<td>'.$adherent->getNomUrl(1).'</td>';
// Login

View File

@@ -159,11 +159,11 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().'&nbsp;</td>';
print '</tr>';
// Lastname
// Nom
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->lastname.'&nbsp;</td>';
print '</tr>';
// Firstname
// Prenom
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->firstname.'&nbsp;</td>';
print '</tr>';

View File

@@ -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
@@ -49,8 +49,8 @@ $backtopage=GETPOST('backtopage','alpha');
$confirm=GETPOST('confirm','alpha');
$rowid=GETPOST('rowid','int');
$typeid=GETPOST('typeid','int');
$userid=GETPOST('userid','int');
$socid=GETPOST('socid','int');
$userid=GETPOST('userid','int');
$socid=GETPOST('socid','int');
if (! empty($conf->mailmanspip->enabled))
{
@@ -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,12 +238,12 @@ 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"]);
$datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
}
// Create new object
@@ -254,23 +253,30 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
// 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->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"]);
@@ -285,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;
@@ -353,24 +365,15 @@ 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";
}
}
$rowid=$object->id;
@@ -394,12 +397,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
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"]))
@@ -409,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"];
@@ -434,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;
@@ -448,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;
@@ -457,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") {
@@ -489,12 +505,12 @@ if ($action == 'add' && $user->rights->adherent->creer)
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Password"))."<br>\n";
}
}
if (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";
@@ -684,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&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("Member"),$help_url);
@@ -694,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
{
@@ -717,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'];
}
@@ -805,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
@@ -829,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
@@ -847,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
{
@@ -883,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";
}
}
/*
@@ -930,10 +958,11 @@ 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
if (isset($_POST["country"]) || $object->country_id)
if (!empty($country) || $object->country_id)
{
$sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(isset($_POST["country"])?$_POST["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);
$resql=$db->query($sql);
if ($resql)
{
@@ -943,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;
@@ -1015,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)
{
@@ -1050,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
@@ -1071,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
@@ -1087,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>';
}
@@ -1103,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
@@ -1118,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
@@ -1356,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>';
@@ -1364,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.'&nbsp;</td>';
// Photo
print $showphoto; $showphoto='';
print '</tr>';
}
@@ -1403,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">';
@@ -1413,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>';
@@ -1427,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>';
@@ -1441,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
@@ -1530,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
@@ -1542,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>";
}
}
@@ -1555,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>";
}
}
@@ -1568,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
@@ -1586,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>";
}
}
@@ -1599,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.'&amp;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.'&amp;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>";
}
}
@@ -1613,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.'&amp;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.'&amp;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
@@ -1639,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";
}

View File

@@ -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>';

View File

@@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
// Security check
$result=restrictedArea($user,'adherent');
// Security check
$result=restrictedArea($user,'adherent');
/*
@@ -47,6 +47,7 @@ $subscriptionstatic=new Cotisation($db);
print_fiche_titre($langs->trans("MembersArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
$var=True;
@@ -121,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
@@ -140,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>';
@@ -195,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;
@@ -207,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";
@@ -267,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";
@@ -418,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();

View File

@@ -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

View File

@@ -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.'&nbsp;</td>';
print '</tr>';
// Firstname
// Prenom
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->firstname.'&nbsp;</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.'&amp;action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a></div>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$adh->id.'&amp;action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
}
print "</div>\n";

View File

@@ -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&eacute
$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");

View File

@@ -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.'&amp;action=edit">'.$langs->trans('Modify')."</a></div>";
print "<a class=\"butAction\" href=\"note.php?id=".$object->id."&amp;action=edit\">".$langs->trans('Modify')."</a>";
}
print "</div>";

View 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,7 +37,7 @@ 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;
@@ -72,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";
@@ -86,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";
@@ -101,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;
}

View 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;
@@ -143,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"].'">';
@@ -209,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">';
@@ -222,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();

View File

@@ -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&amp;rowid='.$adht->id.'">'.$langs->trans("Modify").'</a></div>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;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").'"> &nbsp; &nbsp;';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';

View File

@@ -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)
{

View File

@@ -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 ' &nbsp; &nbsp; ';
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">&nbsp;</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">&nbsp;</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();
?>

View File

@@ -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 "&nbsp; <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();
?>
?>

View File

@@ -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();
?>

View File

@@ -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">&nbsp;</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">&nbsp;</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();
?>

View File

@@ -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'].'">';

View File

@@ -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:'&nbsp;');
print '</td>';
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';
print '<td>' . ($box->note?$box->note:'&nbsp;') . '</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:'&nbsp;');
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:'&nbsp;') . '</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>';

View File

@@ -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();
?>
?>

View File

@@ -7,8 +7,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) 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");
@@ -116,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);
}
@@ -131,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();
}
}
@@ -196,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');
}
}
/*
@@ -220,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"));
@@ -234,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";
@@ -258,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);
@@ -490,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>';

View File

@@ -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 '&nbsp;';
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>';

View File

@@ -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

View File

@@ -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";

View File

@@ -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);

View File

@@ -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]=='')
@@ -463,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>';
}
@@ -694,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)
{
@@ -738,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; }
@@ -753,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>&nbsp;</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"); }
@@ -859,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; }
@@ -874,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; }
@@ -951,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') {
@@ -988,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]);
}
@@ -1044,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'))
@@ -1096,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:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;';
// 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:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;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");
@@ -1121,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:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action=edit#'.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'">'.img_edit().'</a></td>';
else print '<td>&nbsp;</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:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action=delete">'.img_delete().'</a></td>';
else print '<td>&nbsp;</td>';
print "</tr>\n";
@@ -1173,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>';
@@ -1231,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>&nbsp;</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>';
@@ -1319,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" ';

View File

@@ -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

View File

@@ -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">&nbsp;</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">&nbsp;</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();

View File

@@ -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
@@ -65,9 +65,9 @@ if ($action == 'updateMask')
if (isset($res))
{
if ($res < 0)
setEventMessage($langs->trans("SetupSaved"));
else
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();

View File

@@ -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);

View File

@@ -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'
);

View File

@@ -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>';

View File

@@ -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('maskvalue','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&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;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&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;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&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;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&amp;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("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
print '<textarea name="SUPPLIER_ORDER_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_ORDER_FREE_TEXT.'</textarea>';
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";

View File

@@ -55,8 +55,8 @@ print $langs->trans("SetupDescription2")."<br><br>";
print '<br>';
//print '<hr style="color: #DDDDDD;">';
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'));
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) $setupcompanynotcomplete=1;
print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home');
if (! empty($setupcompanynotcomplete))
{
$langs->load("errors");
@@ -82,8 +82,16 @@ print $langs->trans("SetupDescription5")."<br>";
//print '<hr style="color: #DDDDDD;">';
print "<br>";
// Show logo
print '<center><div class="logo_setup"></div></center>';
/*
print '<table width="100%">';
print '<tr '.$bc[false].'><td '.$bc[false].'>'.img_picto('','puce').' '.$langs->trans("SetupDescription3")."</td></tr>";
print '<tr '.$bc[true].'><td '.$bc[true].'>'.img_picto('','puce').' '.$langs->trans("SetupDescription4")."</td></tr>";
print '<tr '.$bc[false].'><td '.$bc[false].'>'.img_picto('','puce').' '.$langs->trans("SetupDescription5")."</td></tr>";
print '</table>';
*/
//print '<br>';
//print info_admin($langs->trans("OnceSetupFinishedCreateUsers")).'<br>';
llxFooter();

View File

@@ -230,7 +230,7 @@ print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_ADDRESS"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked="checked"':'')."></td>";
print '</tr>';
// ZIP
// CP
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
print '<input size="25" type="text" name="fieldzip" value="'.$conf->global->LDAP_CONTACT_FIELD_ZIP.'">';
@@ -238,7 +238,7 @@ print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_ZIP"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked="checked"':'')."></td>";
print '</tr>';
// TOWN
// Ville
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
print '<input size="25" type="text" name="fieldtown" value="'.$conf->global->LDAP_CONTACT_FIELD_TOWN.'">';
@@ -246,7 +246,7 @@ print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_TOWN"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked="checked"':'')."></td>";
print '</tr>';
// COUNTRY
// Pays
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_CONTACT_FIELD_COUNTRY.'">';

View File

@@ -271,7 +271,7 @@ print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
print '<td align="right">&nbsp;</td>';
print '</tr>';
// ZIP
// CP
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
print '<input size="25" type="text" name="fieldzip" value="'.$conf->global->LDAP_MEMBER_FIELD_ZIP.'">';
@@ -279,7 +279,7 @@ print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
print '<td align="right">&nbsp;</td>';
print '</tr>';
// TOWN
// Ville
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
print '<input size="25" type="text" name="fieldtown" value="'.$conf->global->LDAP_MEMBER_FIELD_TOWN.'">';
@@ -287,7 +287,7 @@ print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
print '<td align="right">&nbsp;</td>';
print '</tr>';
// COUNTRY
// Pays
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_MEMBER_FIELD_COUNTRY.'">';
@@ -303,7 +303,7 @@ print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
print '<td align="right">&nbsp;</td>';
print '</tr>';
// Birthday
// Date naissance
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldBirthdate").'</td><td>';
print '<input size="25" type="text" name="fieldbirthdate" value="'.$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE.'">';

View File

@@ -5,8 +5,8 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* 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 Juanjo Menent <jmenent@2byte.es>
* 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
@@ -50,13 +50,13 @@ $type='delivery';
if ($action == 'updateMask')
{
$maskconstdelivery=GETPOST('maskconstdelivery','alpha');
$maskdelivery=GETPOST('maskdelivery','alpha');
if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity);
$maskconstdelivery=GETPOST('maskconstdelivery','alpha');
$maskdelivery=GETPOST('maskdelivery','alpha');
if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $res > 0) $error++;
if (! $error)
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
@@ -68,12 +68,12 @@ if ($action == 'updateMask')
if ($action == 'set_DELIVERY_FREE_TEXT')
{
$free=GETPOST('DELIVERY_FREE_TEXT','alpha');
$free=GETPOST('DELIVERY_FREE_TEXT','alpha');
$res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
@@ -85,58 +85,58 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
if ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
$modele=GETPOST('module','alpha');
$sending = new Livraison($db);
$sending->initAsSpecimen();
$sending = new Livraison($db);
$sending->initAsSpecimen();
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
$file=dol_buildpath($reldir."core/modules/livraison/pdf/pdf_".$modele.".modules.php",0);
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
}
}
// 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/livraison/pdf/pdf_".$modele.".modules.php",0);
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
}
}
if ($filefound)
{
require_once $file;
if ($filefound)
{
require_once $file;
$module = new $classname($db);
$module = new $classname($db);
if ($module->write_file($sending,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&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);
}
if ($module->write_file($sending,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&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);
}
}
if ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
if ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
if ($ret > 0)
{
if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF',$conf->entity);
}
@@ -146,17 +146,17 @@ if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "LIVRAISON_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
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->LIVRAISON_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
if ($action == 'setmod')
@@ -164,7 +164,7 @@ if ($action == 'setmod')
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "LIVRAISON_ADDON",$value,'chaine',0,'',$conf->entity);
}
@@ -191,9 +191,9 @@ $h++;
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
@@ -205,9 +205,8 @@ $h++;
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
/*
* Livraison numbering model
* Module numerotation
*/
print_titre($langs->trans("DeliveryOrderNumberingModules"));
print '<table class="noborder" width="100%">';
@@ -223,99 +222,97 @@ clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/livraison/");
$dir = dol_buildpath($reldir."core/modules/livraison/");
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file)-3, 3) == 'php')
{
$file = substr($file, 0, dol_strlen($file)-4);
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file)-3, 3) == 'php')
{
$file = substr($file, 0, dol_strlen($file)-4);
require_once $dir.$file.'.php';
require_once DOL_DOCUMENT_ROOT ."/core/modules/livraison/".$file.'.php';
$module = new $file;
if ($module->isEnabled())
{
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
$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())
{
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
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";
print '<td align="center">';
if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file")
{
print img_picto($langs->trans("Activated"),'switch_on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
print '</td>';
print '<td align="center">';
if ($conf->global->LIVRAISON_ADDON == "$file")
{
print img_picto($langs->trans("Activated"),'switch_on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
print '</td>';
$livraison=new Livraison($db);
$livraison->initAsSpecimen();
$livraison=new Livraison($db);
$livraison->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$livraison);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$livraison);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
}
}
}
closedir($handle);
}
}
print '</tr>';
}
}
}
closedir($handle);
}
}
}
print '</table>';
/*
* Documents Models for delivery
* Modeles de documents
*/
print '<br>';
print_titre($langs->trans("DeliveryOrderModel"));
// Defini tableau def de modele
// Defini tableau def de modele invoice
$type="delivery";
$def = array();
@@ -355,77 +352,77 @@ clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/livraison/pdf/");
$dir = dol_buildpath($reldir."core/modules/livraison/pdf/");
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
{
$name = substr($file, 4, dol_strlen($file) - 16);
$classname = substr($file, 0, dol_strlen($file) - 12);
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
{
$name = substr($file, 4, dol_strlen($file) - 16);
$classname = substr($file, 0, dol_strlen($file) - 12);
$var=!$var;
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $name;
print "</td><td>\n";
require_once $dir.$file;
$module = new $classname($db);
print '<tr '.$bc[$var].'><td>';
print $name;
print "</td><td>\n";
require_once $dir.$file;
$module = new $classname($db);
print $module->description;
print '</td>';
print $module->description;
print '</td>';
// Activ
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Activ
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Default
print "<td align=\"center\">";
if ($conf->global->LIVRAISON_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Defaut
print "<td align=\"center\">";
if ($conf->global->LIVRAISON_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info
$htmltooltip = ''.$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>'.$langs->trans("FeaturesSupported").':';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'sending').'</a>';
print '</td>';
// Info
$htmltooltip = ''.$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>'.$langs->trans("FeaturesSupported").':';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'sending').'</a>';
print '</td>';
print '</tr>';
}
}
closedir($handle);
}
}
print '</tr>';
}
}
closedir($handle);
}
}
}
print '</table>';

View File

@@ -103,36 +103,8 @@ llxHeader('',$langs->trans("MailingSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MailingSetup"),$linkback,'setup');
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/mailing.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$hselected=$h;
$h++;
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
dol_htmloutput_mesg($mesg);
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#MAILING_EMAIL_UNSUBSCRIBE_KEY").val(token);
});
});
});';
print '</script>';
}
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -183,9 +155,7 @@ print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("ActivateCheckReadKey").'</td><td>';
print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" '.$readonly.' value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
if (! empty($conf->use_javascript_ajax))
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" '.$readonly.' value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
print '</td></tr>';
print '</table>';

View File

@@ -434,7 +434,7 @@ if ($action == 'edit')
// SuperAdministrator access only
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity))
{
print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="' . $mainsmtppw . '">';
print '<input class="flat" name="MAIN_MAIL_SMTPS_PW" size="32" value="' . $mainsmtppw . '">';
}
else
{

View File

@@ -68,7 +68,7 @@ error_reporting($err);
if ($action == 'update' && empty($_POST["cancel"]))
{
$_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer
dolibarr_set_const($db, "MAIN_MENU_STANDARD", $_POST["MAIN_MENU_STANDARD"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", $_POST["MAIN_MENU_SMARTPHONE"],'chaine',0,'',$conf->entity);
@@ -77,37 +77,33 @@ if ($action == 'update' && empty($_POST["cancel"]))
// Define list of menu handlers to initialize
$listofmenuhandler=array();
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENU_STANDARD"])]=1;
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENUFRONT_STANDARD"])]=1;
if (isset($_POST["MAIN_MENU_SMARTPHONE"])) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENU_SMARTPHONE"])]=1;
if (isset($_POST["MAIN_MENUFRONT_SMARTPHONE"])) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENUFRONT_SMARTPHONE"])]=1;
$listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENU_STANDARD"])]=1;
$listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENUFRONT_STANDARD"])]=1;
if (isset($_POST["MAIN_MENU_SMARTPHONE"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENU_SMARTPHONE"])]=1;
if (isset($_POST["MAIN_MENUFRONT_SMARTPHONE"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENUFRONT_SMARTPHONE"])]=1;
// Initialize menu handlers
foreach ($listofmenuhandler as $key => $val)
{
// Load sql init_menu_handler.sql file
$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']);
foreach($dirmenus as $dirmenu)
$dir = "/core/menus/";
$file='init_menu_'.$key.'.sql';
$fullpath=dol_buildpath($dir.$file);
if (file_exists($fullpath))
{
$file='init_menu_'.$key.'.sql';
$fullpath=dol_buildpath($dirmenu.$file);
//print 'action='.$action.' Search menu into fullpath='.$fullpath.'<br>';exit;
if (file_exists($fullpath))
$db->begin();
$result=run_sql($fullpath,1,'',1,$key,'none');
if ($result > 0)
{
$db->begin();
$result=run_sql($fullpath,1,'',1,$key,'none');
if ($result > 0)
{
$db->commit();
}
else
{
$error++;
$errmsgs[]='Failed to initialize menu '.$key.'.';
$db->rollback();
}
$db->commit();
}
else
{
$error++;
$errmsgs[]='Failed to initialize menu '.$key.'.';
$db->rollback();
}
}
}
@@ -149,7 +145,7 @@ $head[$h][2] = 'editor';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][1] = $langs->trans("Miscellanous");
$head[$h][2] = 'misc';
$h++;

View File

@@ -50,8 +50,8 @@ $menu_handler_smartphone=preg_replace('/_frontoffice.php/i','',$menu_handler_sma
$menu_handler=$menu_handler_top;
if (GETPOST("handler_origine")) $menu_handler=GETPOST("handler_origine");
if (GETPOST("menu_handler")) $menu_handler=GETPOST("menu_handler");
if ($_REQUEST["handler_origine"]) $menu_handler=$_REQUEST["handler_origine"];
if ($_REQUEST["menu_handler"]) $menu_handler=$_REQUEST["menu_handler"];
@@ -174,7 +174,7 @@ if ($action == 'add')
if (! $error)
{
$menu = new Menubase($db);
$menu->menu_handler=preg_replace('/_menu$/','',$_POST['menu_handler']);
$menu->menu_handler=$_POST['menu_handler'];
$menu->type=$_POST['type'];
$menu->titre=$_POST['titre'];
$menu->url=$_POST['url'];
@@ -305,7 +305,7 @@ if ($action == 'create')
print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
//User
print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td>';
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans('MenuForUsers').'</td>';
print '<td><select class="flat" name="user">';
print '<option value="2" selected>'.$langs->trans("AllMenus").'</option>';
print '<option value="0">'.$langs->trans('Internal').'</option>';
@@ -406,7 +406,7 @@ elseif ($action == 'edit')
print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td><td>'.$handler.'</td><td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
// User
print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td><td><select class="flat" name="user">';
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans('MenuForUsers').'</td><td><select class="flat" name="user">';
print '<option value="2"'.($menu->user==2?' selected="true"':'').'>'.$langs->trans("AllMenus").'</option>';
print '<option value="0"'.($menu->user==0?' selected="true"':'').'>'.$langs->trans('Internal').'</option>';
print '<option value="1"'.($menu->user==1?' selected="true"':'').'>'.$langs->trans('External').'</option>';
@@ -444,14 +444,10 @@ elseif ($action == 'edit')
print '</select></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
// Enabled
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.dol_escape_htmltag($menu->enabled).'"></td><td>'.$langs->trans('DetailEnabled');
if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')';
print '</td></tr>';
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.$menu->enabled.'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
// Perms
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.dol_escape_htmltag($menu->perms).'"></td><td>'.$langs->trans('DetailRight');
if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')';
print '</td></tr>';
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.$menu->perms.'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
print '</table>';

View File

@@ -47,22 +47,20 @@ $mesg=GETPOST('mesg');
$menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
$menu_handler_top=preg_replace('/(_backoffice\.php|_menu\.php)/i','',$menu_handler_top);
$menu_handler_top=preg_replace('/(_frontoffice\.php|_menu\.php)/i','',$menu_handler_top);
$menu_handler_smartphone=preg_replace('/(_backoffice\.php|_menu\.php)/i','',$menu_handler_smartphone);
$menu_handler_smartphone=preg_replace('/(_frontoffice\.php|_menu\.php)/i','',$menu_handler_smartphone);
$menu_handler_top=preg_replace('/_backoffice.php/i','',$menu_handler_top);
$menu_handler_top=preg_replace('/_frontoffice.php/i','',$menu_handler_top);
$menu_handler_smartphone=preg_replace('/_backoffice.php/i','',$menu_handler_smartphone);
$menu_handler_smartphone=preg_replace('/_frontoffice.php/i','',$menu_handler_smartphone);
$menu_handler=$menu_handler_top;
if (GETPOST("handler_origine")) $menu_handler=GETPOST("handler_origine");
if (GETPOST("menu_handler")) $menu_handler=GETPOST("menu_handler");
$menu_handler_to_search=preg_replace('/(_backoffice|_frontoffice|_menu)?(\.php)?/i','',$menu_handler);
/*
* Actions
*/
* Actions
*/
if ($action == 'up')
{
@@ -91,7 +89,7 @@ if ($action == 'up')
$sql = "SELECT m.rowid, m.position";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
$sql.= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".$_GET["menuId"]."))";
$sql.= " AND m.menu_handler='".$menu_handler_to_search."'";
$sql.= " AND m.menu_handler='".$menu_handler."'";
$sql.= " AND m.entity = ".$conf->entity;
$sql.= " AND m.type = '".$current['type']."'";
$sql.= " AND m.fk_menu = '".$current['fk_menu']."'";
@@ -147,7 +145,7 @@ elseif ($action == 'down')
$sql = "SELECT m.rowid, m.position";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
$sql.= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".$_GET["menuId"]."))";
$sql.= " AND m.menu_handler='".$menu_handler_to_search."'";
$sql.= " AND m.menu_handler='".$menu_handler."'";
$sql.= " AND m.entity = ".$conf->entity;
$sql.= " AND m.type = '".$current['type']."'";
$sql.= " AND m.fk_menu = '".$current['fk_menu']."'";
@@ -206,11 +204,9 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
$form=new Form($db);
$formadmin=new FormAdmin($db);
$arrayofjs=array('/admin/menus/menu.js.php?lang='.$langs->defaultlang);
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs,$arrayofcss);
llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs);
print_fiche_titre($langs->trans("Menus"),'','setup');
@@ -232,7 +228,7 @@ $head[$h][2] = 'editor';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][1] = $langs->trans("Miscellanous");
$head[$h][2] = 'misc';
$h++;
@@ -259,7 +255,7 @@ if ($action == 'delete')
print '<form name="newmenu" class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" action="change_menu_handler">';
print $langs->trans("MenuHandler").': ';
print $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/',$menu_handler)?'':'_menu'),'menu_handler',array_merge($dirstandard,$dirsmartphone));
print $formadmin->select_menu_families($menu_handler,'menu_handler',array_merge($dirstandard,$dirsmartphone));
print ' &nbsp; <input type="submit" class="button" value="'.$langs->trans("Refresh").'">';
print '</form>';
@@ -269,12 +265,10 @@ print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TreeMenuPersonalized").'</td>';
print '<td align="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('','object_category').' '.$langs->trans("UndoExpandAll").'</a>';
print ' | <a href="#">'.img_picto('','object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div></td>';
print '</tr>';
print '<tr>';
print '<td colspan="2">';
print '<td>';
// ARBORESCENCE
@@ -300,7 +294,7 @@ if ($conf->use_javascript_ajax)
$sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
$sql.= " WHERE menu_handler = '".$menu_handler_to_search."'";
$sql.= " WHERE menu_handler = '".$menu_handler."'";
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND fk_menu >= 0";
$sql.= " ORDER BY m.position, m.rowid"; // Order is position then rowid (because we need a sort criteria when position is same)
@@ -316,23 +310,7 @@ if ($conf->use_javascript_ajax)
{
if (! empty($menu['langs'])) $langs->load($menu['langs']);
$titre = $langs->trans($menu['titre']);
$data[] = array(
'rowid'=>$menu['rowid'],
'fk_menu'=>$menu['fk_menu'],
'title'=>$titre,
'mainmenu'=>$menu['mainmenu'],
'leftmenu'=>$menu['leftmenu'],
'fk_mainmenu'=>$menu['fk_mainmenu'],
'fk_leftmenu'=>$menu['fk_leftmenu'],
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.
'<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'.
'</td><td align="right">'.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default',0,'class="menuNew" id="new'.$menu['rowid'].'"').'</a> '.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default',0,'class="menuDel" id="del'.$menu['rowid'].'"').'</a> '.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>'.
'</td></tr></table>'
);
$data[] = array('rowid'=>$menu['rowid'],'fk_menu'=>$menu['fk_menu'],'title'=>$titre,'mainmenu'=>$menu['mainmenu'],'leftmenu'=>$menu['leftmenu'],'fk_mainmenu'=>$menu['fk_mainmenu'],'fk_leftmenu'=>$menu['fk_leftmenu']);
$i++;
}
}

View File

@@ -0,0 +1,225 @@
<?php
/* Copyright (C) 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
* 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/menus/menu.js.php
* \brief File for js menu
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1);
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(FALSE);
require_once '../../master.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
// Define css type
header('Content-type: application/javascript');
// Important: Following code is to avoid page request by browser and PHP CPU at
// each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
else header('Cache-Control: no-cache');
// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL
if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on URL
$langs->load("main",0,0);
?>
// Tests pour navigateurs
var OPE = (window.opera) ? true : false;
var IE = (document.all && !OPE) ? true : false;
var MOZ = (!IE && !OPE) ? true : false;
// -----------------------------------------------------
// Fonction d'initialisation de l'arbre
function arbre() {
// Choix de la balise contenant le texte. (strong par defaut).
balise = "STRONG";
// Presentation de l'arbre au depart : deployee ('yes') ou fermee ('no')
extend = "no";
// Textes du lien plier / deplier
plier_text = '<?php echo $langs->transnoentities("UndoExpandAll"); ?>';
plier_title = 'Replier tous les noeuds de l\'arbre'
deplier_text = '<?php echo $langs->transnoentities("ExpandAll"); ?>';
deplier_title = 'Deplier tous les noeuds de l\'arbre'
// Recuperation de tous les arbres de la page
uls = getElBy('ul','class','arbre');
for (uli=0;uli < uls.length;uli++)
{
ul = uls[uli];
linkSwitch(ul);
processULEL(ul);
plier(ul,'replier');
}
}
// -------------------------------------------------------
// Creation des liens plier /deplier tout
function linkSwitch(ul) {
var a=document.createElement('a');
a.setAttribute('href','#');
if (extend=='yes') {
a.appendChild(document.createTextNode(plier_text));
a.setAttribute('title',plier_title);
}
else {
a.appendChild(document.createTextNode(deplier_text));
a.setAttribute('title',deplier_title);
}
var parbre = document.createElement('p');
parbre.setAttribute('class','arbre-switch');
parbre.appendChild(a);
ul.parentNode.insertBefore(parbre,ul);
listenlink(ul);
}
// Gestion des Clics sur les liens plier / deplier tout
function listenlink(ul) {
var link = ul.previousSibling.childNodes[0];
link.onclick = function() {
if (this.childNodes[0].nodeValue == plier_text) {
plier(ul,'replier');
this.childNodes[0].nodeValue = deplier_text;
this.setAttribute('title',deplier_title);
}
else {
plier(ul,'deplier');
this.childNodes[0].nodeValue = plier_text;
this.setAttribute('title',plier_title);
}
return false;
}
}
// Action Plier / deplier tout
function plier(ul,act) {
for (var i=0; i < ul.childNodes.length; i++) {
var li = ul.childNodes[i];
if (li.nodeName == 'LI') {
for (var j=0; j < li.childNodes.length; j++) {
var child = li.childNodes[j];
if (child.nodeName==balise) {
var strong = child;
}
if (child.nodeName=='UL') {
if (act=='replier') {
child.className='hide';
strong.className='arbre-plier';
}
else {
child.className='';
strong.className='arbre-deplier';
}
var sub = child;
plier(sub,act);
}
}
}
}
}
// ---------------------------------------------------------
// Analyse de l'arbre
function processULEL(ul) {
if (!ul.childNodes || ul.childNodes.length == 0) return;
// Iterate LIs
for (var itemi=0;itemi < ul.childNodes.length;itemi++) {
var item = ul.childNodes[itemi];
if (item.nodeName == "LI") {
// Contenu des balises LI
var a;
var subul;
subul = "";
for (var sitemi=0;sitemi < item.childNodes.length;sitemi++) {
// Uniquement pour moz-firefox
if (MOZ) {item.style.background = "";}
// Enfants des li : balise ou sous-ul
var sitem = item.childNodes[sitemi];
switch (sitem.nodeName) {
case balise:
a = sitem;
break;
case "UL":
subul = sitem;
if (extend != "yes") {sitem.className = 'hide';}
processULEL(subul);
break;
}
}
if (subul) {
if (extend!="yes") {
a.className='arbre-plier';
}
else {
a.className='arbre-deplier';
subul.className='';
}
associateEL(a,subul);
}
}
}
}
// Swicth des noeuds
function associateEL(a,ul) {
a.onclick = function () {
this.className = (ul.className=='hide') ? 'arbre-deplier' : 'arbre-plier';
ul.className = (ul.className=='hide') ? '' : 'hide';
return false;
}
}
// -----------------------------------------------------
// Nom : GetElBy(tag,attr,val)
// By : Rui Nibau
// Date : aout 2005
// Func : Tableau des elements 'tag' dont l'attribut 'attr' a la valeur 'val'.
// -----------------------------------------------------
function getElBy(tag,attr,val) {
var dbRes = [];
var dbEl = document.getElementsByTagName(tag);
for (e=0; e < dbEl.length; e++) {
if (attr == 'class') {if (dbEl[e].className==val) {dbRes.push(dbEl[e]);}}
else {if (dbEl[e].getAttribute(attr)==val) {dbRes.push(dbEl[e]);}}
}
return dbRes;
}
// -----------------------------------------------------
// A l'affichage de la page, lancer la fonction arbre
window.onload = function() {
arbre();
}
function imgDel(id)
{
var delId='del'+id;
var imgDel = document.getElementById('del'+id);
if (imgDel != null) imgDel.style.display='block';
return true;
}

View File

@@ -87,7 +87,7 @@ $head[$h][2] = 'editor';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][1] = $langs->trans("Miscellanous");
$head[$h][2] = 'misc';
$h++;

View File

@@ -71,6 +71,8 @@ $_SESSION["mode"]=$mode;
$help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
llxHeader('',$langs->trans("Setup"),$help_url);
print_fiche_titre($langs->trans("ModulesSetup"),'','setup');
// Search modules dirs
$modulesdir = array();
@@ -192,11 +194,6 @@ asort($orders);
//var_dump($categ);
//var_dump($modules);
$nbofactivatedmodules=count($conf->modules);
$moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1));
if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'setup');
// Start to show page
if (empty($mode)) $mode='common';
if ($mode==='common') print $langs->trans("ModulesDesc")."<br>\n";
@@ -206,8 +203,10 @@ if ($mode==='functional') print $langs->trans("ModulesJobDesc")."<br>\n";
if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."<br>\n";
if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."<br>\n";
//print '<br>'."\n";
$nbofactivatedmodules=count($conf->modules);
print $langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1));
if ($nbofactivatedmodules <= 1) print ' '.img_warning($langs->trans("YouMustEnableOneModule"));
print '<br>'."\n";
$h = 0;
@@ -266,7 +265,9 @@ $head[$h][2] = 'marketplace';
$h++;
print "<br>\n";
// Show warning about external users
print showModulesExludedForExternal($modules).'<br>'."\n";
print "<br>\n";
dol_fiche_head($head, $mode, $langs->trans("Modules"));
@@ -499,10 +500,6 @@ else
dol_fiche_end();
// Show warning about external users
if ($mode != 'marketplace') print showModulesExludedForExternal($modules).'<br>'."\n";
llxFooter();
$db->close();

View File

@@ -1,159 +0,0 @@
<?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) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* 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
* 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/order_extrafields.php
* \ingroup order
* \brief Page to setup extra fields of order
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("orders");
$extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
$type2label=array('');
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha');
$elementtype='commande'; //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("Orders");
llxHeader('',$langs->trans("OrdersSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
print "<br>\n";
$head = order_admin_prepare_head(null);
dol_fiche_head($head, 'attributes', $langs->trans("ModuleSetup"), 0, 'order');
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
print '<br>';
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("AttributeCode").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="center">'.$langs->trans("Unique").'</td>';
print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
print "</tr>";
}
print "</table>";
dol_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit')
{
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
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();
?>

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2103 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 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
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
$langs->load("admin");
$langs->load("languages");
@@ -51,36 +51,23 @@ if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
{
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
}
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
}
if ($action == 'activate_pdfsecurity')
{
dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1",'chaine',0,'',$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
}
else if ($action == 'disable_pdfsecurity')
{
dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
}
/*
* View
@@ -222,31 +209,27 @@ if ($action == 'edit') // Edit
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
print '</td></tr>';
// Hide Tva Intra on adress
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
print '</td></tr>';
//Desc
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
print '</td></tr>';
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
{
//Desc
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
print '</td></tr>';
//Ref
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print '</td></tr>';
//Ref
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print '</td></tr>';
}
print '</table>';
@@ -383,106 +366,72 @@ else // Show
print_fiche_titre($langs->trans("Other"),'','').'<br>';
$var=true;
print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
// Hide any PDF informations
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td colspan="2">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1);
print '</td></tr>';
// Encrypt and protect PDF
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>';
$text = $langs->trans("ProtectAndEncryptPdfFiles");
$desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1);
print $desc;
print '</td>';
print '<td width="60">';
if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
{
print img_picto($langs->trans("Active"),'tick');
}
print '</td>';
print '<td align="center" width="140">';
if ($conf->global->PDF_SECURITY_ENCRYPTION == 0)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_pdfsecurity">'.$langs->trans("Activate").'</a>';
}
if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_pdfsecurity">'.$langs->trans("Disable").'</a>';
}
print "</td>";
print "</td>";
print '</tr>';
// Hide Tva Intra on adress
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
print '</td></tr>';
//Desc
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
print '</td></tr>';
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
{
//Desc
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
print '</td></tr>';
//Ref
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1);
print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
print '</td></tr>';
//Ref
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1);
print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
print '</td></tr>';
}
print '</table>';
/*
* Library
*/
print '<br>';
print_titre($langs->trans("Library"));
/*
* Library
*/
print '<br>';
print_titre($langs->trans("Library"));
print '<table class="noborder" width="100%">'."\n";
print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Name").'</td>'."\n";
print '<td>'.$langs->trans("Value").'</td>'."\n";
print "</tr>\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Name").'</td>'."\n";
print '<td>'.$langs->trans("Value").'</td>'."\n";
print "</tr>\n";
$var=false;
if (! empty($dolibarr_pdf_force_fpdf))
{
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td>dolibarr_pdf_force_fpdf</td>'."\n";
print '<td>';
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td>dolibarr_pdf_force_fpdf</td>'."\n";
print '<td>';
print $dolibarr_pdf_force_fpdf;
print '</td>';
print '</tr>';
}
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td>'.$langs->trans("LibraryToBuildPDF").'</td>'."\n";
print '<tr '.$bc[$var].'>'."\n";
print '<td>'.$langs->trans("LibraryToBuildPDF").'</td>'."\n";
print '<td>';
$i=0;
$pdf=pdf_getInstance('A4');
if (class_exists('FPDF') && ! class_exists('TCPDF'))
if (class_exists('FPDF') && ! class_exists('TCPDF'))
{
if ($i) print ' + ';
if ($i) print ' + ';
print 'FPDF';
print ' ('.@constant('FPDF_PATH').')';
$i++;
@@ -502,8 +451,8 @@ else // Show
$i++;
}
print '<!-- $conf->global->MAIN_USE_FPDF = '.$conf->global->MAIN_USE_FPDF.' -->';
print '</td>'."\n";
print '</tr>'."\n";
print '</td>'."\n";
print '</tr>'."\n";
print "</table>\n";

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