diff --git a/ChangeLog b/ChangeLog index 06aac38c66e..5ee900b9af7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,8 @@ For users: - New: Chart are faster to build - New: Value of data into charts are visible on mouse hover. - New: Import wizard can import contacts. +- New: Install process is now two times faster. +- New: Extra fields support int type. - Fix: Can use POS module with several concurrent users. For developers: @@ -53,6 +55,7 @@ For developers: - New: Log module outputs can be setup with "or" rule (not only "xor"). - New: Add FirePHP output for logging module. - New: Add trigger ACTION_DELETE and ACTION_MODIFY. +- New: Trigger now have a priority to define sort execution order. - New: Can define different requests according to database type into migration files. - New: Add "canvas" feature to overwrite page of thirdparty, contact, product with yours. - New: Removed artichow deprecated libraries. @@ -68,6 +71,19 @@ For developers: - Qual: task #217 : Move core files into core directory (login, menus, triggers, boxes, modules) +***** ChangeLog for 3.1.1 compared to 3.1.0 ***** + +- New: Add option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS. With this option added, + credit notes are not removed from total amount of invoice but are just + payments used to reducs remain to pay. +- Fix: Removed warnings during install. +- Fix: State into address of paypal payments were lost +- Fix: Removed Bare LF from emails sent with smtps method. +- Fix: Can show report on selected period. +- Fix: product removed from list after deleted into order. +- Fix: pgsql can connect using socket. + + ***** ChangeLog for 3.1 compared to 3.0 ***** WARNING: IE6 browser is no more supported in this version. For users: diff --git a/README.md b/README.md index 649067e4b67..b4c26f0574a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,9 @@ Url depends on choice made on first step: http://localhost/dolibarr/htdocs/install/ or + http://localhost/dolibarr/install/ +or + http://yourdolibarrvirtualhost/install/ - Follow instructions provided by installer... @@ -45,7 +48,10 @@ This URL should looks like: http://localhost/dolibarr/htdocs/install/ or - http://yourdolibarrhost/install/index.php + http://localhost/dolibarr/install/ +or + + http://yourdolibarrhost/install/ Then choose the "update" option according to your case. Note: Migrate process can be ran safely several times. diff --git a/build/deb/README.debian b/build/deb/README.debian deleted file mode 100755 index a4dacc288af..00000000000 --- a/build/deb/README.debian +++ /dev/null @@ -1,103 +0,0 @@ -README (english) --------------------------------- -Starter documentation --------------------------------- - -1) Install Dolibarr -2) Upgrade Dolibarr from an older version -3) What's new in this version -4) What Dolibarr can do -5) What Dolibarr can't do yet, todo list - - -I - DOLIBARR INSTALL --------------------- - -Dolibarr files and its dependencies are automatically installed when you install -the dolibarr Debian package. - -Once package is installed, go on menu entry called Dolibarr or use your web browser -to call page http://localhost/dolibarr - - - -II - DOLIBARR UPGRADE ---------------------- - -Dolibarr files and its dependencies are automatically upgraded when you install -the dolibarr Debian package. - -Once new package is installed, go on menu entry called Dolibarr or use your web browser -to call page http://localhost/dolibarr -If a database upgrade is required, you will be prompted to. - - - -III - WHAT'S NEW ----------------- - -See ChangeLog file. - - - -IV - WHAT DOLIBARR CAN DO -------------------------- - -Main modules/features: -- Products and services catalog -- Customers, Prospects or Suppliers directory -- Address book -- Stock management -- Bank accounts management -- Orders management with PDF export -- Commercial proposals management with PDF export -- Contracts management -- Invoices management with PDF export -- Payments management -- Standing orders management -- Shipping management -- ECM (Electronic Content Management) -- EMailings -- Agenda with ical,vcal export for third tools integration -- Management of foundation members -- Donation management - -Other modules: -- Bookmarks management -- Can reports Dolibarr events inside Webcalendar or Phenix -- Data export tools -- LDAP connectivity -- Third parties or products categories -- ClickToDial phone numbers -- RSS - -Miscellanous: -- Mutli-user, with several permissions levels for each feature. -- Serveral menu managers (can be used by internal users, as a back-office, - with a particular menu, or by external users, as a front-office, with - another menu and permissions). -- Very user friendly and easy to use. -- Optional WYSIWYG forms, optional Ajax forms. -- Several skins. -- Code is highly customizable (a lot of use of modules and submodules). -- Works with Mysql 3.1 or higher, experimental support for PostgreSql. -- Works with PHP 4.3 or higher. -- An easy to understand and maintain code (PHP with no heavy frameworks). -- A trigger architecture to allow you to make Dolibarr business events run - PHP code to update your own information system. -- "NPR VAT Rate" (French particularity for managing VAT in DOM-TOM - called "Non Perçue Récupérable"). - - - -V - WHAT DOLIBARR CAN'T DO YET (TODO LIST) ------------------------------------------- -This is features that Dolibarr does not support completely yet: -- Accountancy. -- Dolibarr can manage only one currency. -- Dolibarr does not support the double Canadian Tax. -- Dolibarr does not make coffee (not yet). -- Stock management with option increase/decrease on invoice works on - warehouse number one only (no way to choose warehouse). -- Stock management with option increase/decrease on orders works on - warehouse number one only (no way to choose warehouse). diff --git a/build/deb/dolibarr.menu b/build/deb/dolibarr.menu deleted file mode 100644 index e4616a93a51..00000000000 --- a/build/deb/dolibarr.menu +++ /dev/null @@ -1,6 +0,0 @@ -# This file seems to be useless for Ubuntu -# Good way to add menu on Ubuntu is adding file dolibarr.desktop -?package(dolibarr):needs="X11" section="Applications/Office"\ - title="Dolibarr ERP & CRM" longtitle="The manager for small and medium enterprises or foundations"\ - description="Dolibarr ERP & CRM features agenda, orders, invoices and stock management, marketing campaigns, POS, etc."\ - command="/usr/share/dolibarr/build/deb/rundolibarr.sh" icon="/usr/share/pixmaps/dolibarr.xpm" diff --git a/build/deb/format b/build/deb/format deleted file mode 100644 index 9f8e9b69a33..00000000000 --- a/build/deb/format +++ /dev/null @@ -1 +0,0 @@ -1.0 \ No newline at end of file diff --git a/build/deb/install b/build/deb/install deleted file mode 100755 index d3566d3a59e..00000000000 --- a/build/deb/install +++ /dev/null @@ -1,6 +0,0 @@ -etc/dolibarr/apache.conf -etc/dolibarr/lighttpd.conf -usr/share/applications/dolibarr.desktop -usr/share/dolibarr -usr/share/doc/dolibarr -usr/share/pixmaps diff --git a/build/deb/po/POTFILES.in b/build/deb/po/POTFILES.in deleted file mode 100755 index 98e8416d9a3..00000000000 --- a/build/deb/po/POTFILES.in +++ /dev/null @@ -1 +0,0 @@ -[type: gettext/rfc822deb] templates \ No newline at end of file diff --git a/build/deb/rules b/build/deb/rules deleted file mode 100644 index 9a3f9a98c7a..00000000000 --- a/build/deb/rules +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/make -f - -# Uncomment this to turn on verbose mode. -export DH_VERBOSE=1 -export DH_OPTIONS=-v - -#export DH_COMPAT=7 # This is the debhelper compatability version to use, now defined into compat file - -%: - dh $@ \ No newline at end of file diff --git a/build/deb/wash b/build/deb/wash deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/build/deb/README b/build/debian/README.howto similarity index 85% rename from build/deb/README rename to build/debian/README.howto index 197a2d27886..6e0c7a75d06 100644 --- a/build/deb/README +++ b/build/debian/README.howto @@ -17,8 +17,10 @@ with format .DEB (for Debian, Ubuntu, ...). # # gpg --gen-key Generate a GPG key # -# debconf-updatepo To run into po dir to regenate templates.pot -# podebconf-report-po --from eldy@destailleur.fr To send email to ask translations +# debconf-updatepo To run into po dir to regenate templates.pot +# podebconf-report-po --from email@email.com To send email to ask translations +# Edit manually file XX.po and remove all lines "#, fuzzy" when translation is complete +# msgfmt -v -c -o /dev/null XX.po To have status of translation for language XX # # lintian --pedantic -E -I package.deb To test a package # diff --git a/build/debian/README.source b/build/debian/README.source new file mode 100644 index 00000000000..19777b2da19 --- /dev/null +++ b/build/debian/README.source @@ -0,0 +1,12 @@ +================================================================== +Dolibarr - Web based software to manage a small company or foundation +================================================================== + + +Note for package maintainers +---------------------------- +This file explains how to modify official sources (from http://www.dolibarr.org) +to have ready to use source files to build a debian package. + +All changes are included into patch file +build/debian/install.patch diff --git a/build/deb/apache.conf b/build/debian/apache.conf similarity index 100% rename from build/deb/apache.conf rename to build/debian/apache.conf diff --git a/build/deb/changelog b/build/debian/changelog similarity index 68% rename from build/deb/changelog rename to build/debian/changelog index 152492e7ad7..3b1aeb0907f 100644 --- a/build/deb/changelog +++ b/build/debian/changelog @@ -6,4 +6,4 @@ dolibarr (3.2.0+nmu1) unstable; urgency=low -- Dolibarr team Mon, 10 Aug 2011 12:00:00 +0100 -# For a changelog file dedicated to users, see /usr/share/doc/dolibarr/UserChangeLog.gz file. \ No newline at end of file +# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz \ No newline at end of file diff --git a/build/deb/compat b/build/debian/compat similarity index 100% rename from build/deb/compat rename to build/debian/compat diff --git a/build/deb/conf.php.install b/build/debian/conf.php.install similarity index 100% rename from build/deb/conf.php.install rename to build/debian/conf.php.install diff --git a/build/deb/control.debian b/build/debian/control similarity index 95% rename from build/deb/control.debian rename to build/debian/control index 8661fea9d55..e10b43f392d 100755 --- a/build/deb/control.debian +++ b/build/debian/control @@ -4,7 +4,7 @@ Standards-Version: 3.9.2 Section: web Priority: optional Homepage: http://www.dolibarr.org -Build-Depends: debhelper (>= 7), po-debconf +Build-Depends: debhelper (>= 7), po-debconf, dpatch Package: dolibarr Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, @@ -16,7 +16,8 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | ttf-dejavu-core, xdg-utils, mysql-server, - ${misc:Depends} + ${misc:Depends}, + ${perl:Depends} Recommends: apache2 | lighttpd | httpd, mysql-client Suggests: www-browser Architecture: all diff --git a/build/deb/control.debianbin b/build/debian/control.debianbin similarity index 97% rename from build/deb/control.debianbin rename to build/debian/control.debianbin index e98bc222fa3..2262f245447 100755 --- a/build/deb/control.debianbin +++ b/build/debian/control.debianbin @@ -5,7 +5,8 @@ Maintainer: Laurent Destailleur Installed-Size: 61200 Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, php5-mysql | php5-mysqli, - php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, php5-geoip + php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, php5-geoip, + libnusoap-php, libphp-pclzip, ckeditor, ttf-dejavu-core, diff --git a/build/deb/copyright b/build/debian/copyright similarity index 73% rename from build/deb/copyright rename to build/debian/copyright index ac9bb33a07f..46f70f5bd00 100644 --- a/build/deb/copyright +++ b/build/debian/copyright @@ -5,24 +5,39 @@ Source: git@github.com:Dolibarr/dolibarr.git Files: * Copyright: 2002-2009, Rodolphe Quiedeville - 2003-2011, Laurent Destailleur - 2004-2011, Regis Houssin - 2006-2011, Auguria SARL - 2010-2011, Juanjo Menent 2003-2006, Jean-Louis Bergamo + 2003-2012, Laurent Destailleur 2003, Xavier Dutoit + 2004-2012, Regis Houssin 2004, Sebastien Di Cintio 2004, Benoit Mortier 2004, Christophe Combelles + 2004, Guillaume Delecourt 2004, Eric Seigne + 2005, Brice Davoleau + 2005, Kai Blankenhorn + 2005-2006, Marc Barilley/Ocebo + 2005, Matthieu Valleton 2005, Patrick Rouillon - 2005, Marc Barilley / Ocebo + 2005, Simon TOSSER 2006, Andre Cianfarani + 2006-2011, Auguria SARL 2006, Jean Heimburger + 2006, Roman Ozana + 2006, Yannick Warnier 2007, Patrick Raguin + 2007, Franky Van Liedekerke 2007-2008, Jeremie Ollivier + 2008, Matteli 2008, Raphael Bertrand (Resultic) + 2010, Francois Legastelois + 2010-2012, Juanjo Menent + 2010-2012, Philippe Grand + 2010, Pierre Morin 2010, Servitux Servicios Informaticos + 2011, Herve Prot + 2011, Remy Younes + 2012, Christophe Battarel License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public @@ -36,43 +51,13 @@ License: GPL-2+ 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 package; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. - -Files: htdocs/includes/artichow/* -Copyright: Artichow team -License: Public Domain - This work is not subject to copyright in any jurisdiction -Files: htdocs/includes/ckeditor/* -Copyright: CKeditor team -License: GPL-2+ - 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 package; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA - . - On Debian systems, the full text of the GNU General Public - License version 2 can be found in the file - `/usr/share/common-licenses/GPL-2'. Files: htdocs/includes/fpdi/* Copyright: FPDFI team @@ -89,15 +74,14 @@ License: GPL-2+ 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 package; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + Files: htdocs/includes/jquery/* Copyright: JQuery team License: MIT or GPL-2+ @@ -113,10 +97,8 @@ License: MIT or GPL-2+ 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 package; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file @@ -140,11 +122,13 @@ License: MIT or GPL-2+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + Files: htdocs/includes/jquery/plugins/flot/* Copyright: Flot team License: Public Domain This work is not subject to copyright in any jurisdiction + Files: htdocs/includes/jsgantt/* Copyright: JSGantt team License: GPL-2+ @@ -160,20 +144,20 @@ License: GPL-2+ 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 package; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + Files: htdocs/includes/phpexcel/* Copyright: PHPExcel team License: LGPL 2.1 See http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html + Files: htdocs/includes/odtphp/* Copyright: 2008, Julien Pauli 2008, Cyril PIERRE de GEYER @@ -191,17 +175,15 @@ License: GPL-2+ 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 package; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + Files: htdocs/includes/tcpdf/* Copyright: TCPDF team License: LGPL 3.0 See http://www.gnu.org/licenses/old-licenses/lgpl-3.0-standalone.html - \ No newline at end of file diff --git a/build/deb/config b/build/debian/dolibarr.config similarity index 100% rename from build/deb/config rename to build/debian/dolibarr.config diff --git a/build/deb/dolibarr.desktop b/build/debian/dolibarr.desktop similarity index 100% rename from build/deb/dolibarr.desktop rename to build/debian/dolibarr.desktop diff --git a/build/debian/dolibarr.doc-base b/build/debian/dolibarr.doc-base new file mode 100644 index 00000000000..d7d5666d883 --- /dev/null +++ b/build/debian/dolibarr.doc-base @@ -0,0 +1,10 @@ +Document: dolibarr +Title: Dolibarr ERP & CRM documentation +Author: Dolibarr team +Abstract: This documentation covers the install, use and administration of + Dolibarr ERP & CRM software. +Section: Office + +Format: HTML +Index: /usr/share/doc/dolibarr/index.html +Files: /usr/share/doc/dolibarr/*.html \ No newline at end of file diff --git a/build/debian/dolibarr.install b/build/debian/dolibarr.install new file mode 100755 index 00000000000..beae194006d --- /dev/null +++ b/build/debian/dolibarr.install @@ -0,0 +1,13 @@ +debian/dolibarr.desktop usr/share/applications +debian/dolibarr.xpm usr/share/pixmaps +ChangeLog usr/share/doc/dolibarr +README usr/share/doc/dolibarr +doc/install usr/share/doc/dolibarr +doc/user usr/share/doc/dolibarr +doc/index.html usr/share/doc/dolibarr +build/debian/apache.conf etc/dolibarr +build/debian/lighttpd.conf etc/dolibarr +build usr/share/dolibarr +dev usr/share/dolibarr +htdocs usr/share/dolibarr +scripts usr/share/dolibarr diff --git a/build/deb/dolibarr.lintian-overrides b/build/debian/dolibarr.lintian-overrides similarity index 100% rename from build/deb/dolibarr.lintian-overrides rename to build/debian/dolibarr.lintian-overrides diff --git a/build/deb/postinst b/build/debian/dolibarr.postinst similarity index 98% rename from build/deb/postinst rename to build/debian/dolibarr.postinst index dbfb12557d3..cdee802e986 100644 --- a/build/deb/postinst +++ b/build/debian/dolibarr.postinst @@ -49,7 +49,7 @@ echo Run the dolibarr postinst script # Define vars docdir='/var/lib/dolibarr/documents' -installfileorig="/usr/share/dolibarr/build/deb/install.forced.php.install" +installfileorig="/usr/share/dolibarr/build/debian/install.forced.php.install" installconfig="/etc/dolibarr/install.forced.php" config="/etc/dolibarr/conf.php" diff --git a/build/deb/postrm b/build/debian/dolibarr.postrm similarity index 100% rename from build/deb/postrm rename to build/debian/dolibarr.postrm diff --git a/build/deb/templates b/build/debian/dolibarr.templates similarity index 100% rename from build/deb/templates rename to build/debian/dolibarr.templates diff --git a/build/deb/templates.futur b/build/debian/dolibarr.templates.futur similarity index 100% rename from build/deb/templates.futur rename to build/debian/dolibarr.templates.futur diff --git a/doc/images/dolibarr.xpm b/build/debian/dolibarr.xpm similarity index 100% rename from doc/images/dolibarr.xpm rename to build/debian/dolibarr.xpm diff --git a/build/deb/install.forced.php.install b/build/debian/install.forced.php.install similarity index 100% rename from build/deb/install.forced.php.install rename to build/debian/install.forced.php.install diff --git a/build/deb/lighttpd.conf b/build/debian/lighttpd.conf similarity index 100% rename from build/deb/lighttpd.conf rename to build/debian/lighttpd.conf diff --git a/build/debian/patches/00list b/build/debian/patches/00list new file mode 100644 index 00000000000..e9740160f5b --- /dev/null +++ b/build/debian/patches/00list @@ -0,0 +1 @@ +install.dpatch \ No newline at end of file diff --git a/build/debian/patches/install.dpatch b/build/debian/patches/install.dpatch new file mode 100755 index 00000000000..0b8cb5a54b5 --- /dev/null +++ b/build/debian/patches/install.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## install.patch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Updates htdocs/filefunc.inc.php +## DP: Updates htdocs/install/inc.php +## DP: Updates htdocs/support/inc.php + +@DPATCH@ + + +--- old/htdocs/filefunc.inc.php 2011-09-03 02:32:48.666952000 +0200 ++++ new/htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200 +@@ -64,8 +64,8 @@ + $conffile = "conf/conf.php"; + $conffiletoshow = "htdocs/conf/conf.php"; + // For debian/redhat like systems +-//$conffile = "/etc/dolibarr/conf.php"; +-//$conffiletoshow = "/etc/dolibarr/conf.php"; ++$conffile = "/etc/dolibarr/conf.php"; ++$conffiletoshow = "/etc/dolibarr/conf.php"; + + + // Include configuration +--- old/htdocs/install/inc.php 2011-09-03 02:33:26.450952000 +0200 ++++ new/htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200 +@@ -84,8 +84,8 @@ + $conffile = "../conf/conf.php"; + $conffiletoshow = "htdocs/conf/conf.php"; + // For debian/redhat like systems +-//$conffile = "/etc/dolibarr/conf.php"; +-//$conffiletoshow = "/etc/dolibarr/conf.php"; ++$conffile = "/etc/dolibarr/conf.php"; ++$conffiletoshow = "/etc/dolibarr/conf.php"; + + + if (! defined('DONOTLOADCONF') && file_exists($conffile)) +--- old/htdocs/support/inc.php 2011-09-03 02:34:39.606952000 +0200 ++++ new/htdocs/support/inc.php 2011-09-03 02:33:59.814952000 +0200 +@@ -79,8 +79,8 @@ + $conffile = "../conf/conf.php"; + $conffiletoshow = "htdocs/conf/conf.php"; + // For debian/redhat like systems +-//$conffile = "/etc/dolibarr/conf.php"; +-//$conffiletoshow = "/etc/dolibarr/conf.php"; ++$conffile = "/etc/dolibarr/conf.php"; ++$conffiletoshow = "/etc/dolibarr/conf.php"; + + $charset="UTF-8"; // If not output format found in any conf file + if (! defined('DONOTLOADCONF') && file_exists($conffile)) diff --git a/build/debian/po/POTFILES.in b/build/debian/po/POTFILES.in new file mode 100755 index 00000000000..40130aadd20 --- /dev/null +++ b/build/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] dolibarr.templates \ No newline at end of file diff --git a/build/deb/po/fr.po b/build/debian/po/fr.po similarity index 99% rename from build/deb/po/fr.po rename to build/debian/po/fr.po index 3bbe762283a..a96cd360299 100755 --- a/build/deb/po/fr.po +++ b/build/debian/po/fr.po @@ -45,7 +45,6 @@ msgstr "" #. Type: boolean #. Description #: ../templates:2001 -#, fuzzy msgid "Delete database and uploaded files ?" msgstr "Effacer la base de donnée et les fichiers uploadés ?" @@ -53,7 +52,6 @@ msgstr "Effacer la base de donnée et les fichiers uploadés ?" #. Type: boolean #. Description #: ../templates:2001 -#, fuzzy msgid "" "Answer if you want to removed the Dolibarr MySQL database and all other " "datas (datas related to this question are the Dolibarr DBMS account, all " diff --git a/build/deb/po/templates.pot b/build/debian/po/templates.pot similarity index 100% rename from build/deb/po/templates.pot rename to build/debian/po/templates.pot diff --git a/build/debian/rules b/build/debian/rules new file mode 100755 index 00000000000..04247898209 --- /dev/null +++ b/build/debian/rules @@ -0,0 +1,112 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 +export DH_OPTIONS=-v + +#export DH_COMPAT=7 # This is the debhelper compatability version to use, now defined into compat file + + +# use dpatch +include /usr/share/dpatch/dpatch.make + + +configure: + dh $@ + +build: patch + dh $@ + +build-arch: patch + dh $@ + +build-indep: patch + dh $@ + +binary: + dh $@ + +binary-indep: + dh $@ + +clean: + # Delete files + rm -f .buildpath + rm -fr .cache + rm -fr .git + rm -f .gitmodules + rm -f .gitignore + rm -fr .project + rm -fr .settings + rm -f build.xml + rm -f pom.xml + rm -f README.md + + rm -f htdocs/install/mssql/README + rm -f htdocs/install/mysql/README + rm -f htdocs/install/pgsql/README + + rm -fr dev/codesniffer + rm -fr dev/codetemplates + rm -fr dev/dbmodel + rm -fr dev/initdata + rm -fr dev/iso-normes + rm -fr dev/ldap + rm -fr dev/licence + rm -fr dev/mail + rm -fr dev/phpcheckstyle + rm -fr dev/phpunit + rm -fr dev/security + rm -fr dev/spec + rm -fr dev/test + rm -fr dev/uml + rm -fr dev/xdebug + rm -f dev/dolibarr_changes.txt + rm -f dev/README + rm -f doc/images/dolibarr_screenshot2.png + rm -f doc/images/dolibarr_screenshot3.png + rm -f doc/images/dolibarr_screenshot4.png + rm -f doc/images/dolibarr_screenshot5.png + rm -f doc/images/dolibarr_screenshot6.png + rm -f doc/images/dolibarr_screenshot7.png + rm -f doc/images/dolibarr_screenshot8.png + rm -f doc/images/dolibarr_screenshot9.png + rm -f doc/images/dolibarr_screenshot10.png + rm -f doc/images/dolibarr_screenshot11.png + rm -f doc/images/dolibarr_screenshot12.png + + rm -fr test + + # Licence files are included into copyright file. + rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt + rm -fr htdocs/includes/phpexcel/license.txt + rm -f htdocs/includes/tcpdf/LICENSE.TXT + + rm -fr htdocs/includes/jquery/plugins/lightbox + rm -fr htdocs/includes/jquery/plugins/jstree + rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF + rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip + rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33 + rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 + rm -fr htdocs/includes/tcpdf/fonts/utils + + rm -fr build/aps + rm -fr build/dmg + rm -fr build/doap + rm -fr build/exe + rm -fr build/launchpad + rm -fr build/live + rm -fr build/patch + rm -fr build/perl + rm -fr build/rpm + rm -fr build/zip + rm -fr htdocs/includes/ckeditor + rm -fr htdocs/includes/fonts + rm -fr htdocs/includes/geoip + rm -fr htdocs/includes/nusoap + rm -fr htdocs/includes/odtphp/zip/pclzip + + dh $@ + +binary-arch: + \ No newline at end of file diff --git a/build/debian/source/format b/build/debian/source/format new file mode 100644 index 00000000000..9f6742789cd --- /dev/null +++ b/build/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file diff --git a/build/debian/wash b/build/debian/wash new file mode 100644 index 00000000000..7d3ec07d7a5 --- /dev/null +++ b/build/debian/wash @@ -0,0 +1,3 @@ +# watch control file for uscan +#version=3 +#http://http://sourceforge.net/projects/dolibarr/files/Dolibarr%20installer%20for%20Debian-Ubuntu%20%28DoliDeb%29/ debian uupdate diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 440aed7060a..35db3685573 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -107,7 +107,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m ; Mysql data files (does not overwrite if exists) Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db" ; Dolibarr -Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,telephonie\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\install.forced.php,*\modBookmark4u.class.php,*\modDocument.class.php,*\modDroitPret.class.php,*\modEditeur.class.php,*\modPostnuke.class.php,*\modTelephonie.class.php,*\interface_modEditeur_Editeur.class.php*,*\bureau2crea,*\rodolphe" +Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,telephonie\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\install.forced.php" Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,xdebug\*" Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png" Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php" diff --git a/build/launchpad/README b/build/launchpad/README index c2d98fbb54a..a18e4389aef 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -10,13 +10,53 @@ a package onto LaunchPad # This is standard command to work on RPM packaging: # # To install all packagers tools: -# apt-get install bzr-builder bzr pbuilder +# sudo apt-get install bzr-builder bzr dpatch pbuilder debootstrap devscripts -To submit a package on LaunchPad: +# Init local working env - Create account on launchpad.org - Create Project - Link project to official SCM server - Upload SSH public key onto account -- Run from command line: bzr launchpad-login yourlogin +- Upload you GPG sign key +- Run from command line: + bzr launchpad-login yourlogin + bzr whoami "Your Name " +- Create a file /.pbuilderrc with content + COMPONENTS="main universe multiverse restricted" +- Create chroot ubuntu env + sudo pbuilder create [--distribution sid|squeeze] +- Edit file ~/.bashrc ti add +DEBFULLNAME="" +DEBEMAIL="" -- ... +# Init package tools for launchpad +- Create a Bazaar directory + mkdir bzr +- Create debian directory and upload it onto bzr branch ~yourlogin/dolibarr/debian + cd bzr + mkdir debian + cd debian + bzr init + cp -pr dolibarr_root/debian bzr/debian + bzr add debian + bzr commit -m "Init" + bzr push lp:~eldy/dolibarr/debian + or download it from launchpad bazaar: + cd bzr + bzr branch lp:~eldy/dolibarr/debian +- Create a file dolibarr.recipe with content + cd bzr + vi dolibarr.recipe + # bzr-builder format 0.3 deb-version {debupstream}+{revno}+{revno:packaging} + lp:dolibarr + merge packaging lp:~eldy/dolibarr/debian +- 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 ~eldy/dolibarr/debian +- Test package sources + sudo pbuilder build /_.dsc + + + + diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f618815b750..2d7ec389c59 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -280,7 +280,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`; @@ -301,6 +300,8 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`; + $ret=`rm -f $BUILDROOT/$PROJECT/dev/dolibarr_changes.txt`; + $ret=`rm -f $BUILDROOT/$PROJECT/dev/README`; $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot2.png`; $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot3.png`; $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot4.png`; @@ -317,13 +318,9 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; - #$ret=`rm -fr $BUILDROOT/$PROJECT/build/deb/po/CVS*`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; - $ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/*/*/*/CVS*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.svn $BUILDROOT/$PROJECT/*/.svn $BUILDROOT/$PROJECT/*/*/.svn $BUILDROOT/$PROJECT/*/*/*/.svn $BUILDROOT/$PROJECT/*/*/*/*/.svn`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/fckeditor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/lightbox`; @@ -336,8 +333,6 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; - # Removed because not stable yet - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/bureau2crea`; } # Build package for each target @@ -348,7 +343,8 @@ if ($nboftargetok) { print "\nBuild package for target $target\n"; - if ($target eq 'SNAPSHOT') { + if ($target eq 'SNAPSHOT') + { $NEWDESTI=$DESTI; print "Remove target $FILENAMESNAPSHOT.tgz...\n"; @@ -372,7 +368,8 @@ if ($nboftargetok) { next; } - if ($target eq 'TGZ') { + if ($target eq 'TGZ') + { $NEWDESTI=$DESTI; if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } @@ -397,7 +394,8 @@ if ($nboftargetok) { next; } - if ($target eq 'ZIP') { + if ($target eq 'ZIP') + { $NEWDESTI=$DESTI; if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } @@ -460,9 +458,6 @@ if ($nboftargetok) { print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; - #$ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2"`; - #print "Create directory $BUILDROOT/$FILENAMETGZ2/usr/share\n"; - #$ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2/usr/share"`; print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $ret=`$cmd`; @@ -554,194 +549,111 @@ if ($nboftargetok) { print "Remove target ${FILENAMEDEB}.changes...\n"; unlink("$NEWDESTI/${FILENAMEDEB}.changes"); - #rmdir "$BUILDROOT/$PROJECT.tmp"; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`; $ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`; - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share"`; - print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; - $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; - $ret=`$cmd`; - - print "Fix filefunc.inc.php, install/inc.php, support/inc.php\n"; - $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/filefunc.inc.php\" | - sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | - sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | - sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/filefunc.inc.php\""; - $ret=`$cmd`; - $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/install/inc.php\" | - sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | - sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | - sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/install/inc.php\""; - $ret=`$cmd`; - $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/support/inc.php\" | - sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | - sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | - sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/support/inc.php\""; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n"; + $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\""; $ret=`$cmd`; - # Create DEBIAN directory - print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; - $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - print "Copy $SOURCE/build/deb/xxx to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; - $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/DEBIAN/po/CVS*"`; - - print "Edit version in file $BUILDROOT/$PROJECT.tmp/DEBIAN/control\n"; - open (SPECFROM,"<$SOURCE/build/deb/control.debianbin") || die "Error"; - open (SPECTO,">$BUILDROOT/$PROJECT.tmp/DEBIAN/control") || die "Error"; - while () { - $_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/; - print SPECTO $_; - } - close SPECFROM; - close SPECTO; - print "Version set to $MAJOR.$MINOR.$newbuild\n"; - print "Remove other files\n"; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYING`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYRIGHT`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/INSTALL`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README-FR`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README-FR`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/aps`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dmg`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/pad/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/tgz/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README`; - #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/po`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/changelog`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/compat`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/config`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/control.*`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/copyright`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.desktop`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.menu`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/format`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/install`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/menu`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postrm`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postinst`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/rules`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README.debian`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates.futur`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/wash`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/doap`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/exe`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/launchpad`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/live`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/patch`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/perl`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/rpm`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/zip`; - # We remove embedded libraries or fonts - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/ckeditor`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/fonts`, - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/geoip`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/nusoap`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README-FR`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/aps`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/dmg`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/pad/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/tgz/README`; + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian/po`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian/source`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/changelog`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/compat`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/control*`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/copyright`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.config`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.desktop`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.doc-base`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.install`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.lintian-overrides`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postrm`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postinst`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/rules`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/wash`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/exe`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/launchpad`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/live`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/patch`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; + # We remove embedded libraries or fonts (this is also inside rules file, target clean) + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`, + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`; - # Apache and lighttpd conf files - print "Copy apache.conf file into $BUILDROOT/$PROJECT.tmp/etc/$PROJECT/apache.conf\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT"`; - $ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT/apache.conf"`; - print "Copy lighttpd.conf file into $BUILDROOT/$PROJECT.tmp/etc/$PROJECT/lighttpd.conf\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT"`; - $ret=`cp "$SOURCE/build/deb/lighttpd.conf" "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT/lighttpd.conf"`; - - # dolibarr.desktop - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/applications\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; - print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; - $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; + # Prepare source package (init debian dir) + print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n"; + $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; + print "Copy $SOURCE/build/debian/xxx to $BUILDROOT/$PROJECT.tmp/debian\n"; + # Add files for dpkg-source + $ret=`cp -f "$SOURCE/build/debian/changelog" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/compat" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/control" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/copyright" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.doc-base" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.install" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.lintian-overrides" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/README.source" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/rules" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -fr "$SOURCE/build/debian/patches" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -fr "$SOURCE/build/debian/po" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -fr "$SOURCE/build/debian/source" "$BUILDROOT/$PROJECT.tmp/debian"`; + # Add files also required to build binary package + $ret=`cp -f "$SOURCE/build/debian/dolibarr.config" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`; - # pixmap - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; - print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; - $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; - - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; - - # changelog (to build binary package directly without sources. Useless if we build from sources) - $ret=`gzip -9 -c "$SOURCE/build/deb/changelog" > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.gz`; - - # Set owners + # Set owners and permissions print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - print "Set permissions on files/dir\n"; $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; + $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.php' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; - $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name '*.php' -type f -exec chmod 755 {} \\; "; + $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.dpatch' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name '*.pl' -type f -exec chmod 755 {} \\; "; + $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.pl' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name '*.php' -type f -exec chmod 755 {} \\; "; + $cmd="find $BUILDROOT/$PROJECT.tmp/dev -name '*.php' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/translation/langAutoParser.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/skeletons/modMyModule.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/skeletons/skeleton_class.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/skeletons/skeleton_page.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/skeletons/skeleton_webservice_server.php`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; + $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/modMyModule.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_class.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_page.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`; + $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - # Creation of binary package (to build without sources) - #print "Go to directory $BUILDROOT\n"; - #chdir("$BUILDROOT"); - #$cmd="dpkg -b $BUILDROOT/$PROJECT.tmp $BUILDROOT/${FILENAMEDEB}_all.deb"; - #print "Launch DEB build ($cmd)\n"; - #$ret=`$cmd`; - #print $ret."\n"; - - # Prepare source package - print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n"; - $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian/source"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc"`; - print "Copy $SOURCE/build/deb/xxx to $BUILDROOT/$PROJECT.tmp/debian\n"; - # Add files for dpkg-source - $ret=`cp -f "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/UserChangeLog"`; - $ret=`cp -f "$SOURCE/build/deb/README.debian" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/README"`; - $ret=`cp -f "$SOURCE/build/deb/changelog" "$BUILDROOT/$PROJECT.tmp/debian/changelog"`; - $ret=`cp -f "$SOURCE/build/deb/control.debian" "$BUILDROOT/$PROJECT.tmp/debian/control"`; - $ret=`cp -f "$SOURCE/build/deb/dolibarr.lintian-overrides" "$BUILDROOT/$PROJECT.tmp/debian/dolibarr.lintian-overrides"`; - $ret=`cp -f "$SOURCE/build/deb/install" "$BUILDROOT/$PROJECT.tmp/debian/install"`; - $ret=`cp -f "$SOURCE/build/deb/rules" "$BUILDROOT/$PROJECT.tmp/debian/rules"`; - $ret=`cp -f "$SOURCE/build/deb/copyright" "$BUILDROOT/$PROJECT.tmp/debian/copyright"`; - $ret=`cp -f "$SOURCE/build/deb/compat" "$BUILDROOT/$PROJECT.tmp/debian/compat"`; - $ret=`cp -f "$SOURCE/build/deb/format" "$BUILDROOT/$PROJECT.tmp/debian/source/format"`; - $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/debian/po"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/debian/po/CVS"`; - # Add files also required to build binary package with dpkg-buildpackages - $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/debian"`; - + + print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; $ret=`$cmd`; # Creation of source package - print "Go to directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; + print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"); #$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; $cmd="dpkg-buildpackage -us -uc"; diff --git a/build/makepack-dolibarrmodule.conf b/build/makepack-dolibarrmodule.conf index 8fddcd07a3b..33cd433ea98 100644 --- a/build/makepack-dolibarrmodule.conf +++ b/build/makepack-dolibarrmodule.conf @@ -3,13 +3,13 @@ # Goal: Goal of module # Version: 1.0 # Author: Copyright 2008 - Author name here -# Licence: Not yet defined +# Licence: GPL # Install: Just unpack content of module package in Dolibarr directory. -# Setup: Go on Dolibarr setup - modules page to enable module. +# Setup: Go on Dolibarr setup - modules to enable module. # # Files in module -htdocs/core/modules/modMyModule.class.php -htdocs/core/triggers/interface_mymodule.class.php +htdocs/mymodule/core/modules/modMyModule.class.php +htdocs/mymodule/core/triggers/interface_mymodule.class.php htdocs/mymodule/page1.php htdocs/mymodule/page2.php htdocs/mymodule/sql/script1.sql diff --git a/build/rpm/dolibarr-forrpm.patch b/build/rpm/dolibarr-forrpm.patch index f1627beb897..06dd71a8987 100755 --- a/build/rpm/dolibarr-forrpm.patch +++ b/build/rpm/dolibarr-forrpm.patch @@ -1,7 +1,7 @@ diff -up htdocs/filefunc.inc.php.patch htdocs/filefunc.inc.php --- htdocs/filefunc.inc.php.patch 2011-09-03 02:32:48.666952000 +0200 +++ htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200 -@@ -64,8 +64,8 @@ $conffiletoshowshort = "conf.php"; +@@ -64,8 +64,8 @@ $conffile = "conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems @@ -15,7 +15,7 @@ diff -up htdocs/filefunc.inc.php.patch htdocs/filefunc.inc.php diff -up htdocs/install/inc.php.patch htdocs/install/inc.php --- htdocs/install/inc.php.patch 2011-09-03 02:33:26.450952000 +0200 +++ htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200 -@@ -75,8 +75,8 @@ $conffiletoshowshort = "conf.php"; +@@ -84,8 +84,8 @@ $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems @@ -29,7 +29,7 @@ diff -up htdocs/install/inc.php.patch htdocs/install/inc.php diff -up htdocs/support/inc.php.patch htdocs/support/inc.php --- htdocs/support/inc.php.patch 2011-09-03 02:34:39.606952000 +0200 +++ htdocs/support/inc.php 2011-09-03 02:33:59.814952000 +0200 -@@ -69,8 +69,8 @@ $conffiletoshowshort = "conf.php"; +@@ -79,8 +79,8 @@ $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems diff --git a/build/tgz/tar_exclude.txt b/build/tgz/tar_exclude.txt index af3d3aac3ef..5b7eb73e07a 100644 --- a/build/tgz/tar_exclude.txt +++ b/build/tgz/tar_exclude.txt @@ -31,15 +31,6 @@ htdocs/conf/conf.php.mysql htdocs/conf/conf.php.old htdocs/conf/conf.php.postgres htdocs/avoir -htdocs/core/modules/modBookmark4u.class.php -htdocs/core/modules/modDocument.class.php -htdocs/core/modules/modDroitPret.class.php -htdocs/core/modules/modEditeur.class.php -htdocs/core/modules/modPostnuke.class.php -htdocs/core/modules/modTelephonie.class.php -htdocs/core/triggers/interface_user.class.php -htdocs/core/triggers/interface_contractfrombill.class.php-NORUN -htdocs/core/triggers/interface_modEditeur_Editeur.class.php-NORUN htdocs/custom htdocs/custom2 htdocs/customleave diff --git a/build/zip/zip_exclude.txt b/build/zip/zip_exclude.txt index 512aa41f368..1409e7ee9db 100644 --- a/build/zip/zip_exclude.txt +++ b/build/zip/zip_exclude.txt @@ -27,15 +27,6 @@ */htdocs/conf/conf.php.mysql */htdocs/conf/conf.php.old */htdocs/conf/conf.php.postgres -*/htdocs/core/modules/modBookmark4u.class.php -*/htdocs/core/modules/modClickToDial.class.php -*/htdocs/core/modules/modDocument.class.php -*/htdocs/core/modules/modDomain.class.php -*/htdocs/core/modules/modDroitPret.class.php -*/htdocs/core/modules/modEditeur.class.php -*/htdocs/core/modules/modPostnuke.class.php -*/htdocs/core/triggers/interface_user.class.php -*/htdocs/core/triggers/interface_contractfrombill.class.php-NORUN */htdocs/custom/* */htdocs/custom2/* */htdocs/document/* diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 20b6fbf6847..7a9d658c15f 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -246,7 +246,7 @@ class modMyModule extends DolibarrModules $result=$this->load_tables(); - return $this->_init($sql); + return $this->_init($sql, $options); } /** @@ -261,7 +261,7 @@ class modMyModule extends DolibarrModules { $sql = array(); - return $this->_remove($sql); + return $this->_remove($sql, $options); } diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 7354912147e..497ec4532d4 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -156,7 +156,7 @@ if ($action == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch(GETPOST("socid")); $error++; - $mesg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'
'; + $mesg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'
'; } } @@ -894,11 +894,11 @@ if ($rowid) print ' '.$langs->trans("MoreActionBankDirect").'
'; } - if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled) + if ($conf->societe->enabled && $conf->facture->enabled) { - print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; - print '> '.$langs->trans("MoreActionBankViaInvoice"); + print '> '.$langs->trans("MoreActionInvoiceOnly"); if ($adh->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else { @@ -909,11 +909,11 @@ if ($rowid) } print '
'; } - if ($conf->societe->enabled && $conf->facture->enabled) + if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled) { - print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; - print '> '.$langs->trans("MoreActionInvoiceOnly"); + print '> '.$langs->trans("MoreActionBankViaInvoice"); if ($adh->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else { @@ -949,7 +949,7 @@ if ($rowid) print ''.$langs->trans('CheckTransmitter'); print ' ('.$langs->trans("ChequeMaker").')'; print ''; - print ''; + print ''; print ''.$langs->trans('Bank'); print ' ('.$langs->trans("ChequeBank").')'; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 8b0a051e0b0..e0b8fca05e7 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -57,7 +57,7 @@ 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.prenom, d.nom, d.login, d.societe, d.datefin,"; + $sql = "SELECT d.rowid, d.prenom as firstname, d.nom as lastname, d.login, d.societe, d.datefin,"; $sql.= " d.adresse, d.cp, d.ville, d.naiss, d.email, d.photo,"; $sql.= " t.libelle as type,"; $sql.= " p.libelle as pays"; @@ -81,8 +81,8 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // List of values to scan for a replacement $substitutionarray = array ( - '%PRENOM%'=>$objp->prenom, - '%NOM%'=>$objp->nom, + '%PRENOM%'=>$objp->firstname, + '%NOM%'=>$objp->lastname, '%LOGIN%'=>$objp->login, '%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/", '%SOCIETE%'=>$objp->societe, diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 924c08dee25..3322e573d78 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -509,8 +509,10 @@ class Adherent extends CommonObject if ($result >= 0) { $luser->civilite_id=$this->civilite_id; - $luser->prenom=$this->prenom; - $luser->nom=$this->nom; + $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; @@ -1000,19 +1002,19 @@ class Adherent extends CommonObject $this->ref = $obj->rowid; $this->id = $obj->rowid; $this->civilite_id = $obj->civilite; - $this->prenom = $obj->firstname; + $this->prenom = $obj->firstname; // deprecated $this->firstname = $obj->firstname; - $this->nom = $obj->lastname; + $this->nom = $obj->lastname; // deprecated $this->lastname = $obj->lastname; $this->login = $obj->login; $this->pass = $obj->pass; $this->societe = $obj->societe; $this->fk_soc = $obj->fk_soc; - $this->adresse = $obj->address; // TODO deprecated + $this->adresse = $obj->address; // deprecated $this->address = $obj->address; - $this->cp = $obj->zip; // TODO deprecated + $this->cp = $obj->zip; // deprecated $this->zip = $obj->zip; - $this->ville = $obj->town; // TODO deprecated + $this->ville = $obj->town; // deprecated $this->town = $obj->town; $this->state_id = $obj->fk_departement; @@ -1427,7 +1429,7 @@ class Adherent extends CommonObject { $mdpass=dol_hash($this->pass); $htpass=crypt($this->pass,makesalt()); - $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".$this->prenom." ".$this->nom."\",\"".$this->email."\",\"".$this->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; + $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".$this->firstname." ".$this->lastname."\",\"".$this->email."\",\"".$this->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; $mydb=getDoliDBInstance('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB,ADHERENT_SPIP_PORT); @@ -1677,44 +1679,6 @@ class Adherent extends CommonObject } } - /** - * Return full name (civility+' '+name+' '+lastname) - * - * @param Translate $langs Language object for translation of civility - * @param int $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname - * @return string String with full name - */ - function getFullName($langs,$option=0,$nameorder=-1) - { - global $conf; - - $ret=''; - if ($option && $this->civilite_id) - { - if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; - else $ret.=$this->civilite_id.' '; - } - - // If order not defined, we use the setup - if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION); - - if ($nameorder) - { - if ($this->prenom) $ret.=$this->prenom; - if ($this->prenom && $this->nom) $ret.=' '; - if ($this->nom) $ret.=$this->nom; - } - else - { - if ($this->nom) $ret.=$this->nom; - if ($this->prenom && $this->nom) $ret.=' '; - if ($this->prenom) $ret.=$this->prenom; - } - return trim($ret); - } - - /** * Return label of a civility of a contact * @@ -1983,8 +1947,8 @@ class Adherent extends CommonObject $this->id=0; $this->specimen=1; $this->civilite_id = 0; - $this->nom = 'DOLIBARR'; - $this->prenom = 'SPECIMEN'; + $this->lastname = 'DOLIBARR'; + $this->firstname = 'SPECIMEN'; $this->login='dolibspec'; $this->pass='dolibspec'; $this->societe = 'Societe ABC'; diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index d7ddc80c463..ee05be2e5ba 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -64,7 +64,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu if ($msg) print $msg.'
'; // Liste des cotisations -$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, 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,"; @@ -123,7 +123,9 @@ if ($result) $cotisation->ref=$objp->crowid; $cotisation->id=$objp->crowid; - $adherent->ref=trim($objp->prenom.' '.$objp->nom); + $adherent->lastname=$objp->lastname; + $adherent->firstname=$objp->firstname; + $adherent->ref=$adherent->getFullName($langs); $adherent->id=$objp->rowid; $adherent->login=$objp->login; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index b71ba3dd48b..2e83fa53e25 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -172,11 +172,11 @@ if ($id > 0) print ''; // Nom - print ''.$langs->trans("Lastname").''.$member->nom.' '; + print ''.$langs->trans("Lastname").''.$member->lastname.' '; print ''; // Prenom - print ''.$langs->trans("Firstname").''.$member->prenom.' '; + print ''.$langs->trans("Firstname").''.$member->firstname.' '; print ''; // Status diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index eeb716938ca..950967b4eb4 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -137,7 +137,7 @@ if ($_POST['action'] == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch($_POST["socid"]); $error++; - $errmsg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'
'; + $errmsg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'
'; } } @@ -223,8 +223,10 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->adhe // Change values $object->civilite_id = trim($_POST["civilite_id"]); - $object->prenom = trim($_POST["prenom"]); - $object->nom = trim($_POST["nom"]); + $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"]); @@ -380,8 +382,10 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer) $socid=$_POST["socid"]; $object->civilite_id = $civilite_id; - $object->prenom = $prenom; - $object->nom = $nom; + $object->prenom = $prenom; // deprecated + $object->nom = $nom; // deprecated + $object->firstname = $prenom; + $object->lastname = $nom; $object->societe = $societe; $object->adresse = $address; // deprecated $object->address = $address; @@ -692,11 +696,11 @@ if ($action == 'create') print ''; // Lastname - print ''.$langs->trans("Lastname").'nom).'" size="40">'; + print ''.$langs->trans("Lastname").'lastname).'" size="40">'; print ''; // Firstname - print ''.$langs->trans("Firstname").'prenom).'">'; + print ''.$langs->trans("Firstname").'firstname).'">'; print ''; // Password @@ -923,11 +927,11 @@ if ($action == 'edit') print ''; // Name - print ''.$langs->trans("Lastname").'nom).'">'; + print ''.$langs->trans("Lastname").'lastname).'">'; print ''; // Firstname - print ''.$langs->trans("Firstname").'prenom).'">'; + print ''.$langs->trans("Firstname").'firstname).'">'; print ''; // Password @@ -1074,9 +1078,9 @@ if ($rowid && $action != 'edit') { // Full firstname and name separated with a dot : firstname.name include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); - $login=dol_buildlogin($object->nom,$object->prenom); + $login=dol_buildlogin($object->lastname,$object->firstname); } - if (empty($login)) $login=strtolower(substr($object->prenom, 0, 4)) . strtolower(substr($object->nom, 0, 4)); + if (empty($login)) $login=strtolower(substr($object->firstname, 0, 4)) . strtolower(substr($object->lastname, 0, 4)); // Create a form array $formquestion=array( @@ -1246,11 +1250,11 @@ if ($rowid && $action != 'edit') print ''; // Name - print ''.$langs->trans("Lastname").''.$object->nom.' '; + print ''.$langs->trans("Lastname").''.$object->lastname.' '; print ''; // Firstname - print ''.$langs->trans("Firstname").''.$object->prenom.' '; + print ''.$langs->trans("Firstname").''.$object->firstname.' '; // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 1f04032179a..dc3d8f3c689 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -203,7 +203,7 @@ $var=true; */ $max=5; -$sql = "SELECT a.rowid, a.statut, a.nom, a.prenom,"; +$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,"; $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"; @@ -229,8 +229,8 @@ if ($resql) $obj = $db->fetch_object($resql); print ""; $staticmember->id=$obj->rowid; - $staticmember->nom=$obj->nom; - $staticmember->prenom=$obj->prenom; + $staticmember->lastname=$obj->lastname; + $staticmember->firstname=$obj->firstname; $staticmember->ref=$staticmember->getFullName($langs); $statictype->id=$obj->typeid; $statictype->libelle=$obj->libelle; @@ -283,8 +283,8 @@ if ($resql) $subscriptionstatic->id=$obj->cid; $subscriptionstatic->ref=$obj->cid; $staticmember->id=$obj->rowid; - $staticmember->nom=$obj->nom; - $staticmember->prenom=$obj->prenom; + $staticmember->lastname=$obj->lastname; + $staticmember->firstname=$obj->firstname; $staticmember->ref=$staticmember->getFullName($langs); print ''.$subscriptionstatic->getNomUrl(1).''; print ''.$staticmember->getNomUrl(1,24,'subscription').''; diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 39a00c6444e..5e3456c2cfd 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -109,11 +109,11 @@ print $form->showrefnav($adh,'id'); print ''; // Nom -print ''.$langs->trans("Lastname").''.$adh->nom.' '; +print ''.$langs->trans("Lastname").''.$adh->lastname.' '; print ''; // Prenom -print ''.$langs->trans("Firstname").''.$adh->prenom.' '; +print ''.$langs->trans("Firstname").''.$adh->firstname.' '; print ''; // Login diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 625ab0355b3..a88056930b7 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -79,7 +79,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhé $now=dol_now(); -$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, "; +$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as name, 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"; @@ -258,8 +258,8 @@ if ($resql) // Nom $var=!$var; print ""; - $memberstatic->nom=$objp->nom; - $memberstatic->prenom=$objp->prenom; + $memberstatic->lastname=$objp->lastname; + $memberstatic->firstname=$objp->firstname; if ($objp->societe != '') { print "rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."\n"; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index a5a285da341..7c36b2414aa 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -120,11 +120,11 @@ if ($id) print ''; // Lastname - print ''.$langs->trans("Lastname").''.$adh->nom.' '; + print ''.$langs->trans("Lastname").''.$adh->lastname.' '; print ''; // Firstname - print ''.$langs->trans("Firstname").''.$adh->prenom.' '; + print ''.$langs->trans("Firstname").''.$adh->firstname.' '; // Status print ''.$langs->trans("Status").''.$adh->getLibStatut(4).''; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 470793fe1e5..ea15f11b1ed 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -338,7 +338,7 @@ if ($rowid > 0) $membertypestatic=new AdherentType($db); - $sql = "SELECT d.rowid, d.login, d.prenom, d.nom, 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"; @@ -486,17 +486,19 @@ if ($rowid > 0) $datefin=$db->jdate($objp->datefin); $adh=new Adherent($db); + $adh->lastname=$objp->lastname; + $adh->firstname=$objp->firstname; // Nom $var=!$var; print ''; if ($objp->societe != '') { - print ''.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom,12).' / '.dol_trunc($objp->societe,12).''."\n"; + print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).''."\n"; } else { - print ''.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom).''."\n"; + print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).''."\n"; } // Login @@ -627,7 +629,7 @@ if ($rowid > 0) print ""; print ''; - + print '
   '; print '
'; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 31756a2c67f..144b3d02ca4 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Andre Cianfarani * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2011 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -73,7 +73,7 @@ if ($action == 'specimen') $commande->initAsSpecimen(); // Charge le modele - $dir = "/core/modules/commande/"; + $dir = "/core/modules/commande/doc/"; $file = "pdf_".$modele.".modules.php"; $file = dol_buildpath($dir.$file); if (file_exists($file)) @@ -375,98 +375,119 @@ print "\n"; clearstatcache(); +$var=true; foreach ($conf->file->dol_document_root as $dirroot) { - $dir = $dirroot . "/core/modules/commande/"; + foreach (array('','/doc') as $valdir) + { + $dir = $dirroot . "/core/modules/commande".$valdir; - if (is_dir($dir)) - { - $handle = opendir($dir); - if (is_resource($handle)) - { - $var=true; - 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); + if (is_dir($dir)) + { + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); - $var=!$var; - print "\n "; - print "$name"; - print "\n \n"; - require_once($dir.$file); - $module = new $classname($db); - print $module->description; - print "\n"; - - // Activated - print "\n"; - if (in_array($name, $def)) - { - //if ($conf->global->COMMANDE_ADDON_PDF != "$name") - //{ - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Activated"),'switch_on'); - print ''; - //} - //else - //{ - // print img_picto($langs->trans("Activated"),'switch_on'); - //} - } - else - { - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Disabled"),'switch_off'); - print ''; - } - print ""; - - // Defaut - print ""; - if ($conf->global->COMMANDE_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Yes"),'on'); - } - else - { - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("No"),'off'); - print ''; - } - print ''; - - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - if ($module->type == 'pdf') + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) { - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + if (file_exists($dir.'/'.$file)) + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); + + require_once($dir.'/'.$file); + $module = new $classname($db); + + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + + if ($modulequalified) + { + $var = !$var; + print ''; + print (empty($module->name)?$name:$module->name); + print "\n"; + if (method_exists($module,'info')) print $module->info($langs); + else print $module->description; + print ''; + + // Active + if (in_array($name, $def)) + { + print ''."\n"; + print ''; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; + print ''; + } + else + { + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print ""; + } + + // Defaut + print ""; + if ($conf->global->PROPALE_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + if ($module->type == 'pdf') + { + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + //$htmltooltip.='
'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); + //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + + + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print ''; + + // Preview + print ''; + if ($module->type == 'pdf') + { + print ''.img_object($langs->trans("Preview"),'bill').''; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"),'generic'); + } + print ''; + + print "\n"; + } + } } - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - //$htmltooltip.='
'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); - //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); - - print ''; - print $form->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'order').''; - print ''; - - print "\n"; - } - } - closedir($handle); - } - } + } + } + } + } } print ''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 9c075a36cd7..c45ce72c04d 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -353,7 +353,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') // Logo $var=!$var; print ''.$langs->trans("Logo").' (png,jpg)'; - print ''; if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT c.libelle as nom, sum(s.amount) as amount"; + $sql = "SELECT c.libelle as nom, sum(cs.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; - $sql.= " WHERE s.fk_type = c.id"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND c.deductible = 0"; - if ($date_start && $date_end) $sql.= " AND s.date_ech >= '".$db->idate($date_start)."' AND s.date_ech <= '".$db->idate($date_end)."'"; + if ($date_start && $date_end) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } else { $sql = "SELECT c.libelle as nom, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = s.rowid"; - $sql.= " AND s.fk_type = c.id"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; $sql.= " AND c.deductible = 0"; if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle"; dol_syslog("get social contributions deductible=0 sql=".$sql); @@ -414,26 +414,26 @@ print ''; if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT c.libelle as nom, sum(s.amount) as amount"; + $sql = "SELECT c.libelle as nom, sum(cs.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; - $sql.= " WHERE s.fk_type = c.id"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND c.deductible = 1"; - if ($date_start && $date_end) $sql.= " AND s.date_ech >= '".$db->idate($date_start)."' AND s.date_ech <= '".$db->idate($date_end)."'"; - $sql.= " AND s.entity = ".$conf->entity; + if ($date_start && $date_end) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; + $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle DESC"; } else { $sql = "SELECT c.libelle as nom, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql .= " WHERE p.fk_charge = s.rowid"; - $sql.= " AND s.fk_type = c.id"; + $sql .= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; $sql.= " AND c.deductible = 1"; if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle"; } diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index ed738e9864b..db4adcd63fc 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -346,23 +346,23 @@ $subtotal_ht = 0; $subtotal_ttc = 0; if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT c.libelle as nom, date_format(s.date_ech,'%Y-%m') as dm, sum(s.amount) as amount_ht, sum(s.amount) as amount_ttc"; + $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount_ht, sum(cs.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; - $sql.= " WHERE s.fk_type = c.id"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND c.deductible = 0"; } else { $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount_ht, sum(p.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = s.rowid"; - $sql.= " AND s.fk_type = c.id"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; $sql.= " AND c.deductible = 0"; } -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, dm"; dol_syslog("get social contributions deductible=0 sql=".$sql); @@ -403,13 +403,13 @@ else { $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount_ht, sum(p.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = s.rowid"; - $sql.= " AND s.fk_type = c.id"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; $sql.= " AND c.deductible = 1"; } -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, dm"; dol_syslog("get social contributions paid deductible=1 sql=".$sql); diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index e017add6c9b..e674b07026d 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -320,10 +320,10 @@ if ($chid > 0) $sql.= "c.libelle as paiement_type"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c "; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " WHERE p.fk_charge = ".$chid; - $sql.= " AND p.fk_charge = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND p.fk_charge = cs.rowid"; + $sql.= " AND cs.entity = ".$conf->entity; $sql.= " AND p.fk_typepaiement = c.id"; $sql.= " ORDER BY dp DESC"; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 398e06e73d6..e70f23066b0 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -40,7 +40,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; $limit = $conf->liste_limit; -if (! $sortfield) $sortfield="s.date_ech"; +if (! $sortfield) $sortfield="cs.date_ech"; if (! $sortorder) $sortorder="DESC"; $year=$_GET["year"]; @@ -53,7 +53,7 @@ if (empty($_REQUEST['typeid'])) foreach($filterarray as $val) { $part=explode(':',$val); - if ($part[0] == 's.fk_type') $typeid=$part[1]; + if ($part[0] == 'cs.fk_type') $typeid=$part[1]; } } else @@ -71,21 +71,21 @@ llxHeader(); $form = new Form($db); -$sql = "SELECT s.rowid as id, s.fk_type as type, "; -$sql.= " s.amount, s.date_ech, s.libelle, s.paye, s.periode,"; +$sql = "SELECT cs.rowid as id, cs.fk_type as type, "; +$sql.= " cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode,"; $sql.= " c.libelle as type_lib"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; -$sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; -$sql.= " WHERE s.fk_type = c.id"; -$sql.= " AND s.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND s.libelle like '%".GETPOST("search_label")."%'"; +$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; +$sql.= " WHERE cs.fk_type = c.id"; +$sql.= " AND cs.entity = ".$conf->entity; +if (GETPOST("search_label")) $sql.=" AND cs.libelle LIKE '%".GETPOST("search_label")."%'"; if ($year > 0) { $sql .= " AND ("; // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire - $sql .= " (s.periode is not null and date_format(s.periode, '%Y') = '".$year."') "; - $sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = '".$year."')"; + $sql .= " (cs.periode IS NOT NULL AND date_format(cs.periode, '%Y') = '".$year."') "; + $sql .= "OR (cs.periode IS NULL AND date_format(cs.date_ech, '%Y') = '".$year."')"; $sql .= ")"; } if ($filtre) { @@ -93,7 +93,7 @@ if ($filtre) { $sql .= " AND ".$filtre; } if ($typeid) { - $sql .= " AND s.fk_type=".$typeid; + $sql .= " AND cs.fk_type=".$typeid; } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1,$offset); @@ -142,12 +142,12 @@ if ($resql) print ""; print_liste_field_titre($langs->trans("Ref"),"index.php","id","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),"index.php","s.libelle","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),"index.php","cs.libelle","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),"index.php","type","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PeriodEndDate"),"index.php","periode","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Amount"),"index.php","s.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateDue"),"index.php","s.date_ech","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),"index.php","s.paye","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Amount"),"index.php","cs.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateDue"),"index.php","cs.date_ech","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),"index.php","cs.paye","",$param,'align="right"',$sortfield,$sortorder); print "\n"; print ''; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index 3154c5de299..70eb871b5c8 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -67,7 +67,7 @@ function tva_coll($db,$y,$q) $sql.= ", ".MAIN_DB_PREFIX."facturedet as d" ; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.fk_statut in (1,2)"; $sql.= " AND f.rowid = d.fk_facture "; $sql.= " AND date_format(f.datef,'%Y') = '".$y."'"; @@ -134,7 +134,7 @@ function tva_paye($db, $y,$q) $sql.= ", ".MAIN_DB_PREFIX."facture_fourn_det as d" ; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.fk_statut = 1 "; $sql.= " AND f.rowid = d.fk_facture_fourn "; $sql.= " AND date_format(f.datef,'%Y') = '".$y."'"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d3c8781aa7d..76c8dda3775 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -900,45 +900,6 @@ class Contact extends CommonObject return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : ''; } - - /** - * Return full name (civility+' '+name+' '+lastname) - * - * @param Translate $langs Language object for translation of civility - * @param string $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname - * @return string String with full name - */ - function getFullName($langs,$option=0,$nameorder=-1) - { - global $conf; - - $ret=''; - if ($option && $this->civilite_id) - { - if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; - else $ret.=$this->civilite_id.' '; - } - - // If order not defined, we use the setup - if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION); - - if ($nameorder) - { - if ($this->firstname) $ret.=$this->firstname; - if ($this->firstname && $this->name) $ret.=' '; - if ($this->name) $ret.=$this->name; - } - else - { - if ($this->name) $ret.=$this->name; - if ($this->firstname && $this->name) $ret.=' '; - if ($this->firstname) $ret.=$this->firstname; - } - return trim($ret); - } - - /** * Retourne le libelle du statut du contact * diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a495a3e7323..851fa959541 100755 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -113,8 +113,8 @@ llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Modu $form=new Form($db); -$sql = "SELECT s.rowid as socid, s.nom,"; -$sql.= " p.rowid as cidp, p.name, p.firstname, p.poste, p.email,"; +$sql = "SELECT s.rowid as socid, s.nom as name,"; +$sql.= " p.rowid as cidp, p.name as lastname, p.firstname, p.poste, p.email,"; $sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,"; $sql.= " cp.code as pays_code"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; @@ -338,7 +338,7 @@ if ($result) // Name print ''; - print '\n"; + print '\n"; print ''; // Delivery date planed @@ -1159,7 +1159,7 @@ else $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - + $label = ( ! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; } else diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index 34a3a03068e..467e8683527 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -298,14 +298,14 @@ if ($id > 0) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index ee1a2d94f88..54046659566 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -32,7 +32,7 @@ if (! defined('DOL_VERSION')) define('DOL_VERSION','3.2.0-alpha'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z) if (! defined('EURO')) define('EURO',chr(128)); -// Definition des constantes syslog +// Define syslog constants if (! defined('LOG_DEBUG')) { if (function_exists("define_syslog_variables")) diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index d384a3bade6..20117e34e8c 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -125,7 +125,7 @@ class Fournisseur extends Societe $clause = "AND"; } $sql.= " ".$clause." s.fournisseur = 1"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $resql=$this->db->query($sql); if ($resql) @@ -188,7 +188,7 @@ class Fournisseur extends Societe $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$this->user->rights->societe->client->voir && !$this->user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fournisseur = 1"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (!$this->user->rights->societe->client->voir && !$this->user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$this->user->id; $resql=$this->db->query($sql); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 9427bb327a1..75f50eee054 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -331,7 +331,7 @@ class ProductFournisseur extends Product $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " ON pfp.fk_soc = s.rowid"; - $sql.= " WHERE s.entity = ".$conf->entity; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND pfp.fk_product = ".$prodid; $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price"; @@ -408,7 +408,7 @@ class ProductFournisseur extends Product $sql.= " pfp.rowid as product_fourn_price_id, pfp.ref_fourn,"; $sql.= " pfp.price, pfp.quantity, pfp.unitprice"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; - $sql.= " WHERE s.entity = ".$conf->entity; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND pfp.fk_product = ".$prodid; $sql.= " AND pfp.fk_soc = s.rowid"; $sql.= " ORDER BY pfp.unitprice"; diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 5a80d98ec7d..10fd92f18c4 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -130,7 +130,7 @@ dol_htmloutput_mesg($mesg); if ($id > 0 || ! empty($ref)) { $langs->trans("OrderCard"); - + if ($object->fetch($id, $ref) > 0) { $soc = new Societe($db); @@ -303,14 +303,14 @@ if ($id > 0 || ! empty($ref)) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 0c182a7a47d..b30dd309167 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1444,7 +1444,8 @@ if ($id > 0 || ! empty($ref)) $genallowed=$user->rights->fournisseur->commande->creer; $delallowed=$user->rights->fournisseur->commande->supprimer; - $somethingshown=$formfile->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); + print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$soc->default_lang); + $somethingshown=$formfile->numoffiles; $object=$object; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 29377968798..daa4f915f87 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -77,7 +77,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE cf.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND cf.entity = ".$conf->entity; if ($user->societe_id) $sql.=' AND cf.fk_soc = '.$user->societe_id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " GROUP BY cf.fk_statut"; @@ -223,8 +223,8 @@ if ($resql) print ""; print ''; print "\n"; diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index 57338dc67e9..3e182374e84 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -81,7 +81,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX $sql.= ")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid"; $sql.= " WHERE cf.fk_soc = s.rowid "; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND cf.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($sref) { @@ -101,7 +101,7 @@ if ($sttc) } if ($sall) { - $sql.= " AND (cf.ref like '%".$db->escape($sall)."%' OR cf.note like '%".$db->escape($sall)."%')"; + $sql.= " AND (cf.ref LIKE '%".$db->escape($sall)."%' OR cf.note LIKE '%".$db->escape($sall)."%')"; } if ($socid) $sql.= " AND s.rowid = ".$socid; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 2b5ccbf7cc3..c10bf7bca87 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -299,14 +299,14 @@ if ($id > 0) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 92eb804f76a..fde9f1a237b 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1789,7 +1789,8 @@ else $delallowed=$user->rights->fournisseur->facture->supprimer; print '
'; - $somethingshown=$formfile->show_documents('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); + print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$societe->default_lang); + $somethingshown=$formfile->numoffiles; /* * Linked object block diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index e8b8ab122a9..8169429b8cb 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -235,7 +235,7 @@ $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " AND s.fournisseur = 1"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql .= " AND s.rowid = ".$socid; $sql.= " ORDER BY s.tms DESC"; diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 9c89c441d06..71da3a75c5b 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -74,7 +74,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st"; if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_fournisseur as cf"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_stcomm = st.id AND s.fournisseur = 1"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if ($search_categ) $sql.= " AND s.rowid = cf.fk_societe"; // Join for the needed table to filter by categ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql .= " AND s.rowid = ".$socid; diff --git a/htdocs/index.php b/htdocs/index.php index 9804a46d7e0..17968aa962b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/doctemplates/orders/template_order.odt b/htdocs/install/doctemplates/orders/template_order.odt new file mode 100644 index 00000000000..d73f957297f Binary files /dev/null and b/htdocs/install/doctemplates/orders/template_order.odt differ diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 0bd22e41ad2..bdc9868e3ee 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -167,7 +167,7 @@ if (! $error) $db=getDoliDBInstance($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest,$_POST["db_port"]); dol_syslog("databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected, LOG_DEBUG); - print "databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected; + //print "databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected; if (empty($_POST["db_create_database"]) && $db->connected && ! $db->database_selected) { @@ -467,7 +467,8 @@ if (! $error && $db->connected && $action == "set") else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' - || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS') + || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' + || $db->errno() == 'DB_ERROR_USER_ALREADY_EXISTS') { dolibarr_install_syslog("etape1: User already exists"); print ''; - print '"; + print '"; } } diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 8292268d717..8fe90ac479f 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -277,7 +277,7 @@ if (! empty($force_install_message)) { while (($file = readdir($handle))!==false) { - if (is_readable($dir."/".$file) && preg_match('/^(.*)\.class\.php/i',$file,$reg)) + if (is_readable($dir."/".$file) && preg_match('/^(.*)\.class\.php$/i',$file,$reg)) { $type=$reg[1]; $class='DoliDB'.ucfirst($type); diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index dddff4a1298..fafb001bd18 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -18,9 +18,10 @@ * along with this program. If not, see . */ -/** \file htdocs/install/inc.php - * \ingroup core - * \brief File that define environment for install pages +/** + * \file htdocs/install/inc.php + * \ingroup core + * \brief File that define environment for support pages */ define('DOL_VERSION','3.2.0-alpha'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z) @@ -53,25 +54,25 @@ if (isset($_SERVER["DOCUMENT_URI"]) && $_SERVER["DOCUMENT_URI"]) } -// Definition des constantes syslog -if (function_exists("define_syslog_variables")) +// Define syslog constants +if (! defined('LOG_DEBUG')) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) + if (function_exists("define_syslog_variables")) { define_syslog_variables(); // Deprecated since php 5.3.0, syslog variables no longer need to be initialized } -} -else -{ - // Pour PHP sans syslog (comme sous Windows) - define('LOG_EMERG',0); - define('LOG_ALERT',1); - define('LOG_CRIT',2); - define('LOG_ERR',3); - define('LOG_WARNING',4); - define('LOG_NOTICE',5); - define('LOG_INFO',6); - define('LOG_DEBUG',7); + else + { + // Pour PHP sans syslog (comme sous Windows) + define('LOG_EMERG',0); + define('LOG_ALERT',1); + define('LOG_CRIT',2); + define('LOG_ERR',3); + define('LOG_WARNING',4); + define('LOG_NOTICE',5); + define('LOG_INFO',6); + define('LOG_DEBUG',7); + } } $includeconferror=''; diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index 0de2be26be0..918606565da 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -182,3 +182,4 @@ update llx_cotisation set fk_bank = null where fk_bank not in (select rowid from insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (12, 'Cotisation foncière des entreprises', 0, 1, 'TAXCFE', '1'); insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (13, 'Cotisation sur la valeur ajoutée des entreprises', 0, 1, 'TAXCVAE', '1'); +ALTER TABLE llx_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; diff --git a/htdocs/install/mysql/tables/llx_events.sql b/htdocs/install/mysql/tables/llx_events.sql index 7edd4174538..7425a4e5e68 100644 --- a/htdocs/install/mysql/tables/llx_events.sql +++ b/htdocs/install/mysql/tables/llx_events.sql @@ -18,7 +18,7 @@ -- ======================================================================== -- This table logs all dolibarr security events -- Content of this table is not managed by users but by Dolibarr --- trigger interface_all_LogEvent. +-- trigger interface_20_all_Logevents. -- ======================================================================== create table llx_events diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql index 9fb7d68c757..3fd4bdcbce2 100644 --- a/htdocs/install/mysql/tables/llx_paiement.sql +++ b/htdocs/install/mysql/tables/llx_paiement.sql @@ -1,6 +1,7 @@ -- =================================================================== --- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2012 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -24,16 +25,17 @@ create table llx_paiement ( rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, -- date de creation + entity integer DEFAULT 1 NOT NULL, -- Multi company id + datec datetime, -- date de creation tms timestamp, - datep datetime, -- payment date + datep datetime, -- payment date amount double(24,8) DEFAULT 0, fk_paiement integer NOT NULL, num_paiement varchar(50), note text, fk_bank integer NOT NULL DEFAULT 0, - fk_user_creat integer, -- utilisateur qui a cree l'info - fk_user_modif integer, -- utilisateur qui a modifie l'info + fk_user_creat integer, -- utilisateur qui a cree l'info + fk_user_modif integer, -- utilisateur qui a modifie l'info statut smallint DEFAULT 0 NOT NULL, fk_export_compta integer DEFAULT 0 NOT NULL diff --git a/htdocs/langs/ar_SA/admin.lang b/htdocs/langs/ar_SA/admin.lang index 1b32b0a7339..ac7b70ebf1c 100644 --- a/htdocs/langs/ar_SA/admin.lang +++ b/htdocs/langs/ar_SA/admin.lang @@ -1165,8 +1165,6 @@ NoteOnPathLocation=لاحظ أن الملكية الفكرية الخاصة بك YouCanDownloadFreeDatFileTo=يمكنك تحميل نسخة تجريبية مجانية من GeoIP ملف Maxmind البلاد في ٪ s. YouCanDownloadAdvancedDatFileTo=كما يمكنك تحميل نسخة كاملة أكثر من ذلك ، مع التحديثات ، من GeoIP ملف Maxmind البلاد في ٪ s. TestGeoIPResult=اختبار لتحويل الملكية الفكرية --> البلاد -NumberWordsSetup=NumberWords الإعداد وحدة -DescNumberWords=هذا يوفر وظائف وحدة لتحويل المبلغ أو عدد الأحرف في الكامل. وسيكون أيضا استبدال تكرارات السلسلة التالية __TOTAL_TTC_WORDS__ ، __TOTAL_HT_WORDS__ أو مدفوع من قبل __TOTAL_VAT_WORDS__ الإجمالي. الضرائب ، ومجموع صافي الضرائب ، أو مجموع ضريبة القيمة المضافة في جميع textes التي تستخدمها (النص الحرة على الفواتير ،...) ProjectsNumberingModules=مشاريع وحدة الترقيم ProjectsSetup=مشروع إعداد وحدة ProjectsModelModule=المشروع نموذج التقرير وثيقة diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 4dd4d05bcf6..e73593337ba 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -862,6 +862,7 @@ MAIN_PROXY_USER=Login del servidor proxy MAIN_PROXY_PASS=Contrasenya del servidor proxy DefineHereComplementaryAttributes=Definiu aquí la llista d'atributs addicionals, no disponibles a estàndard, i que vol gestionar per %s. ExtraFields=Atributs addicionals +ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte. SendingMailSetup=Configuració de l'enviament per mail SendmailOptionNotComplete=Atenció, en alguns sistemes Linux, amb aquest mètode d'enviament, per poder enviar mails en nom seu, la configuració de sendmail ha de contenir l'opció -ba (paràmetre mail.force_extra_parameters a l'arxiu php.ini). Si alguns dels seus destinataris no reben els seus missatges, proveu de modificar aquest paràmetre PHP amb mail.force_extra_parameters =-ba . ##### Module password generation @@ -1298,9 +1299,6 @@ NoteOnPathLocation=Tingueu en compte que aquest arxiu ha d'estar en una carpeta YouCanDownloadFreeDatFileTo=Pot descarregar-se una versió demo gratuïta de l'arxiu de països Maxmind GeoIP a l'adreça %s. YouCanDownloadAdvancedDatFileTo=També pot descarregar-se una versió més completa de l'arxiu de països Maxmind GeoIP a l'adreça %s. TestGeoIPResult=Test de conversió IP -> País -##### NumberWords ##### -NumberWordsSetup=Configuració del mòdul NumberWords -DescNumberWords=Aquest mòdul us ofereix convertir números o imports en qualsevol cadena. També realitza la substitució de les variables genèriques __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ o __TOTAL_VAT_WORDS__ pel valor d'imports totals, base o de l'IVA, en cadena dins el text al qual fan referència (text lliure de factures, ...) ##### Projects ##### ProjectsNumberingModules=Mòdul de numeració per a les referències dels projectes ProjectsSetup=Configuració del mòdul Projectes diff --git a/htdocs/langs/ca_ES/agenda.lang b/htdocs/langs/ca_ES/agenda.lang index c4ab461f131..53c89b3be21 100644 --- a/htdocs/langs/ca_ES/agenda.lang +++ b/htdocs/langs/ca_ES/agenda.lang @@ -6,6 +6,7 @@ Agenda=Agenda Agendas=Agendes Calendar=Calendari Calendars=Calendaris +LocalAgenda=Calendari local AffectedTo=Assignada a DoneBy=Realitzat per Events=Esdeveniments @@ -29,8 +30,8 @@ ViewDay=Vista diària ViewWeek=Vista setmanal ViewWithPredefinedFilters=Veure amb els filtres predefinits AutoActions=Inclusió automàtica a l'agenda -AgendaAutoActionDesc=Definir els esdeveniments aquí per què voleu que Dolibarr creu automàticament una acció en l'ordre del dia. Si no està marcada (per defecte), es podran crear manualment. -AgendaSetupOtherDesc=Aquesta pàgina us permet configurar altres paràmetres del mòdul agenda. +AgendaAutoActionDesc=Indiqueu en aquesta pestanya els esdeveniments per els que desitja que Dolibarr creu automàticament una acció a l'agenda. Si no es marca cap cas (per defecte), només les accions manuals s'han d'incloure en l'agenda. +AgendaSetupOtherDesc=Aquesta pàgina permet configurar algunes opcions que permeten exportar una vista de la seva agenda Dolibar a un calendari extern (thunderbird, google calendar, ...) AgendaExtSitesDesc=Aquesta pàgina permet configurar calendaris externs per a la seva visualització en l'agenda de Dolibarr. ActionsEvents=Esdeveniments per a què Dolibarr crei una acció de forma automàtica PropalValidatedInDolibarr=Pressupost %s validat diff --git a/htdocs/langs/ca_ES/companies.lang b/htdocs/langs/ca_ES/companies.lang index 8cc44a29fd2..3cdf9b80129 100644 --- a/htdocs/langs/ca_ES/companies.lang +++ b/htdocs/langs/ca_ES/companies.lang @@ -326,6 +326,7 @@ NoDolibarrAccess=Sense accés d'usuari ExportDataset_company_1=Tercers (empreses/institucions) i atributs ExportDataset_company_2=Contactes de tercers i atributs ImportDataset_company_1=Tercers (empreses/institucions) i atributs +ImportDataset_company_2=Contactes (tercers o lliures) i atributs PriceLevel=Nivell de preus DeliveriesAddress=Adreça(es) d'enviament DeliveryAddress=Adreça d'enviament diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang index dd2057d7bd2..8d4172aea62 100644 --- a/htdocs/langs/ca_ES/errors.lang +++ b/htdocs/langs/ca_ES/errors.lang @@ -51,6 +51,8 @@ ErrorPartialFile=Arxiu no rebut íntegrament pel servidor. ErrorNoTmpDir=Directori temporal de recepció %s inexistent ErrorUploadBlockedByAddon=Pujada bloquejada per un plugin PHP/Apache. ErrorFileSizeTooLarge=La mida del fitxer és massa gran. +ErrorSizeTooLongForIntType=Longitud del camp massa llarg per al tipus int (màxim %s xifres) +ErrorSizeTooLongForVarcharType=Longitud del camp massa llarg per al tipus cadena (màxim %s xifres) ErrorFieldCanNotContainSpecialCharacters=El camp %s no ha de contenir caràcters especials ErrorNoAccountancyModuleLoaded=Mòdul de comptabilitat no activat ErrorExportDuplicateProfil=El nom del perfil ja existeix per a aquest lot d'exportació @@ -65,6 +67,7 @@ ErrorPasswordsMustMatch=Les 2 contrasenyes indicades s'han de correspondre ErrorContactEMail=S'ha produït un error tècnic. Contacti amb l'administrador al e-mail %s, indicant el codi d'error %s en el seu missatge, o pot també adjuntar una còpia de pantalla d'aquesta pàgina. ErrorWrongValueForField=Valor incorrecte per al camp número %s (el valor '%s' no compleix amb la regla %s) ErrorFieldValueNotIn=Valor incorrecte per al camp nombre %s (el valor '%s' no es un valor en el camp %s de la taula %s) +ErrorFieldRefNotIn=Valor incorrecte per al camp nombre %s (el valor '%s' no és una referència existent en %s) ErrorsOnXLines=Errors a %s línies font ErrorFileIsInfectedWithAVirus=L'antivirus no ha pogut validar aquest arxiu (és probable que estigui infectat per un virus)! ErrorSpecialCharNotAllowedForField=Els caràcters especials no són admesos pel camp "%s" diff --git a/htdocs/langs/ca_ES/exports.lang b/htdocs/langs/ca_ES/exports.lang index fa400bc9296..68036fd6e36 100644 --- a/htdocs/langs/ca_ES/exports.lang +++ b/htdocs/langs/ca_ES/exports.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - ca_ES - exports +# Dolibarr language file - ca_ES - exports CHARSET=UTF-8 ExportsArea=Àrea exportació ImportArea=Àrea importació @@ -103,8 +103,12 @@ NbOfLinesImported=Nombre de línies correctament importades: %s. DataComeFromNoWhere=El valor a inserir no correspon a cap camp de l'arxiu origen. DataComeFromFileFieldNb=El valor a inserir es correspon al camp nombre <%s de l'arxiu origen. DataComeFromIdFoundFromRef=El valor donat per el camp %s de l'arxiu origen serà utilitzat per trobar el ID de l'objecte pare a fer servir (l'objecte %s amb la referència de l'arxiu origen ha d'existir a Dolibarr). +DataComeFromIdFoundFromCodeId=El codi del camp número %s de l'arxiu d'origen s'utilitzarà per trobar l'id de l'objecte pare a utilitzar (el codi de l'arxiu d'origen ha d'existir en el diccionari %s). Tingueu en compte que si coneix l'id, pot usar-lo en lloc del codi a l'arxiu d'origen. La importació funcionarà en els 2 casos. DataIsInsertedInto=Les dades de l'arxiu d'origen s'inseriran en el següent camp: DataIDSourceIsInsertedInto=L'ID de l'objecte pare trobat a partir de la dada origen, s'inserirà en el següent camp: +DataCodeIDSourceIsInsertedInto=L'id de la línia pare trobada a partir del codi, s'ha d'inserir en el següent camp: SourceRequired=Dades d'origen obligatòries SourceExample=Exemple de dades d'origen possibles -CSVFormatDesc=Arxiu amb format Valors separats per coma (.csv).
És un fitxer amb format de text en què els camps són separats pel caràcter [ %s ]. Si el separador es troba en el contingut d'un camp, el camp ha d'estar tancat per el caràcter [ %s ]. El caràcter d'escapament per a incloure un caràcter d'entorn en una dada és [ %s ]. \ No newline at end of file +ExampleAnyRefFoundIntoElement=Totes les referències trobades per als elements %s +ExampleAnyCodeOrIdFoundIntoDictionnary=Tots els codis (o id) trobats en el diccionari %s +CSVFormatDesc=Arxiu amb format Valors separats per coma (.csv).
És un fitxer amb format de text en què els camps són separats pel caràcter [ %s ]. Si el separador es troba en el contingut d'un camp, el camp ha d'estar tancat per el caràcter [ %s ]. El caràcter d'escapament per a incloure un caràcter d'entorn en una dada és [ %s ]. diff --git a/htdocs/langs/ca_ES/main.lang b/htdocs/langs/ca_ES/main.lang index 2dbaffd682c..fb34a2976a3 100644 --- a/htdocs/langs/ca_ES/main.lang +++ b/htdocs/langs/ca_ES/main.lang @@ -122,6 +122,8 @@ Modify=Modificar Edit=Editar Validate=Validar ToValidate=A validar +Block=Bloquejar +Unblock=Desbloquejar Save=Gravar SaveAs=Gravar com TestConnection=Provar la connexió diff --git a/htdocs/langs/da_DK/admin.lang b/htdocs/langs/da_DK/admin.lang index dcaa78a9b39..e91fe17bf91 100644 --- a/htdocs/langs/da_DK/admin.lang +++ b/htdocs/langs/da_DK/admin.lang @@ -1170,8 +1170,6 @@ NoteOnPathLocation=Bemærk, at din ip til land datafil skal være inde en mappe YouCanDownloadFreeDatFileTo=Du kan downloade en gratis demo version af Maxmind GeoIP land fil på %s. YouCanDownloadAdvancedDatFileTo=Du kan også downloade en mere komplet version, med opdateringer på den Maxmind GeoIP land fil på %s. TestGeoIPResult=Test af en konvertering IP -> land -NumberWordsSetup=NumberWords modul opsætning -DescNumberWords=Dette modul giver funktioner til at konvertere nummer eller beløb i fuld tegn. Det vil også erstatte den følgende streng begivenheder __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ eller __TOTAL_VAT_WORDS__ af den samlede incl. skat, alt efter skat, eller i alt beholder i alle Textes at bruge dem (fri tekst på fakturaer, ...) ProjectsNumberingModules=Projekter nummerering modul ProjectsSetup=Project modul opsætning ProjectsModelModule=Projekt rapport dokument model diff --git a/htdocs/langs/de_AT/admin.lang b/htdocs/langs/de_AT/admin.lang index 7f74d64af61..c3e5bd89519 100644 --- a/htdocs/langs/de_AT/admin.lang +++ b/htdocs/langs/de_AT/admin.lang @@ -1153,8 +1153,6 @@ NoteOnPathLocation=Bitte beachten Sie, dass Ihre IP-Länder-Datei in einem von P YouCanDownloadFreeDatFileTo=Eine kostenlose Demo-Version der Maxmind-GeoIP Datei finden Sie hier: %s YouCanDownloadAdvancedDatFileTo=Eine vollständigere Version mit Updates der Maxmind-GeoIP Datei können Sie hier herunterladen: %s TestGeoIPResult=Test einer Umwandlung IP -> Land -NumberWordsSetup=NumberWords Moduleinstellungen -DescNumberWords=Dieses Modul bietet Funktionen zur Konvertierung von Zahlen und Beträgen in formatierte Zeichenketten. Es ersetzt auch die folgende Zeichenfolgen __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ oder __TOTAL_VAT_WORDS__ durch 'Bruttosumme', 'Nettosumme' oder 'Steuersumme' in allen verwendeten Texten (freier Text auf Rechnungen, ...) ProjectsNumberingModules=Projektnumerierungsmodul ProjectsSetup=Projekteinstellungenmodul ProjectsModelModule=Projektvorlagenmodul diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang index 7f74d64af61..c3e5bd89519 100644 --- a/htdocs/langs/de_DE/admin.lang +++ b/htdocs/langs/de_DE/admin.lang @@ -1153,8 +1153,6 @@ NoteOnPathLocation=Bitte beachten Sie, dass Ihre IP-Länder-Datei in einem von P YouCanDownloadFreeDatFileTo=Eine kostenlose Demo-Version der Maxmind-GeoIP Datei finden Sie hier: %s YouCanDownloadAdvancedDatFileTo=Eine vollständigere Version mit Updates der Maxmind-GeoIP Datei können Sie hier herunterladen: %s TestGeoIPResult=Test einer Umwandlung IP -> Land -NumberWordsSetup=NumberWords Moduleinstellungen -DescNumberWords=Dieses Modul bietet Funktionen zur Konvertierung von Zahlen und Beträgen in formatierte Zeichenketten. Es ersetzt auch die folgende Zeichenfolgen __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ oder __TOTAL_VAT_WORDS__ durch 'Bruttosumme', 'Nettosumme' oder 'Steuersumme' in allen verwendeten Texten (freier Text auf Rechnungen, ...) ProjectsNumberingModules=Projektnumerierungsmodul ProjectsSetup=Projekteinstellungenmodul ProjectsModelModule=Projektvorlagenmodul diff --git a/htdocs/langs/el_GR/admin.lang b/htdocs/langs/el_GR/admin.lang index ae6f0ac3998..c1d0aa71999 100644 --- a/htdocs/langs/el_GR/admin.lang +++ b/htdocs/langs/el_GR/admin.lang @@ -1216,9 +1216,6 @@ NoteOnPathLocation=Note that your ip to country data file must be inside a direc YouCanDownloadFreeDatFileTo=You can download a free demo version of the Maxmind GeoIP country file at %s. YouCanDownloadAdvancedDatFileTo=You can also download a more complete version, with updates, of the Maxmind GeoIP country file at %s. TestGeoIPResult=Test of a conversion IP -> country -##### NumberWords ##### -NumberWordsSetup=NumberWords module setup -DescNumberWords=This module provide functions to convert number or amount in full characters. It will also replace the following string occurences __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ or __TOTAL_VAT_WORDS__ by total incl. tax, total net of tax, or total of vat into all textes that use them (free text on invoices, ...) ##### Projects ##### ProjectsNumberingModules=Projects numbering module ProjectsSetup=Project module setup diff --git a/htdocs/langs/el_GR/products.lang b/htdocs/langs/el_GR/products.lang index 05fd0b00727..5e679ead1a9 100644 --- a/htdocs/langs/el_GR/products.lang +++ b/htdocs/langs/el_GR/products.lang @@ -73,15 +73,12 @@ ContractStatusClosed=Κλειστό ContractStatusRunning=Ενεργό ContractStatusExpired=Ληγμένο ContractStatusOnHold=Ανενεργό -ContractStatusToRun=A mettre en service ContractNotRunning=Το Συμβόλαιο είναι Ανενεργό ErrorProductAlreadyExists=Ένα προϊόν με κωδικό %s υπάρχει ήδη. -ErrorProductBadRefOrLabel=Wrong value for reference or label. Suppliers=Προμηθευτές SupplierRef=Κωδ. Προμηθευτή ShowProduct=Εμφάνιση προϊόντων ShowService=Εμφάνιση Υπηρεσίας -ProductsAndServicesArea=Product and Services area ProductsArea=Περιοχή Προϊόντων ServicesArea=Περιοχή Υπηρεσιών AddToMyProposals=Προσθήκη στις Προτάσεις μου @@ -95,19 +92,15 @@ NoPhotoYet=Δεν υπάρχει φωτογραφία BuiingPrice=Τιμή Αγοράς SupplierCard=Κάρτα προμηθευτή CommercialCard=Εμπορική Κάρτα -AllWays=Path to find your product in stock NoCat=Το προϊόν σας, δεν ανήκει σε κάποια κατηγορία PrimaryWay=Κύρια διαδρομή DeleteFromCat=Αφαίρεση από την κατηγορία PriceRemoved=Η τιμή αφαιρέθηκε -BarCode=Barcode BarcodeType=τύπος Barcode SetDefaultBarcodeType=Ορισμός τύπου barcode BarcodeValue=ΤΙμή Barcode -GenbarcodeLocation=Bar code generation command line tool (used by phpbarcode engine for some bar code types) NoteNotVisibleOnBill=Σημείωση (μη ορατή σε τιμολόγια, προτάσεις...) CreateCopy=Δημιουργία Αντιγράφου -ServiceLimitedDuration=If product is a service with limited duration: MultiPricesAbility=Ενεργοποίηση πολυ-τιμών MultiPricesNumPrices=Αριθμός τιμής MultiPriceLevelsName=Κατηγορίες τιμών @@ -122,48 +115,21 @@ ProductToAddSearch=Εύρεση προϊόντως προς προσθήκη AddDel=Προσθήκη/Διαγραφή Quantity=Ποσότητα NoMatchFound=Δεν βρέθηκε κατάλληλη εγγραφή -ProductAssociationList=List of related products/services: name of product/service (quantity affected) -ErrorAssociationIsFatherOfThis=One of selected product is parent with current product DeleteProduct=Διαγραφή προϊόντος/υπηρεσίας -ConfirmDeleteProduct=Are you sure you want to delete this product/service? -ProductDeleted=Product/Service "%s" deleted from database. DeletePicture=Διαγραφή εικόνας ConfirmDeletePicture=Είστε σίγουροι ότι θέλετε να διαγράψετε την εικόνα; ExportDataset_produit_1=Προϊόντα ExportDataset_service_1=Υπηρεσίες ImportDataset_produit_1=Προϊόντα ImportDataset_service_1=Υπηρεσίες -DeleteProductLine=Delete product line -ConfirmDeleteProductLine=Are you sure you want to delete this product line? -NoProductMatching=No product/service match your criteria -MatchingProducts=Matching products/services -NoStockForThisProduct=No stock for this product NoStock=Χωρίς απόθεμα -Restock=Restock -ProductSpecial=Special -QtyMin=Quantity minimum -PriceQty=Price for this quantity -PriceQtyMin=Price quantity min. -NoPriceDefinedForThisSupplier=No price/qty defined for this supplier/product -NoSupplierPriceDefinedForThisProduct=No supplier price/qty defined for this product -RecordedProducts=Products recorded -RecordedProductsAndServices=Products/services recorded GenerateThumb=Δημιουργία μικρογραφίας -ProductCanvasAbility=Use special "canvas" addons ServiceNb=Υπηρεσία #%s -ListProductServiceByPopularity=List of products/services by popularity -ListProductByPopularity=List of products by popularity -ListServiceByPopularity=List of services by popularity Finished=Κατασκευασμένο Προϊόν RowMaterial=Πρώτη ύλη CloneProduct=Κλώνοποίηση προϊόντος ή υπηρεσίας -ConfirmCloneProduct=Are you sure you want to clone product or service %s ? -CloneContentProduct=Clone all main informations of product/service -ClonePricesProduct=Clone main informations and prices ProductIsUsed=Μεταχειρισμένο NewRefForClone=Ref. of new product/service CustomerPrices=Τιμές πελατών SuppliersPrices=Τιμές προμηθευτών -CustomCode=Custom code CountryOrigin=Χώρα προέλευσης -HiddenIntoCombo=Hidden into select lists diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 481128574c1..7e9a02610b4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -855,6 +855,7 @@ MAIN_PROXY_USER=Login to use the proxy server MAIN_PROXY_PASS=Password to use the proxy server DefineHereComplementaryAttributes=Define here all atributes, not already available by default, and that you want to be supported for %s. ExtraFields=Complementary attributes +ExtraFieldHasWrongValue=Attribut %s has a wrong value. SendingMailSetup=Setup of sendings by email SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must conatins option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba). PathToDocuments=Path to documents @@ -1289,9 +1290,6 @@ NoteOnPathLocation=Note that your ip to country data file must be inside a direc YouCanDownloadFreeDatFileTo=You can download a free demo version of the Maxmind GeoIP country file at %s. YouCanDownloadAdvancedDatFileTo=You can also download a more complete version, with updates, of the Maxmind GeoIP country file at %s. TestGeoIPResult=Test of a conversion IP -> country -##### NumberWords ##### -NumberWordsSetup=NumberWords module setup -DescNumberWords=This module provide functions to convert number or amount in full characters. It will also replace the following string occurences __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ or __TOTAL_VAT_WORDS__ by total incl. tax, total net of tax, or total of vat into all textes that use them (free text on invoices, ...) ##### Projects ##### ProjectsNumberingModules=Projects numbering module ProjectsSetup=Project module setup diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b375711e4fc..0817785acce 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -51,6 +51,8 @@ ErrorPartialFile=File not received completely by server. ErrorNoTmpDir=Temporary directy %s does not exists. ErrorUploadBlockedByAddon=Upload blocked by a PHP/Apache plugin. ErrorFileSizeTooLarge=File size is too large. +ErrorSizeTooLongForIntType=Size too long for int type (%s digits maximum) +ErrorSizeTooLongForVarcharType=Size too long for string type (%s chars maximum) ErrorFieldCanNotContainSpecialCharacters=Field %s must not contains special characters. ErrorNoAccountancyModuleLoaded=No accountancy module activated ErrorExportDuplicateProfil=This profil name already exists for this export set. diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index f008150b5d3..0dfb6cb9eac 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -166,6 +166,6 @@ ProductIsUsed=This product is used NewRefForClone=Ref. of new product/service CustomerPrices=Customers prices SuppliersPrices=Suppliers prices -CustomCode=Custom code +CustomCode=Customs code CountryOrigin=Origin country HiddenIntoCombo=Hidden into select lists \ No newline at end of file diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 319d769e916..62c5f29b825 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -862,6 +862,7 @@ MAIN_PROXY_USER=Login del servidor proxy MAIN_PROXY_PASS=Contraseña del servidor proxy DefineHereComplementaryAttributes=Defina aquí la lista de atributos adicionales, no disponibles en estándar, y que desea gestionar para %s. ExtraFields=Atributos adicionales +ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto. SendingMailSetup=Configuració de l'enviament per mail SendmailOptionNotComplete=Atención, en algunos sistemas Linux, con este método de envio, para poder enviar mails en su nombre, la configuración de sendmail debe contener la opción -ba (parámetro mail.force_extra_parameters en el archivo php.ini). Si algunos de sus destinatarios no reciben sus mensajes, pruebe a modificar este parámetro PHP con mail.force_extra_parameters=-ba. PathToDocuments=Rutas de acceso a documentos @@ -1295,9 +1296,6 @@ NoteOnPathLocation=Tenga en cuenta que este archivo debe estar en un directorio YouCanDownloadFreeDatFileTo=Puede descargarse una versión demo gratuita del archivo de países Maxmind GeoIP en la dirección %s. YouCanDownloadAdvancedDatFileTo=También puede descargarse una versión más completa del archivo de países Maxmind GeoIP en la dirección %s. TestGeoIPResult=Test de conversión IP -> País -##### NumberWords ##### -NumberWordsSetup=Configuración del módulo NumberWords -DescNumberWords=Este módulo le ofrece convertir números o importes en cualquier cadena. También realiza la sustitución de las variables genéricas __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ o __TOTAL_VAT_WORDS__ por el valor de importes totales, base o del IVA, en cadena dentro del texto al que hacen referencia (texto libre de facturas, ...) ##### Projects ##### ProjectsNumberingModules=Módulo de numeración para las referencias de los proyectos ProjectsSetup=Configuración del módulo Proyectos diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang index 0871f67bd00..f7ba39c6fdb 100644 --- a/htdocs/langs/es_ES/agenda.lang +++ b/htdocs/langs/es_ES/agenda.lang @@ -6,6 +6,7 @@ Agenda=Agenda Agendas=Agendas Calendar=Calendario Calendars=Calendarios +LocalAgenda=Calendario local AffectedTo=Asignada a DoneBy=Realizado por Events=Eventos @@ -29,8 +30,8 @@ ViewDay=Vista diaria ViewWeek=Vista semanal ViewWithPredefinedFilters=Ver con los filtros predefinidos AutoActions=Inclusión automática en la agenda -AgendaAutoActionDesc=Definir los eventos aquí para los que desea que Dolibarr cree automáticamente una acción en el orden del día. Si no está marcada (por defecto), se podrán crear manualmente. -AgendaSetupOtherDesc=Esta página le permite configurar otros parámetros del módulo agenda. +AgendaAutoActionDesc=Indique en esta pestaña los eventos para los que desea que Dolibarr cree automáticamente una acción en la agenda. Si no se marca ningún caso (por defecto), solamente las acciones manuales se incluirán en la agenda. +AgendaSetupOtherDesc=Esta página le permite configurar algunas opciones que permiten exportar una vista de su agenda Dolibar a un calendario externo (thunderbird, google calendar, ...) AgendaExtSitesDesc=Esta página le permite configurar calendarios externos para su visualización en la agenda de Dolibarr. ActionsEvents=Eventos para que Dolibarr cree una acción de forma automática PropalValidatedInDolibarr=Presupuesto %s validado diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 1d0ac410c8f..199f90333c8 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -326,6 +326,7 @@ NoDolibarrAccess=Sin acceso de usuario ExportDataset_company_1=Terceros (empresas/instituciones) y atributos ExportDataset_company_2=Contactos de terceros y atributos ImportDataset_company_1=Terceros (empresas/instituciones) y atributos +ImportDataset_company_2=Contactos (terceros o libres) y atributos PriceLevel=Nivel de precios DeliveriesAddress=Dirección(es) de envío DeliveryAddress=Dirección de envío diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 170e20451b0..a77b34d8fd6 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -51,6 +51,8 @@ ErrorPartialFile=Archivo no recibido íntegramente por el servidor. ErrorNoTmpDir=Directorio temporal de recepción %s inexistente ErrorUploadBlockedByAddon=Subida bloqueada por un plugin PHP/Apache. ErrorFileSizeTooLarge=El tamaño del fichero es demasiado grande. +ErrorSizeTooLongForIntType=Longitud del campo demasiado largo para el tipo int (máximo %s cifras) +ErrorSizeTooLongForVarcharType=Longitud del campo demasiado largo para el tipo cadena (máximo %s cifras) ErrorFieldCanNotContainSpecialCharacters=El campo %s no debe contener carácteres especiales ErrorNoAccountancyModuleLoaded=Módulo de contabilidad no activado ErrorExportDuplicateProfil=El nombre del perfil ya existe para este lote de exportación @@ -65,6 +67,7 @@ ErrorPasswordsMustMatch=Las 2 contraseñas indicadas deben corresponderse ErrorContactEMail=Se ha producido un error técnico. Contacte con el administrador al e-mail %s, indicando el código de error %s en su mensaje, o puede también adjuntar una copia de pantalla de esta página. ErrorWrongValueForField=Valor incorrecto para el campo número %s (el valor '%s' no cumple con la regla %s) ErrorFieldValueNotIn=Valor incorrecto para el campo número %s (el valor '%s' no es un valor en el campo %s de la tabla %s) +ErrorFieldRefNotIn=Valor incorrecto para el campo número %s (el valor '%s' no es una referencia existente en %s) ErrorsOnXLines=Errores en %s líneas fuente ErrorFileIsInfectedWithAVirus=¡El antivirus no ha podido validar este archivo (es probable que esté infectado por un virus)! ErrorSpecialCharNotAllowedForField=Los caracteres especiales no son admitidos por el campo "%s" diff --git a/htdocs/langs/es_ES/exports.lang b/htdocs/langs/es_ES/exports.lang index 6c998693d4a..b1a61723b94 100644 --- a/htdocs/langs/es_ES/exports.lang +++ b/htdocs/langs/es_ES/exports.lang @@ -1,110 +1,114 @@ -# Dolibarr language file - es_ES - exports -CHARSET= UTF-8 -ExportsArea= Área exportación -ImportArea= Área importación -NewExport= Nueva exportación -NewImport= Nueva importación -ExportableDatas= Conjunto de datos exportables -ImportableDatas= Conjunto de datos importables -SelectExportDataSet= Elija un conjunto predefinido de datos que desee exportar... -SelectImportDataSet= Seleccione un lote de datos predefinidos que desee importar... -SelectExportFields= Elija los campos que deben exportarse, o elija un perfil de exportación predefinido -SelectImportFields= Seleccione los campos a importar, o seleccione un perfil predefinido de importación -NotImportedFields= Campos del archivo origen no importados -SaveExportModel= Guardar este perfil de exportación si desea reutilizarlo posteriormente... -SaveImportModel= Guarde este perfil de importación si desea reutilizarlo de nuevo posteriormente... -ExportModelName= Nombre del perfil de exportación -ExportModelSaved= Perfil de exportación guardado con el nombre de %s. -ExportableFields= Campos exportables -ExportedFields= Campos a exportar -ImportModelName= Nombre del perfil de importación -ImportModelSaved= Perfil de importación guardado bajo el nombre %s. -ImportableFields= Campos importables -ImportedFields= Campos a importar -DatasetToExport= Conjunto de datos a exportar -DatasetToImport= Lote de datos a importar -NoDiscardedFields= Sin campos del archivo origen rechazados -Dataset= Conjunto de datos -ChooseFieldsOrdersAndTitle= Elija el orden de los campos... -FieldsOrder= Orden de los campos -FieldsTitle= Título campos -FieldOrder= Orden del campo -FieldTitle= Título campo -ChooseExportFormat= Elija el formato de exportación -NowClickToGenerateToBuildExportFile= Ahora, seleccione el formato de exportación de la lista desplegable y haga clic en "Generar" para generar el archivo exportación... -AvailableFormats= Formatos dispo. -LibraryShort= Librería -LibraryUsed= Librería utilizada -LibraryVersion= Versión -Step= Paso -FormatedImport= Asistente de importación -FormatedImportDesc1= Esta área permite realizar importaciones personalizadas de datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr. -FormatedImportDesc2= El primer paso consiste en elegir el tipo de dato que debe importarse, luego el archivo y a continuación elegir los campos que desea importar. -FormatedExport= Asistente de exportación -FormatedExportDesc1= Esta área permite realizar exportaciones personalizadas de los datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr. -FormatedExportDesc2= El primer paso consiste en elegir uno de los conjuntos de datos predefinidos, a continuación elegir los campos que quiere exportar al archivo y en que orden. -FormatedExportDesc3= Una vez seleccionados los datos, es posible elegir el formato del archivo de exportación generado. -Sheet= Hoja -NoImportableData= Sin tablas de datos importables (ningún módulo con las definiciones de los perfiles de importación está activo) -FileSuccessfullyBuilt= Archivo de exportación generado -SQLUsedForExport= Consulta SQL utilizada para construir el archivo de exportación -LineId= ID de línea -LineDescription= Descripción de línea -LineUnitPrice= Precio unitario de la línea -LineVATRate= Tipo de IVA de la línea -LineQty= Cantidad de la línea -LineTotalHT= Importe sin IVA de la línea -LineTotalTTC= Importe total de la línea -LineTotalVAT= Importe IVA de la línea -TypeOfLineServiceOrProduct= Tipo de línea (0=producto, 1=servicio) -FileWithDataToImport= Archivo que contiene los datos a importar -FileToImport= Archivo origen a importar -FileMustHaveOneOfFollowingFormat= El archivo de importación debe tener uno de los siguientes formatos -ChooseFormatOfFileToImport= Elija el formato de archivo que desea importar haciendo en el picto %s para seleccionarlo... -ChooseFileToImport= Elija el archivo de importación y haga clic en el picto %s para seleccionarlo como archivo origen de importación... -DownloadEmptyExample= Descargar archivo de ejemplo vacío -SourceFileFormat= Formato del archivo origen -FieldsInSourceFile= Campos en el archivo origen -FieldsInTargetDatabase= Campos destino en la base de datos Dolibarr (*=obligatorio) -Field= Campo -NoFields= Ningún campo -MoveField= Mover campo columna número %s -ExampleOfImportFile= Ejemplo_de_archivo_importación -SaveImportProfile= Guardar este perfil de importación -ErrorImportDuplicateProfil= No se puede guardar el perfil de importación bajo este nombre. Ya existe un perfil con ese nombre. -ImportSummary= Resumen de la configuración de importación -TablesTarget= Tablas de destino -FieldsTarget= Campos de destino -TableTarget= Tabla destino -FieldTarget= Campo destino -FieldSource= Campo origen -DoNotImportFirstLine= No importar la primera línea del archivo fuente -NbOfSourceLines= Número de líneas del archivo fuente -NowClickToTestTheImport= Compruebe los parámetros de importación establecidos. Si está de acuerdo, haga clic en el botón "%s" para ejecutar una simulación de importación (ningún dato será modificado, inicialmente sólo será una simulación)... -RunSimulateImportFile= Ejecutar la simulación de importación -FieldNeedSource= Este campo requiere obligatoriamente una fuente de datos -SomeMandatoryFieldHaveNoSource= Algunos campos obligatorios no tienen campo fuente en el archivo de origen -InformationOnSourceFile= Información del archivo origen -InformationOnTargetTables= Información sobre los campos de destino -SelectAtLeastOneField= Bascular al menos un campo origen en la columna de campos a exportar -SelectFormat= Seleccione este formato de archivo de importación -RunImportFile= Lanzar la importación -NowClickToRunTheImport= Compruebe los resultados de la simulación. Si todo está bien, inicie la importación definitiva. -DataLoadedWithId= Todos los datos serán importados con la siguiente id de importación: %s -ErrorMissingMandatoryValue= Dato obligatorio no indicado en el archivo fuente, campo número %s. -TooMuchErrors= Todavía hay %s líneas con error, pero su visualización ha sido limitada. -TooMuchWarnings= Todavía hay %s líneas con warnings, pero su visualización ha sido limitada. -EmptyLine= Línea en blanco -CorrectErrorBeforeRunningImport= Debe corregir todos los errores antes de iniciar la importación definitiva. -FileWasImported= El archivo se ha importado con el número de importación %s. -YouCanUseImportIdToFindRecord= Puede encontrar los registros de esta importación en su base de datos filtrando el campo import_key='%s'. -NbOfLinesOK= Número de líneas sin errores ni warnings: %s. -NbOfLinesImported= Número de líneas correctamente importadas: %s. -DataComeFromNoWhere= El valor a insertar no corresponde a ningún campo del archivo origen. -DataComeFromFileFieldNb= El valor a insertar se corresponde al campo número %s del archivo origen. -DataComeFromIdFoundFromRef= El valor dado por el campo %s del archivo origen será utilizado para encontrar el ID del objeto padre a usar (el objeto %s con la referencia del archivo origen debe existir en Dolibarr). -DataIsInsertedInto= Los datos del archivo de origen se insertarán en el siguiente campo: -DataIDSourceIsInsertedInto= El ID del objeto padre encontrado a partir del dato origen, se insertará en el siguiente campo: -SourceRequired= Datos de origen obligatorios -SourceExample= Ejemplo de datos de origen posibles -CSVFormatDesc=Archivo con formato Valores separados por coma (.csv).
Es un fichero con formato de texto en el que los campos son separados por el carácter [ %s ]. Si el separador se encuentra en el contenido de un campo, El campo debe de estar acotado por el carácter [ %s ]. El carácter de escape para incluir un carácter de entorno en un dato es [ %s ]. \ No newline at end of file +# Dolibarr language file - es_ES - exports +CHARSET=UTF-8 +ExportsArea=Área exportación +ImportArea=Área importación +NewExport=Nueva exportación +NewImport=Nueva importación +ExportableDatas=Conjunto de datos exportables +ImportableDatas=Conjunto de datos importables +SelectExportDataSet=Elija un conjunto predefinido de datos que desee exportar... +SelectImportDataSet=Seleccione un lote de datos predefinidos que desee importar... +SelectExportFields=Elija los campos que deben exportarse, o elija un perfil de exportación predefinido +SelectImportFields=Seleccione los campos a importar, o seleccione un perfil predefinido de importación +NotImportedFields=Campos del archivo origen no importados +SaveExportModel=Guardar este perfil de exportación si desea reutilizarlo posteriormente... +SaveImportModel=Guarde este perfil de importación si desea reutilizarlo de nuevo posteriormente... +ExportModelName=Nombre del perfil de exportación +ExportModelSaved=Perfil de exportación guardado con el nombre de %s. +ExportableFields=Campos exportables +ExportedFields=Campos a exportar +ImportModelName=Nombre del perfil de importación +ImportModelSaved=Perfil de importación guardado bajo el nombre %s. +ImportableFields=Campos importables +ImportedFields=Campos a importar +DatasetToExport=Conjunto de datos a exportar +DatasetToImport=Lote de datos a importar +NoDiscardedFields=Sin campos del archivo origen rechazados +Dataset=Conjunto de datos +ChooseFieldsOrdersAndTitle=Elija el orden de los campos... +FieldsOrder=Orden de los campos +FieldsTitle=Título campos +FieldOrder=Orden del campo +FieldTitle=Título campo +ChooseExportFormat=Elija el formato de exportación +NowClickToGenerateToBuildExportFile=Ahora, seleccione el formato de exportación de la lista desplegable y haga clic en "Generar" para generar el archivo exportación... +AvailableFormats=Formatos dispo. +LibraryShort=Librería +LibraryUsed=Librería utilizada +LibraryVersion=Versión +Step=Paso +FormatedImport=Asistente de importación +FormatedImportDesc1=Esta área permite realizar importaciones personalizadas de datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr. +FormatedImportDesc2=El primer paso consiste en elegir el tipo de dato que debe importarse, luego el archivo y a continuación elegir los campos que desea importar. +FormatedExport=Asistente de exportación +FormatedExportDesc1=Esta área permite realizar exportaciones personalizadas de los datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr. +FormatedExportDesc2=El primer paso consiste en elegir uno de los conjuntos de datos predefinidos, a continuación elegir los campos que quiere exportar al archivo y en que orden. +FormatedExportDesc3=Una vez seleccionados los datos, es posible elegir el formato del archivo de exportación generado. +Sheet=Hoja +NoImportableData=Sin tablas de datos importables (ningún módulo con las definiciones de los perfiles de importación está activo) +FileSuccessfullyBuilt=Archivo de exportación generado +SQLUsedForExport=Consulta SQL utilizada para construir el archivo de exportación +LineId=ID de línea +LineDescription=Descripción de línea +LineUnitPrice=Precio unitario de la línea +LineVATRate=Tipo de IVA de la línea +LineQty=Cantidad de la línea +LineTotalHT=Importe sin IVA de la línea +LineTotalTTC=Importe total de la línea +LineTotalVAT=Importe IVA de la línea +TypeOfLineServiceOrProduct=Tipo de línea (0=producto, 1=servicio) +FileWithDataToImport=Archivo que contiene los datos a importar +FileToImport=Archivo origen a importar +FileMustHaveOneOfFollowingFormat=El archivo de importación debe tener uno de los siguientes formatos +ChooseFormatOfFileToImport=Elija el formato de archivo que desea importar haciendo en el picto %s para seleccionarlo... +ChooseFileToImport=Elija el archivo de importación y haga clic en el picto %s para seleccionarlo como archivo origen de importación... +DownloadEmptyExample=Descargar archivo de ejemplo vacío +SourceFileFormat=Formato del archivo origen +FieldsInSourceFile=Campos en el archivo origen +FieldsInTargetDatabase=Campos destino en la base de datos Dolibarr (*=obligatorio) +Field=Campo +NoFields=Ningún campo +MoveField=Mover campo columna número %s +ExampleOfImportFile=Ejemplo_de_archivo_importación +SaveImportProfile=Guardar este perfil de importación +ErrorImportDuplicateProfil=No se puede guardar el perfil de importación bajo este nombre. Ya existe un perfil con ese nombre. +ImportSummary=Resumen de la configuración de importación +TablesTarget=Tablas de destino +FieldsTarget=Campos de destino +TableTarget=Tabla destino +FieldTarget=Campo destino +FieldSource=Campo origen +DoNotImportFirstLine=No importar la primera línea del archivo fuente +NbOfSourceLines=Número de líneas del archivo fuente +NowClickToTestTheImport=Compruebe los parámetros de importación establecidos. Si está de acuerdo, haga clic en el botón "%s" para ejecutar una simulación de importación (ningún dato será modificado, inicialmente sólo será una simulación)... +RunSimulateImportFile=Ejecutar la simulación de importación +FieldNeedSource=Este campo requiere obligatoriamente una fuente de datos +SomeMandatoryFieldHaveNoSource=Algunos campos obligatorios no tienen campo fuente en el archivo de origen +InformationOnSourceFile=Información del archivo origen +InformationOnTargetTables=Información sobre los campos de destino +SelectAtLeastOneField=Bascular al menos un campo origen en la columna de campos a exportar +SelectFormat=Seleccione este formato de archivo de importación +RunImportFile=Lanzar la importación +NowClickToRunTheImport=Compruebe los resultados de la simulación. Si todo está bien, inicie la importación definitiva. +DataLoadedWithId=Todos los datos serán importados con la siguiente id de importación: %s +ErrorMissingMandatoryValue=Dato obligatorio no indicado en el archivo fuente, campo número %s. +TooMuchErrors=Todavía hay %s líneas con error, pero su visualización ha sido limitada. +TooMuchWarnings=Todavía hay %s líneas con warnings, pero su visualización ha sido limitada. +EmptyLine=Línea en blanco +CorrectErrorBeforeRunningImport=Debe corregir todos los errores antes de iniciar la importación definitiva. +FileWasImported=El archivo se ha importado con el número de importación %s. +YouCanUseImportIdToFindRecord=Puede encontrar los registros de esta importación en su base de datos filtrando el campo import_key='%s'. +NbOfLinesOK=Número de líneas sin errores ni warnings: %s. +NbOfLinesImported=Número de líneas correctamente importadas: %s. +DataComeFromNoWhere=El valor a insertar no corresponde a ningún campo del archivo origen. +DataComeFromFileFieldNb=El valor a insertar se corresponde al campo número %s del archivo origen. +DataComeFromIdFoundFromRef=El valor dado por el campo %s del archivo origen será utilizado para encontrar el ID del objeto padre a usar (el objeto %s con la referencia del archivo origen debe existir en Dolibarr). +DataComeFromIdFoundFromCodeId=El código del campo número %s del archivo de origen se utilizará para encontrar el id del objeto padre a usar (el código del archivo de origen debe existir en el diccionario %s). Tenga en cuenta que si conoce el id, puede usarlo en lugar del código en el archivo de origen. La importación funcionará en los 2 casos. +DataIsInsertedInto=Los datos del archivo de origen se insertarán en el siguiente campo: +DataIDSourceIsInsertedInto=El ID del objeto padre encontrado a partir del dato origen, se insertará en el siguiente campo: +DataCodeIDSourceIsInsertedInto=El id de la línea padre encontrada a partir del código, se insertará en el siguiente campo: +SourceRequired=Datos de origen obligatorios +SourceExample=Ejemplo de datos de origen posibles +ExampleAnyRefFoundIntoElement=Todas las referencias encontradas para los elementos %s +ExampleAnyCodeOrIdFoundIntoDictionnary=Todos los códigos (o id) encontrados en el diccionario %s +CSVFormatDesc=Archivo con formato Valores separados por coma (.csv).
Es un fichero con formato de texto en el que los campos son separados por el carácter [ %s ]. Si el separador se encuentra en el contenido de un campo, El campo debe de estar acotado por el carácter [ %s ]. El carácter de escape para incluir un carácter de entorno en un dato es [ %s ]. diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 7dd0d46b5f6..6c6a579d777 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -122,6 +122,8 @@ Modify=Modificar Edit=Editar Validate=Validar ToValidate=A validar +Block=Bloquear +Unblock=Desbloquear Save=Grabar SaveAs=Grabar como TestConnection=Probar la conexión diff --git a/htdocs/langs/fa_IR/admin.lang b/htdocs/langs/fa_IR/admin.lang index 1ca4e5b366d..c8595b83743 100644 --- a/htdocs/langs/fa_IR/admin.lang +++ b/htdocs/langs/fa_IR/admin.lang @@ -1176,8 +1176,6 @@ NoteOnPathLocation=لاحظ أن الملكية الفكرية الخاصة بك YouCanDownloadFreeDatFileTo=يمكنك تحميل نسخة تجريبية مجانية من GeoIP ملف Maxmind البلاد في ٪ s. YouCanDownloadAdvancedDatFileTo=كما يمكنك تحميل نسخة كاملة أكثر من ذلك ، مع التحديثات ، من GeoIP ملف Maxmind البلاد في ٪ s. TestGeoIPResult=اختبار لتحويل الملكية الفكرية --> البلاد -NumberWordsSetup=NumberWords الإعداد وحدة -DescNumberWords=هذا يوفر وظائف وحدة لتحويل المبلغ أو عدد الأحرف في الكامل. وسيكون أيضا استبدال تكرارات السلسلة التالية __TOTAL_TTC_WORDS__ ، __TOTAL_HT_WORDS__ أو مدفوع من قبل __TOTAL_VAT_WORDS__ الإجمالي. الضرائب ، ومجموع صافي الضرائب ، أو مجموع ضريبة القيمة المضافة في جميع textes التي تستخدمها (النص الحرة على الفواتير ،...) ProjectsNumberingModules=مشاريع وحدة الترقيم ProjectsSetup=مشروع إعداد وحدة ProjectsModelModule=المشروع نموذج التقرير وثيقة diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang index aaa9c46c54d..ed1f2d835b9 100644 --- a/htdocs/langs/fi_FI/admin.lang +++ b/htdocs/langs/fi_FI/admin.lang @@ -1168,8 +1168,6 @@ NoteOnPathLocation=Huomaa, että IP-maahan tiedosto on sisällä hakemiston PHP YouCanDownloadFreeDatFileTo=Voit ladata ilmaisen demoversion Maxmind GeoIP maa-tiedoston %s. YouCanDownloadAdvancedDatFileTo=Voit myös ladata pidempään versioon, niiden päivitykset ja Maxmind GeoIP maa-tiedoston %s. TestGeoIPResult=Testaus muuntaminen IP -> maa -NumberWordsSetup=NumberWords moduuli setup -DescNumberWords=Tämä moduuli tarjoaa funktioita muunnosten määrä tai määrä koko merkkiä. Se korvaa myös seuraavat jono tapahtumien __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ tai __TOTAL_VAT_WORDS__ Koko varastossa. veron kokonaismäärä ilman veroja tai koko arvonlisäveroa kaikkiin textes käyttävät niitä (vapaa teksti laskuissa, ...) ProjectsNumberingModules=Hankkeet numerointi moduuli ProjectsSetup=Hankkeen moduuli setup ProjectsModelModule=Hankkeen raportti asiakirjan malli diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2b56e6e1968..9f88f1ef975 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -863,6 +863,7 @@ MAIN_PROXY_USER=Login pour passer le serveur proxy mandataire MAIN_PROXY_PASS=Mot de passe pour passer le serveur proxy mandataire DefineHereComplementaryAttributes=Definissez ici la liste des attributs supplémentaire, non disponible en standard, et que vous voulez voir gérez sur les %s. ExtraFields=Attributs suplémentaires +ExtraFieldHasWrongValue=L'attribut %s a une valeur incorrecte. SendingMailSetup=Configuration de l'envoi par mail SendmailOptionNotComplete=Attention, sur certains systèmes Linux, avec cette méthode d'envoi, pour pouvoir envoyer des mails en votre nom, la configuration d'exécution de sendmail doit contenir l'option -ba (paramètre mail.force_extra_parameters dans le fichier php.ini). Si certains de vos destinataires ne reçoivent pas de message, essayer de modifer ce paramètre PHP avec mail.force_extra_parameters = -ba. PathToDocuments= Chemin d'accès aux documents @@ -1297,9 +1298,6 @@ NoteOnPathLocation=Notez que ce fichier doit être dans un répertoire accessibl YouCanDownloadFreeDatFileTo=Vous pouvez télécharger une version démo gratuite de la base Maxmind à l'adresse %s. YouCanDownloadAdvancedDatFileTo=Vous pouvez aussi télécharger une version plus complète avec mise à jours de la base Maxmind à l'adresse %s. TestGeoIPResult=Test de conversion IP -> Pays -##### NumberWords ##### -NumberWordsSetup=Configuration du module NumberWords -DescNumberWords=Ce module amène des fonctions de conversion de nombre ou montant en toute chaine. Il effectue aussi des remplacements de variables génériques __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ ou __TOTAL_VAT_WORDS__ par leur valeur du montant ttc, ht ou de la tva, en chaine dans les textes qui y font référence (texte libre des factures, ...) ##### Projects ##### ProjectsNumberingModules=Modèles de numérotation des références projets ProjectsSetup=Configuration du module Projets diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 82a78406c04..b708c2aba1a 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -52,6 +52,8 @@ ErrorPartialFile=Fichier non reçu intégralement par le serveur. ErrorNoTmpDir=Répertoire temporaire de réception %s inexistant. ErrorUploadBlockedByAddon=Upload bloqué par un plugin PHP/Apache. ErrorFileSizeTooLarge=La taille du fichier est trop grande. +ErrorSizeTooLongForIntType=Longueur de champ trop longue pour le type int (%s chiffres maximum) +ErrorSizeTooLongForVarcharType=Longueur de champ trop longue pour le type chaine (%s caractères maximum) ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux. ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export. diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index c89613f71b8..fd74baddbb3 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -103,7 +103,7 @@ NbOfLinesImported=Nombre de lignes importées avec succès: %s. DataComeFromNoWhere=La valeur à insérer n'est issue d'aucun champ du fichier source. DataComeFromFileFieldNb=La valeur à insérer sera issue du champ numéro %s du fichier source. DataComeFromIdFoundFromRef=La valeur issue du champ numéro %s du fichier source sera utilisée pour trouver l'id de l'objet père à utiliser (L'objet %s ayant la réf. issue du fichier source doit donc exister dans Dolibarr). -DataComeFromIdFoundFromCodeId=Le code issu du champ numéro %s du fichier source sera utilisée pour trouver l'id de l'objet père à utiliser (Le code issue du fichier source doit donc exister dans le dictionnaire %s). Noton que si vous connaissez cet id, vou spouvez l'utiliser dans le fichier source au lieu du code. L'import fonctionnera dans les 2 cas. +DataComeFromIdFoundFromCodeId=Le code issu du champ numéro %s du fichier source sera utilisée pour trouver l'id de l'objet père à utiliser (Le code issue du fichier source doit donc exister dans le dictionnaire %s). Noton que si vous connaissez cet id, vous pouvez l'utiliser dans le fichier source au lieu du code. L'import fonctionnera dans les 2 cas. DataIsInsertedInto=La donnée issue du fichier source sera insérée dans le champ suivant: DataIDSourceIsInsertedInto=L'id de l'objet père retrouvé à partir de la donnée source, sera insérée dans le champ suivant: DataCodeIDSourceIsInsertedInto=L'id de la ligne père retrouvé à partir du code, sera insérée dans le champ suivant: diff --git a/htdocs/langs/is_IS/admin.lang b/htdocs/langs/is_IS/admin.lang index 95f7bf01c4c..3bde2e60f59 100644 --- a/htdocs/langs/is_IS/admin.lang +++ b/htdocs/langs/is_IS/admin.lang @@ -1141,8 +1141,6 @@ NoteOnPathLocation=Athugaðu að IP þinn til landsins gögn skrá verður inni YouCanDownloadFreeDatFileTo=Þú getur sótt ókeypis útgáfa af Maxmind GeoIP landi skrá hjá %s . YouCanDownloadAdvancedDatFileTo=Þú getur einnig hlaðið niður fleiri heill útgáfa með uppfærslum á Maxmind GeoIP landi skrá hjá %s . TestGeoIPResult=Próf af viðskiptum IP -> Land -NumberWordsSetup=NumberWords mát skipulag -DescNumberWords=Þessi eining veita virka til að breyta númeri eða upphæð í fullu stafi. Það mun einnig skipta eftirfarandi strengur viðburður __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ eða __TOTAL_VAT_WORDS__ með heildar incl. skattur, alls að frádregnum skatti, eða samtals um VSK í allan textes að nota þær (frjáls texti á reikningum, ...) ProjectsNumberingModules=Verkefni tala mát ProjectsSetup=Project mát skipulag ProjectsModelModule=Project Skýrsla skjal líkan diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang index d9895f4d47c..10f76ba7e54 100644 --- a/htdocs/langs/it_IT/admin.lang +++ b/htdocs/langs/it_IT/admin.lang @@ -1219,8 +1219,6 @@ DonationsReceiptModel=Modello della donazione ricevuta PastDelayVCalExport=Non esportare evento più grande di CashDesk=Punto di vendita SuppliersCommandModel=modello completo di ordine fornitore (logo. ..) -NumberWordsSetup=NumberWords di installazione modulo -DescNumberWords=Questo modulo fornisce le funzioni per convertire il numero in caratteri o importo intero. Sostituirà anche le occorrenze seguente stringa __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ o __TOTAL_VAT_WORDS__ da incl totale. fiscale, al netto delle imposte totale, o totale dell'IVA in tutte le textes che li utilizzano (testo libero sulle fatture, ...) // STOP - Lines generated via autotranslator.php tool (2010-07-17 11:34:00). diff --git a/htdocs/langs/nb_NO/admin.lang b/htdocs/langs/nb_NO/admin.lang index dfb35ed66fc..9d569bef29c 100644 --- a/htdocs/langs/nb_NO/admin.lang +++ b/htdocs/langs/nb_NO/admin.lang @@ -1185,8 +1185,6 @@ NoteOnPathLocation=Merk at din IP til land datafilen må være inne i en katalog YouCanDownloadFreeDatFileTo=Du kan laste ned en gratis demoversjon av Maxmind GeoIP landet arkiv for %s. YouCanDownloadAdvancedDatFileTo=Du kan også laste ned en mer komplett utgave, med oppdateringer, av Maxmind GeoIP landet arkiv for %s. TestGeoIPResult=Test av en konvertering IP -> landet -NumberWordsSetup=NumberWords modul oppsett -DescNumberWords=Denne modulen gir funksjoner for å konvertere nummer eller beløpet i sin helhet tegn. Det vil også erstatte følgende streng forekomster __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ eller __TOTAL_VAT_WORDS__ av totalt inkl.. skatt, de samlede netto etter skatt, eller totalt mva inn i alle tekster som bruker dem (ledig tekst på fakturaer, ...) ProjectsNumberingModules=Prosjekter nummerering modulen ProjectsSetup=Prosjekt modul oppsett ProjectsModelModule=Prosjektets rapport dokument modellen diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang index 0ac03784ae8..775155f95ba 100644 --- a/htdocs/langs/nl_NL/admin.lang +++ b/htdocs/langs/nl_NL/admin.lang @@ -1236,9 +1236,6 @@ NoteOnPathLocation = Let op dat uw "GeoIP Maxmind"-landbestand zich bevind in ee YouCanDownloadFreeDatFileTo = U kunt een gratis demo versie downloaden van een "Maxmind GeoIP"-landbestand op het adres %s. YouCanDownloadAdvancedDatFileTo = U kunt ook een completere versie, met updates downloaden van het "Maxmind GeoIP"-landbestand op het adres %s. TestGeoIPResult = Test van een conversie IP -> land -##### NumberWords ##### = -NumberWordsSetup = "NumberWords"-moduleinstellingen -DescNumberWords = Deze module maakt het u mogelijk cijfers in woorden om te zetten. Het vervangt ook de volgende variabelen: __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ en __TOTAL_VAT_WORDS__ door totaal incl. belastingen, totaal excl. belasting, en totaal belasting in alle teksten die deze variabelen gebruiken (bijvoorbeeld vrije tekst op rekeningen) ##### Projects ##### = ProjectsNumberingModules = Projectennummeringsmodule ProjectsSetup = Projectenmoduleinstellingen diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang index bd6bb8630bc..d85dbb0b2b3 100644 --- a/htdocs/langs/pl_PL/admin.lang +++ b/htdocs/langs/pl_PL/admin.lang @@ -1179,8 +1179,6 @@ NoteOnPathLocation=Pamiętać, że dane państwo ip do pliku musi być wewnątrz YouCanDownloadFreeDatFileTo=Możesz pobrać darmową wersję demo kraju GeoIP plik Maxmind w %s. YouCanDownloadAdvancedDatFileTo=Możesz także pobrać bardziej kompletna wersja, z aktualizacjami, kraju GeoIP plik Maxmind w %s. TestGeoIPResult=Test konwersji IP -> kraj -NumberWordsSetup=NumberWords konfiguracji modułu -DescNumberWords=Moduł ten zapewnia szereg funkcji do konwersji lub kwota w całości znaków. Zastąpi ona również następujące zdarzenia ciąg __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ lub __TOTAL_VAT_WORDS__ całkowitej zł. podatkowych, łącznej ceny netto podatku VAT lub łącznie na wszystkie textes które z nich korzystają (dowolny tekst na fakturach, ...) ProjectsNumberingModules=Moduł projektów numeracji ProjectsSetup=Projekt instalacji modułu ProjectsModelModule=Wzór dokumentu projektu sprawozdania diff --git a/htdocs/langs/pt_PT/admin.lang b/htdocs/langs/pt_PT/admin.lang index 8939a91aa55..d3126e9e03f 100644 --- a/htdocs/langs/pt_PT/admin.lang +++ b/htdocs/langs/pt_PT/admin.lang @@ -1198,8 +1198,6 @@ NoteOnPathLocation=Note que o ip de dados do país arquivo deve estar dentro de YouCanDownloadFreeDatFileTo=Você pode baixar uma versão demo gratuita do país arquivo GeoIP MaxMind em %s. YouCanDownloadAdvancedDatFileTo=Você também pode baixar uma versão mais completa, com atualizações do país arquivo GeoIP MaxMind em %s. TestGeoIPResult=Teste de uma conversão de IP -> país -NumberWordsSetup=NumberWords instalação do módulo -DescNumberWords=Este módulo fornecer funções para converter o número ou a quantidade de caracteres completa. Ele também irá substituir as ocorrências seguinte seqüência __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ ou __TOTAL_VAT_WORDS__ por incl total. fiscal líquida total do imposto, ou total do IVA em todos os textes que usá-los (texto livre nas facturas, ...) ProjectsNumberingModules=Projetos módulo de numeração ProjectsSetup=Projeto de instalação do módulo ProjectsModelModule=modelo de projeto de documento de relatório diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang index a252436de0f..0b8e955bbe8 100644 --- a/htdocs/langs/ro_RO/admin.lang +++ b/htdocs/langs/ro_RO/admin.lang @@ -1168,8 +1168,6 @@ NoteOnPathLocation=Reţineţi că dvs. de IP la datele din ţara Dosarul trebuie YouCanDownloadFreeDatFileTo=Puteţi descărca o versiune demo gratuită a ţării dosar GeoIP Maxmind la %s. YouCanDownloadAdvancedDatFileTo=Puteţi descărca de asemenea, o versiune mai completă, cu actualizari ale ţării dosar GeoIP Maxmind la %s. TestGeoIPResult=Test de o conversie de IP -> ţară -NumberWordsSetup=NumberWords modul de configurare -DescNumberWords=Acest modul oferă funcţii pentru a converti numărul sau valoarea în caractere plin. Aceasta va înlocui, de asemenea, evenimentele următoare şir __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ sau __TOTAL_VAT_WORDS__ de incl. totală. fiscale, netă totală a taxei, sau totală a TVA-ului în toate textes care să le utilizeze (text liber pe facturi, ...) ProjectsNumberingModules=Proiecte de numerotare modulul ProjectsSetup=Proiect modul de configurare ProjectsModelModule=Proiectul de raport document model diff --git a/htdocs/langs/ro_RO/install.lang b/htdocs/langs/ro_RO/install.lang index 10fa560ce92..79aeccef7eb 100644 --- a/htdocs/langs/ro_RO/install.lang +++ b/htdocs/langs/ro_RO/install.lang @@ -9,475 +9,797 @@ // START - Lines generated via autotranslator.php tool. // Reference language: en_US CHARSET=UTF-8 -InstallEasy=Am încercat să facă Dolibarr setup la fel de uşor ca posibil. Doar urmaţi instrucţiunile pas cu pas. -MiscellanousChecks=Cerinţe preliminare verifica -DolibarrWelcome=Bine ati venit la Dolibarr -ConfFileExists=Fişier de configurare %s există. -ConfFileDoesNotExists=Fişier de configurare %s nu exista! -ConfFileDoesNotExistsAndCouldNotBeCreated=Fişier de configurare %s nu există, şi nu a putut fi creat! -ConfFileCouldBeCreated=Fişier de configurare %s ar putea fi creat. -ConfFileIsNotWritable=Fişier de configurare %s nu are drepturi de scriere. Verificaţi permisiunile. Pentru prima instalare, serverul de web trebuie să fie acordate, pentru a putea scrie în acest fişier de configurare în timpul procesului ( "chmod 666", de exemplu pe Unix, cum ar fi sisteme de operare). -ConfFileIsWritable=Fişier de configurare %s este writable. -PHPSupportSessions=Acest lucru, PHP suportă sesiuni. -PHPSupportPOSTGETOk=Acest lucru, PHP suportă variabile POST şi GET. -PHPSupportPOSTGETKo=Este posibil dvs. PHP setup nu suporta variabile POST şi / sau GET. Verificaţi-vă parametru variables_order în php.ini. -PHPSupportGD=Acest suport PHP HG grafice de funcţii. -PHPSupportUTF8=Acest suport PHP UTF8 funcţii. -PHPMemoryOK=Parerea PHP max sesiune de memorie este setat la %s. Acest lucru ar trebui să fie de ajuns. -PHPMemoryTooLow=Parerea PHP max sesiune de memorie este setat la %s octeţi. Acest lucru ar trebui să fie prea mic. Schimbaţi-vă pentru a seta php.ini memory_limit parametru la cel puţin %s octeţi. -Recheck=Click aici pentru o mai important test -ErrorPHPDoesNotSupportSessions=Dvs. PHP nu suportă instalarea de sesiuni. Această facilitate este necesar pentru a face Dolibarr de lucru. Verificaţi-vă PHP setup. -ErrorPHPDoesNotSupportGD=Parerea PHP instalare nu suport grafic funcţia HG. Nu grafic va fi disponibil. -ErrorPHPDoesNotSupportUTF8=Parerea PHP instalare nu suport UTF8 funcţii. Dolibarr nu poate funcţiona corect. Rezolva aceasta înainte de a instala Dolibarr. -ErrorDirDoesNotExists=Directorul %s nu există. -ErrorGoBackAndCorrectParameters=Du-te înapoi şi de a corecta greşit parametri. -ErrorWrongValueForParameter=Este posibil să fi tastat gresit o valoare pentru parametrul " %s". -ErrorFailedToCreateDatabase=Nu a reuşit să creeze baza de date " %s". -ErrorFailedToConnectToDatabase=Nu a reuşit să se conecteze la baza de date " %s". -ErrorPHPVersionTooLow=PHP versiune prea veche. Versiunea %s este necesar. -ErrorConnectedButDatabaseNotFound=Conectarea la serverul de succes, dar baza de date " %s" nu a fost găsit. -ErrorDatabaseAlreadyExists=Baza de date " %s" există deja. -IfDatabaseNotExistsGoBackAndUncheckCreate=Dacă baza de date nu exista, mergeţi înapoi şi să verificaţi opţiunea "Creaţi baza de date". -IfDatabaseExistsGoBackAndCheckCreate=Dacă există deja o bază de date, să mergeţi înapoi şi să deselectaţi "Crearea bazei de date" opţiune. -PHPVersion=PHP Version -YouCanContinue=Puteţi continua ... -PleaseBePatient=Vă rugăm să aveţi răbdare ... -License=Utilizarea de licenţă -ConfigurationFile=Fişier de configurare -WebPagesDirectory=Director pagini web în cazul în care sunt stocate -DocumentsDirectory=Director pentru a stoca încărcate şi a generat documente -URLRoot=URL-ul rădăcină -DolibarrDatabase=Baza de date Dolibarr -DatabaseChoice=Baza de date alegere -DatabaseType=Baza de date de tip -DriverType=Driver de tip -Server=Server -ServerAddressDescription=Numele sau adresa IP pentru serverul de baze de date, de obicei 'localhost', atunci când baza de date server este găzduit pe acelaşi server decât serverul web -ServerPortDescription=Baza de date server port. Păstraţi gol dacă necunoscut. -DatabaseServer=Server de baze de date -DatabaseName=Baza de date nume -Login=Conecta -AdminLogin=Login pentru Dolibarr baza de date de administrator. Păstraţi gol dacă vă conectaţi la anonim -Password=Parola -PasswordAgain=Repetă parola pentru a doua oară -AdminPassword=Parola pentru Dolibarr baza de date de administrator. Păstraţi gol dacă vă conectaţi la anonim -CreateDatabase=Crearea de baze de date -CreateUser=Creaţi utilizator -DatabaseSuperUserAccess=Baza de date - superutilizator acces -CheckToCreateDatabase=Casetă de validare dacă baza de date nu există, şi trebuie să fie creat.
În acest caz, trebuie să completaţi de login / parola pentru contul superutilizator în partea de jos a acestei pagini. -CheckToCreateUser=Verificaţi caseta de login, dacă nu există şi trebuie să fie creat.
În acest caz, trebuie să completaţi de login / parola pentru contul superutilizator în partea de jos a acestei pagini. -DatabaseRootLoginDescription=Login de utilizator pentru a permis crearea de noi baze de date sau de noi utilizatori, inutil dacă dumneavoastră de baze de date şi baza de date există deja (ca de exemplu, atunci când aţi găzduit de un furnizor de web hosting). -KeepEmptyIfNoPassword=Lăsaţi gol dacă utilizatorul nu are nici o parola (evita acest lucru) -SaveConfigurationFile=Salvaţi valori -ConfigurationSaving=Salvarea fişierului de configurare -ServerConnection=Server conexiune -DatabaseConnection=Baza de date de conectare -DatabaseCreation=Crearea de baze de date -UserCreation=Utilizatori noi -CreateDatabaseObjects=Crearea de baze de date de obiecte -ReferenceDataLoading=Datele de referinţă de încărcare -TablesAndPrimaryKeysCreation=Tabele cheile primare şi crearea -CreateTableAndPrimaryKey=Creaţi tabelul %s -CreateOtherKeysForTable=Creaţi cheile străine şi indexurile de tabel %s -OtherKeysCreation=Cheile de Externe şi indexează crearea -FunctionsCreation=Funcţiile crearea -AdminAccountCreation=Administrator login crearea -PleaseTypePassword=Vă rugăm să tastaţi o parolă, gol parolele nu sunt permise! -PleaseTypeALogin=Vă rugăm să scrieţi un login! -PasswordsMismatch=Parolele diferă, vă rugăm să încercaţi din nou! -SetupEnd=Sfarsit de configurare -SystemIsInstalled=Această instalare este completă. -SystemIsUpgraded=Dolibarr a fost actualizat cu succes. -YouNeedToPersonalizeSetup=Ai nevoie de a configura Dolibarr, pentru a se potrivi nevoilor dumneavoastră (aspect, caracteristici, ...). Pentru a face acest lucru, vă rugăm să urmaţi link-ul de mai jos: -AdminLoginCreatedSuccessfuly=Dolibarr administrator de conectare ' %s' a creat cu succes. -GoToSetupArea=Du-te la Dolibarr (zona de configurare) -Examples=Exemple -WithNoSlashAtTheEnd=Fără a slash "/" de la sfârşitul -LoginAlreadyExists=Există deja -DolibarrAdminLogin=Dolibarr admin login -AdminLoginAlreadyExists=Dolibarr cont de administrator " %s" există deja. -WarningRemoveInstallDir=Atenţie, din motive de securitate, o dată sau de a instala actualizarea este completă, trebuie să eliminaţi directorul de instalare sau să redenumiţi-l la install.lock pentru a evita sa rău de utilizare. -ThisPHPDoesNotSupportTypeBase=Acest sistem de PHP nu suportă orice interfaţă pentru a accesa baza de date de tip %s -FunctionNotAvailableInThisPHP=Nu este disponibil pe acest PHP -MigrateScript=Migra script -ChoosedMigrateScript=Migra ales script-ul -DataMigration=Date de migrare -DatabaseMigration=Structura bazei de date de migrare -ProcessMigrateScript=Script de prelucrare -ChooseYourSetupMode=Alege-ţi modul de instalare şi faceţi clic pe "Start" ... -FreshInstall=Proaspete instala -FreshInstallDesc=Utilizaţi acest mod, dacă aceasta este prima dvs. instalaţi. Dacă nu, acest mod se poate repara un precedent incomplet instala, dar dacă doriţi să vă actualizaţi versiunea, alege "Upgrade" mode. -Upgrade=Upgrade -UpgradeDesc=Utilizaţi acest mod dacă aveţi înlocuieşte vechiul Dolibarr fişiere cu imagini de la o versiune mai nouă. Aceasta va actualiza baza de date şi de date. -Start=Porni -InstallNotAllowed=Setup nu sunt acceptate de către conf.php permisiunile -NotAvailable=Nu este disponibil -YouMustCreateWithPermission=Trebuie să creaţi fişierul %s şi să setaţi permisiunile de a scrie pe el pentru server de web în timpul procesului de instalare. -CorrectProblemAndReloadPage=Vă rugăm să rezolva problema şi apăsaţi F5 pentru a reîncărca pagina. -AlreadyDone=Deja migrat -DatabaseVersion=Baza de date a versiunea -ServerVersion=Baza de date a serverului de versiune -YouMustCreateItAndAllowServerToWrite=Trebuie să creaţi acest director, şi pentru a permite pentru serverul de web pentru a scrie în el. -CharsetChoice=Setul de caractere alegere -CharacterSetClient=Setul de caractere utilizat pentru a generat HTML pagini web -CharacterSetClientComment=Alegeţi setul de caractere pentru web afişate.
Implicit propuse set de caractere este una din baza de date. -CollationConnection=De caractere pentru sortarea -CollationConnectionComment=Alegeţi pagina de cod care defineşte caracterul de sortare pentru folosit de baza de date. Acest parametru este, de asemenea, numit "aperitiv" de către unele baze de date.
Acest parametru nu poate fi definit, dacă există deja o bază de date. -CharacterSetDatabase=Setul de caractere pentru baza de date -CharacterSetDatabaseComment=Alegeţi setul de caractere pentru a dorit crearea de baze de date.
Acest parametru nu poate fi definit, dacă există deja o bază de date. -YouAskDatabaseCreationSoDolibarrNeedToConnect=Te întreb pentru a crea baza de date %s, dar pentru asta, Dolibarr nevoie pentru a se conecta la server %s cu %s super utilizator permissions. -YouAskLoginCreationSoDolibarrNeedToConnect=Te întreb pentru a crea baza de date de conectare %s, dar pentru asta, Dolibarr nevoie pentru a se conecta la server %s cu %s super utilizator permissions. -BecauseConnectionFailedParametersMayBeWrong=Ca nu a reuşit conectarea, gazdă sau super parametrii de utilizator trebuie să fie greşit. -OrphelinsPaymentsDetectedByMethod=Orphelins plată detectate prin metoda %s -RemoveItManuallyAndPressF5ToContinue=Eliminaţi-o manual şi apăsaţi F5 pentru a continua. -KeepDefaultValuesWamp=Folositi DoliWamp Setup Wizard, astfel încât valorile propuse aici sunt deja optimizate. Schimbaţi-le numai daca stii ce faci. -KeepDefaultValuesMamp=Folositi DoliMamp Setup Wizard, astfel încât valorile propuse aici sunt deja optimizate. Schimbaţi-le numai daca stii ce faci. -FieldRenamed=Câmp redenumite -IfLoginDoesNotExistsCheckCreateUser=Login Dacă nu există încă, trebuie să vă verificaţi opţiunea "Create user" -ErrorConnection=Serverul " %s", nume de bază de date " %s", de conectare " %s", sau baze de date poate fi gresit parola sau PHP versiunea client poate fi prea vechi, comparativ cu versiunea de baze de date. -MigrationOrder=Migrarea datelor pentru ordinelor clienţilor -MigrationSupplierOrder=Migrarea datelor pentru furnizori ordinelor -MigrationProposal=Migrarea datelor pentru propuneri comerciale -MigrationInvoice=Date de migraţie pentru clienţii "facturi -MigrationContract=Date de migraţie pentru contracte -MigrationSuccessfullUpdate=Upgrade-ul de succes -MigrationPaymentsUpdate=Plata date de corecţie -MigrationPaymentsNumberToUpdate= %s plată (e) pentru a actualiza -MigrationProcessPaymentUpdate=Actualizare de plată (s) %s -MigrationPaymentsNothingToUpdate=Nu mai multe lucruri de facut -MigrationPaymentsNothingUpdatable=Nu mai multe plăţi, care poate fi corectat -MigrationContractsUpdate=Contract de date de corecţie -MigrationContractsNumberToUpdate= %s contract (e) pentru a actualiza -MigrationContractsLineCreation=Creaţi contractul pentru linia de contract ref %s -MigrationContractsNothingToUpdate=Nu mai multe lucruri de facut -MigrationContractsFieldDontExist=Câmp fk_facture nu mai există. Nimic de-a face. -MigrationContractsEmptyDatesUpdate=Contract de gol data de corecţie -MigrationContractsEmptyDatesUpdateSuccess=Contractul emtpy data de corecţie a terminat cu succes -MigrationContractsEmptyDatesNothingToUpdate=Nr contract gol data pentru a corecta -MigrationContractsEmptyCreationDatesNothingToUpdate=Nr contract data de creare a corecta -MigrationContractsInvalidDatesUpdate=Bad data valoarea contractului de corecţie -MigrationContractsInvalidDateFix=Correct contract %s (Contract date=%s, Starting service date min=Corect contract %s (Contract data= %s, începând de serviciu data min= %s) -MigrationContractsInvalidDatesNumber= %s contracte modificate -MigrationContractsInvalidDatesNothingToUpdate=Nu data cu valoare de rău pentru a corecta -MigrationContractsIncoherentCreationDateUpdate=Bad valoarea contractului data de creare de corecţie -MigrationContractsIncoherentCreationDateUpdateSuccess=Bad valoarea contractului data de creare de corecţie a făcut cu succes -MigrationContractsIncoherentCreationDateNothingToUpdate=Nu rău valoarea contractului pentru crearea data pentru a corecta -MigrationReopeningContracts=Deschideţi contract încheiat de eroare -MigrationReopenThisContract=Redeschideţi contract %s -MigrationReopenedContractsNumber= %s contracte modificate -MigrationReopeningContractsNothingToUpdate=Nu sa încheiat contractul, pentru a deschide -MigrationBankTransfertsNothingToUpdate=Toate link-uri sunt de până la data de -MigrationShipmentOrderMatching=Sendings primirea actualizare -MigrationDeliveryOrderMatching=Livrarea primirea actualizare -MigrationDeliveryDetail=Livrarea actualizare +CountryFR=Franţa +CountryBE=Belgia +CountryIT=Italia +CountryES=Spania +CountryDE=Germania +CountryGB=Marea Britanie +CountryCN=China +CountryTN=Tunisia +CountryUS=Statele Unite +CountryDZ=Algeria +CountryCA=Canada +CountryTG=Togo +CountryGA=Gabon +CountryNL=Olanda +CountryHU=Hongria +CountryRU=Rusia +CountrySE=Suedia +CountryCI=Ivoiry Coast +CountrySN=Senegal +CountryAR=Argentina +CountryCM=Camerun +CountryPT=Portugalia +CountrySA=Arabia Saudită +CountryMC=Monaco +CountryAU=Australia +CountrySG=Singapore +CountryAF=Afghanistan +CountryAX=Teren Insulele +CountryAL=Albania +CountryAS=American Samoa +CountryAD=Andora +CountryAO=Angola +CountryAI=Anguilla +CountryAQ=Antarctica +CountryAG=Antigua şi Barbuda +CountryAM=Armenia +CountryAW=Aruba +CountryAT=Austria +CountryAZ=Azerbaidjan +CountryBS=Bahamas +CountryBH=Bahrain +CountryBD=Bangladesh +CountryBB=Barbados +CountryBY=Belarus +CountryBZ=Belize +CountryBJ=Benin +CountryBM=Bermuda +CountryBT=Bhutan +CountryBO=Bolivia +CountryBA=Bosnia şi Herţegovina +CountryBW=Botswana +CountryBV=Insula Bouvet +CountryBR=Brazilia +CountryIO=Teritoriul Britanic din Oceanul Indian +CountryBN=Brunei Darussalam +CountryBG=Bulgaria +CountryBF=Burkina Faso +CountryBI=Burundi +CountryKH=Cambodgia +CountryCV=Capul Verde +CountryKY=Insulele Cayman +CountryCF=Republica Africa Centrală +CountryTD=Ciad +CountryCL=Chile +CountryCX=Insula Christmas +CountryCC=Insulele Cocos (Keeling) +CountryCO=Columbia +CountryKM=Comore +CountryCG=Congo +CountryCD=Congo, Republica Democrată +CountryCK=Insulele Cook +CountryCR=Costa Rica +CountryHR=Croaţia +CountryCU=Cuba +CountryCY=Cipru +CountryCZ=Republica Cehă +CountryDK=Danemarca +CountryDJ=Djibouti +CountryDM=Dominica +CountryDO=Republica Dominicană +CountryEC=Ecuador +CountryEG=Egipt +CountrySV=El Salvador +CountryGQ=Guineea Ecuatorială +CountryER=Eritrea +CountryEE=Estonia +CountryET=Etiopia +CountryFK=Insulele Falkland +CountryFO=Insulele Feroe +CountryFJ=Insulele Fiji +CountryFI=Finlanda +CountryGF=Guyana franceză +CountryPF=Polinezia franceză +CountryTF=Franceză Teritoriile de Sud +CountryGM=Gambia +CountryGE=Georgia +CountryGH=Ghana +CountryGI=Gibraltar +CountryGR=Grecia +CountryGL=Groenlanda +CountryGD=Grenada +CountryGP=Guadeloupe +CountryGU=Guam +CountryGT=Guatemala +CountryGN=Guinea +CountryGW=Guineea-Bissau +CountryGY=Guiana +CountryHT=Hati +CountryHM=Insula Heard şi McDonald +CountryVA=Sfântul Scaun (Cetatea Vaticanului membru) +CountryHN=Honduras +CountryHK=Hong Kong +CountryIS=Icelande +CountryIN=India +CountryID=Indonezia +CountryIR=Iran +CountryIQ=Irak +CountryIL=Israel +CountryJM=Jamaica +CountryJP=Japonia +CountryJO=Iordania +CountryKZ=Kazahstan +CountryKE=Kenya +CountryKI=Kiribati +CountryKP=Coreea de Nord +CountryKR=Coreea de Sud +CountryKW=Kuweit +CountryKG=Kyrghyztan +CountryLA=Laoţiană +CountryLV=Letonia +CountryLB=Liban +CountryLS=Lesotho +CountryLR=Liberia +CountryLY=Libia +CountryLI=Liechtenstein +CountryLT=Lituania +CountryLU=Luxemburg +CountryMO=Macao +CountryMK=Macedoniei, cu Fosta Republică Iugoslavă a +CountryMG=Madagascar +CountryMW=Malawi +CountryMY=Malaysia +CountryMV=Maldive +CountryML=Mali +CountryMT=Malta +CountryMH=Insulele Marshall +CountryMQ=Martinica +CountryMR=Mauritania +CountryMU=Mauritius +CountryYT=Mayotte +CountryMX=Mexic +CountryFM=Micronezia +CountryMD=Moldova +CountryMN=Mongolia +CountryMS=Montserrat +CountryMZ=Mozambic +CountryMM=Birmania (Myanmar) +CountryNA=Namibia +CountryNR=Nauru +CountryNP=Nepal +CountryAN=Antilele Olandeze +CountryNC=Noua Caledonie +CountryNZ=Noua Zeelandă +CountryNI=Nicaragua +CountryNE=Niger +CountryNG=Nigeria +CountryNU=Niue +CountryNF=Insula Norfolk +CountryMP=Insulele Mariane de Nord +CountryNO=Norvegia +CountryOM=Oman +CountryPK=Pakistan +CountryPW=Palau +CountryPS=Teritoriul Palestinian, Ocupate +CountryPA=Panama +CountryPG=Papua Noua Guinee +CountryPY=Paraguay +CountryPE=Peru +CountryPH=Filipine +CountryPN=Insulele Pitcairn +CountryPL=Polonia +CountryPR=Puerto Rico +CountryQA=Qatar +CountryRE=Reunion +CountryRO=România +CountryRW=Rwanda +CountrySH=Sfânta Elena +CountryKN=Saint Kitts şi Nevis +CountryLC=Saint Lucia +CountryPM=Saint Pierre şi Miquelon +CountryVC=Saint Vincent şi Grenadinele +CountryWS=Samoa +CountrySM=San Marino +CountryST=Sao Tome şi Principe +CountryRS=Serbia +CountrySC=Seychelles +CountrySL=Sierra Leone +CountrySK=Slovacia +CountrySI=Slovenia +CountrySB=Insulele Solomon +CountrySO=Somalia +CountryZA=Africa de Sud +CountryGS=Georgia de Sud şi Insulele Sandwich de Sud +CountryLK=Sri Lanka +CountrySD=Sudan +CountrySR=Surinam +CountrySJ=Svalbard şi Jan Mayen +CountrySZ=Swaziland +CountrySY=Sirian +CountryTW=Taiwan +CountryTJ=Tadjikistan +CountryTZ=Tanzania +CountryTH=Thailanda +CountryTL=Timorul de Est +CountryTK=Tokelau +CountryTO=Tonga +CountryTT=Trinidad şi Tobago +CountryTR=Turcia +CountryTM=Turkmenistan +CountryTC=Insulele Turks şi Cailos +CountryTV=Tuvalu +CountryUG=Uganda +CountryUA=Ucraina +CountryAE=Emiratele Arabe Unite +CountryUM=Statele Unite Insulele Minor Outlying +CountryUY=Uruguay +CountryUZ=Uzbekistan +CountryVU=Vanuatu +CountryVE=Venezuela +CountryVN=Vietnam +CountryVG=Insulele Virgine Britanice +CountryVI=Insulele Virgine, SUA +CountryWF=Wallis şi Futuna +CountryEH=Sahara Occidentală +CountryYE=Yemen +CountryZM=Zambia +CountryZW=Zimbabwe +CountryGG=Guernsey +CountryIM=Insula Man +CountryJE=Jersey +CountryME=Muntenegru +CountryBL=Saint Barthélemy +CountryMF=Saint Martin +CivilityMME=D-na +CivilityMR=Dl +CivilityMLE=Doamna +CivilityMTRE=Maestru +Currencyeuros=Euro +CurrencyAUD=Dolar AU +CurrencyCAD=Dolar CAN +CurrencyCHF=Franci elveţieni +CurrencyEUR=Euro +CurrencyFRF=Franceză Franci +CurrencyMAD=Dirham +CurrencyMGA=Ariary +CurrencyGBP=GB Lire +CurrencyTND=TND +CurrencyUSD=Dolar SUA +CurrencyXAF=CFA BEAC Franci +CurrencyXOF=CFA BCEAO Franci +// Date 2009-01-19 21:32:52 +// STOP - Lines generated via parser + + +// START - Lines generated via autotranslator.php tool (2009-08-19 20:22:33). +// Reference language: en_US +CountryCH=Eleveţia +CountryIE=Irlanda +CountryMA=Maroc +// STOP - Lines generated via autotranslator.php tool (2009-08-19 20:22:33). + + +// START - Lines generated via autotranslator.php tool (2010-07-17 11:36:47). +// Reference language: en_US +CurrencySingAUD=UA dolar +CurrencySingCAD=CAN dolar +CurrencySingCHF=Francul elveţian +CurrencySingEUR=Euro +CurrencySingFRF=Franceză franc +CurrencySingGBP=GB Pound +CurrencyINR=rupii indiene +CurrencySingINR=Rupie indiană +CurrencySingMAD=Dirham +CurrencySingMGA=Ariary +CurrencyMUR=Mauritius rupii +CurrencySingMUR=Rupie Mauritius +CurrencyNOK=Krones norvegiană +CurrencySingNOK=Coroană norvegiană +CurrencySingTND=Dinar tunisian +CurrencySingUSD=Dolari SUA +CurrencySingXAF=CFA franc BEAC +CurrencySingXOF=CFA franc BCEAO +CurrencyXPF=PCP franci +CurrencySingXPF=PCP franc +// STOP - Lines generated via autotranslator.php tool (2010-07-17 11:37:44). + + +// START - Lines generated via autotranslator.php tool (2011-10-10 02:45:33). +// Reference language: en_US -> ro_RO +CurrencySingUAH=Grivna +DemandReasonTypeSRC_INTE=Internet +DemandReasonTypeSRC_CAMP_MAIL=Mailing campanie +DemandReasonTypeSRC_CAMP_EMAIL=Corespondenţei campanie +DemandReasonTypeSRC_CAMP_PHO=Telefon de campanie +DemandReasonTypeSRC_CAMP_FAX=Fax campanie +DemandReasonTypeSRC_COMM=Comercială de contact +DemandReasonTypeSRC_SHOP=Magazin de contact +// STOP - Lines generated via autotranslator.php tool (2011-10-10 08:52:27). +cul standard +SeeVATReportInDueDebtMode=A se vedea raportul privind %sVAT flow%s pentru un calcul, cu o opţiune de pe fluxul +RulesVATIn=Pentru servicii, raportul include TVA lege efectiv primite sau eliberate pe baza de data plăţii.
- Pentru bunuri materiale, aceasta include facturi cu TVA, pe baza de la data validării a facturii. +RulesVATDue=Pentru servicii, raportul include facturile TVA datorată, plătite sau nu, în funcţie de data de validarea acestor facturi.
- Pentru bunuri materiale, aceasta include facturi cu TVA, în funcţie de data de validare a facturii. +OptionVatInfoModuleComptabilite=Notă: Pentru bunuri materiale, ar trebui să utilizeze la data livrării să fie mai echitabil. +ThirdPartyMustBeEditAsCustomer=A treia parte trebuie să fie definit ca un client +// STOP - Lines generated via autotranslator.php tool (2010-07-17 11:38:42). + + + +// START - Lines generated via autotranslator.php tool (2011-10-10 02:45:33). +// Reference language: en_US -> ro_RO +InvoiceStats=Statistici privind facturile +SellsJournal=Jurnalul de vânzări +PurchasesJournal=Cumparari Jurnalul +DescSellsJournal=Jurnalul de vânzări +DescPurchasesJournal=Cumparari Jurnalul +InvoiceRef=Factură ref. +CodeNotDef=Nu a fost definit +AddRemind=Expedierea Suma disponibilă +RemainToDivide=Ramaneti la expediere: +WarningDepositsNotIncluded=Depozitele facturile nu sunt incluse in aceasta versiune cu acest modul de contabilitate. +// STOP - Lines generated via autotranslator.php tool (2011-10-10 06:19:18). +a de facturi de luni +ShowSocialContribution=Arata contribuţiilor sociale +ShowBill=Afişare factură +ShowInvoice=Afişare factură +ShowInvoiceReplace=Arata de înlocuire a facturii +ShowInvoiceAvoir=Arata nota de credit +ShowPayment=Arata plată +File=Dosar +AlreadyPaid=Deja platite +Abandoned=Abandonat +RemainderToPay=Restul de a plăti +RemainderToTake=Restul de a lua +AmountExpected=Suma a susţinut +ExcessReceived=Trop Peru +EscompteOffered=Reducere oferite (de plată înainte de termen) +CreateDraft=Creaţi proiect +SendBillRef=Trimiteţi factură %s +SendReminderBillRef=Trimiteţi factură %s (memento) +StandingOrders=Ordine de plată +StandingOrder=Permanent pentru +NoDraftBills=Nu proiectul de facturi +NoOtherDraftBills=Nici un alt proiect de facturi +RefBill=Factura ref +ToBill=Pentru a factura +RemainderToBill=Restul la factura +SendBillByMail=Trimiteţi factură prin email +SendReminderBillByMail=Trimite un memento prin e-mail +RelatedCommercialProposals=Comerciale legate de propuneri +MenuToValid=Pentru a valid +DateMaxPayment=Plata datorate înainte de +DateEcheance=Datorită data limită +DateInvoice=Data facturii +NoInvoice=Nu factură +ClassifyBill=Clasifica factură +SupplierBillsToPay=Furnizori de la plata facturilor +DispenseMontantLettres=Les factures rdiges par procdsmcanographiques sont dispensează de l'arrt en lettres +DispenseMontantLettres=Facturi, în scris, prin intermediul procedurilor mecanographic sunt înlăturată de ordinea în litere +NonPercuRecuperable=Nerecuperabilă +SetConditions=Setare conditiile de plata +SetMode=Setaţi modul de plată +Billed=Facturat +RepeatableInvoice=Pre-definite factură +RepeatableInvoices=Pre-definite facturi +Repeatable=Pre-definite +Repeatables=Pre-definite +ChangeIntoRepeatableInvoice=Conversia în pre-definite +CreateRepeatableInvoice=Creaţi pre-definite factură +CreateFromRepeatableInvoice=Crearea de la pre-definite factură +CustomersInvoicesAndInvoiceLines=Clienţi facturi si facturi "linii +CustomersInvoicesAndPayments=Clienţi facturi şi plăţi +ExportDataset_invoice_1=Clientul lista de facturi si facturi "linii +ExportDataset_invoice_2=Clienţi facturi şi plăţi +ProformaBill=Proforma Bill: +Reduction=Reducerea +ReductionShort=De reducere. +Reductions=Reducerile +ReductionsShort=De reducere. +Discount=Reducere +Discounts=Reduceri +ShowDiscount=Arata discount +RelativeDiscount=Relativă reducere +GlobalDiscount=Global discount +CreditNote=Nota de credit +CreditNotes=Credit note +DiscountFromCreditNote=Reducere de la nota de credit %s +NewGlobalDiscount=Noua reducere +NoteReason=Notă / Motiv +ReasonDiscount=Motiv +AddDiscount=Adauga discount +AddGlobalDiscount=Adauga discount +DiscountOfferedBy=Acordate de către +DiscountStillRemaining=Reducere rămânând +DiscountAlreadyCounted=Reducere deja numărate +BillAddress=Bill adresa +HelpEscompte=Această reducere este un discount acordat clientului său paiement pentru că a fost făcută înainte de termen. +HelpAbandonBadCustomer=Această sumă a fost abandonată (client a declarat a fi un client de rău) şi este considerat ca fiind un exceptionnal libertate. +HelpAbandonOther=Această sumă a fost abandonat, deoarece acesta a fost o eroare (greşit client sau factură înlocuită cu o altă de exemplu) +InvoiceId=Factura id +InvoiceRef=Factura ref. +InvoiceDateCreation=Factura crearea data +InvoiceStatus=Starea Facturii +InvoiceNote=Factura nota +InvoicePaid=Facturii platite +PaymentNumber=Plata numărul +RemoveDiscount=Eliminaţi discount +WatermarkOnDraftBill=Filigran cu privire la proiectele de facturi (nimic dacă gol) +CloneInvoice=Clone factură +CloneMainAttributes=Clone obiect cu principalele sale atribute +ConfirmCloneInvoice=Sunteţi sigur că doriţi să clona această factură %s? +DisabledBecauseReplacedInvoice=Acţiunea cu handicap, pentru că factura a fost înlocuit +PaymentConditionShortRECEP=Imediat +PaymentConditionRECEP=Imediat +PaymentConditionShort30D=30 zile +PaymentCondition30D=30 zile +PaymentConditionShort30DENDMONTH=30 zile sfârşitul lunii +PaymentCondition30DENDMONTH=30 zile sfârşitul lunii +PaymentConditionShort60D=60 zile +PaymentCondition60D=60 zile +PaymentConditionShort60DENDMONTH=60 zile sfârşitul lunii +PaymentCondition60DENDMONTH=60 zile sfârşitul lunii +PaymentTypeVIR=Banca de depozit +PaymentTypeShortVIR=Banca de depozit +PaymentTypePRE=Băncii pentru +PaymentTypeShortPRE=Băncii pentru +PaymentTypeLIQ=Cash +PaymentTypeShortLIQ=Cash +PaymentTypeCB=Carte de credit +PaymentTypeShortCB=Carte de credit +PaymentTypeCHQ=Cec +PaymentTypeShortCHQ=Cec +PaymentTypeTIP=TIP +PaymentTypeShortTIP=TIP +PaymentTypeVAD=Pe linie de plată +PaymentTypeShortVAD=Pe linie de plată +PaymentTypeTRA=Bill plată +PaymentTypeShortTRA=Document +BankDetails=Banca detalii +BankCode=Codul băncii +DeskCode=Desk cod +BankAccountNumber=Numărul de cont +BankAccountNumberKey=Cheie +Residence=Domiciliere +IBANNumber=IBAN numărul +IBAN=IBAN +BIC=BIC / SWIFT +BICNumber=BIC / SWIFT numărul +ExtraInfos=Extra infos +RegulatedOn=Reglementate pe +ChequeNumber=Cec N +ChequeOrTransferNumber=Cec / transfer N +ChequeMaker=Verificaţi transmiţător +ChequeBank=Banca de cec +NetToBePaid=Netă care urmează să fie plătite +PhoneNumber=Tel +FullPhoneNumber=Telefon +TeleFax=Fax +PrettyLittleSentence=Accept valoarea plăţile datorate de cecuri emise în numele meu, ca membru al unei asociaţii de contabilitate aprobate de către Administraţia fiscală. +IntracommunityVATNumber=Intracommunity numărul de TVA +PaymentByChequeOrderedTo=Cec de plată sunt de plătit pentru a %s pentru a trimite +PaymentByChequeOrderedToShort=Cec de plată se achită la +SendTo=trimis la +PaymentByTransferOnThisBankAccount=Plata prin transfer pe următorul cont bancar +VATIsNotUsedForInvoice=* Non TVA aplicabile art-293B din CGI +LawApplicationPart1=Prin aplicarea legii 80.335 din 12.05.80 +LawApplicationPart2=de mărfuri rămân în proprietatea +LawApplicationPart3=vânzătorului, până la completa de incasare +LawApplicationPart4=preţul lor. +LimitedLiabilityCompanyCapital=SARL cu capitalul de +UseDiscount=Utilizarea discount +UseCreditNoteInInvoicePayment=Reducerea de plată cu acest act de credit +MenuChequeDeposits=Cecuri depozite +MenuCheques=Cecuri +MenuChequesReceipts=Cecuri încasări +NewChequeDeposit=Depozitul +ChequesReceipts=Cecuri încasări +ChequesArea=Cecuri depozite zona +ChequeDeposits=Cecuri depozite +Cheques=Cecuri +CreditNoteConvertedIntoDiscount=Această notă de credit a fost transformată în %s +UsBillingContactAsIncoiveRecipientIfExist=Utilizaţi client facturare, adresa de contact în loc de o terţă parte ca adresa destinatarului pentru facturile +Of=du +PDFBerniqueDescription=Model de factură Bernique +PDFBigorneauDescription=Model de factură Bigorneau +PDFBulotDescription=Model de factură Bulot +PDFCrabeDescription=Model de factură Crabe. Un model de factură (Sprijin TVA opţiune, reduceri, plăţi condiţii, logo-ul, etc ..) +PDFHuitreDescription=Model de factură Huitre +PDFOursinDescription=Model de factură oursin +PDFTourteauDescription=Model de factură Tourteau +TerreNumRefModelDesc1=Întoarceţi-vă cu NUMERO format %syymm-NNNN standard pentru facturi şi %syymm-NNNN de credit, în cazul în care constată aa este ani, mm este luna şi NNNN este o secvenţă fără nici o pauză şi a reveni la 0 +TerreNumRefModelError=Un proiect de lege incepand cu $ syymm există deja şi nu este compatibilă cu acest model de succesiune. Eliminaţi-o sau redenumiţi-o pentru a activa acest modul. +OrionNumRefModelDesc1=Întoarceţi-vă la numărul în format FAYYNNNNN unde YY este NNNNN an şi de creşterea numărului începând de la 1. +OrionNumRefModelDesc2=De ani este crescut cu 1, fără o initialisation la zero la începutul anului fiscal. +OrionNumRefModelDesc3=Definiţi variabilă SOCIETE_FISCAL_MONTH_START cu luni de la începutul anului fiscal, de exemplu: pentru 9 septembrie. +OrionNumRefModelDesc4=În acest exemplu, vom avea pe 1 septembrie 2006 o factură numit FA700354. +TitanNumRefModelDesc1=Întoarceţi-vă la numărul de format FAYYNNNNN unde YY este NNNNN an şi este în creştere numărul incepand de la 1. +TitanNumRefModelDesc2=În anul incremented este de 1, precum şi creşterea numărului este iniţializată la zero la începutul anului fiscal. +TitanNumRefModelDesc3=Definiţi variabilă SOCIETE_FISCAL_MONTH_START cu luni de la începutul anului fiscal, de exemplu: pentru 9 septembrie. +TitanNumRefModelDesc4=În acest exemplu, vom avea pe 1 septembrie 2006 o factură numit FA0700001 +PlutonNumRefModelDesc1=Întoarceţi-vă un personalizabile numărul facturii în conformitate cu o mască de definit. // Date 2009-01-19 21:32:52 // STOP - Lines generated via parser // START - Lines generated via autotranslator.php tool (2009-08-13 21:12:07). // Reference language: en_US -GoToDolibarr=Du-te la Dolibarr -GoToUpgradePage=Du-te la pagina de actualizare din nou -InstallChoiceSuggested=Instalarea de alegere a sugerat de instalare. -MigrationStockDetail=Update valoarea stocului de produse -MigrationMenusDetail=Update dinamic meniuri tabele -MigrationDeliveryAddress=Update adresa de livrare în transporturile +InvoiceDeposit=Depozit de factură +InvoiceDepositAsk=Depozit de factură +InvoiceDepositDesc=Acest tip de factură se face în cazul în care un depozit a fost primit. +InvoiceProForma=Proforma factură +InvoiceProFormaAsk=Proforma factură +InvoiceProFormaDesc=Proforma factură este o imagine de o adevărată factură, dar nu are nici o valoare contabilă. +UsedByInvoice=Folosite pentru a plăti factura %s +ConsumedBy=Consumat de către +NotConsumed=Nu consumaţi +HelpPaymentHigherThanReminderToPay=Atentie, la plata sumei de una sau mai multe proiecte de lege este mai mare decât în restul să plătească.
Editaţi-vă de intrare, altfel confirma si gandeste-te la crearea unei note de credit a primit în exces, pentru fiecare overpaid facturilor. +BillStatusConverted=Convertite în reducere +BillShortStatusConverted=Prelucrate +Prélèvements=Permanent pentru +Prélèvements=Ordine de plată +ShowInvoiceDeposit=Arata depozit factură +SetDate=Setaţi data +Deposit=Garantie +Deposits=Depozite +DiscountFromDeposit=Plăţile efectuate de depozit factura %s +AbsoluteDiscountUse=Acest tip de credit poate fi utilizat pe factură înainte de validarea acestuia +CreditNoteDepositUse=Factură trebuie să fie validate pentru a utiliza acest rege de credite +NewRelativeDiscount=Noua reducere relativă +IdSocialContribution=Social contribuţie id +PaymentId=Plata id +DescTaxAndDividendsArea=Această zonă a prezentat un rezumat al tuturor plăţilor efectuate de impozit sau a contribuţiilor sociale. Numai de înregistrări cu plată în cursul fix an sunt incluse aici. +NbOfPayments=Nb de plăţi +SplitDiscount=Split reducere în două +ConfirmSplitDiscount=Sunteţi sigur că doriţi să împărţim această reducere a %s %s în 2 mai mici reduceri? +TypeAmountOfEachNewDiscount=Valoarea de intrare, pentru fiecare din două părţi: +TotalOfTwoDiscountMustEqualsOriginal=Total a două noi reduceri trebuie să fie egal cu suma iniţială de reduceri. +ConfirmRemoveDiscount=Sunteţi sigur că doriţi să eliminaţi acest discount? +UseCredit=Utilizarea de credit +ShowUnpaidLateOnly=Arata târziu unpaid factura numai +PaymentInvoiceRef=Plata facturii %s // STOP - Lines generated via autotranslator.php tool (2009-08-13 21:12:07). // START - Lines generated via autotranslator.php tool (2009-08-19 20:22:33). // Reference language: en_US -Experimental=(experimental, non operaţionale) -MigrationUpdateFailed=Eşuare proces de actualizare -MigrationBankTransfertsUpdate=Update-uri utile tranzacţie între bancă şi un transfer bancar +BillsCustomersUnpaid=Neplătite clientilor facturi +BillsCustomersUnpaidForCompany=Neplătite clientilor facturile pentru %s +BillsSuppliersUnpaid=Neachitate furnizorilor facturi +BillsUnpaid=Neachitate +InvoiceReplacementDesc=Înlocuirea factură este utilizat pentru a anula şi înlocuiţi complet o factură fără plată primit deja.

Notă: Doar factura de plată pe care nu poate fi înlocuit. În cazul în care nu sa încheiat, acesta va fi închis în mod automat pentru a "abandonat". +BillStatusClosedUnpaid=Închis (fără plată) +BillShortStatusClosedUnpaid=Închis +Unpaid=Neachitate +ConfirmCancelBillQuestion=De ce vrei pentru a clasifica această factură "abandonat"? +ConfirmClassifyPaidPartiallyReasonOther=Suma abandonat pentru alte motive +NoSupplierBillsUnpaid=Nu furnizori facturi neachitate +CustomerBillsUnpaid=Neachitate facturi clienţi // STOP - Lines generated via autotranslator.php tool (2009-08-19 20:22:33). // START - Lines generated via autotranslator.php tool (2010-07-17 11:36:47). // Reference language: en_US -ForceHttps=Forţa de conexiuni securizate (HTTPS) -CheckToForceHttps=Bifaţi această opţiune pentru a forţa conexiuni securizate (HTTPS).
Aceasta implică faptul că serverul de web este configurat cu un certificat SSL. -DirectoryRecommendation=Este recomandat să utilizaţi un director din afara directorul de paginile dvs. de web. -KeepDefaultValuesDeb=Puteţi utiliza expertul de configurare Dolibarr dintr-un pachet Debian sau Ubuntu, asa ca valorile propuse aici sunt deja optimizate. Numai parola proprietarul bazei de date pentru a crea trebuie completate. Schimbarea alţi parametri numai daca stii ce faci. -InstallChoiceRecommanded=Recomandat alegere pentru a instala %s versiunea curentă de la %s versiunea dvs. -CheckThatDatabasenameIsCorrect=Verificaţi că numele bazei de date "%s" este corectă. -IfAlreadyExistsCheckOption=În cazul în care acest nume este corectă şi că baza de date nu există încă, trebuie să verificaţi opţiunea "Creare de baze de date". -OpenBaseDir=PHP openbasedir parametru -YouAskToCreateDatabaseSoRootRequired=Aţi bifat caseta "Crearea bazei de date". Pentru aceasta, aveţi nevoie pentru a oferi autentificare user / parola de superuser (partea de jos a formularului). -YouAskToCreateDatabaseUserSoRootRequired=Aţi bifat caseta "Crearea proprietarul bazei de date". Pentru aceasta, aveţi nevoie pentru a oferi autentificare user / parola de superuser (partea de jos a formularului). -NextStepMightLastALongTime=pasul curent poate dura câteva minute. Vă rugăm să aşteptaţi până când ecranul următor este prezentată complet înainte de a continua. -MigrationCustomerOrderShipping=Migrarea de transport maritim pentru depozitare client comenzi -MigrationShippingDelivery=Upgrade-ul de stocare de transport maritim -MigrationShippingDelivery2=Upgrade-ul de stocare de transport maritim 2 -MigrationFixData=Fix pentru datele denormalized -MigrationRelationshipTables=migrarea datelor pentru tabelele relaţia (%s) -MigrationProjectTaskActors=migrare de date pentru tabel llx_projet_task_actors -MigrationProjectUserResp=Datele fk_user_resp domeniul migraţiei de la llx_projet llx_element_contact -MigrationProjectTaskTime=Update timpul petrecut în câteva secunde -// STOP - Lines generated via autotranslator.php tool (2010-07-17 11:39:31). +ClassifyCanceled=Clasifica "abandonaţi" +BillStatusCanceled=Abandonat +BillShortStatusCanceled=Abandonat +ConfirmClassifyPaidPartiallyReasonDiscountNoVatDesc=Această alegere este posibilă în cazul în care factura dvs. au fost prevăzute cu comentariul adecvat. (Exemplu «Numai impozitul corespunzător preţului care au fost plătite efectiv dă dreptul la deducere») +AlreadyPaidNoCreditNotesNoDeposits=Deja plătite (fără notele de credit şi depozite) +RelatedBill=Legate de factura +RelatedBills=facturi corelate +ValidateInvoice=Validare factură +Cash=Numerar +Reported=Întârziat +DisabledBecausePayments=Nu este posibil, deoarece nu există anumite plăţi +CantRemovePaymentWithOneInvoicePaid=nu se poate elimina de plată, deoarece nu există, cel puţin pe factură clasificate platite +ExpectedToPay=Preconizate de plată +PayedByThisPayment=Plătită de către această plată +TypeContact_facture_internal_SALESREPFOLL=Reprezentant client urmărirea factura +TypeContact_facture_external_BILLING=Clientul factura de contact +TypeContact_facture_external_SHIPPING=Clientul de transport maritim de contact +TypeContact_facture_external_SERVICE=Contactaţi serviciul clienţi +TypeContact_facture_fourn_internal_SALESREPFOLL=Reprezentant furnizorul urmărirea factura +TypeContact_facture_fourn_external_BILLING=A lua legatura cu furnizorul factură +TypeContact_facture_fourn_external_SHIPPING=Furnizor de transport maritim de contact +TypeContact_facture_fourn_external_SERVICE=Furnizor de servicii de contact +PDFLinceDescription=Un model de factura complet, cu RE şi spaniolă IRPF +// STOP - Lines generated via autotranslator.php tool (2010-07-17 11:37:32). - -// START - Lines generated via autotranslator.php tool (2010-07-17 12:23:40). -// Reference language: en_US -CHARSET=UTF-8 -InstallEasy=Bare følg instruksjonene trinn for trinn. -MiscellanousChecks=Forutsetninger sjekk -DolibarrWelcome=Velkommen til Dolibarr -ConfFileExists=Konfigurasjonsfil %s eksisterer. -ConfFileDoesNotExists=Konfigurasjonsfil %s finnes ikke! -ConfFileDoesNotExistsAndCouldNotBeCreated=Konfigurasjonsfil %s eksisterer ikke og kunne ikke opprettes! -ConfFileCouldBeCreated=Konfigurasjonsfil %s kunne bli skapt. -ConfFileIsNotWritable=Konfigurasjonsfil %s er ikke skrivbar. Sjekk tillatelser. For første installere, må webserveren få innvilget å kunne skrive inn i denne filen under konfigureringen ("chmod 666" for eksempel på en Unix som OS). -ConfFileIsWritable=Konfigurasjonsfil %s er skrivbar. -PHPSupportSessions=Dette PHP støtter sesjoner. -PHPSupportPOSTGETOk=Dette PHP støtter variabler POST og GET. -PHPSupportPOSTGETKo=Det er mulig at din PHP-oppsettet støtter ikke variabler POST og / eller GET. Sjekk din parameter variables_order i php.ini. -PHPSupportGD=Denne PHP-støtte GD grafiske funksjoner. -PHPSupportUTF8=Denne PHP-støtte UTF8 funksjoner. -PHPMemoryOK=Din PHP max økten minnet er satt til %s. Dette bør være nok. -PHPMemoryTooLow=Din PHP max økten minnet er satt til %s bytes. Dette bør være for lav. Endre php.ini å sette memory_limit parameter til minst %s byte. -Recheck=Klikk her for en mer significative test -ErrorPHPDoesNotSupportSessions=Din PHP installasjon har ikke støtte for sesjoner. Denne funksjonen er nødvendig for å gjøre Dolibarr jobbe. Sjekk din PHP oppsett. -ErrorPHPDoesNotSupportGD=Din PHP installasjon har ikke støtte for grafiske funksjonen GD. Ingen grafen vil være tilgjengelig. -ErrorPHPDoesNotSupportUTF8=Din PHP installasjon har ikke støtte for UTF8 funksjoner. Dolibarr kan ikke fungere riktig. Løs dette før du installerer Dolibarr. -ErrorDirDoesNotExists=Directory %s finnes ikke. -ErrorGoBackAndCorrectParameters=Gå bakover og korrigere feil parametre. -ErrorWrongValueForParameter=Du har kanskje skrevet feil verdi for parameteren '%s'. -ErrorFailedToCreateDatabase=Kunne ikke opprette database '%s'. -ErrorFailedToConnectToDatabase=Kunne ikke koble til database '%s'. -ErrorPHPVersionTooLow=PHP-versjonen for gammel. Versjon %s er nødvendig. -ErrorConnectedButDatabaseNotFound=Tilkobling til server vellykket, men database '%s' ikke funnet. -ErrorDatabaseAlreadyExists=Database '%s' finnes allerede. -IfDatabaseNotExistsGoBackAndUncheckCreate=Hvis databasen ikke finnes, gå tilbake og sjekke alternativet "Opprett database". -IfDatabaseExistsGoBackAndCheckCreate=Hvis databasen allerede eksisterer, gå tilbake og fjern "Opprett database" alternativet. -PHPVersion=PHP versjon -YouCanContinue=Du kan fortsette ... -PleaseBePatient=Vær tålmodig ... -License=Bruke lisens -ConfigurationFile=Konfigurasjonsfil -WebPagesDirectory=Katalog der hvor web sider er lagret -DocumentsDirectory=Katalog for å lagre lastet opp og genererte dokumenter -URLRoot=URL Root -ForceHttps=Force sikre tilkoblinger (https) -CheckToForceHttps=Sjekk dette alternativet for å tvinge sikre tilkoblinger (https).
Dette krever at web-serveren er satt opp med en SSL-sertifikat. -DolibarrDatabase=Dolibarr Database -DatabaseChoice=Database valg -DatabaseType=Database type -DriverType=Driver type -Server=Server -ServerAddressDescription=Navn eller IP-adressen til database-serveren, som regel "localhost" når database server ligger på samme server enn webserveren -ServerPortDescription=Database server port. Hold tomt hvis ukjent. -DatabaseServer=Databaseserveren -DatabaseName=Databasenavn -Login=Innlogging -AdminLogin=Logg inn for Dolibarr database eier. -Password=Passord -PasswordAgain=Skriv inn passordet en gang -AdminPassword=Passord for Dolibarr database eier. -CreateDatabase=Opprett database -CreateUser=Lag eier -DatabaseSuperUserAccess=Databaseserveren - Superbruker tilgang -CheckToCreateDatabase=Boksen hvis databasen finnes ikke og må lages.
I dette tilfellet må du fylle login / passord for superuser kontoen nederst på denne siden. -CheckToCreateUser=Boksen hvis databasen eieren ikke eksisterer og må opprettes.
I dette tilfellet må du velge sin login og passord, og også fylle brukernavn / passord for superuser kontoen nederst på denne siden. Hvis denne boksen ikke er avkrysset, eier database og passord må finnes. -Experimental=(Eksperimentell) -DatabaseRootLoginDescription=Logg inn av brukeren lov til å opprette nye databaser eller nye brukere, ubrukelig hvis databasen og databasen din logikk allerede eksisterer (som når du er vert for en web hosting leverandør). -KeepEmptyIfNoPassword=La det være tomt hvis bruker har ingen passord (unngå denne) -SaveConfigurationFile=Lagre verdier -ConfigurationSaving=Lagrer konfigurasjonsfil -ServerConnection=Server-tilkobling -DatabaseConnection=Databasetilkobling -DatabaseCreation=Database opprettelse -UserCreation=Bruker opprettelse -CreateDatabaseObjects=Databaseobjekter opprettelse -ReferenceDataLoading=Referanse data lasting -TablesAndPrimaryKeysCreation=Tabeller og primærnøkler opprettelse -CreateTableAndPrimaryKey=Lag tabell %s -CreateOtherKeysForTable=Lag utenlandske nøkler og indekser for bord %s -OtherKeysCreation=Utenlandske nøkler og indekser opprettelse -FunctionsCreation=Funksjoner opprettelse -AdminAccountCreation=Administrator login opprettelse -PleaseTypePassword=Vennligst skriv inn et passord, er tomt passord ikke tillatt! -PleaseTypeALogin=Vennligst skriv inn en logikk! -PasswordsMismatch=Passord skiller, vennligst prøv igjen! -SetupEnd=Slutt på oppsett -SystemIsInstalled=Denne installasjonen er fullført. -SystemIsUpgraded=Dolibarr har blitt oppgradert med hell. -YouNeedToPersonalizeSetup=Du må konfigurere Dolibarr som passer dine behov (utseende, funksjoner, ...). For å gjøre dette, vennligst følg lenken nedenfor: -AdminLoginCreatedSuccessfuly=Dolibarr administrator login '%s' opprettet heldig. -GoToDolibarr=Gå til Dolibarr -GoToSetupArea=Gå til Dolibarr (setup-området) -GoToUpgradePage=Gå til side oppgradere igjen -Examples=Eksempler -WithNoSlashAtTheEnd=Uten skråstrek "/" på slutten -DirectoryRecommendation=Det er recommanded å bruke en ut av ditt katalogen av websidene dine. -LoginAlreadyExists=Det finnes allerede -DolibarrAdminLogin=Dolibarr admin login -AdminLoginAlreadyExists=Dolibarr administratorkonto '%s' finnes allerede. -WarningRemoveInstallDir=Advarsel, av sikkerhetshensyn, når installere eller oppgraderingen er fullført, bør du fjerne installerer katalogen eller endre navnet til install.lock for å unngå den skadelige bruk. -ThisPHPDoesNotSupportTypeBase=Dette PHP Systemet støtter ikke noen grensesnitt for å få tilgang til databasen type %s -FunctionNotAvailableInThisPHP=Ikke tilgjengelig på denne PHP -MigrateScript=Migrasjon script -ChoosedMigrateScript=Velg migrasjon script -DataMigration=Datamigrering -DatabaseMigration=Struktur databasen migrasjon -ProcessMigrateScript=Script behandling -ChooseYourSetupMode=Velg ditt oppsett modus og klikk på "Start" ... -FreshInstall=Frisk installere -FreshInstallDesc=Bruk denne modusen hvis dette er den første installere. Hvis ikke, kan denne modusen reparere en ufullstendig tidligere installere, men hvis du ønsker å oppgradere din versjon, velg "Oppgrader" modus. -Upgrade=Oppgrader -UpgradeDesc=Bruk denne modusen hvis du har erstattet gamle Dolibarr filene med filer fra en nyere versjon. Dette vil oppgradere din database og data. -Start=Start -InstallNotAllowed=Installasjonsprogrammet ikke tillates av conf.php tillatelser -NotAvailable=Ikke tilgjengelig -YouMustCreateWithPermission=Du må lage filen %s og sette skriverettigheter på den for web-serveren under installasjonsprosessen. -CorrectProblemAndReloadPage=Rett problemet og trykk F5 for å laste siden. -AlreadyDone=Allerede migrert -DatabaseVersion=Database versjon -ServerVersion=Databaseserveren versjon -YouMustCreateItAndAllowServerToWrite=Du må lage denne katalogen og la for web-serveren til å skrive inn i den. -CharsetChoice=Tegnsett valg -CharacterSetClient=Tegnsett brukes for genererte HTML-nettsider -CharacterSetClientComment=Velg tegnsettet for web visning.
Standard foreslåtte tegnsett er en av databasen. -CollationConnection=Tegn sorteringsrekkefølgen -CollationConnectionComment=Velg side kode som definerer figuren sorteringsrekkefølgen brukes av databasen. Denne parameteren blir også kalt "sortering" av noen databaser.
Denne parameteren kan ikke defineres dersom databasen allerede eksisterer. -CharacterSetDatabase=Tegnsettet for databasen -CharacterSetDatabaseComment=Velg tegnsettet ettersøkt for database skaperverk.
Denne parameteren kan ikke defineres dersom databasen allerede eksisterer. -YouAskDatabaseCreationSoDolibarrNeedToConnect=ber deg opprette database %s, men for dette, Dolibarr trenger å koble til serveren %s med superbruker %s tillatelser. -YouAskLoginCreationSoDolibarrNeedToConnect=ber deg opprette database logikk %s, men for dette, Dolibarr trenger å koble til serveren %s med superbruker %s tillatelser. -BecauseConnectionFailedParametersMayBeWrong=Som tilkobling mislyktes, må vert eller super bruker parametere være feil. -OrphelinsPaymentsDetectedByMethod=Orphans innbetaling oppdaget av metoden %s -RemoveItManuallyAndPressF5ToContinue=Fjerne det manuelt, og trykk F5 for å fortsette. -KeepDefaultValuesWamp=Du bruker Dolibarr konfigureringsveiviseren fra DoliWamp, verdiene slik foreslått her, er allerede optimalisert. Endre dem bare hvis du vet hva du gjør. -KeepDefaultValuesDeb=Du bruker Dolibarr konfigurasjonsveiviseren fra en Ubuntu eller Debian-pakke, så verdiene foreslått her allerede er optimalisert. Bare passordet til databasen eieren til å opprette må fullføres. Endre andre parametere bare hvis du vet hva du gjør. -KeepDefaultValuesMamp=Du bruker Dolibarr konfigureringsveiviseren fra DoliMamp, verdiene slik foreslått her, er allerede optimalisert. Endre dem bare hvis du vet hva du gjør. -FieldRenamed=Field omdøpt -IfLoginDoesNotExistsCheckCreateUser=Hvis logikk ikke eksisterer ennå, må du sjekke alternativet "Opprett bruker" -ErrorConnection=Server "%s", databasenavn "%s", logg inn "%s", eller database passordet er feil eller PHP-klient-versjon kan være for gammel i forhold til database versjon. -InstallChoiceRecommanded=Anbefalt valget å installere versjon %s fra din nåværende versjonen %s -InstallChoiceSuggested=Installer valg foreslått av installatør. -CheckThatDatabasenameIsCorrect=Sjekk at database navn "%s" er korrekt. -IfAlreadyExistsCheckOption=Hvis dette navnet er riktig, og at databasen ikke eksisterer ennå, du må sjekke alternativet "Opprett database". -OpenBaseDir=PHP openbasedir parameter -YouAskToCreateDatabaseSoRootRequired=Du merket "Opprett database". For dette, må du oppgi brukernavn / passord av superbruker (nederst på skjemaet). -YouAskToCreateDatabaseUserSoRootRequired=Du merket "Opprett database eier". For dette, må du oppgi brukernavn / passord av superbruker (nederst på skjemaet). -NextStepMightLastALongTime=Gjeldende trinn kan vare i flere minutter. Vennligst vent til neste skjermbildet vises helt før du fortsetter. -MigrationCustomerOrderShipping=Migrer frakt for kundeordrer oppbevaring -MigrationShippingDelivery=Oppgrader lagring av shipping -MigrationShippingDelivery2=Oppgrader lagring av shipping 2 -MigrationFixData=Fastsette for denormalized data -MigrationOrder=Data migrering for kundens ordre -MigrationSupplierOrder=Data migrering for leverandørens ordre -MigrationProposal=Data migrering for kommersielle forslag -MigrationInvoice=Data migrering for kundens fakturaer -MigrationContract=Data migrering for kontrakter -MigrationSuccessfullUpdate=Oppgrader vellykket -MigrationUpdateFailed=Mislyktes oppgraderingsprosessen -MigrationRelationshipTables=Data migrering for forholdet tabeller (%s) -MigrationPaymentsUpdate=Betaling data korreksjon -MigrationPaymentsNumberToUpdate=%s betaling (er) for å oppdatere -MigrationProcessPaymentUpdate=Oppdater betaling (er) %s -MigrationPaymentsNothingToUpdate=Ingen flere ting å gjøre -MigrationPaymentsNothingUpdatable=Ingen flere betalinger som kan korrigeres -MigrationContractsUpdate=Kontrakt data korreksjon -MigrationContractsNumberToUpdate=%s kontrakt (er) for å oppdatere -MigrationContractsLineCreation=Lag kontrakt linje for kontrakt Ref %s -MigrationContractsNothingToUpdate=Ingen flere ting å gjøre -MigrationContractsFieldDontExist=Felt fk_facture eksisterer ikke lenger. Ingenting å gjøre. -MigrationContractsEmptyDatesUpdate=Kontrakt tom dato korreksjon -MigrationContractsEmptyDatesUpdateSuccess=Kontrakt emtpy dato korreksjon gjort heldig -MigrationContractsEmptyDatesNothingToUpdate=Ingen kontrakt tom dato til korrekt -MigrationContractsEmptyCreationDatesNothingToUpdate=Ingen kontrakt opprettelsesdato å korrigere -MigrationContractsInvalidDatesUpdate=Bad valuteringsdato kontrakten korreksjon -MigrationContractsInvalidDateFix=Riktig kontrakt %s (Contract dato = %s, Starter service datoen min = %s) -MigrationContractsInvalidDatesNumber=%s kontrakter endret -MigrationContractsInvalidDatesNothingToUpdate=Ingen dato med dårlig verdi til rette -MigrationContractsIncoherentCreationDateUpdate=Bad verdi kontrakten opprettelsesdato korreksjon -MigrationContractsIncoherentCreationDateUpdateSuccess=Bad verdi kontrakten opprettelsesdato korreksjon gjort med suksess -MigrationContractsIncoherentCreationDateNothingToUpdate=Ingen dårlig verdi for kontrakten opprettelsesdato å korrigere -MigrationReopeningContracts=Åpne kontrakt lukket av feil -MigrationReopenThisContract=Åpne kontrakt %s -MigrationReopenedContractsNumber=%s kontrakter endret -MigrationReopeningContractsNothingToUpdate=Ingen lukket kontrakt for å åpne -MigrationBankTransfertsUpdate=Oppdater koblinger mellom bank transaksjon og en bankoverføring -MigrationBankTransfertsNothingToUpdate=Alle linker er oppdatert -MigrationShipmentOrderMatching=Sendings kvittering oppdatering -MigrationDeliveryOrderMatching=Levering kvittering oppdatering -MigrationDeliveryDetail=Levering oppdatering -MigrationStockDetail=Oppdater lager verdien av produkter -MigrationMenusDetail=Oppdater dynamiske menyer tabeller -MigrationDeliveryAddress=Oppdater leveringsadresse i leveransene -MigrationProjectTaskActors=Data migrering for llx_projet_task_actors bord -MigrationProjectUserResp=Data migrering feltet fk_user_resp av llx_projet å llx_element_contact -MigrationProjectTaskTime=Oppdater tid i sekunder -ForceHttps=Force beveiligde verbindingen (https) -CheckToForceHttps=Vink deze optie aan beveiligde verbindingen (https kracht).
Dit vereist dat de webserver is geconfigureerd met een SSL certificaat. -KeepDefaultValuesDeb=U gebruikt de Dolibarr setup-wizard uit een Ubuntu of Debian pakket, dus hier voorgestelde waarden zijn al geoptimaliseerd. Alleen het wachtwoord van de database-eigenaar te maken moeten worden ingevuld. Wijzig andere parameters alleen als je weet wat je doet. -CheckThatDatabasenameIsCorrect=Controleer of de database naam "%s" juist is. -IfAlreadyExistsCheckOption=Als deze naam correct is en dat de database nog niet bestaat, moet u controleren optie "Create database". -OpenBaseDir=PHP openbasedir parameter -YouAskToCreateDatabaseSoRootRequired=U gecontroleerd het vakje "Create database". Voor dit, moet je login / wachtwoord van de root (bodem van de vorm). -YouAskToCreateDatabaseUserSoRootRequired=U controleerde het vak "Create database-eigenaar". Voor dit, moet je login / wachtwoord van de root (bodem van de vorm). -NextStepMightLastALongTime=Huidig stap kan enkele minuten duren. Gelieve te wachten tot het volgende scherm wordt weergegeven voordat u verdergaat. -MigrationCustomerOrderShipping=Migreren verzendkosten voor de klant bestellingen opslag -MigrationShippingDelivery=Upgrade opslag van de scheepvaart -MigrationShippingDelivery2=Upgrade opslag van de scheepvaart 2 -MigrationFixData=Fix voor gedenormaliseerd gegevens -MigrationRelationshipTables=Data migratie voor de relatie tabellen (%s) -MigrationProjectTaskActors=Data migratie voor llx_projet_task_actors tafel -MigrationProjectUserResp=Data migratie fk_user_resp gebied van llx_projet om llx_element_contact -MigrationProjectTaskTime=Update tijd in seconden -ForceHttps=Force beveiligde verbindingen (https) -CheckToForceHttps=Vink deze optie aan beveiligde verbindingen (https kracht).
Dit vereist dat de webserver is geconfigureerd met een SSL certificaat. -MigrationCustomerOrderShipping=Migreren verzendkosten voor de klant bestellingen opslag -MigrationShippingDelivery=Upgrade opslag van de scheepvaart -MigrationShippingDelivery2=Upgrade opslag van de scheepvaart 2 -ForceHttps=Życie bezpiecznych połączeń (HTTPS) -CheckToForceHttps=Zaznacz tę opcję, aby zmusić bezpiecznych połączeń (HTTPS).
Wymaga to, aby serwer WWW jest skonfigurowany z certyfikatem SSL. -KeepDefaultValuesDeb=Państwo skorzystać z kreatora konfiguracji Dolibarr z pakietu Debiana lub Ubuntu, więc wartości proponowanego tutaj są już zoptymalizowane. Tylko hasła właściciela bazy danych do tworzenia muszą być wypełnione. Zmień inne parametry tylko jeśli wiesz co robisz. -CheckThatDatabasenameIsCorrect=Sprawdź, czy nazwa bazy danych "%s" jest poprawna. -IfAlreadyExistsCheckOption=Jeśli nazwa jest poprawna i że baza danych nie istnieje, należy sprawdzić opcję "Utwórz bazę danych". -OpenBaseDir=parametr openbasedir PHP -YouAskToCreateDatabaseSoRootRequired=Zaznaczono pole "Tworzenie bazy danych". W tym celu musisz podać login / hasło administratora (na dole formularza). -YouAskToCreateDatabaseUserSoRootRequired=Zaznaczono pole "właściciel bazy danych Utwórz". W tym celu musisz podać login / hasło administratora (na dole formularza). -NextStepMightLastALongTime=Aktualny krok może trwać kilka minut. Proszę czekać do następnego ekranu znajduje się całkowicie w niej danych. -MigrationCustomerOrderShipping=koszty migracji do przechowywania zleceń klienta -MigrationShippingDelivery=Upgrade pamięci żeglugi -MigrationShippingDelivery2=Upgrade pamięci żeglugi 2 -MigrationFixData=Ustalenie dla danych nieznormalizowaną -MigrationRelationshipTables=Migracja danych do tabel relacji (%s) -MigrationProjectTaskActors=Migracja danych do tabeli llx_projet_task_actors -MigrationProjectUserResp=Migracja danych fk_user_resp dziedzinie llx_projet do llx_element_contact -MigrationProjectTaskTime=Aktualizacja czasu spędził w sekundach -ForceHttps=conexões seguras (https) -CheckToForceHttps=Marque esta opção para forçar conexões seguras (https).
Isso exige que o servidor web está configurado com um certificado SSL. -DirectoryRecommendation=É recomendaram usar um diretório fora do diretório das suas páginas da web. -KeepDefaultValuesDeb=Você pode usar o assistente de configuração Dolibarr de um Ubuntu ou um pacote Debian, então os valores propostos aqui já estão otimizados. Apenas a senha do proprietário do banco de dados para criar tem de ser concluída. Alterar parâmetros outros apenas se você sabe o que fazer. -InstallChoiceRecommanded=Recomendado opção de instalar a versão do seu %s %s versão atual -CheckThatDatabasenameIsCorrect=Verifique se o nome do banco de dados "%s" está correto. -IfAlreadyExistsCheckOption=Se esse nome está correto e que banco de dados ainda não existe, você deve marcar a opção "Criar banco de dados". -OpenBaseDir=PHP parâmetro openbasedir -YouAskToCreateDatabaseSoRootRequired=Você marcou a caixa "Criar banco de dados". Para isso, você precisa fornecer login e senha de superusuário (parte inferior do formulário). -YouAskToCreateDatabaseUserSoRootRequired=Você marcou a caixa "Criar banco de dados proprietário". Para isso, você precisa fornecer login e senha de superusuário (parte inferior do formulário). -NextStepMightLastALongTime=etapa atual pode durar vários minutos. Por favor, aguarde até a próxima tela é mostrada completamente antes de continuar. -MigrationCustomerOrderShipping=Migrar para o transporte de armazenamento ordens do cliente -MigrationShippingDelivery=Upgrade de armazenamento de navegação -MigrationShippingDelivery2=Upgrade de armazenamento do transporte 2 -MigrationFixData=Correção de dados desnormalizada -MigrationRelationshipTables=Migração de dados para tabelas de relacionamento (%s) -MigrationProjectTaskActors=Migração de dados para llx_projet_task_actors tabela -MigrationProjectUserResp=Dados fk_user_resp domínio da migração de llx_projet para llx_element_contact -MigrationProjectTaskTime=Atualização de tempo gasto em segundos -// STOP - Lines generated via autotranslator.php tool (2010-07-17 12:41:27). - - -// START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). -// Reference language: en_US -> ro_RO -MigrationNotFinished=Versiune a bazei de date nu este complet până la data de, aşa că va trebui să rulaţi procesul de actualizare din nou. -// STOP - Lines generated via autotranslator.php tool (2010-09-04 01:57:36). - - -// START - Lines generated via autotranslator.php tool (2011-10-10 02:45:33). -// Reference language: en_US -> ro_RO -ConfFileReload=Reîncarcă toate informaţiile din fişierul de configurare. -MigrationActioncommElement=Actualizarea datelor pe acţiuni -// STOP - Lines generated via autotranslator.php tool (2011-10-10 10:08:45). +ission2401=Czytaj działań (zdarzeń lub zadań) związane z jego konta +Permission2402=Tworzenie / modyfikować / usuwać działań (zdarzeń lub zadań) związane z jego konta +Permission2403=Czytaj działań (zdarzeń lub zadań) innych +Permission2405=Tworzenie / modyfikować / usuwać działań (zdarzeń lub zadań) innych +Permission2501=Przeczytaj dokumenty +Permission2502=Prześlij dokumenty lub usunąć +Permission2515=Instalator dokumenty katalogów +DictionnaryCompanyType=Firma typy +DictionnaryCompanyJuridicalType=Juridical rodzajów spółek +DictionnaryProspectLevel=Prospect poziomu potencjalnego +DictionnaryCanton=Dzielnice +DictionnaryRegion=Regiony +DictionnaryCountry=Kraje +DictionnaryCurrency=Waluty +DictionnaryCivility=Civility tytuł +DictionnaryActions=Działania listy +DictionnarySocialContributions=Składek na ubezpieczenia społeczne typy +DictionnaryVAT=Stawek VAT +DictionnaryPaymentConditions=Warunki płatności +DictionnaryPaymentModes=Płatność tryby +DictionnaryTypeContact=Kontakt typy +DictionnaryEcotaxe=Podatku ekologicznego (WEEE) +DictionnaryPaperFormat=Księga formatów +DictionnaryFees=Rodzaj opłaty +SetupSaved=Instalator zapisane +BackToModuleList=Powrót do listy modułów +BackToDictionnaryList=Powrót do listy słowników +VATReceivedOnly=Specjalne stawki nie obciążają +VATManagement=Zarządzanie VAT +VATIsUsedDesc=The VAT rate by default when creating prospects, invoices, orders etc follow the active standard rule:
If the seller is subjected to VAT, then VAT by default=0. End of rule.
If the (selling country= buying country), then the VAT by default=VAT of the product in the selling country. End of rule.
If seller and buyer in the European Community and goods are sold having new means of transport (car, ship, plane), the default VAT=0 ( The VAT should be paid by the buyer at the customoffice of his country and not at the seller). End of rule.
If seller and buyer in the European Community and goods sold by other means rather than new means of transport, then the VAT by default=VAT of product sold. End of rule.
Else the proposed default VAT=Stawki VAT domyślnie podczas tworzenia perspektyw, faktury, zamówienia itp. następujące aktywnych standardowe zasady:
Jeśli sprzedający jest narażony na podatek VAT, wówczas podatek domyślnie= 0. Koniec rządów.
Jeśli (sprzedaż kraju= skupu kraju), a następnie VAT domyślnie= VAT produktu w sprzedaży kraju. Koniec rządów.
Jeżeli sprzedający i kupujący we Wspólnocie Europejskiej i towary są sprzedawane mając nowych środków transportu (samochód, statek, samolot), domyślne VAT= 0 (VAT powinna być zapłacona przez kupującego na customoffice swojego kraju, a nie sprzedającego ). Koniec rządów.
Jeżeli sprzedający i kupujący we Wspólnocie Europejskiej i towary sprzedawane za pomocą innych środków niż nowe środki transportu, a następnie VAT domyślnie= VAT produktu sprzedawanego. Koniec rządów.
Inne proponowane domyślne VAT= 1. Koniec rządów. +VATIsNotUsedDesc=Domyślnie proponowany VAT wynosi 0, które mogą być wykorzystane w przypadkach takich jak stowarzyszeń, osób fizycznych lub małych firm. +VATIsUsedExampleFR=We Francji, oznacza to, że firmy i organizacje o rzeczywistym systemu fiskalnego (uproszczony rzeczywistym lub normalnej rzeczywistym). A system, w którym VAT jest deklarowana. +VATIsNotUsedExampleFR=We Francji, oznacza to stowarzyszenia, które nie są zgłoszone VAT lub firm, organizacji i wolnych zawodów, które wybrały mikro przedsiębiorstw systemu fiskalnego (VAT w franczyzy) i wypłaciła franszyzowej VAT bez deklaracji VAT. Ten wybór będzie wyświetlany odniesienie "Nie dotyczy podatku VAT - art-293B z CGI" na fakturach. +LabelUsedByDefault=Wytwórnia używany domyślnie, jeśli nie można znaleźć tłumaczenie dla kodu +LabelOnDocuments=Etykieta na dokumenty +NbOfDays=Nb dni +AtEndOfMonth=Na koniec miesiąca +Offset=Offset +AlwaysActive=Zawsze aktywnych +UpdateRequired=Your system needs to be updated. To do this, click on Aktualizuj teraz. +Upgrade=Uaktualnij +AddExtensionThemeModuleOrOther=Dodaj rozszerzenie (temat, modułu, ...) +WebServer=Web server +DocumentRootServer=Web serwera katalogu +DataRootServer=Dane plików katalogu +IP=OD +Port=Port +VirtualServerName=Wirtualne nazwy serwera +AllParameters=Wszystkie parametry +OS=OS +Php=Php +PhpEnv=Env +PhpModules=Moduły +PhpConf=Conf. +PhpWebLink=Web-Php link +Pear=Pear +PearPackages=Pear Packages +Database=Baza +DatabaseName=Nazwa bazy danych +DatabasePort=Baza portu +DatabaseConfiguration=Baza danych konfiguracji +Tables=Tabele +TableName=Nazwa tabeli +TableLineFormat=Linia formacie +NbOfRecord=Nb rekordów +Constraints=Constraints +ConstraintsType=Constraint Typ +ConstraintsToShowOrNotEntry=Constraint pokazać też nie menu +AllMustBeOk=Wszystkie te muszą być sprawdzone +Host=Serwer +DriverType=Sterownik typu +SummarySystem=System informacji podsumowanie +SummaryConst=Lista wszystkich Dolibarr konfiguracji parametrów +SystemUpdate=System aktualizacji +SystemSuccessfulyUpdate=System został zaktualizowany successfuly +MenuCompanySetup=Firma / Fundacja +MenuNewUser=Nowy użytkownik +MenuTopManager=Górne menu menedżera +MenuLeftManager=Lewe menu menedżera +DefaultMenuTopManager=Górne menu menedżera +DefaultMenuLeftManager=Lewe menu menedżera +Skin=Skóra tematu +DefaultSkin=Domyślny motyw skóry +MaxSizeList=Maks. długość listy +DefaultMaxSizeList=Domyślny maks. długość listy +MessageOfDay=Wiadomość dnia +MessageLogin=Strona logowania wiadomość +PermanentLeftSearchForm=Stałe formularz wyszukiwania na lewym menu +DefaultLanguage=Domyślny język do użytku (kod języka) +EnableMultilangInterface=Włącz wielojęzyczny interfejs +SystemSuccessfulyUpdated=System został zaktualizowany +CompanyInfo=Firma / fundacja informacji +CompanyIds=Firma / fundament tożsamości +CompanyName=Imię +CompanyAddress=Adres +CompanyZip=Kod pocztowy +CompanyTown=Miasto +CompanyCountry=Kraj +CompanyCurrency=Główne waluty +DoNotShow=Nie pokazuj +DoNotSuggestPaymentMode=Nie wskazują +NoActiveBankAccountDefined=Brak aktywnego konta bankowego zdefiniowane +OwnerOfBankAccount=Właściciel konta bankowego %s +BankModuleNotActive=Rachunki bankowe modułu nie aktywny +ShowBugTrackLink=Pokaż link "Zgłoś błąd" +ShowWorkBoard=Pokaż "roboczego" na stronie głównej +Alerts=Alarmy +Delays=Opóźnienia +DelayBeforeWarning=Opóźnienie ostrzeżenie przed +DelaysBeforeWarning=Opóźnienia ostrzeżenie przed +DelaysOfToleranceBeforeWarning=Tolerancja opóźnień ostrzeżenie przed +DelaysOfToleranceDesc=Ten ekran pozwala na określenie dopuszczalnego opóźnienia przed wpisu jest zgłaszane na ekranie z picto %s dla każdego elementu późno. +DelaysOfToleranceActionsToDo=Opóźnienie tolerancji (w dniach) przed wpisu na temat planowanych działań nie został jeszcze zrealizowany +DelaysOfToleranceOrdersToProcess=Opóźnienie tolerancji (w dniach) przed wpisu dotyczącego zamówień jeszcze nie +DelaysOfTolerancePropalsToClose=Opóźnienie tolerancji (w dniach) przed wpisu w sprawie propozycji, aby zamknąć +DelaysOfTolerancePropalsToBill=Opóźnienie tolerancji (w dniach) przed wpisu na temat propozycji nie rozliczone +DelaysOfToleranceNotActivatedServices=Tolerancja opóźnienia (liczba dni) przed wpisu na usługi, aby uaktywnić +DelaysOfToleranceRunningServices=Tolerancja opóźnienie (w dniach) upłynął przed wpisu na usługi +DelaysOfToleranceSupplierBillsToPay=Tolerancja opóźnienia (liczba dni) przed wpisu na dostawcę niezapłaconych faktur +DelaysOfToleranceCustomerBillsUnpaid=Tolerancja opóźnienia (liczba dni) przed wpisu na klienta niezapłaconych faktur +DelaysOfToleranceTransactionsToConciliate=Tolerancja opóźnienia (liczba dni) przed wpisu w oczekiwaniu banku pojednania +DelaysOfToleranceChequesToDeposit=Tolerancja opóźnienia (liczba dni) przed wpisu do deponowania czeków do +SetupDescription1=Wszystkie parametry dostępne w konfiguracji obszaru pozwalają na konfigurację Dolibarr przed rozpoczęciem jej używania. +SetupDescription2=2 Najważniejsze kroki konfiguracji są 2 pierwszych w lewym menu, oznacza to, firmy / fundacji stronie konfiguracji i instalacji modułów strony: +SetupDescription3=Firma / fundacji konfiguracji jest wymagane, ponieważ wkład informacje są wykorzystywane na Dolibarr wyświetla Dolibarr i zmiany zachowań (na przykład na funkcje związane z danym kraju). +SetupDescription4=Moduły konfiguracji jest wymagane, ponieważ Dolibarr nie jest proste ERP / CRM, ale suma kilku modułów, wszystkie mniej lub bardziej niezależne. To dopiero po aktywacji modułów jesteś interesująca, widać cechy pojawiły się w Dolibarr menu. +EventsSetup=Instalator dla dzienników zdarzeń +LogEvents=Audyt bezpieczeństwa imprez +Audit=Audyt +ListEvents=Audyt wydarzenia +ListOfSecurityEvents=Lista Dolibarr bezpieczeństwa imprez +LogEventDesc=Można włączyć dziennik Dolibarr bezpieczeństwa imprez tutaj. Administratorzy mogą wtedy zobaczyć jego zawartość za pomocą menu Narzędzia systemowe - Audyt. Ostrzeżenie: Funkcja ta może zużywają duże ilości danych w bazie danych. +AreaForAdminOnly=Cechy te mogą być używane tylko przez administratora użytkowników. Administrator cechy i pomóc w Dolibarr są określone przez następujące picto: +SystemInfoDesc=System informacji jest różne informacje techniczne można uzyskać w trybie tylko do odczytu i widoczne tylko dla administratorów. +SystemAreaForAdminOnly=Obszar ten jest dostępny tylko dla administratora użytkowników. Żaden z Dolibarr uprawnień może zmniejszyć ten limit. +CompanyFundationDesc=Edycja na tej stronie informacje o wszystkich znanych spółki lub fundacji należy zarządzać +DisplayDesc=Możesz wybrać każdego z parametrów związanych z wyglądem i Dolibarr tutaj +AvailableModules=Dostępne moduły +ToActivateModule=Aby uaktywnić modules, przejdź na konfigurację Powierzchnia. +SessionTimeOut=Godzina dla sesji +SessionExplanation=Numer ten gwarantuje, że sesja nigdy nie wygaśnie przed upływem tego opóźnienia. Ale PHP sessoin zarządzania nie zawsze gwarantują, że sesja wygasa po tym terminie: Ten problem występuje, jeśli system do czyszczenia Wikisłowniku sesji jest uruchomiony.
Uwaga: nie szczególności systemu wewnętrznej PHP będzie czyste sesji każdy temat %s / %s dostępu, ale tylko podczas dostępu przez innych sesji. +TriggersAvailable=Dostępne wyzwala +TriggersDesc=Wyzwalacze są pliki, które będą modyfikować zachowania Dolibarr pracy po skopiowaniu do katalogu htdocs / includes / wyzwala. One zrealizowane nowych działań, uaktywnionego Dolibarr na imprezy (utworzenie nowej spółki, zatwierdzania faktur, ...). +TriggerDisabledByName=Wyzwalacze w tym pliku są wyłączone przez NORUN-suffix w ich imieniu. +TriggerDisabledAsModuleDisabled=Wyzwalacze w tym pliku są wyłączone jako modułu %s została wyłączona. +TriggerAlwaysActive=Wyzwalacze w tym pliku są zawsze aktywne, niezależnie są aktywowane Dolibarr modułów. +TriggerActiveAsModuleActive=Wyzwalacze w tym pliku są aktywne jako modułu %s jest aktywny. +GeneratedPasswordDesc=Określ tutaj reguły, które chcesz użyć do wygenerowania nowego hasła, jeśli zapyta się automatycznie wygenerowane hasło +DictionnaryDesc=Określ tutaj wszystkie odniesienia danych. Możesz zakończyć predefiniowane wartości Ciebie. +ConstDesc=Ta strona pozwala edytować wszystkie inne parametry nie są dostępne w poprzedniej strony. Są one zastrzeżone dla zaawansowanych parametrów deweloperzy lub troubleshouting. +OnceSetupFinishedCreateUsers=Ostrzeżenie, jesteś Dolibarr administratora użytkownika. Administrator użytkowników wykorzystywane są do konfiguracji Dolibarr. Dla Zazwyczaj korzystanie z Dolibarr, zaleca się używać nieujemnych administratora użytkownika tworzone Użytkownicy i grupy menu. +MiscellanousDesc=Określ tutaj wszystkie inne parametry związane z bezpieczeństwem. +LimitsSetup=Ograniczenia / Precision konfiguracji +LimitsDesc=Można określić limity, doprecyzowanie i optymalizacje stosowane przez Dolibarr tutaj +MAIN_MAX_DECIMALS_UNIT=Max dziesiętnych na ceny jednostkowe +MAIN_MAX_DECIMALS_TOT=Max dziesiętnych dla całkowitej ceny +MAIN_MAX_DECIMALS_SHOWN=Max dziesiętnych ceny wyświetlane na ekranie (Dodaj ... po ten numer, jeśli chcesz zobaczyć ... kiedy liczba jest obcięty przy wyświetlane na ekranie) +MAIN_DISABLE_PDF_COMPRESSION=Użyj PDF kompresji generowanych plików PDF. +ParameterActiveForNextInputOnly=Parametr skuteczne wejście tylko dla najbliższych +NoEventOrNoAuditSetup=Nr bezpieczeństwa zdarzenie zostało jeszcze zarejestrowane. To może być normalne, jeśli kontrola nie została włączona w "setup - bezpieczeństwo - audytu" strony. +NoEventFoundWithCriteria=Nr bezpieczeństwa zdarzenie zostało znalezionych dla takich kryteriów wyszukiwania. +SeeLocalSendMailSetup=Zobacz lokalnej konfiguracji sendmaila +PasswordGenerationStandard=Wróć hasło generowane zgodnie z wewnętrznym Dolibarr algorytmu: 8 znaków zawierających cyfry i znaki udostępniony w małe. +PasswordGenerationNone=Nie zgłosił żadnych wygenerowane hasło. Hasło należy wpisać ręcznie. +UserGroupSetup=Użytkownicy i grupy konfiguracji modułu +GeneratePassword=Zaproponuj wygenerowane hasło +RuleForGeneratedPasswords=Artykuł sugerował, aby wygenerować hasła +DoNotSuggest=Nie zgłosił żadnych hasło +EncryptedPasswordInDatabase=Aby umożliwić szyfrowanie haseł w bazie danych +DisableForgetPasswordLinkOnLogonPage=Nie pokazuj link "Zapomniałeś hasła" na stronie logowania +CompanySetup=Firmy konfiguracji modułu +CompanyCodeChecker=Moduł dla stron trzecich i generowania kodu kontroli (klienta lub dostawcy) +AccountCodeManager=Moduł do generowania kodu rachunkowych (klienta lub dostawcy) +ModuleCompanyCodeAquarium=Zwrócić rachunkowych kod zbudowany przez %s, a następnie trzeciej dostawcy kod dostawcy rachunkowych kod i %s, a następnie trzeciej klienta kodu dla klienta rachunkowych kodu. +ModuleCompanyCodePanicum=Wróć pusty rachunkowych kodu. +ModuleCompanyCodeDigitaria=Księgowość kod zależy od trzeciej kodu. Kod składa się z charakterem "C" na pierwszej pozycji, po którym następuje pierwsze 5 znaków w kodzie strony trzeciej. +UseNotifications=Użyj powiadomień +NotificationsDesc=Powiadomienia umożliwia automatyczne cichu wysłać mail, w przypadku niektórych Dolibarr wydarzeń, do spółek, które są skonfigurowane do +WebCalSetup=Webcalendar link konfiguracji +WebCalSyncro=Dodaj Dolibarr wydarzeń WebCalendar +WebCalAllways=Zawsze, nie pytając +WebCalYesByDefault=Na żądanie (tak domyślnie) +WebCalNoByDefault=Na życzenie (bez domyślnie) +WebCalNever=Nigdy +WebCalURL=URL kalendarza dostępu +WebCalServer=Serwerze bazy danych kalendarza +WebCalDatabaseName=Nazwa bazy danych +WebCalUser=Użytkownicy mają dostęp do bazy danych +WebCalSetupSaved=Webcalendar konfiguracji zapisany pomyślnie. +WebCalTestOk=Połączenie do serwera ' %s' w bazie danych " %s" z użytkownika' %s' powiodło się. +WebCalTestKo1=Połączenie do serwera ' %s' sukces, ale baza danych' %s' nie mógł zostać osiągnięty. +WebCalTestKo2=Połączenie do serwera ' %s' z użytkownika' %s' nie powiodło się. +WebCalErrorConnectOkButWrongDatabase=Połączenie udało, ale baza danych nie patrzy się Webcalendar danych. +WebCalAddEventOnCreateActions=Dodaj wydarzenie w kalendarzu działań utworzyć +WebCalAddEventOnCreateCompany=Dodaj wydarzenie w kalendarzu tworzyć spółki +WebCalAddEventOnStatusPropal=Dodaj wydarzenie w kalendarzu propozycji zmiany statusu +WebCalAddE \ No newline at end of file diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang index f3c76d89a2f..98336beaee8 100644 --- a/htdocs/langs/ru_RU/admin.lang +++ b/htdocs/langs/ru_RU/admin.lang @@ -1177,8 +1177,6 @@ NoteOnPathLocation=Обратите внимание, что Ваш IP, чтоб YouCanDownloadFreeDatFileTo=Вы можете скачать бесплатную демонстрационную версию страны GeoIP MaxMind файл на %s. YouCanDownloadAdvancedDatFileTo=Вы также можете скачать более полную версию, с обновлениями, в стране GeoIP MaxMind файл на %s. TestGeoIPResult=Испытание преобразование IP -> страны -NumberWordsSetup=NumberWords модуля установки -DescNumberWords=Этот модуль обеспечивает функции для преобразования числа или суммы в полном объеме символов. Она также будет заменить следующие строки вхождения __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ или __TOTAL_VAT_WORDS__ на общую вкл. налог, всего за вычетом налогов, или в общей сложности НДС во всех textes, которые используют их (в произвольной форме по счетам-фактурам, ...) ProjectsNumberingModules=Проекты нумерации модуль ProjectsSetup=Проект модуля установки ProjectsModelModule=доклад документ проекта модели diff --git a/htdocs/langs/sl_SI/admin.lang b/htdocs/langs/sl_SI/admin.lang index bbc3bc75cf8..1da1cc89011 100644 --- a/htdocs/langs/sl_SI/admin.lang +++ b/htdocs/langs/sl_SI/admin.lang @@ -1271,9 +1271,6 @@ NoteOnPathLocation = Pazite, da je mora biti vaš ip do datoteke s podatki o dr YouCanDownloadFreeDatFileTo = Brezplačno demo različico Maxmind GeoIP deželne datoteke lahko prenesete z %s. YouCanDownloadAdvancedDatFileTo = Lahko tudi prenesete bolj popolno različico, s posodobitvami, deželne datoteke Maxmind GeoIP z %s. TestGeoIPResult = Test pretvorbe IP -> država -##### NumberWords ##### = undefined -NumberWordsSetup = Nastavitev modula za izpis številke z besedami -DescNumberWords = Ta modul omogoča funkcijo pretvorbe številke ali zneska or v besedo. Zamenjani bodo tudi naslednji nizi __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ ali __TOTAL_VAT_WORDS__ z skupaj z davkom, skupaj brez davka, ali skupni davek v vseh tekstih, kjer so uporabljeni (prosto besedilo na računih, ...) ##### Projects ##### = undefined ProjectsNumberingModules = Modul za številčenje projektov ProjectsSetup = Nastavitve modula za projekte diff --git a/htdocs/langs/sv_SE/admin.lang b/htdocs/langs/sv_SE/admin.lang index 98f8bcddb19..e11387669c7 100644 --- a/htdocs/langs/sv_SE/admin.lang +++ b/htdocs/langs/sv_SE/admin.lang @@ -1138,8 +1138,6 @@ NoteOnPathLocation=Observera att ditt ip till land datafil måste vara inne i en YouCanDownloadFreeDatFileTo=Du kan ladda ner en gratis demoversion av Maxmind GeoIP landet filen på %s. YouCanDownloadAdvancedDatFileTo=Du kan också ladda ner en mer komplett version, med uppdateringar av de Maxmind GeoIP landet filen på %s. TestGeoIPResult=Test av en omvandling IP -> land -NumberWordsSetup=NumberWords modul setup -DescNumberWords=Denna modul ger funktioner för att konvertera antal eller belopp i full tecken. Det kommer också att ersätta de följande sträng händelser __TOTAL_TTC_WORDS__, __TOTAL_HT_WORDS__ eller __TOTAL_VAT_WORDS__ av totala inkl. skatt, totalt netto efter skatt, eller totalt moms i alla textes som använder dem (fri text på fakturor, ...) ProjectsNumberingModules=Projekt numrering modul ProjectsSetup=Projekt modul setup ProjectsModelModule=S rapport dokument modell diff --git a/htdocs/langs/tr_TR/admin.lang b/htdocs/langs/tr_TR/admin.lang index 034d3c862c2..baff5c967f8 100644 --- a/htdocs/langs/tr_TR/admin.lang +++ b/htdocs/langs/tr_TR/admin.lang @@ -1202,8 +1202,6 @@ SupposedToBeInvoiceDate=Kullanılan Fatura tarihinden InvoiceDateUsed=Kullanılan Fatura tarihinden AccountancyCode=Muhasebe Kodu PastDelayVCalExport=Daha olayı büyük vermeyin -NumberWordsSetup=NumberWords modülü kurulumu -DescNumberWords=Bu modül tam karakter sayısı ya da miktarı dönüştürmek için işlevler sağlar. Ayrıca __TOTAL_TTC_WORDS__ __TOTAL_HT_WORDS__ veya __TOTAL_VAT_WORDS__ toplam dahil aşağıdaki dize olaylar yerini alacak. vergisi, toplam vergi, net ve KDV toplam bunları kullanan bütün textes içine (faturalar ücretsiz metin, ...) ProjectsNumberingModules=Projeler modülü numaralandırma ProjectsSetup=Proje modülü kurulumu // STOP - Lines generated via autotranslator.php tool (2011-10-10 11:45:12). diff --git a/htdocs/langs/zh_CN/admin.lang b/htdocs/langs/zh_CN/admin.lang index fdfb097a8bf..79acd8806e1 100644 --- a/htdocs/langs/zh_CN/admin.lang +++ b/htdocs/langs/zh_CN/admin.lang @@ -1138,8 +1138,6 @@ NoteOnPathLocation=请注意您的IP到国家数据文件必须是你的PHP目 YouCanDownloadFreeDatFileTo=你可以下载一个在%s的免费演示版 geoip的国家Maxmind文件 YouCanDownloadAdvancedDatFileTo=您也可以下载一个更完整版本,更新,对Maxmind geoip的文件在%s的国家 TestGeoIPResult=试验的IP转换 - >国家 -NumberWordsSetup=NumberWords模块设置 -DescNumberWords=本模块提供的功能转换的字符数或全部数额。它也将取代以下字符串匹配__TOTAL_TTC_WORDS__,__TOTAL_HT_WORDS__或总含__TOTAL_VAT_WORDS__。税,税,增值税总额或净融入所有textes使用它们(发票上的自由文本,...) ProjectsNumberingModules=项目编号模块 ProjectsSetup=项目模块设置 ProjectsModelModule=项目的报告文档模型 diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 2bf23fcb2df..72d1822e746 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -57,11 +57,13 @@ class Livraison extends CommonObject /** - * Initialisation + * Constructor + * + * @param DoliDB $db Database handler */ - function Livraison($DB) + function Livraison($db) { - $this->db = $DB; + $this->db = $db; $this->lines = array(); $this->products = array(); @@ -72,9 +74,10 @@ class Livraison extends CommonObject } /** - * \brief Create delivery receipt in database - * \param user Objet du user qui cree - * \return int <0 si erreur, id livraison cree si ok + * Create delivery receipt in database + * + * @param User $user Objet du user qui cree + * @return int <0 si erreur, id livraison cree si ok */ function create($user) { @@ -146,7 +149,7 @@ class Livraison extends CommonObject $origin_id=$this->lines[$i]->origin_line_id; if (! $origin_id) $origin_id=$this->lines[$i]->commande_ligne_id; // For backward compatibility - if (! $this->create_line(0, $origin_id, $this->lines[$i]->qty, $this->lines[$i]->fk_product, $this->lines[$i]->description)) + if (! $this->create_line($origin_id, $this->lines[$i]->qty, $this->lines[$i]->fk_product, $this->lines[$i]->description)) { $error++; } @@ -205,10 +208,15 @@ class Livraison extends CommonObject } /** + * Create a line * - * + * @param string $origin_id Id of order + * @param string $qty Quantity + * @param string $fk_product Id of predefined product + * @param string $description Description + * @return int <0 if KO, >0 if OK */ - function create_line($transaction, $commande_ligne_id, $qty, $fk_product=0, $description) + function create_line($origin_id, $qty, $fk_product, $description) { $error = 0; $idprod = $fk_product; @@ -216,12 +224,12 @@ class Livraison extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."livraisondet (fk_livraison, fk_origin_line,"; $sql.= " fk_product, description, qty)"; - $sql.= " VALUES (".$this->id.",".$commande_ligne_id.","; + $sql.= " VALUES (".$this->id.",".$origin_id.","; $sql.= " ".($idprod>0?$idprod:"null").","; $sql.= " ".($description?"'".$this->db->escape($description)."'":"null").","; $sql.= $qty.")"; - dol_syslog("Livraison::create_line sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create_line sql=".$sql, LOG_DEBUG); if (! $this->db->query($sql) ) { $error++; @@ -234,7 +242,10 @@ class Livraison extends CommonObject } /** - * \brief Read a delivery receipt + * Load a delivery receipt + * + * @param int $id Id of object to load + * @return void */ function fetch($id) { @@ -248,7 +259,7 @@ class Livraison extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = l.rowid AND el.targettype = '".$this->element."'"; $sql.= " WHERE l.rowid = ".$id; - dol_syslog("Livraison::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -294,13 +305,13 @@ class Livraison extends CommonObject else { $this->error='Delivery with id '.$id.' not found sql='.$sql; - dol_syslog('Livraison::Fetch Error '.$this->error, LOG_ERR); + dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR); return -2; } } else { - dol_syslog('Livraison::Fetch Error '.$this->error, LOG_ERR); + dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR); $this->error=$this->db->error(); return -1; } @@ -308,7 +319,7 @@ class Livraison extends CommonObject /** * Validate object and update stock if option enabled - * + * * @param User $user Object user that validate * @return int */ @@ -317,7 +328,7 @@ class Livraison extends CommonObject global $conf, $langs; require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); - dol_syslog("livraison.class.php::valid begin"); + dol_syslog(get_class($this)."::valid begin"); $this->db->begin(); @@ -406,13 +417,13 @@ class Livraison extends CommonObject $this->statut = 1; } - dol_syslog("livraison.class.php::valid ok"); + dol_syslog(get_class($this)."::valid ok"); } else { $this->db->rollback(); $this->error=$this->db->error()." - sql=$sql"; - dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); return -1; } } @@ -421,7 +432,7 @@ class Livraison extends CommonObject else { $this->error="Non autorise"; - dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); return -1; } @@ -434,20 +445,22 @@ class Livraison extends CommonObject { $this->db->rollback(); $this->error = $interface->errors; - dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); return -1; } else { $this->db->commit(); - dol_syslog("livraison.class.php::valid commit"); return 1; } } - /** \brief Cree le bon de livraison depuis une expedition existante - * \param user Utilisateur qui cree - * \param sending_id Id de l'expedition qui sert de modele + /** + * Cree le bon de livraison depuis une expedition existante + * + * @param User $user Utilisateur qui cree + * @param int $sending_id Id de l'expedition qui sert de modele + * @return void */ function create_from_sending($user, $sending_id) { @@ -484,23 +497,28 @@ class Livraison extends CommonObject /** - * Ajoute une ligne + * Add line * + * @param int $origin_id Origin id + * @param int $qty Qty + * @return void */ - function addline( $id, $qty ) + function addline($origin_id, $qty) { $num = count($this->lines); $line = new LivraisonLigne($this->db); - $line->commande_ligne_id = $id; + $line->origin_id = $origin_id; $line->qty = $qty; $this->lines[$num] = $line; } /** + * Delete line * - * + * @param int $lineid Line id + * @return void */ function deleteline($lineid) { @@ -523,7 +541,9 @@ class Livraison extends CommonObject } /** - * Supprime la fiche + * Delete object + * + * @return void */ function delete() { @@ -594,9 +614,10 @@ class Livraison extends CommonObject } /** - * \brief Renvoie nom clicable (avec eventuellement le picto) - * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul - * \return string Chaine avec URL + * Renvoie nom clicable (avec eventuellement le picto) + * + * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * @return string Chaine avec URL */ function getNomUrl($withpicto=0) { @@ -619,8 +640,9 @@ class Livraison extends CommonObject } /** + * Load lines * - * + * @return void */ function fetch_lines() { @@ -634,7 +656,7 @@ class Livraison extends CommonObject $sql.= " WHERE ld.fk_origin_line = cd.rowid"; $sql.= " AND ld.fk_livraison = ".$this->id; - dol_syslog("Livraison::fetch_lines sql=".$sql); + dol_syslog(get_class($this)."::fetch_lines sql=".$sql); $resql = $this->db->query($sql); if ($resql) { @@ -672,8 +694,10 @@ class Livraison extends CommonObject /** - * \brief Retourne le libelle du statut d'une expedition - * \return string Libelle + * Retourne le libelle du statut d'une expedition + * + * @param int $mode Mode + * @return string Label */ function getLibStatut($mode=0) { @@ -681,10 +705,11 @@ class Livraison extends CommonObject } /** - * \brief Renvoi le libelle d'un statut donne - * \param statut Id statut - * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * \return string Libelle + * Renvoi le libelle d'un statut donne + * + * @param int $statut Id statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label */ function LibStatut($statut,$mode) { @@ -766,9 +791,10 @@ class Livraison extends CommonObject } /** - * \brief Renvoie la quantite de produit restante a livrer pour une commande - * \return array Product remaining to be delivered - * TODO use new function + * Renvoie la quantite de produit restante a livrer pour une commande + * + * @return array Product remaining to be delivered + * TODO use new function */ function getRemainingDelivered() { @@ -847,8 +873,7 @@ class Livraison extends CommonObject /** - * \class LivraisonLigne - * \brief Classe de gestion des lignes de bons de livraison + * Classe de gestion des lignes de bons de livraison */ class LivraisonLigne { @@ -860,14 +885,19 @@ class LivraisonLigne var $qty_shipped; var $price; var $fk_product; - var $commande_ligne_id; + var $origin_id; var $label; // Label produit var $description; // Description produit var $ref; - function LivraisonLigne($DB) + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function LivraisonLigne($db) { - $this->db=$DB; + $this->db=$db; } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f072d5c709e..7b8fb96bdf8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -88,7 +88,7 @@ class Product extends CommonObject // Statut indique si le produit est un produit fini '1' ou une matiere premiere '0' var $finished; - var $customcode; // Custom code + var $customcode; // Customs code var $country_id; // Country origin id var $country_code; // Country origin code (US, FR, ...) @@ -479,7 +479,7 @@ class Product extends CommonObject return -2; } } - + if (! $notrigger) { // Appel des triggers @@ -526,23 +526,6 @@ class Product extends CommonObject { $this->db->begin(); - // Delete supplier prices log - /*if (! $error) - { - $sql = 'DELETE pfpl'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'product_fournisseur_price_log as pfpl, '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp'; - $sql.= ' WHERE pfpl.fk_product_fournisseur = pfp.rowid'; - $sql.= ' AND pf.fk_product = '.$id; - dol_syslog(get_class($this).'::delete sql='.$sql, LOG_DEBUG); - $result = $this->db->query($sql); - if (! $result) - { - $error++; - $this->error = $this->db->lasterror(); - dol_syslog(get_class($this).'::delete error '.$this->error, LOG_ERR); - } - }*/ - // Delete supplier prices if (! $error) { @@ -639,6 +622,7 @@ class Product extends CommonObject return 0; } } + return 0; } /** @@ -1018,13 +1002,13 @@ class Product extends CommonObject global $langs, $conf; - dol_syslog("Product::fetch id=$id ref=$ref ref_ext=$ref_ext"); + dol_syslog(get_class($this)."::fetch id=".$id." ref=".$ref." ref_ext=".$ref_ext); // Check parameters if (! $id && ! $ref && ! $ref_ext) { $this->error=$langs->trans('ErrorWrongParameters'); - dol_print_error("Product::fetch ".$this->error, LOG_ERR); + dol_print_error(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; } @@ -1039,7 +1023,7 @@ class Product extends CommonObject else if ($ref) $sql.= " WHERE ref = '".$this->db->escape($ref)."'"; else if ($ref_ext) $sql.= " WHERE ref_ext = '".$this->db->escape($ref_ext)."'"; - dol_syslog("Product::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch sql=".$sql); $resql = $this->db->query($sql); if ( $resql ) { @@ -1173,7 +1157,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.rowid = pd.fk_propal"; $sql.= " AND p.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND pd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; //$sql.= " AND pr.fk_statut != 0"; @@ -1216,7 +1200,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = cd.fk_commande"; $sql.= " AND c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND cd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid; @@ -1258,7 +1242,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = cd.fk_commande"; $sql.= " AND c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND cd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid; @@ -1301,7 +1285,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE e.rowid = ed.fk_expedition"; $sql.= " AND e.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND e.entity = ".$conf->entity; $sql.= " AND ed.fk_origin_line = cd.rowid"; $sql.= " AND cd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND e.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -1344,7 +1328,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = cd.fk_contrat"; $sql.= " AND c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND cd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; //$sql.= " AND c.statut != 0"; @@ -1386,7 +1370,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.rowid = fd.fk_facture"; $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND fd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; //$sql.= " AND f.fk_statut != 0"; @@ -1428,7 +1412,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.rowid = fd.fk_facture_fourn"; $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND fd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; //$sql.= " AND f.fk_statut != 0"; @@ -1526,7 +1510,7 @@ class Product extends CommonObject $sql.= " WHERE f.rowid = d.fk_facture"; $sql.= " AND d.fk_product =".$this->id; $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql.= " AND f.fk_soc = $socid"; $sql.= " GROUP BY date_format(f.datef,'%Y%m')"; @@ -1555,7 +1539,7 @@ class Product extends CommonObject $sql.= " WHERE f.rowid = d.fk_facture_fourn"; $sql.= " AND d.fk_product =".$this->id; $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql.= " AND f.fk_soc = $socid"; $sql.= " GROUP BY date_format(f.datef,'%Y%m')"; @@ -1584,7 +1568,7 @@ class Product extends CommonObject $sql.= " WHERE p.rowid = d.fk_propal"; $sql.= " AND d.fk_product =".$this->id; $sql.= " AND p.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND p.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql.= " AND p.fk_soc = ".$socid; $sql.= " GROUP BY date_format(p.datep,'%Y%m')"; @@ -1611,7 +1595,7 @@ class Product extends CommonObject $sql.= " WHERE c.rowid = d.fk_commande"; $sql.= " AND d.fk_product =".$this->id; $sql.= " AND c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid; $sql.= " GROUP BY date_format(c.date_commande,'%Y%m')"; @@ -2371,7 +2355,7 @@ class Product extends CommonObject /** * Load information about stock of a product into stock_warehouse[] and stock_reel * - * @return int < 0 si erreur, > 0 si ok + * @return int < 0 if KO, > 0 if OK */ function load_stock() { @@ -2381,7 +2365,7 @@ class Product extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."product_stock"; $sql.= " WHERE fk_product = '".$this->id."'"; - dol_syslog("Product::load_stock sql=".$sql); + dol_syslog(get_class($this)."::load_stock sql=".$sql); $result = $this->db->query($sql); if ($result) { @@ -2403,7 +2387,7 @@ class Product extends CommonObject } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); return -1; } } @@ -2938,4 +2922,4 @@ class Product extends CommonObject $this->note='This is a comment (private)'; } } -?> \ No newline at end of file +?> diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 690f6c8ea7f..79ec4d6f9ce 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -771,7 +771,7 @@ else print ''; } - // Custom code + // Customs code print '
'; // Origin country @@ -961,7 +961,7 @@ else print ''; } - // Custom code + // Customs code print ''; // Origin country @@ -1177,7 +1177,7 @@ else print "\n"; } - // Custom code + // Customs code print ''; // Origin country code diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 7c11bcb3f2c..63739a4f44f 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -272,7 +272,8 @@ print "
'; + print '
'; print ''; print ''; if ($mysoc->logo_mini) @@ -708,7 +708,7 @@ else $var=!$var; print '
'.$langs->trans("Logo").''; - print ''; - - if ($mil->statut == 0) - { - print ''; - print ''; - } - - print ''; - - /* - print '"; - */ - $nbofrecipient=$obj->getNbOfRecipients(); - print ''; - - print ''; - - print ''; - - if ($mil->statut == 0) print ''; - - print "\n"; - } - } + if ($reg[1] == 'example') continue; + $modulenames[]=$reg[1]; } } - closedir($handle); + } + closedir($handle); + } + + // Sort $modulenames + sort($modulenames); + + // Loop on each submodule + foreach($modulenames as $modulename) + { + // Chargement de la classe + $file = $dir.$modulename.".modules.php"; + $classname = "mailing_".$modulename; + require_once($file); + + $obj = new $classname($db); + + $qualified=1; + foreach ($obj->require_module as $key) + { + if (! $conf->$key->enabled || (! $user->admin && $obj->require_admin)) + { + $qualified=0; + //print "Les prerequis d'activation du module mailing ne sont pas respectes. Il ne sera pas actif"; + break; + } + } + + // Si le module mailing est qualifie + if ($qualified) + { + $var = !$var; + print ''; + + if ($mil->statut == 0) + { + print ''; + print ''; + } + + print ''; + + /* + print '"; + */ + $nbofrecipient=$obj->getNbOfRecipients(); + print ''; + + print ''; + + print ''; + + if ($mil->statut == 0) print ''; + + print "\n"; } } } // End foreach dir @@ -511,7 +541,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0) } -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index 3d9ed3de3b6..790c4a8a1ee 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -152,7 +152,7 @@ if ($_socid > 0) print ''; print ''; $userstatic->id=$obj->uid; - $userstatic->nom=$obj->login; + $userstatic->lastname=$obj->login; print ''; print ''; $i++; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a9f088dd77b..e1a50e5e6fa 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1808,7 +1808,7 @@ else if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid'; $sql.= ' WHERE p.fk_soc = s.rowid'; - $sql.= ' AND s.entity = '.$conf->entity; + $sql.= ' AND p.entity = '.$conf->entity; if (!$user->rights->societe->client->voir && !$socid) //restriction { diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 1a070e87d8a..28feac26022 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -67,7 +67,7 @@ class PropaleStats extends Stats $this->field='total_ht'; $this->where.= " fk_statut > 0"; - $this->where.= " AND p.fk_soc = s.rowid AND s.entity = ".$conf->entity; + $this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if($this->socid) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index b6fe67d4122..809a5e3a76a 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Destailleur Laurent + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,12 +34,10 @@ $langs->load("orders"); $langs->load("sendings"); $langs->load("companies"); -$id=GETPOST('id'); -$ligne=GETPOST('ligne'); -$lineid=GETPOST('lineid'); -$action=GETPOST('action'); - -$id = isset($id)?$id:''; +$id=GETPOST('id', 'int'); +$ref= GETPOST('ref', 'alpha'); +$lineid=GETPOST('lineid', 'int'); +$action=GETPOST('action', 'alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -49,7 +48,7 @@ $result = restrictedArea($user, 'propale', $id, 'propal'); * Ajout d'un nouveau contact */ -if ($_POST["action"] == 'addcontact' && $user->rights->propale->creer) +if ($action == 'addcontact' && $user->rights->propale->creer) { $result = 0; @@ -63,7 +62,7 @@ if ($_POST["action"] == 'addcontact' && $user->rights->propale->creer) if ($result >= 0) { - Header("Location: contact.php?id=".$propal->id); + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$propal->id); exit; } else @@ -103,10 +102,11 @@ if ($action == 'deleteline' && $user->rights->propale->creer) if ($result >= 0) { - Header("Location: contact.php?id=".$propal->id); + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$propal->id); exit; } - else { + else + { dol_print_error($db); } } @@ -131,27 +131,23 @@ $userstatic=new User($db); /* *************************************************************************** */ dol_htmloutput_mesg($mesg); -$id = $id; -$ref= GETPOST('ref'); if ($id > 0 || ! empty($ref)) { $propal = New Propal($db); - if ( $propal->fetch($id,$ref) > 0) + if ($propal->fetch($id,$ref) > 0) { $soc = new Societe($db); $soc->fetch($propal->socid); - $head = propal_prepare_head($propal); dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal'); - /* - * Propal synthese pour rappel - */ + * Propal synthese pour rappel + */ print '
'; + print ''; } @@ -528,7 +530,7 @@ else // Port $var=!$var; - if ($linuxlike && ($conf->global->MAIN_MAIL_SENDMODE == 'mail' || $conf->global->MAIN_MAIL_SENDMODE == 'simplemail')) + if ($linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print ''; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 8c9d2e18328..57ee3b7e395 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -72,16 +72,8 @@ llxHeader('',$langs->trans("Setup"),$help_url); print_fiche_titre($langs->trans("ModulesSetup"),'','setup'); -// Search modules -$filename = array(); -$modules = array(); -$orders = array(); -$categ = array(); -$dirmod = array(); +// Search modules dirs $modulesdir = array(); -$i = 0; // is a sequencer of modules found -$j = 0; // j is module number. Automatically affected if module number not defined. - foreach ($conf->file->dol_document_root as $type => $dirroot) { $modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/'; @@ -104,6 +96,15 @@ foreach ($conf->file->dol_document_root as $type => $dirroot) } //var_dump($modulesdir); + +$filename = array(); +$modules = array(); +$orders = array(); +$categ = array(); +$dirmod = array(); +$i = 0; // is a sequencer of modules found +$j = 0; // j is module number. Automatically affected if module number not defined. + foreach ($modulesdir as $dir) { // Load modules attributes in arrays (name, numero, orders) from dir directory diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 9855c45a0dc..bc228be0711 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -24,7 +24,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/triggers/interface_modNotification_Notification.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/triggers/interface_50_modNotification_Notification.class.php"); $langs->load("admin"); $langs->load("other"); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 8c7e6937a47..d16462390d0 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -223,11 +223,18 @@ else // Show // Show pdf format $var=!$var; print ''; print '
'; print $mysoc->logo; print ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 46fea7a992c..ab09048a624 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2009-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -52,18 +52,18 @@ $action=GETPOST('action'); if ($action == 'update' && empty($_POST["cancel"])) { - dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", $_POST["MAIN_DISABLE_ALL_MAILS"],'chaine',0,'',$conf->entity); - - dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", $_POST["MAIN_MAIL_SENDMODE"],'chaine',0,'',0); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", $_POST["MAIN_MAIL_SMTP_PORT"],'chaine',0,'',0); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", $_POST["MAIN_MAIL_SMTP_SERVER"],'chaine',0,'',0); - if (isset($_POST["MAIN_MAIL_SMTPS_ID"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", $_POST["MAIN_MAIL_SMTPS_ID"],'chaine',0,'',0); - if (isset($_POST["MAIN_MAIL_SMTPS_PW"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", $_POST["MAIN_MAIL_SMTPS_PW"],'chaine',0,'',0); - if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); - - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity); + // Send mode parameters + dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',0); + if (isset($_POST["MAIN_MAIL_SMTP_PORT"])) dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',0); + if (isset($_POST["MAIN_MAIL_SMTP_SERVER"])) dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"),'chaine',0,'',0); + if (isset($_POST["MAIN_MAIL_SMTPS_ID"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine',0,'',0); + if (isset($_POST["MAIN_MAIL_SMTPS_PW"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine',0,'',0); + if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"),'chaine',0,'',0); + // Content parameters + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -83,7 +83,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) if (create_exdir($upload_dir) >= 0) { - $resupload=dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0,0,$_FILES['addedfile']['error']); + $resupload=dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'], 1, 0, $_FILES['addedfile']['error']); if (is_numeric($resupload) && $resupload > 0) { $mesg = '
'.$langs->trans("FileTransferComplete").'
'; @@ -115,8 +115,8 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) $mesg = '
'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'
'; } - if ($_POST['addfile']) $_GET["action"]='test'; - if ($_POST['addfilehtml']) $_GET["action"]='testhtml'; + if ($_POST['addfile']) $action='test'; + if ($_POST['addfilehtml']) $action='testhtml'; } /* @@ -153,8 +153,8 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) $formmail->remove_attached_files($keytodelete); } } - if ($_POST['removedfile']) $_GET["action"]='test'; - if ($_POST['removedfilehtml']) $_GET["action"]='testhtml'; + if ($_POST['removedfile'] || $action='send') $action='test'; + if ($_POST['removedfilehtml'] || $action='sendhtml') $action='testhtml'; } /* @@ -189,20 +189,20 @@ if (($action == 'send' || $action == 'sendhtml') if (empty($_POST["frommail"])) { $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")).'
'; - $_GET["action"]='test'; + $action='test'; $error++; } if (empty($sendto)) { $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")).'
'; - $_GET["action"]='test'; + $action='test'; $error++; } if (! $error) { // Le message est-il en html $msgishtml=0; // Message is not HTML - if ($_POST['action'] == 'sendhtml') $msgishtml=1; // Force message to HTML + if ($action == 'sendhtml') $msgishtml=1; // Force message to HTML // Pratique les substitutions sur le sujet et message $subject=make_substitutions($subject,$substitutionarrayfortest); @@ -226,7 +226,7 @@ if (($action == 'send' || $action == 'sendhtml') $message='
'.$langs->trans("ResultKo").'
'.$mailfile->error.' '.$result.'
'; } - $_GET["action"]=''; + $action=''; } } @@ -351,7 +351,7 @@ if ($action == 'edit') // Server $var=!$var; print '
'; - if (! $conf->use_javascript_ajax && $linuxlike && ($conf->global->MAIN_MAIL_SENDMODE == 'mail' || $conf->global->MAIN_MAIL_SENDMODE == 'simplemail')) + if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print ''; @@ -367,6 +367,7 @@ if ($action == 'edit') if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { print ''; + print ''; } else { @@ -381,7 +382,7 @@ if ($action == 'edit') // Port $var=!$var; print '
'; - if (! $conf->use_javascript_ajax && $linuxlike && ($conf->global->MAIN_MAIL_SENDMODE == 'mail' || $conf->global->MAIN_MAIL_SENDMODE == 'simplemail')) + if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); print ''; @@ -397,6 +398,7 @@ if ($action == 'edit') if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { print ''; + print ''; } else { @@ -517,7 +519,7 @@ else // Server $var=!$var; - if ($linuxlike && ($conf->global->MAIN_MAIL_SENDMODE == 'mail' || $conf->global->MAIN_MAIL_SENDMODE == 'simplemail')) + if ($linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("DictionnaryPaperFormat").''; - $pdfformatlabel=$conf->global->MAIN_PDF_FORMAT; - if (! empty($conf->global->MAIN_PDF_FORMAT)) + + if (empty($conf->global->MAIN_PDF_FORMAT)) + { + include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); + $pdfformatlabel=dol_getDefaultFormat(); + } + else $pdfformatlabel=$conf->global->MAIN_PDF_FORMAT; + + if (! empty($pdfformatlabel)) { $sql="SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX."c_paper_format"; - $sql.=" WHERE code LIKE '%".$conf->global->MAIN_PDF_FORMAT."%'"; + $sql.=" WHERE code LIKE '%".$db->escape($pdfformatlabel)."%'"; $resql=$db->query($sql); if ($resql) diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 39f185c4a21..d3860512d1e 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ /** * \file htdocs/admin/triggers.php - * \brief Page de configuration et activation des triggers + * \brief Page to view triggers */ require("../main.inc.php"); @@ -25,13 +25,13 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/interfaces.class.php"); $langs->load("admin"); -if (!$user->admin) - accessforbidden(); +if (!$user->admin) accessforbidden(); /* * Action */ +// None /* @@ -50,9 +50,11 @@ print "
\n"; $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); -$triggers = $interfaces->getTriggersList(0); +$triggers = $interfaces->getTriggersList(0,'priority'); include($template_dir.'triggers.tpl.php'); llxFooter(); + +$db->close(); ?> diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index bbd5883f283..f3539e672cd 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -40,9 +40,9 @@ if (empty($phone)) exit; } -$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."societe as s"; +$sql = "SELECT nom as name FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid"; -$sql.= " WHERE s.entity=".$conf->entity; +$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND (s.tel='".$db->escape($phone)."'"; $sql.= " OR sp.phone='".$db->escape($phone)."'"; $sql.= " OR sp.phone_perso='".$db->escape($phone)."'"; @@ -53,10 +53,10 @@ dol_syslog('cidlookup search information with phone '.$phone, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { - $row = $db->fetch_object($resql); - if ($row) + $obj = $db->fetch_object($resql); + if ($obj) { - $found = $row->nom; + $found = $obj->name; } $db->free($resql); } diff --git a/htdocs/bookmarks/fiche.php b/htdocs/bookmarks/fiche.php index 1e9a3cd23bc..67bd962e747 100644 --- a/htdocs/bookmarks/fiche.php +++ b/htdocs/bookmarks/fiche.php @@ -230,7 +230,6 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"])) { $fuser=new User($db); $fuser->fetch($bookmark->fk_user); - //$fuser->nom=$fuser->login; $fuser->prenom=''; print $fuser->getNomUrl(1); } else diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php index cb05a23c77e..10bbd015cf6 100644 --- a/htdocs/bookmarks/liste.php +++ b/htdocs/bookmarks/liste.php @@ -127,7 +127,7 @@ if ($resql) require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); $societe=new Societe($db); $societe->fetch($obj->rowid); - $obj->title=$societe->nom; + $obj->title=$societe->name; } $title=img_object($langs->trans("ShowCompany"),"company").' '.$obj->title; } @@ -154,7 +154,7 @@ if ($resql) if ($obj->fk_user) { $userstatic->id=$obj->fk_user; - $userstatic->nom=$obj->login; + $userstatic->lastname=$obj->login; print $userstatic->getNomUrl(1); } else diff --git a/htdocs/boutique/client/class/boutiqueclient.class.php b/htdocs/boutique/client/class/boutiqueclient.class.php index 837afb5497c..a84b81ed6a7 100644 --- a/htdocs/boutique/client/class/boutiqueclient.class.php +++ b/htdocs/boutique/client/class/boutiqueclient.class.php @@ -37,11 +37,11 @@ class BoutiqueClient /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function BoutiqueClient($DB) + function BoutiqueClient($db) { - $this->db = $DB; + $this->db = $db; } /** diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php index 85e2c8f99b4..bd6428684e4 100644 --- a/htdocs/boutique/client/fiche.php +++ b/htdocs/boutique/client/fiche.php @@ -33,12 +33,7 @@ include_once(DOL_DOCUMENT_ROOT.'/boutique/client/class/boutiqueclient.class.php' * Actions */ -if ($action == 'update' && !$cancel) -{ - $client = new BoutiqueClient($dbosc); - $client->nom = $nom; - $client->update($id, $user); -} +// None diff --git a/htdocs/boutique/critiques/class/critique.class.php b/htdocs/boutique/critiques/class/critique.class.php index e47385d3876..eca4877b0ed 100644 --- a/htdocs/boutique/critiques/class/critique.class.php +++ b/htdocs/boutique/critiques/class/critique.class.php @@ -23,8 +23,7 @@ /** - * \class Critique - * \brief Classe permettant la gestion des critiques OSCommerce + * Classe permettant la gestion des critiques OSCommerce */ class Critique { @@ -40,7 +39,7 @@ class Critique */ function Critique($db) { - $this->db = $DB; + $this->db = $db; } /** diff --git a/htdocs/boutique/notification/fiche.php b/htdocs/boutique/notification/fiche.php deleted file mode 100644 index a1071d71ddb..00000000000 --- a/htdocs/boutique/notification/fiche.php +++ /dev/null @@ -1,152 +0,0 @@ - - * Copyright (C) 2004-2006 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/boutique/notification/fiche.php - * \ingroup boutique - * \brief Page fiche notification OS Commerce - */ - -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); - - -/* - * View - */ - -llxHeader(); - -if ($action == 'add') { - $editeur = new Editeur($dbosc); - - $editeur->nom = $nom; - - $id = $editeur->create($user); -} - -if ($action == 'addga') { - $editeur = new Editeur($dbosc); - - $editeur->linkga($id, $ga); -} - - -if ($action == 'update' && !$cancel) { - $editeur = new Editeur($dbosc); - - $editeur->nom = $nom; - - $editeur->update($id, $user); -} - -/* - * - * - */ -if ($action == 'create') -{ - - print "
\n"; - print ''; - print ''; - - print '
Nouvel Editeur

'; - - print ''; - print ""; - print ''; - print ''; - print '
Nom
 
'; - print '
'; - - -} -else -{ - if ($id) - { - - $editeur = new Editeur($dbosc); - $result = $editeur->fetch($id); - - if ( $result ) - { - if ($action == 'edit') - { - print '
Edition de la fiche Editeur : '.$editeur->titre.'

'; - - print "
\n"; - print ''; - print ''; - - print ''; - print ""; - print ''; - - - print ''; - - print ''; - - print '
Nom
 

'; - - } - - print '
Fiche Editeur : '.$editeur->titre.'

'; - - print ''; - print ""; - print ''; - print "
Nom'.$editeur->nom.'
"; - - - - } - else - { - print "Fetch failed"; - } - - - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - - -print '
'; -if ($action != 'create') -{ - print ''.$langs->trans("Modify").''; -} -print '
'; - - -$dbosc->close(); - -llxFooter(); -?> diff --git a/htdocs/boutique/notification/index.php b/htdocs/boutique/notification/index.php index 7516bfad6c2..06715f51588 100644 --- a/htdocs/boutique/notification/index.php +++ b/htdocs/boutique/notification/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2003 �ric Seigne + * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2006 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 2ac3afab931..c982bfbcdbd 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -528,7 +528,7 @@ class ActionComm extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ")"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " WHERE a.percent >= 0 AND a.percent < 100"; $sql.= " AND a.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND a.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -800,7 +800,7 @@ class ActionComm extends CommonObject $sql.= " c.id as type_id, c.code as type_code, c.libelle"; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc AND s.entity IN (0, ".$conf->entity.")"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; $sql.= " WHERE a.fk_action=c.id"; $sql.= " AND a.entity = ".$conf->entity; foreach ($filters as $key => $value) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index bc293d9485f..76a15422aa1 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -156,7 +156,7 @@ $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; $sql.= " ".MAIN_DB_PREFIX.'user as u,'; $sql.= " ".MAIN_DB_PREFIX."actioncomm as a)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON a.fk_user_author = ua.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ut ON a.fk_user_action = ut.rowid"; diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 62793e86d27..38c9c4bed4c 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2009 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,19 +28,19 @@ require("../main.inc.php"); $langs->load("companies"); -$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; -$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; -$page=$_GET["page"]; +$sortfield=GETPOST('sortfield', 'alpha'); +$sortorder=GETPOST('sortorder', 'alpha'); +$page=GETPOST('page', 'int'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.name"; -if ($page < 0) { $page = 0 ; } +if ($page < 0) { $page = 0; } $limit = $conf->liste_limit; $offset = $limit * $page ; $type=$_GET["type"]; // Security check -$socid = isset($_GET["socid"])?$_GET["socid"]:''; +$socid = GETPOST('socid'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'societe',$socid,''); @@ -75,12 +75,12 @@ if ($type == "f") $sql = "SELECT s.rowid, s.nom, st.libelle as stcomm"; $sql.= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone"; $sql.= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; +if (! $user->rights->societe->client->voir && ! $socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; $sql.= " ".MAIN_DB_PREFIX."socpeople as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND p.entity = ".$conf->entity; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +$sql.= " AND p.entity IN (".getEntity('societe', 1).")"; +if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($type == "c") $sql.= " AND s.client IN (1, 3)"; if ($type == "p") $sql.= " AND s.client IN (2, 3)"; if ($type == "f") $sql.= " AND s.fournisseur = 1"; @@ -93,27 +93,27 @@ if (dol_strlen($stcomm)) if (dol_strlen($begin)) // filtre sur la premiere lettre du nom { - $sql.= " AND upper(p.name) like '$begin%'"; + $sql.= " AND upper(p.name) LIKE '".$begin."%'"; } if (trim($_GET["search_nom"])) { - $sql.= " AND p.name like '%".trim($_GET["search_nom"])."%'"; + $sql.= " AND p.name LIKE '%".trim($_GET["search_nom"])."%'"; } if (trim($_GET["search_prenom"])) { - $sql.= " AND p.firstname like '%".trim($_GET["search_prenom"])."%'"; + $sql.= " AND p.firstname LIKE '%".trim($_GET["search_prenom"])."%'"; } if (trim($_GET["search_societe"])) { - $sql.= " AND s.nom like '%".trim($_GET["search_societe"])."%'"; + $sql.= " AND s.nom LIKE '%".trim($_GET["search_societe"])."%'"; } if ($_GET["contactname"]) // acces a partir du module de recherche { - $sql.= " AND ( p.name like '%".strtolower($_GET["contactname"])."%' OR lower(p.firstname) like '%".strtolower($_GET["contactname"])."%') "; + $sql.= " AND (p.name LIKE '%".strtolower($_GET["contactname"])."%' OR lower(p.firstname) LIKE '%".strtolower($_GET["contactname"])."%') "; $sortfield = "p.name"; $sortorder = "ASC"; } @@ -178,7 +178,8 @@ else dol_print_error($db); } +llxFooter(); + $db->close(); -llxFooter(); ?> diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 025ee92c122..a7ec49e4aa9 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -141,11 +141,11 @@ if ($conf->propal->enabled && $user->rights->propale->lire) $sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_statut = 0"; $sql.= " AND p.fk_soc = s.rowid"; $sql.= " AND p.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $resql=$db->query($sql); @@ -208,11 +208,11 @@ if ($conf->commande->enabled && $user->rights->commande->lire) $sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND c.fk_soc = ".$socid; $resql = $db->query($sql); @@ -283,10 +283,10 @@ if ($conf->societe->enabled && $user->rights->societe->lire) $sql = "SELECT s.rowid, s.nom as name, s.client, s.datec,s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.client IN (1, 2, 3)"; - $sql.= " AND s.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + $sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = $socid"; $sql .= " ORDER BY s.tms DESC"; $sql .= $db->plimit($max, 0); @@ -343,10 +343,10 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire) $sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fournisseur = 1"; - $sql.= " AND s.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + $sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")"; + if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY s.datec DESC"; $sql.= $db->plimit($max, 0); @@ -418,12 +418,11 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."contrat as c"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; - //$sql.= " AND c.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_product = p.rowid"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY c.tms DESC"; $sql.= $db->plimit(5, 0); @@ -475,11 +474,11 @@ if ($conf->propal->enabled && $user->rights->propale->lire) $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_soc = s.rowid"; $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND p.fk_statut = 1"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY p.rowid DESC"; @@ -548,8 +547,8 @@ if ($conf->propal->enabled && $user->rights->propale->lire) print '
'; +llxFooter(); + $db->close(); - -llxFooter(); ?> \ No newline at end of file diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index b4d9aa44d4d..9f4f5087cee 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -32,16 +32,11 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); $langs->load("mails"); // Security check -if (! $user->rights->mailing->lire || $user->societe_id > 0) -accessforbidden(); - - -$dirmod=DOL_DOCUMENT_ROOT."/core/modules/mailings"; +if (! $user->rights->mailing->lire || $user->societe_id > 0) accessforbidden(); $mesg = ''; - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -52,50 +47,78 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="email"; -$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"]; -$search_prenom=isset($_GET["search_prenom"])?$_GET["search_prenom"]:$_POST["search_prenom"]; -$search_email=isset($_GET["search_email"])?$_GET["search_email"]:$_POST["search_email"]; +$id=GETPOST('rowid')?GETPOST('rowid'):GETPOST('id'); +$action=GETPOST("action"); +$search_nom=GETPOST("search_nom"); +$search_prenom=GETPOST("search_prenom"); +$search_email=GETPOST("search_email"); + +// Search modules dirs +$modulesdir = array(); +foreach ($conf->file->dol_document_root as $type => $dirroot) +{ + $modulesdir[$dirroot . '/core/modules/mailings/'] = $dirroot . '/core/modules/mailings/'; + + $handle=@opendir($dirroot); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') + { + if (is_dir($dirroot . '/' . $file . '/core/modules/mailings/')) + { + $modulesdir[$dirroot . '/' . $file . '/core/modules/mailings/'] = $dirroot . '/' . $file . '/core/modules/mailings/'; + } + } + } + closedir($handle); + } +} +//var_dump($modulesdir); + +$dirmod=DOL_DOCUMENT_ROOT."/core/modules/mailings"; /* * Actions */ -if ($_GET["action"] == 'add') +if ($action == 'add') { - $modulename=$_GET["module"]; - $result=0; + $module=GETPOST("module"); + $result=-1; $var=true; - foreach ($conf->file->dol_document_root as $dirmod) + + foreach ($modulesdir as $dir) { - $dir=$dirmod."/core/modules/mailings/"; + // Load modules attributes in arrays (name, numero, orders) from dir directory + //print $dir."\n
"; + dol_syslog("Scan directory ".$dir." for modules"); - if (is_dir($dir)) + // Chargement de la classe + $file = $dir."/".$module.".modules.php"; + $classname = "mailing_".$module; + + if (file_exists($file)) { - // Chargement de la classe - $file = $dir."/".$modulename.".modules.php"; - $classname = "mailing_".$modulename; + require_once($file); - if (file_exists($file)) - { - require_once($file); + // We fill $filtersarray. Using this variable is now deprecated. + // Kept for backward compatibility. + $filtersarray=array(); + if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"]; - // We fill $filtersarray. Using this variable is now deprecated. - // Kept for backward compatibility. - $filtersarray=array(); - if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"]; - - // Add targets into database - $obj = new $classname($db); - $result=$obj->add_to_target($_GET["rowid"],$filtersarray); - } + // Add targets into database + $obj = new $classname($db); + $result=$obj->add_to_target($id,$filtersarray); } } if ($result > 0) { - Header("Location: cibles.php?id=".$_GET["rowid"]); + Header("Location: cibles.php?id=".$id); exit; } if ($result == 0) @@ -104,12 +127,11 @@ if ($_GET["action"] == 'add') } if ($result < 0) { - $mesg='
'.$obj->error.'
'; + $mesg='
'.$langs->trans("Error").($obj->error?' '.$obj->error:'').'
'; } - $_REQUEST["id"]=$_GET["rowid"]; } -if ($_GET["action"] == 'clear') +if ($action == 'clear') { // Chargement de la classe $file = $dirmod."/modules_mailings.php"; @@ -117,16 +139,16 @@ if ($_GET["action"] == 'clear') require_once($file); $obj = new $classname($db); - $obj->clear_target($_GET["rowid"]); + $obj->clear_target($id); - Header("Location: cibles.php?id=".$_GET["rowid"]); + Header("Location: cibles.php?id=".$id); exit; } -if ($_GET["action"] == 'delete') +if ($action == 'delete') { // Ici, rowid indique le destinataire et id le mailing - $sql="DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles where rowid=".$_GET["rowid"]; + $sql="DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles where rowid=".$id; $resql=$db->query($sql); if ($resql) { @@ -135,7 +157,7 @@ if ($_GET["action"] == 'delete') require_once($file); $obj = new $classname($db); - $obj->update_nb($_REQUEST["id"]); + $obj->update_nb($id); } else { @@ -162,7 +184,7 @@ $form = new Form($db); $mil = new Mailing($db); -if ($mil->fetch($_REQUEST["id"]) >= 0) +if ($mil->fetch($id) >= 0) { $head = emailing_prepare_head($mil); @@ -207,7 +229,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0) print ""; - if ($mesg) print "$mesg
\n"; + dol_htmloutput_mesg($mesg); $var=!$var; @@ -227,102 +249,110 @@ if ($mil->fetch($_REQUEST["id"]) >= 0) clearstatcache(); $var=true; - foreach ($conf->file->dol_document_root as $dirroot) + + foreach ($modulesdir as $dir) { - $dir=$dirroot."/core/modules/mailings/"; + $modulenames=array(); - if (is_dir($dir)) + // Load modules attributes in arrays (name, numero, orders) from dir directory + //print $dir."\n
"; + dol_syslog("Scan directory ".$dir." for modules"); + $handle=@opendir($dir); + if (is_resource($handle)) { - $handle=opendir($dir); - if (is_resource($handle)) + while (($file = readdir($handle))!==false) { - while (($file = readdir($handle))!==false) + if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { - if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + if (preg_match("/(.*)\.modules\.php$/i",$file,$reg)) { - if (preg_match("/(.*)\.modules\.php$/i",$file,$reg)) - { - $modulename=$reg[1]; - if ($modulename == 'example') continue; - - // Chargement de la classe - $file = $dir.$modulename.".modules.php"; - $classname = "mailing_".$modulename; - require_once($file); - - $obj = new $classname($db); - - $qualified=1; - foreach ($obj->require_module as $key) - { - if (! $conf->$key->enabled || (! $user->admin && $obj->require_admin)) - { - $qualified=0; - //print "Les prerequis d'activation du module mailing ne sont pas respectes. Il ne sera pas actif"; - break; - } - } - - // Si le module mailing est qualifie - if ($qualified) - { - $var = !$var; - print '
'; - if (! $obj->picto) $obj->picto='generic'; - print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc(); - print ''; - print $modulename; - print "'; - if ($nbofrecipient >= 0) - { - print $nbofrecipient; - } - else - { - print $langs->trans("Error").' '.img_error($obj->error); - } - print ''; - $filter=$obj->formFilter(); - if ($filter) print $filter; - else print $langs->trans("None"); - print ''; - if ($mil->statut == 0) - { - print ''; - } - else - { - //print $langs->trans("MailNoChangePossible"); - print " "; - } - print '
'; + if (! $obj->picto) $obj->picto='generic'; + print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc(); + print ''; + print $modulename; + print "'; + if ($nbofrecipient >= 0) + { + print $nbofrecipient; + } + else + { + print $langs->trans("Error").' '.img_error($obj->error); + } + print ''; + $filter=$obj->formFilter(); + if ($filter) print $filter; + else print $langs->trans("None"); + print ''; + if ($mil->statut == 0) + { + print ''; + } + else + { + //print $langs->trans("MailNoChangePossible"); + print " "; + } + print '
'.dol_print_date($db->jdate($obj->dc),"dayhour").''.$obj->price_level.' '.$userstatic->getNomUrl(1).'
'; - $linkback="".$langs->trans("BackToList").""; + $linkback=''.$langs->trans("BackToList").''; // Ref print ''; print '
'.$langs->trans('Ref').''; @@ -179,17 +175,15 @@ if ($id > 0 || ! empty($ref)) print ''; - + /* + * Lignes de contacts + */ + print '
'; /* - * Lignes de contacts - */ - echo '
'; - - /* - * Ajouter une ligne de contact - * Non affiche en mode modification de ligne - */ + * Ajouter une ligne de contact + * Non affiche en mode modification de ligne + */ if ($action != 'editline' && $user->rights->propale->creer) { print ''; @@ -322,14 +316,14 @@ if ($id > 0 || ! empty($ref)) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } @@ -351,7 +345,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->propale->creer) { print ' '; - print ''; + print ''; print img_delete(); print ''; } @@ -370,7 +364,8 @@ if ($id > 0 || ! empty($ref)) } } +llxFooter(); + $db->close(); -llxFooter(); ?> \ No newline at end of file diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 79cb2befc58..665b01882a5 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -79,16 +79,16 @@ print "

\n"; * Statistics */ -$sql = "SELECT count(cf.rowid), cf.fk_statut"; +$sql = "SELECT count(p.rowid), p.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql.= ", ".MAIN_DB_PREFIX."propal as cf"; +$sql.= ", ".MAIN_DB_PREFIX."propal as p"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE cf.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; -if ($user->societe_id) $sql.=' AND cf.fk_soc = '.$user->societe_id; +$sql.= " WHERE p.fk_soc = s.rowid"; +$sql.= " AND p.entity = ".$conf->entity; +if ($user->societe_id) $sql.=' AND p.fk_soc = '.$user->societe_id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -$sql.= " AND cf.fk_statut in (0,1,2,3,4)"; -$sql.= " GROUP BY cf.fk_statut"; +$sql.= " AND p.fk_statut IN (0,1,2,3,4)"; +$sql.= " GROUP BY p.fk_statut"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/comm/prospect/class/prospect.class.php b/htdocs/comm/prospect/class/prospect.class.php index 63c3d2cb56a..7a5928058e1 100644 --- a/htdocs/comm/prospect/class/prospect.class.php +++ b/htdocs/comm/prospect/class/prospect.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2006 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2006-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,16 +35,15 @@ class Prospect extends Societe /** - * \brief Constructeur de la classe - * \param DB handler acces base de donnees - * \param id id societe (0 par defaut) + * Constructor + * + * @param DoliDB $db Databas handler */ - function Prospect($DB, $id=0) + function Prospect($db) { global $config; - $this->db = $DB; - $this->id = $id; + $this->db = $db; return 0; } @@ -69,8 +68,8 @@ class Prospect extends Societe $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= " ".$clause." s.client in (1,2,3)"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " ".$clause." s.client IN (1,2,3)"; + $sql.= " AND s.entity IN (".getEntity($this->element, 1).")"; $sql.= " GROUP BY s.client"; $resql=$this->db->query($sql); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index b93c0706b4a..834db513855 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -72,11 +72,11 @@ if ($conf->propal->enabled) $sql = "SELECT count(*) as cc, st.libelle, st.id"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st "; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " AND s.client IN (2, 3)"; -$sql.= " AND s.entity = ".$conf->entity; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")"; +if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " GROUP BY st.id"; $sql.= " ORDER BY st.id"; @@ -116,11 +116,11 @@ if ($conf->propal->enabled && $user->rights->propale->lire) $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_statut = 0"; $sql.= " AND p.fk_soc = s.rowid"; $sql.= " AND p.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $resql=$db->query($sql); if ($resql) @@ -177,12 +177,12 @@ if ($conf->propal->enabled && $user->rights->propale->lire) $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."c_propalst as c"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_soc = s.rowid"; $sql.= " AND p.fk_statut = c.id"; $sql.= " AND p.fk_statut = 1"; $sql.= " AND p.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY p.rowid DESC"; $sql.= $db->plimit(5, 0); @@ -239,10 +239,10 @@ if ($conf->propal->enabled && $user->rights->propale->lire) */ $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_stcomm = 1"; -$sql.= " AND s.entity = ".$conf->entity; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")"; +if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY s.tms ASC"; $sql.= $db->plimit(15, 0); @@ -279,8 +279,8 @@ if ($resql) print '
'; +llxFooter(); + $db->close(); - -llxFooter(); ?> \ No newline at end of file diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 8b6a5bb304f..bc8ca78ad55 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -76,7 +76,7 @@ class CommandeStats extends Stats $this->field='total_ht'; $this->where.= " c.fk_statut > 0"; } - $this->where.= " AND c.fk_soc = s.rowid AND s.entity = ".$conf->entity; + $this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if($this->socid) diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 94dee98896b..966e2c660fc 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -313,14 +313,14 @@ if ($id > 0 || ! empty($ref)) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 576f3b6e246..a3978f8b099 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -78,15 +78,15 @@ print "

\n"; * Statistics */ -$sql = "SELECT count(cf.rowid), cf.fk_statut, cf.facture"; +$sql = "SELECT count(cf.rowid), c.fk_statut, c.facture"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql.= ", ".MAIN_DB_PREFIX."commande as cf"; +$sql.= ", ".MAIN_DB_PREFIX."commande as c"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE cf.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; -if ($user->societe_id) $sql.=' AND cf.fk_soc = '.$user->societe_id; +$sql.= " WHERE c.fk_soc = s.rowid"; +$sql.= " AND c.entity = ".$conf->entity; +if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -$sql.= " GROUP BY cf.fk_statut, cf.facture"; +$sql.= " GROUP BY c.fk_statut, c.facture"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index ff35059d812..6ffe19b3df9 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -81,7 +81,7 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ', '.MAIN_DB_PREFIX.'commande as c'; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ' WHERE c.fk_soc = s.rowid'; -$sql.= ' AND s.entity = '.$conf->entity; +$sql.= ' AND c.entity = '.$conf->entity; if ($socid) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($sref) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index ef8b6c25ab2..6195ba4cd73 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -87,30 +87,30 @@ if ($_GET["mode"] == 'sconly') print ''; print ""; -print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.date_ech","",$param,'width="120"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="120"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"s.fk_type","",$param,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pid","",$param,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"datep","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $sql = "SELECT c.id, c.libelle as lib,"; -$sql.= " s.rowid, s.libelle, s.fk_type as type, s.periode, s.date_ech, s.amount as total,"; +$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; -$sql.= " ".MAIN_DB_PREFIX."chargesociales as s"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = s.rowid"; -$sql.= " WHERE s.fk_type = c.id"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; +$sql.= " WHERE cs.fk_type = c.id"; +$sql.= " AND cs.entity = ".$conf->entity; if ($year > 0) { $sql .= " AND ("; // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire - $sql .= " (s.periode is not null and s.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; - $sql .= "or (s.periode is null and s.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; + $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; + $sql .= "OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= ")"; } $sql.= $db->order($sortfield,$sortorder); @@ -145,7 +145,7 @@ if ($resql) print $socialcontrib->getNomUrl(1,'20'); print ''; // Type - print ''; + print ''; // Expected to pay print ''; // Ref payment diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index dcb76232589..eb3292da8f1 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -80,8 +80,8 @@ if ($action == 'note') if ($mode == 'search') { if ($modesearch == 'soc') { $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; - $sql.= " WHERE lower(s.nom) like '%".$db->escape(strtolower($socname))."%'"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " WHERE lower(s.nom) LIKE '%".$db->escape(strtolower($socname))."%'"; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; } $resql=$db->query($sql); @@ -106,7 +106,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_stcomm = st.id AND s.client in (1, 3)"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (dol_strlen($stcomm)) { @@ -114,25 +114,25 @@ if (dol_strlen($stcomm)) } if ($socname) { - $sql.= " AND s.nom like '%".$db->escape(strtolower($socname))."%'"; + $sql.= " AND s.nom LIKE '%".$db->escape(strtolower($socname))."%'"; $sortfield = "s.nom"; $sortorder = "ASC"; } if ($_GET["search_nom"]) { - $sql.= " AND s.nom like '%".$db->escape(strtolower($_GET["search_nom"]))."%'"; + $sql.= " AND s.nom LIKE '%".$db->escape(strtolower($_GET["search_nom"]))."%'"; } if ($_GET["search_compta"]) { - $sql.= " AND s.code_compta like '%".$db->escape($_GET["search_compta"])."%'"; + $sql.= " AND s.code_compta LIKE '%".$db->escape($_GET["search_compta"])."%'"; } if ($_GET["search_code_client"]) { - $sql.= " AND s.code_client like '%".$db->escape($_GET["search_code_client"])."%'"; + $sql.= " AND s.code_client LIKE '%".$db->escape($_GET["search_code_client"])."%'"; } if (dol_strlen($begin)) { - $sql.= " AND s.nom like '".$db->escape($begin)."'"; + $sql.= " AND s.nom LIKE '".$db->escape($begin)."'"; } if ($socid) { diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index 5b3203ccef9..075200bccf3 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -458,7 +458,7 @@ class Don extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON cp.id = d.fk_paiement"; $sql.= " WHERE d.rowid = ".$rowid." AND d.entity = ".$conf->entity; - dol_syslog("Don::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -686,42 +686,5 @@ class Don extends CommonObject return $result; } - /** - * Return full name (civility+' '+name+' '+lastname) - * - * @param Translate $langs Language object for translation of civility - * @param int $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname - * @return string String with full name - */ - function getFullName($langs,$option=0,$nameorder=-1) - { - global $conf; - - $ret=''; - if ($option && $this->civilite_id) - { - if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; - else $ret.=$this->civilite_id.' '; - } - - // If order not defined, we use the setup - if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION); - - if ($nameorder) - { - if ($this->prenom) $ret.=$this->prenom; - if ($this->prenom && $this->nom) $ret.=' '; - if ($this->nom) $ret.=$this->nom; - } - else - { - if ($this->nom) $ret.=$this->nom; - if ($this->prenom && $this->nom) $ret.=' '; - if ($this->prenom) $ret.=$this->prenom; - } - - return trim($ret); - } } ?> diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 143cda2b27c..5ee0351d559 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -34,18 +34,24 @@ $langs->load("companies"); $langs->load("donations"); $langs->load("bills"); +$id=GETPOST('rowid')?GETPOST('rowid'):GETPOST('id'); +$action=GETPOST('action'); + $mesg=""; $mesgs=array(); $don = new Don($db); $donation_date=dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); +// Security check +$result = restrictedArea($user, 'don', $id); + /* * Actions */ -if ($_POST["action"] == 'update') +if ($action == 'update') { if (! empty($_POST['cancel'])) { @@ -58,14 +64,14 @@ if ($_POST["action"] == 'update') if (empty($donation_date)) { $mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Date")); - $_GET["action"] = "create"; + $action = "create"; $error++; } if (! $_POST["amount"] > 0) { $mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Amount")); - $_GET["action"] = "create"; + $action = "create"; $error++; } @@ -100,7 +106,7 @@ if ($_POST["action"] == 'update') } } -if ($_POST["action"] == 'add') +if ($action == 'add') { if (! empty($_POST['cancel'])) { @@ -152,19 +158,19 @@ if ($_POST["action"] == 'add') } } -if ($_GET["action"] == 'delete') +if ($action == 'delete') { $don->delete($_GET["rowid"]); Header("Location: liste.php"); exit; } -if ($_POST["action"] == 'commentaire') +if ($action == 'commentaire') { $don->fetch($_POST["rowid"]); $don->update_note($_POST["commentaire"]); $_GET["rowid"] = $_POST["rowid"]; } -if ($_GET["action"] == 'valid_promesse') +if ($action == 'valid_promesse') { if ($don->valid_promesse($_GET["rowid"], $user->id) >= 0) { @@ -173,7 +179,7 @@ if ($_GET["action"] == 'valid_promesse') } else $mesg=$don->error; } -if ($_GET["action"] == 'set_cancel') +if ($action == 'set_cancel') { if ($don->set_cancel($_GET["rowid"]) >= 0) { @@ -182,7 +188,7 @@ if ($_GET["action"] == 'set_cancel') } else $mesg=$don->error; } -if ($_GET["action"] == 'set_paid') +if ($action == 'set_paid') { if ($don->set_paye($_GET["rowid"], $modepaiement) >= 0) { @@ -191,7 +197,7 @@ if ($_GET["action"] == 'set_paid') } else $mesg=$don->error; } -if ($_GET["action"] == 'set_encaisse') +if ($action == 'set_encaisse') { if ($don->set_encaisse($_GET["rowid"]) >= 0) { @@ -204,7 +210,7 @@ if ($_GET["action"] == 'set_encaisse') /* * Build doc */ -if ($_REQUEST['action'] == 'builddoc') +if ($action == 'builddoc') { $donation = new Don($db); $donation->fetch($_GET['rowid']); @@ -255,7 +261,7 @@ $formcompany = new FormCompany($db); /* */ /* ************************************************************************** */ -if ($_GET["action"] == 'create') +if ($action == 'create') { print_fiche_titre($langs->trans("AddDonation")); @@ -326,10 +332,9 @@ if ($_GET["action"] == 'create') /* */ /* ************************************************************ */ -if ($_GET["rowid"] && $_GET["action"] == 'edit') +if ($id && $_GET["action"] == 'edit') { - $don->id = $_GET["rowid"]; - $don->fetch($_GET["rowid"]); + $don->fetch($id); $h=0; $head[$h][0] = DOL_URL_ROOT."/compta/dons/fiche.php?rowid=".$_GET["rowid"]; @@ -420,11 +425,9 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') /* Fiche don en mode visu */ /* */ /* ************************************************************ */ -if ($_GET["rowid"] && $_GET["action"] != 'edit') +if ($id && $action != 'edit') { - $don->id = $_GET["rowid"]; - $result=$don->fetch($_GET["rowid"]); - + $result=$don->fetch($id); $h=0; $head[$h][0] = DOL_URL_ROOT."/compta/dons/fiche.php?rowid=".$_GET["rowid"]; diff --git a/htdocs/compta/dons/index.php b/htdocs/compta/dons/index.php index 23bb7ee3d56..e72f49b9cb3 100644 --- a/htdocs/compta/dons/index.php +++ b/htdocs/compta/dons/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +27,8 @@ require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php"); $langs->load("donations"); +if (!$user->rights->don->lire) accessforbidden(); + $donation_static=new Don($db); @@ -34,7 +36,7 @@ $donation_static=new Don($db); * Actions */ - +// None /* diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index feaf89f2565..14be56fdba6 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -45,6 +45,7 @@ $search_ref=GETPOST('search_ref'); $search_company=GETPOST('search_company'); $search_name=GETPOST('search_name'); +if (!$user->rights->don->lire) accessforbidden(); /* diff --git a/htdocs/compta/dons/stats.php b/htdocs/compta/dons/stats.php index 7c07f62ef54..369e9a7a785 100644 --- a/htdocs/compta/dons/stats.php +++ b/htdocs/compta/dons/stats.php @@ -26,6 +26,8 @@ require("../../main.inc.php"); $langs->load("donations"); +if (!$user->rights->don->lire) accessforbidden(); + /* * View @@ -77,7 +79,7 @@ else } -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 30324631071..0f71a0de133 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -493,14 +493,14 @@ class FactureRec extends Facture $sql.= ") VALUES ("; $sql.= "'".$facid."'"; $sql.= ", '".$this->db->escape($desc)."'"; - $sql.= ", ".price2num($price); + $sql.= ", ".price2num($pu_ht); $sql.= ", ".price2num($qty); $sql.= ", ".price2num($txtva); $sql.= ", ".($fk_product?"'".$fk_product."'":"null"); $sql.= ", ".$product_type; $sql.= ", '".price2num($remise_percent)."'"; $sql.= ", '".price2num($pu_ht)."'"; - $sql.= ", '".price2num($remise)."'"; + $sql.= ", null"; $sql.= ", '".price2num($total_ht)."'"; $sql.= ", '".price2num($total_tva)."'"; $sql.= ", '".price2num($total_ttc)."'"; diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 1787baa2208..410cfcff75e 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -308,14 +308,14 @@ if ($id > 0 || ! empty($ref)) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 4bcf25ece22..36f8777f234 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -474,7 +474,7 @@ else if ($fac->statut == 0 && $user->rights->facture->supprimer) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print ''; @@ -496,7 +496,7 @@ else $sql = "SELECT s.nom, s.rowid as socid, f.titre, f.total, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql .= " AND s.rowid = ".$socid; //$sql .= " ORDER BY $sortfield $sortorder, rowid DESC "; @@ -507,13 +507,13 @@ else if ($result) { $num = $db->num_rows($result); - print_barre_liste($langs->trans("RepeatableInvoices"),$page,"fiche-rec.php","&socid=$socid",$sortfield,$sortorder,'',$num); + print_barre_liste($langs->trans("RepeatableInvoices"),$page,$_SERVER['PHP_SELF'],"&socid=$socid",$sortfield,$sortorder,'',$num); $i = 0; - print "
'.$obj->lib.''.$obj->lib.''.price($obj->total).'
"; + print '
'; print ''; print ''; - print_liste_field_titre($langs->trans("Company"),"fiche-rec.php","s.nom","","&socid=$socid","",$sortfiled,$sortorder); + print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"s.nom","","&socid=$socid","",$sortfiled,$sortorder); print ''; print ''; print "\n"; @@ -528,11 +528,11 @@ else print ""; - print '\n"; print ''; - print "\n"; + print ''."\n"; if (! $objp->paye) { @@ -566,7 +566,8 @@ else } +llxFooter(); + $db->close(); -llxFooter(); ?> diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 1a025f0e836..9ce5dca35dd 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -192,7 +192,7 @@ if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PRE $sql.= ",".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid=pf.fk_facture "; $sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.type IN (0,1,3) AND f.fk_statut = 1"; $sql.= " AND f.paye = 0"; if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 4166a4ab130..128b02002a7 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -429,7 +429,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.rowid = ff.fk_soc"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND ff.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql.= " AND ff.fk_soc = ".$socid; $sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid"; @@ -503,10 +503,10 @@ if ($conf->don->enabled && $user->rights->societe->lire) $langs->load("boxes"); $donationstatic=new Don($db); - $sql = "SELECT s.rowid, s.nom, s.prenom, s.societe, s.datedon as date, s.tms as dm, s.amount, s.fk_statut"; - $sql.= " FROM ".MAIN_DB_PREFIX."don as s"; - $sql.= " WHERE s.entity = ".$conf->entity; - $sql.= $db->order("s.tms","DESC"); + $sql = "SELECT d.rowid, d.nom, d.prenom, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut"; + $sql.= " FROM ".MAIN_DB_PREFIX."don as d"; + $sql.= " WHERE d.entity = ".$conf->entity; + $sql.= $db->order("d.tms","DESC"); $sql.= $db->plimit($max, 0); $result = $db->query($sql); @@ -604,8 +604,8 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire) $deplacementstatic->ref=$objp->rowid; $deplacementstatic->id=$objp->rowid; $userstatic->id=$objp->uid; - $userstatic->nom=$objp->name; - $userstatic->prenom=$objp->firstname; + $userstatic->lastname=$objp->name; + $userstatic->firstname=$objp->firstname; print ''; print ''; print ''; @@ -928,7 +928,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.rowid = ff.fk_soc"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND ff.entity = ".$conf->entity; $sql.= " AND ff.paye = 0"; $sql.= " AND ff.fk_statut = 1"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -1027,8 +1027,8 @@ print ''; print '
'.$langs->trans("Ref").''.$langs->trans("Amount").' 
'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre; + print ''.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre; print "'.$objp->nom.'".price($objp->total)."'.price($objp->total).'
'.$deplacementstatic->getNomUrl(1).''.$userstatic->getNomUrl(1).'
'; +llxFooter(); + $db->close(); - -llxFooter(); ?> diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 358e73d4f85..95658793d12 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke @@ -212,18 +212,18 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { $facture = new Facture($db); $result=$facture->fetch($facid); - + if ($result >= 0) { $facture->fetch_thirdparty(); - + $title=''; if ($facture->type != 2) $title.=$langs->trans("EnterPaymentReceivedFromCustomer"); if ($facture->type == 2) $title.=$langs->trans("EnterPaymentDueToCustomer"); print_fiche_titre($title); - + dol_htmloutput_errors($errmsg); - + // Bouchon if ($facture->type == 2) { @@ -231,17 +231,17 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie llxFooter(); exit; } - + // Initialize data for confirmation (this is used because data can be change during confirmation) if ($action == 'add_paiement') { $i=0; - + $formquestion[$i++]=array('type' => 'hidden','name' => 'facid', 'value' => $facture->id); $formquestion[$i++]=array('type' => 'hidden','name' => 'socid', 'value' => $facture->socid); $formquestion[$i++]=array('type' => 'hidden','name' => 'type', 'value' => $facture->type); } - + // Invoice with Paypal transaction // TODO add hook possibility (regis) if ($conf->paypalplus->enabled && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int)) @@ -254,15 +254,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print "\n".''."\n"; } - + print '
'; print ''; print ''; @@ -357,7 +357,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; - + print ''; // Third party @@ -382,6 +382,22 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; + // Bank account + print ''; + if ($conf->banque->enabled) + { + if ($facture->type != 2) print ''; + if ($facture->type == 2) print ''; + print ''; + } + else + { + print ''; + } + print "\n"; + // Payment amount if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT)) { @@ -400,21 +416,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; } - print ''; - if ($conf->banque->enabled) - { - if ($facture->type != 2) print ''; - if ($facture->type == 2) print ''; - print ''; - } - else - { - print ''; - } - print "\n"; - // Cheque number print ''; + + print ''; + + $j++; + } + + $db->free($resqlp); + } + else + { + dol_print_error($db); + } + } + } + else + { + dol_print_error($db); + } + print "
'.$langs->trans('AccountToCredit').''.$langs->trans('AccountToDebit').''; + $form->select_comptes($accountid,'accountid',0,'',2); + print ' 
'.$langs->trans('AccountToCredit').''.$langs->trans('AccountToDebit').''; - $form->select_comptes($accountid,'accountid',0,'',2); - print ' 
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; @@ -637,16 +638,17 @@ if (! GETPOST('action')) if (! $sortfield) $sortfield='p.datep'; $sql = 'SELECT p.datep as dp, p.amount, f.amount as fa_amount, f.facnumber'; - $sql .=', f.rowid as facid, c.libelle as paiement_type, p.num_paiement'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'c_paiement as c'; - $sql .= ' WHERE p.fk_facture = f.rowid AND p.fk_paiement = c.id'; + $sql.=', f.rowid as facid, c.libelle as paiement_type, p.num_paiement'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'c_paiement as c'; + $sql.= ' WHERE p.fk_facture = f.rowid AND p.fk_paiement = c.id'; + $sql.= ' AND f.entity = '.$conf->entity; if ($socid) { - $sql .= ' AND f.fk_soc = '.$socid; + $sql.= ' AND f.fk_soc = '.$socid; } - $sql .= ' ORDER BY '.$sortfield.' '.$sortorder; - $sql .= $db->plimit($limit+1, $offset); + $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; + $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php index 2cb5efb1ce3..1fde3bd1a19 100644 --- a/htdocs/compta/paiement/avalider.php +++ b/htdocs/compta/paiement/avalider.php @@ -56,21 +56,22 @@ if (! $sortfield) $sortfield="p.rowid"; $limit = $conf->liste_limit; $sql = "SELECT p.rowid, p.datep as dp, p.amount, p.statut"; -$sql .=", c.libelle as paiement_type, p.num_paiement"; -$sql .= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as c"; +$sql.=", c.libelle as paiement_type, p.num_paiement"; +$sql.= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as c"; if ($socid) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid"; } -$sql .= " WHERE p.fk_paiement = c.id"; +$sql.= " WHERE p.fk_paiement = c.id"; +$sql.= " AND p.entity = ".$conf->entity; if ($socid) { $sql.= " AND f.fk_soc = ".$socid; } -$sql .= " AND p.statut = 0"; -$sql .= " ORDER BY $sortfield $sortorder"; -$sql .= $db->plimit($limit +1 ,$offset); +$sql.= " AND p.statut = 0"; +$sql.= " ORDER BY $sortfield $sortorder"; +$sql.= $db->plimit($limit +1 ,$offset); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 7754a370ecd..d5cc2ce4e3f 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -56,11 +56,11 @@ class Paiement extends CommonObject /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function Paiement($DB) + function Paiement($db) { - $this->db = $DB ; + $this->db = $db ; } /** @@ -129,7 +129,7 @@ class Paiement extends CommonObject */ function create($user,$closepaidinvoices=0) { - global $langs,$conf; + global $conf, $langs; $error = 0; @@ -151,8 +151,8 @@ class Paiement extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)"; - $sql.= " VALUES ('".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$totalamount."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)"; + $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$totalamount."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")"; dol_syslog(get_class($this)."::Create insert paiement sql=".$sql); $resql = $this->db->query($sql); @@ -619,10 +619,9 @@ class Paiement extends CommonObject */ function info($id) { - $sql = 'SELECT c.rowid, c.datec, c.fk_user_creat, c.fk_user_modif,'; - $sql.= ' c.tms'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as c'; - $sql.= ' WHERE c.rowid = '.$id; + $sql = 'SELECT p.rowid, p.datec, p.fk_user_creat, p.fk_user_modif, p.tms'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p'; + $sql.= ' WHERE p.rowid = '.$id; dol_syslog(get_class($this).'::info sql='.$sql); $result = $this->db->query($sql); diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 5a8234c6970..0fd3e886354 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -269,7 +269,7 @@ $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.total_ttc, f.paye, f.fk_ $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s'; $sql.= ' WHERE pf.fk_facture = f.rowid'; $sql.= ' AND f.fk_soc = s.rowid'; -$sql.= ' AND s.entity = '.$conf->entity; +$sql.= ' AND f.entity = '.$conf->entity; $sql.= ' AND pf.fk_paiement = '.$paiement->id; $resql=$db->query($sql); if ($resql) diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index a9237f22b11..ddc95aa5642 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -73,6 +73,7 @@ if (GETPOST("orphelins")) $sql.= " ".MAIN_DB_PREFIX."c_paiement as c)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql.= " WHERE p.fk_paiement = c.id"; + $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND pf.fk_facture IS NULL"; } else @@ -89,13 +90,14 @@ else $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid AND s.entity = ".$conf->entity; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql.= " WHERE p.fk_paiement = c.id"; - if (!$user->rights->societe->client->voir && !$socid) + $sql.= " AND p.entity = ".$conf->entity; + if (! $user->rights->societe->client->voir && ! $socid) { $sql.= " AND sc.fk_user = " .$user->id; } diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php index 6333000b8ad..6df698b529a 100644 --- a/htdocs/compta/prelevement/lignes.php +++ b/htdocs/compta/prelevement/lignes.php @@ -122,10 +122,12 @@ $pagenext = $page + 1; $sql = "SELECT pl.rowid, pl.statut, pl.amount"; $sql.= ", s.rowid as socid, s.nom"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; +$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE pl.fk_prelevement_bons=".$prev_id; +$sql.= " WHERE pl.fk_prelevement_bons = ".$prev_id; +$sql.= " AND pl.fk_prelevement_bons = pb.rowid"; +$sql.= " AND pb.entity = ".$conf->entity; $sql.= " AND pl.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit+1, $offset); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 63bae197f5a..85b525d2917 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -47,9 +47,9 @@ print_fiche_titre($langs->trans("Statistics")); // Define total and nbtotal $sql = "SELECT sum(pl.amount), count(pl.amount)"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; -$sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE pl.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; +$sql.= " WHERE pl.fk_prelevement_bons = pb.rowid"; +$sql.= " AND pb.entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) { @@ -76,9 +76,9 @@ $ligne=new LignePrelevement($db,$user); $sql = "SELECT sum(pl.amount), count(pl.amount), pl.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; -$sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE pl.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; +$sql.= " WHERE pl.fk_prelevement_bons = pb.rowid"; +$sql.= " AND pb.entity = ".$conf->entity; $sql.= " GROUP BY pl.statut"; $resql=$db->query($sql); @@ -146,9 +146,9 @@ print_titre($langs->trans("WithdrawRejectStatistics")); // Define total and nbtotal $sql = "SELECT sum(pl.amount), count(pl.amount)"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; -$sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE pl.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; +$sql.= " WHERE pl.fk_prelevement_bons = pb.rowid"; +$sql.= " AND pb.entity = ".$conf->entity; $sql.= " AND pl.statut = 3"; $resql=$db->query($sql); if ($resql) @@ -169,10 +169,10 @@ if ($resql) */ $sql = "SELECT sum(pl.amount), count(pl.amount) as cc, pr.motif"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; -$sql.= " , ".MAIN_DB_PREFIX."prelevement_rejet as pr"; -$sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE pl.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; +$sql.= ", ".MAIN_DB_PREFIX."prelevement_rejet as pr"; +$sql.= " WHERE pl.fk_prelevement_bons = pb.rowid"; +$sql.= " AND pb.entity = ".$conf->entity; $sql.= " AND pl.statut = 3"; $sql.= " AND pr.fk_prelevement_lignes = pl.rowid"; $sql.= " GROUP BY pr.motif"; @@ -232,8 +232,8 @@ else dol_print_error($db); } +llxFooter(); $db->close(); -llxFooter(); ?> diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 72771a20c8b..f5e3b3ca01a 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -47,170 +47,171 @@ llxHeader(); if ($socid > 0) { - $societe = new Societe($db); - $societe->fetch($socid); - - /* - * Affichage onglets - */ + $societe = new Societe($db); + $societe->fetch($socid); + + /* + * Affichage onglets + */ $head = societe_prepare_head($societe); - - dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); - - print "\n"; - print '
'; - - print ''; - - // Nom - print ''; - - // Prefix - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field - { - print ''; - } - - print "
'.$langs->trans("Name").''.$societe->nom.'
'.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print '
"; - - print "
\n"; - - print ''; - - - if ($conf->facture->enabled && $user->rights->facture->lire) - { - // Factures - print_fiche_titre($langs->trans("CustomerPreview")); - - print ''; - - $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,"; - $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; - $sql.= " u.login, u.rowid as userid"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id; - $sql.= " AND f.fk_user_valid = u.rowid"; - $sql.= " ORDER BY f.datef DESC"; - - $resql=$db->query($sql); - if ($resql) - { - $var=true; - $num = $db->num_rows($resql); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - + + dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); + + print "
'.$langs->trans("Date").' '.$langs->trans("Status").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").' 
\n"; + print '
'; + + print ''; + + // Nom + print ''; + + // Prefix + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } + + print "
'.$langs->trans("Name").''.$societe->nom.'
'.$langs->trans("Prefix").''; + print ($societe->prefix_comm?$societe->prefix_comm:' '); + print '
"; + + print "
\n"; + + print ''; + + if ($conf->facture->enabled && $user->rights->facture->lire) + { + // Factures + print_fiche_titre($langs->trans("CustomerPreview")); + + print ''; + + $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,"; + $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; + $sql.= " u.login, u.rowid as userid"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."user as u"; + $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND f.fk_user_valid = u.rowid"; + $sql.= " ORDER BY f.datef DESC"; + + $resql=$db->query($sql); + if ($resql) + { + $var=true; + $num = $db->num_rows($resql); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if (! $num > 0) - { - print ''; - } - - $solde = 0; - - // Boucle sur chaque facture - for ($i = 0 ; $i < $num ; $i++) - { - $objf = $db->fetch_object($resql); - - $fac = new Facture($db); - $ret=$fac->fetch($objf->facid); - if ($ret < 0) - { - print $fac->error."
"; - continue; - } - $totalpaye = $fac->getSommePaiement(); - - $var=!$var; - print ""; - - print "\n"; - print "\n"; - - print ''; - print '\n"; - $solde = $solde + $fac->total_ttc; - - print ''; - print '\n"; - - // Auteur - print ''; - - print "\n"; - - // Paiements - $sql = "SELECT p.rowid, p.datep as dp, pf.amount, p.statut,"; - $sql.= " p.fk_user_creat, u.login, u.rowid as userid"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf,"; - $sql.= " ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON p.fk_user_creat = u.rowid"; - $sql.= " WHERE pf.fk_paiement = p.rowid"; - $sql.= " AND pf.fk_facture = ".$fac->id; - - $resqlp = $db->query($sql); - if ($resqlp) - { - $nump = $db->num_rows($resqlp); - $j = 0; - - while ($j < $nump) - { - $objp = $db->fetch_object($resqlp); - //$var=!$var; - print ""; - print '\n"; - print ''; - print "\n"; - print "\n"; - print ''; - $solde = $solde - $objp->amount; - print '\n"; - + { + print ''; + } + + $solde = 0; + + // Boucle sur chaque facture + for ($i = 0 ; $i < $num ; $i++) + { + $objf = $db->fetch_object($resql); + + $fac = new Facture($db); + $ret=$fac->fetch($objf->facid); + if ($ret < 0) + { + print $fac->error."
"; + continue; + } + $totalpaye = $fac->getSommePaiement(); + + $var=!$var; + print ""; + + print "\n"; + print "\n"; + + print ''; + print '\n"; + $solde = $solde + $fac->total_ttc; + + print ''; + print '\n"; + + // Auteur + print ''; + + print "\n"; + + // Paiements + $sql = "SELECT p.rowid, p.datep as dp, pf.amount, p.statut,"; + $sql.= " p.fk_user_creat, u.login, u.rowid as userid"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf,"; + $sql.= " ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON p.fk_user_creat = u.rowid"; + $sql.= " WHERE pf.fk_paiement = p.rowid"; + $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND pf.fk_facture = ".$fac->id; + + $resqlp = $db->query($sql); + if ($resqlp) + { + $nump = $db->num_rows($resqlp); + $j = 0; + + while ($j < $nump) + { + $objp = $db->fetch_object($resqlp); + //$var=!$var; + print ""; + print '\n"; + print ''; + print "\n"; + print "\n"; + print ''; + $solde = $solde - $objp->amount; + print '\n"; + // Auteur - print ''; - - print ''; - - $j++; - } - - $db->free($resqlp); - } - else - { - dol_print_error($db); - } - } - } - else - { - dol_print_error($db); - } - print "
'.$langs->trans("Date").' '.$langs->trans("Status").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").' 
'.$langs->trans("NoInvoice").'
".dol_print_date($fac->date)."id\">".img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."'.$fac->getLibStatut(2,$totalpaye).''.price($fac->total_ttc)." '.price($solde)."'.img_object($langs->trans("ShowUser"),'user').' '.$objf->login.'
'.dol_print_date($db->jdate($objp->dp))."'; - print '      '; // Decalage - print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.'  '.price($objp->amount).''.price($solde)."
'.$langs->trans("NoInvoice").'
".dol_print_date($fac->date)."id\">".img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."'.$fac->getLibStatut(2,$totalpaye).''.price($fac->total_ttc)." '.price($solde)."'.img_object($langs->trans("ShowUser"),'user').' '.$objf->login.'
'.dol_print_date($db->jdate($objp->dp))."'; + print '      '; // Decalage + print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.'  '.price($objp->amount).''.price($solde)."'.img_object($langs->trans("ShowUser"),'user').' '.$objp->login.'
"; - print "
"; - } + print '
'.img_object($langs->trans("ShowUser"),'user').' '.$objp->login.'
"; + print "
"; + } } else { - dol_print_error($db); + dol_print_error($db); } +llxFooter(); $db->close(); -llxFooter(); ?> diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index b81a6444cc7..d9f764f5e87 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -344,25 +344,25 @@ print '
'.$langs->trans("SocialContributions").'
'.$langs->trans("SocialContributions").'
'; - $contactstatic->name=$obj->name; + $contactstatic->lastname=$obj->lastname; $contactstatic->firstname=''; $contactstatic->id=$obj->cidp; print $contactstatic->getNomUrl(1,'',20); @@ -357,7 +357,7 @@ if ($result) if ($obj->socid) { print ''; - print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,20).''; + print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,20).''; } else { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 97af3767f55..9eca94bd8c0 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1358,7 +1358,7 @@ class Contrat extends CommonObject $sql.= " AND cd.date_fin_validite < '".$this->db->idate(time())."'"; } $sql.= " AND c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; if ($user->societe_id) $sql.=" AND c.fk_soc = ".$user->societe_id; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; $resql=$this->db->query($sql); @@ -1403,7 +1403,7 @@ class Contrat extends CommonObject $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= " ".$clause." s.entity = ".$conf->entity; + $sql.= " ".$clause." c.entity = ".$conf->entity; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index cee7fd45353..df9f6cc6126 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -308,14 +308,14 @@ if ($id > 0) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 301610daaf8..d0045156eed 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -103,7 +103,7 @@ $sql.= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid"; $sql.= " AND (cd.statut != 4 OR (cd.statut = 4 AND (cd.date_fin_validite is null or cd.date_fin_validite >= '".$db->idate(dol_now('tzref'))."')))"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " GROUP BY cd.statut"; @@ -140,7 +140,7 @@ $sql.= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid"; $sql.= " AND (cd.statut = 4 AND cd.date_fin_validite < '".$db->idate(dol_now('tzref'))."')"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " GROUP BY cd.statut"; @@ -229,7 +229,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.rowid = c.fk_soc"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.statut = 0"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.fk_soc = ".$socid; @@ -300,7 +300,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " ".MAIN_DB_PREFIX. $sql.= " ".MAIN_DB_PREFIX."contrat as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; $sql.= " WHERE c.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.statut > 0"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; @@ -374,7 +374,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX $sql.= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql.= " WHERE cd.fk_contrat = c.rowid"; $sql.= " AND c.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY cd.tms DESC"; @@ -454,7 +454,7 @@ $sql.= " WHERE c.statut=1"; $sql.= " AND cd.statut = 0"; $sql.= " AND cd.fk_contrat = c.rowid"; $sql.= " AND c.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY cd.tms DESC"; @@ -534,7 +534,7 @@ $sql.= " AND cd.statut = 4"; $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'"; $sql.= " AND cd.fk_contrat = c.rowid"; $sql.= " AND c.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY cd.tms DESC"; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 7a86d16fea3..ea8ff2a549a 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -76,7 +76,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX $sql.= ", ".MAIN_DB_PREFIX."contrat as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; $sql.= " WHERE c.fk_soc = s.rowid "; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($search_nom) $sql.= " AND s.nom like '%".$db->escape($search_nom)."%'"; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index e6d3ddd2e8c..24a788f8fd7 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -87,7 +87,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql.= " WHERE"; $sql.= " c.rowid = cd.fk_contrat"; $sql.= " AND c.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($mode == "0") $sql.= " AND cd.statut = 0"; if ($mode == "4") $sql.= " AND cd.statut = 4"; diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php index 00d4e4cfa48..e723cc2ac5b 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/admin_extrafields.inc.php @@ -21,17 +21,27 @@ * \brief Code for actions on extrafields admin pages */ +$maxsizestring=255; +$maxsizeint=10; + // Add attribute if ($action == 'add') { if ($_POST["button"] != $langs->trans("Cancel")) { // Check values - if (GETPOST('type')=='varchar' && GETPOST('size') > 255) + if (GETPOST('type')=='varchar' && GETPOST('size') > $maxsizestring) { $error++; $langs->load("errors"); - $mesg=$langs->trans("ErrorSizeTooLongForVarcharType"); + $mesg=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring); + $action = 'create'; + } + if (GETPOST('type')=='int' && GETPOST('size') > $maxsizeint) + { + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint); $action = 'create'; } @@ -69,11 +79,18 @@ if ($action == 'update') if ($_POST["button"] != $langs->trans("Cancel")) { // Check values - if (GETPOST('type')=='varchar' && GETPOST('size') > 255) + if (GETPOST('type')=='varchar' && GETPOST('size') > $maxsizestring) { $error++; $langs->load("errors"); - $mesg=$langs->trans("ErrorSizeTooLongForVarcharType"); + $mesg=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring); + $action = 'edit'; + } + if (GETPOST('type')=='int' && GETPOST('size') > $maxsizeint) + { + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint); $action = 'edit'; } diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 267d238d5ce..e909e60620a 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -25,8 +25,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); - -class box_actions extends ModeleBoxes { +/** + * Class to manage the box to show last events + */ +class box_actions extends ModeleBoxes +{ var $boxcode="lastactions"; var $boximg="object_action"; @@ -76,7 +79,7 @@ class box_actions extends ModeleBoxes { $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " ".MAIN_DB_PREFIX."societe_commerciaux AS sc, "; $sql.= MAIN_DB_PREFIX."actioncomm AS a)"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " WHERE a.fk_action = ta.id"; $sql.= " AND a.entity = ".$conf->entity; $sql.= " AND a.percent >= 0 AND a.percent < 100"; diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index 89352d908aa..9427b64b721 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -22,8 +22,11 @@ */ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); - -class box_bookmarks extends ModeleBoxes { +/** + * Class to manage the box to show bookmarks + */ +class box_bookmarks extends ModeleBoxes +{ var $boxcode="bookmarks"; var $boximg="object_bookmark"; diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 509641b7570..05654cc43aa 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -26,7 +26,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_clients extends ModeleBoxes { +/** + * Class to manage the box to show last thirdparties + */ + class box_clients extends ModeleBoxes + { var $boxcode="lastcustomers"; var $boximg="object_company"; @@ -74,7 +78,7 @@ class box_clients extends ModeleBoxes { $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.client IN (1, 3)"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($user->societe_id) $sql.= " AND s.rowid = $user->societe_id"; $sql.= " ORDER BY s.tms DESC"; diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 74da5a9ab39..f729b6881ec 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -26,7 +26,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_commandes extends ModeleBoxes { +/** + * Class to manage the box to show last orders + */ + class box_commandes extends ModeleBoxes + { var $boxcode="lastcustomerorders"; var $boximg="object_order"; @@ -71,16 +75,16 @@ class box_commandes extends ModeleBoxes { { $sql = "SELECT s.nom, s.rowid as socid,"; - $sql.= " p.ref, p.tms, p.rowid,"; - $sql.= " p.fk_statut, p.facture"; + $sql.= " c.ref, c.tms, c.rowid,"; + $sql.= " c.fk_statut, c.facture"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."commande as p"; + $sql.= ", ".MAIN_DB_PREFIX."commande as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE p.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " WHERE c.fk_soc = s.rowid"; + $sql.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; - $sql.= " ORDER BY p.date_commande DESC, p.ref DESC "; + $sql.= " ORDER BY c.date_commande DESC, c.ref DESC "; $sql.= $db->plimit($max, 0); $result = $db->query($sql); diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index f988017338a..7cc328d6294 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -26,7 +26,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); include_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php"); -class box_comptes extends ModeleBoxes { +/** + * Class to manage the box to show last users + */ + class box_comptes extends ModeleBoxes + { var $boxcode="currentaccounts"; var $boximg="object_bill"; diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 98c43b14f96..15f7a77b9cb 100755 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -27,7 +27,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); include_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -class box_contacts extends ModeleBoxes { +/** + * Class to manage the box to show last contacts + */ + class box_contacts extends ModeleBoxes + { var $boxcode="lastcontacts"; var $boximg="object_contact"; @@ -71,7 +75,7 @@ class box_contacts extends ModeleBoxes { $sql = "SELECT s.rowid, s.name, s.firstname, s.civilite, s.datec, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE s.entity = ".$conf->entity; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($user->societe_id) $sql.= " AND s.rowid = $user->societe_id"; $sql.= " ORDER BY s.tms DESC"; diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index f92494b100a..a1c3e673c56 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -24,7 +24,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_contracts extends ModeleBoxes { +/** + * Class to manage the box to show last contracts + */ + class box_contracts extends ModeleBoxes + { var $boxcode="lastcontracts"; var $boximg="object_contract"; diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index f61df2d8c4c..d0dbe88e278 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -28,7 +28,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/class/rssparser.class.php"); include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_external_rss extends ModeleBoxes { +/** + * Class to manage the box to show RSS feeds + */ + class box_external_rss extends ModeleBoxes + { var $boxcode="lastrssinfos"; var $boximg="object_rss"; @@ -43,7 +47,7 @@ class box_external_rss extends ModeleBoxes { /** * Constructor - * + * * @param DoliDB $db Database handler */ function box_external_rss($db,$param) diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index f801afb650f..d34c50750bb 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -25,7 +25,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_factures extends ModeleBoxes { +/** + * Class to manage the box to show last invoices + */ + class box_factures extends ModeleBoxes + { var $boxcode="lastcustomerbills"; var $boximg="object_bill"; @@ -80,7 +84,7 @@ class box_factures extends ModeleBoxes { if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ")"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " ORDER BY f.tms DESC"; diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 365c3a12a7f..7899e8b4491 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -25,7 +25,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_factures_fourn extends ModeleBoxes { +/** + * Class to manage the box to show last supplier invoices + */ + class box_factures_fourn extends ModeleBoxes + { var $boxcode="lastsupplierbills"; var $boximg="object_bill"; @@ -80,7 +84,7 @@ class box_factures_fourn extends ModeleBoxes { $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " ORDER BY f.tms DESC"; diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 3a9a48bedbd..c9013d9a6db 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -24,7 +24,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_factures_fourn_imp extends ModeleBoxes { +/** + * Class to manage the box to show not payed suppliers invoices + */ + class box_factures_fourn_imp extends ModeleBoxes + { var $boxcode="oldestunpaidsupplierbills"; var $boximg="object_bill"; @@ -76,7 +80,7 @@ class box_factures_fourn_imp extends ModeleBoxes { $sql.= ",".MAIN_DB_PREFIX."facture_fourn as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.paye=0"; $sql.= " AND fk_statut = 1"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 7eeac19a248..dff509b025d 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -27,7 +27,11 @@ require_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); require_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'); -class box_factures_imp extends ModeleBoxes { +/** + * Class to manage the box to show last invoices + */ + class box_factures_imp extends ModeleBoxes + { var $boxcode="oldestunpaidcustomerbills"; var $boximg="object_bill"; @@ -78,7 +82,7 @@ class box_factures_imp extends ModeleBoxes { $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.paye = 0"; $sql.= " AND fk_statut = 1"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 9c02cab8462..0270f0c12c9 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -25,7 +25,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_fournisseurs extends ModeleBoxes { +/** + * Class to manage the box to show last suppliers + */ + class box_fournisseurs extends ModeleBoxes + { var $boxcode="lastsuppliers"; var $boximg="object_company"; @@ -73,7 +77,7 @@ class box_fournisseurs extends ModeleBoxes { $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fournisseur = 1"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " ORDER BY s.tms DESC "; diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 6d0b9f27241..5390e6a74c6 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -26,7 +26,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_members extends ModeleBoxes { +/** + * Class to manage the box to show last members + */ + class box_members extends ModeleBoxes + { var $boxcode="lastmembers"; var $boximg="object_user"; @@ -70,12 +74,12 @@ class box_members extends ModeleBoxes { if ($user->rights->societe->lire) { - $sql = "SELECT s.rowid, s.nom as lastname, s.prenom as firstname, s.datec, s.tms, s.statut as status, s.datefin as date_end_subscription,"; + $sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"; $sql.= " t.cotisation"; - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as s, ".MAIN_DB_PREFIX."adherent_type as t"; - $sql.= " WHERE s.entity = ".$conf->entity; - $sql.= " AND s.fk_adherent_type = t.rowid"; - $sql.= " ORDER BY s.tms DESC"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t"; + $sql.= " WHERE a.entity = ".$conf->entity; + $sql.= " AND a.fk_adherent_type = t.rowid"; + $sql.= " ORDER BY a.tms DESC"; $sql.= $db->plimit($max, 0); $result = $db->query($sql); @@ -91,9 +95,9 @@ class box_members extends ModeleBoxes { $datec=$db->jdate($objp->datec); $datem=$db->jdate($objp->tms); - $memberstatic->nom=$objp->lastname; - $memberstatic->prenom=$objp->firstname; - + $memberstatic->lastname=$objp->lastname; + $memberstatic->firstname=$objp->firstname; + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/adherents/fiche.php?rowid=".$objp->rowid); diff --git a/htdocs/core/boxes/box_osc_client.php b/htdocs/core/boxes/box_osc_client.php index a784a0c8774..72c97013881 100644 --- a/htdocs/core/boxes/box_osc_client.php +++ b/htdocs/core/boxes/box_osc_client.php @@ -25,7 +25,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_osc_clients extends ModeleBoxes { +/** + * Class to manage the box to show last customers of shop + */ + class box_osc_clients extends ModeleBoxes + { var $boxcode="nbofcustomers"; var $boximg="object_company"; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 6e031577cbc..46fa860eef1 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -27,7 +27,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); include_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -class box_produits extends ModeleBoxes { +/** + * Class to manage the box to show last products + */ + class box_produits extends ModeleBoxes + { var $boxcode="lastproducts"; var $boximg="object_product"; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 4752e0ffc70..33230db1a54 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -26,7 +26,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_propales extends ModeleBoxes { +/** + * Class to manage the box to show last proposals + */ + class box_propales extends ModeleBoxes + { var $boxcode="lastpropals"; var $boximg="object_propal"; @@ -76,7 +80,7 @@ class box_propales extends ModeleBoxes { $sql.= ", ".MAIN_DB_PREFIX."propal as p"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND p.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " ORDER BY p.datep DESC, p.ref DESC "; diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 69bb2444008..19607d4d791 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -28,7 +28,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); include_once(DOL_DOCUMENT_ROOT."/comm/prospect/class/prospect.class.php"); -class box_prospect extends ModeleBoxes { +/** + * Class to manage the box to show last prospects + */ + class box_prospect extends ModeleBoxes + { var $boxcode="lastprospects"; var $boximg="object_company"; @@ -78,7 +82,7 @@ class box_prospect extends ModeleBoxes { $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.client IN (2, 3)"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " ORDER BY s.tms DESC"; diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 895fa7713a2..4b2e9a857aa 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -24,7 +24,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_services_expired extends ModeleBoxes { +/** + * Class to manage the box to show expired services + */ + class box_services_expired extends ModeleBoxes + { var $boxcode="expiredservices"; var $boximg="object_contract"; diff --git a/htdocs/core/boxes/box_services_vendus.php b/htdocs/core/boxes/box_services_vendus.php index 477cb6383f3..a5be4a29b59 100644 --- a/htdocs/core/boxes/box_services_vendus.php +++ b/htdocs/core/boxes/box_services_vendus.php @@ -26,7 +26,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_services_vendus extends ModeleBoxes { +/** + * Class to manage the box to show last services lines + */ + class box_services_vendus extends ModeleBoxes + { var $boxcode="lastproductsincontract"; var $boximg="object_product"; @@ -80,7 +84,7 @@ class box_services_vendus extends ModeleBoxes { if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ")"; $sql.= " WHERE s.rowid = c.fk_soc"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.rowid = cd.fk_contrat"; $sql.= " AND cd.fk_product = p.rowid"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index b38c37494fa..08a4d0cef86 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -24,8 +24,7 @@ /** - * \class ModeleBoxes - * \brief Classe mere des boites + * Parent class of boxes */ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" boxes { @@ -33,17 +32,21 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" var $error=''; var $max=5; - /* - * \brief Constructeur - */ - function ModeleBoxes($DB) - { - $this->db=$DB; - } - /** - * \brief Renvoi le dernier message d'erreur de creation de facture + * Constructor + * + * @param DoliDB $db Database hanlder + */ + function ModeleBoxes($db) + { + $this->db=$db; + } + + /** + * Return last error message + * + * @return string Error message */ function error() { @@ -52,7 +55,10 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" /** - * \brief Charge une ligne boxe depuis son rowid + * Load a box line from its rowid + * + * @param int $rowid Row id to load + * @return int <0 if KO, >0 if OK */ function fetch($rowid) { @@ -60,7 +66,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" $sql = "SELECT b.rowid, b.box_id, b.position, b.box_order, b.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes as b"; $sql.= " WHERE b.rowid = ".$rowid; - dol_syslog("ModeleBoxes::fetch rowid=".$rowid); + dol_syslog(get_class($this)."::fetch rowid=".$rowid); $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 8ab422c7e12..b597e39ec3a 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -30,10 +30,9 @@ */ /** - * \class CMailFile - * \brief Class to send emails (with attachments or not) - * \remarks Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to); - * \remarks $mailfile->sendfile(); + * Class to send emails (with attachments or not) + * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to); + * $mailfile->sendfile(); */ class CMailFile { @@ -106,17 +105,15 @@ class CMailFile // We define end of line (RFC 822bis section 2.3) $this->eol="\r\n"; - //if (preg_match('/^win/i',PHP_OS)) $this->eol="\r\n"; - //if (preg_match('/^mac/i',PHP_OS)) $this->eol="\r"; // On defini mixed_boundary - $this->mixed_boundary = dol_hash(uniqid("dolibarr1")); + $this->mixed_boundary = "multipart_x." . time() . ".x_boundary"; // On defini related_boundary - $this->related_boundary = dol_hash(uniqid("dolibarr2")); + $this->related_boundary = 'mul_'.dol_hash(uniqid("dolibarr2")); // On defini alternative_boundary - $this->alternative_boundary = dol_hash(uniqid("dolibarr3")); + $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3")); // If ending method not defined if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail'; @@ -190,14 +187,14 @@ class CMailFile $smtp_headers = $this->write_smtpheaders(); // Define mime_headers - $mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list); + //$mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list); if (! empty($this->html)) { if (!empty($css)) { $this->css = $css; - $this->buildCSS(); + $this->buildCSS(); // Build a css style (mode = all) into this->styleCSS and this->bodyCSS } $msg = $this->html; @@ -222,16 +219,16 @@ class CMailFile $files_encoded = $this->write_files($filename_list,$mimetype_list,$mimefilename_list); } - // We now define $this->headers et $this->message + // We now define $this->headers and $this->message $this->headers = $smtp_headers . $mime_headers; - - $this->message = $text_body . $images_encoded . $files_encoded; - $this->message.= "--" . $this->mixed_boundary . "--" . $this->eol; - // On nettoie le header pour qu'il ne se termine pas par un retour chariot. // Ceci evite aussi les lignes vides en fin qui peuvent etre interpretees // comme des injections mail par les serveurs de messagerie. $this->headers = preg_replace("/([\r\n]+)$/i","",$this->headers); + + $this->message = 'This is a message with multiple parts in MIME format.'.$this->eol; + $this->message.= $text_body . $images_encoded . $files_encoded; + $this->message.= "--" . $this->mixed_boundary . "--" . $this->eol; } else if ($conf->global->MAIN_MAIL_SENDMODE == 'smtps') { @@ -479,7 +476,7 @@ class CMailFile if (is_readable($newsourcefile)) { $contents = file_get_contents($newsourcefile); // Need PHP 4.3 - $encoded = chunk_split(base64_encode($contents), 68, $this->eol); + $encoded = chunk_split(base64_encode($contents), 76, $this->eol); // 76 max is defined into http://tools.ietf.org/html/rfc2047 return $encoded; } else @@ -551,7 +548,7 @@ class CMailFile } /** - * Build a css style (mode = all) + * Build a css style (mode = all) into this->styleCSS and this->bodyCSS * * @return css */ @@ -589,10 +586,13 @@ class CMailFile global $conf; $out = ""; + $host = dol_getprefix(); + // Sender - //$out .= "X-Sender: ".getValidAddress($this->addr_from,2).$this->eol; - $out .= "From: ".$this->getValidAddress($this->addr_from,0,1).$this->eol; - $out .= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol; + //$out .= "Sender: ".getValidAddress($this->addr_from,2m)).$this->eol; + $out .= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol; + //$out .= "From: ".$this->getValidAddress($this->addr_from,2,0).$this->eol; + //$out .= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol; if (isset($this->reply_to) && $this->reply_to) $out .= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol; if (isset($this->errors_to) && $this->errors_to) $out .= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol; @@ -604,8 +604,12 @@ class CMailFile if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out .= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol; //$out .= "X-Priority: 3".$this->eol; + + $out.= 'Date: ' . date("r") . $this->eol; + $out.= 'Message-ID: <' . time() . '.phpmail@' . $host . ">" . $this->eol; + $out.= "X-Mailer: Dolibarr version " . DOL_VERSION ." (using php mail)".$this->eol; - $out.= "MIME-Version: 1.0".$this->eol; + $out.= "Mime-Version: 1.0".$this->eol; $out.= "Content-Type: multipart/mixed; boundary=\"".$this->mixed_boundary."\"".$this->eol; $out.= "Content-Transfer-Encoding: 8bit".$this->eol; @@ -950,10 +954,12 @@ class CMailFile * Return an address for SMTP protocol * * @param string $adresses Example: 'John Doe ' or 'john@doe.com' - * @param int $format 0=Auto, 1=emails with <>, 2=emails without <> + * @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between " * @param int $encode 1=Encode name to RFC2822 - * @return string If format 1: '' or 'John Doe ' + * @return string If format 0: '' or 'John Doe ' or '=?UTF-8?B?Sm9obiBEb2U=?= ' + * If format 1: '' * If format 2: 'john@doe.com' + * If format 3: '' or '"John Doe" ' or '"=?UTF-8?B?Sm9obiBEb2U=?=" ' */ function getValidAddress($adresses,$format,$encode='') { @@ -984,15 +990,15 @@ class CMailFile { $newemail=$email; } - if ($format == 1) + if ($format == 1 || $format == 3) { $newemail='<'.$email.'>'; } - if ($format == 0) + if ($format == 0 || $format == 3) { if ($conf->global->MAIN_MAIL_NO_FULL_EMAIL) $newemail='<'.$email.'>'; elseif (! $name) $newemail='<'.$email.'>'; - else $newemail=($encode?$this->encodetorfc2822($name):$name).' <'.$email.'>'; + else $newemail=($format==3?'"':'').($encode?$this->encodetorfc2822($name):$name).($format==3?'"':'').' <'.$email.'>'; } $ret=($ret ? $ret.',' : '').$newemail; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9549eaf371d..4465d79aa06 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2012 Christophe Battarel @@ -8,12 +8,12 @@ * 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 . */ @@ -26,10 +26,8 @@ /** - * \class CommonObject - * \brief Parent class of all other business classes (invoices, contracts, proposals, orders, ...) + * Parent class of all other business classes (invoices, contracts, proposals, orders, ...) */ - abstract class CommonObject { protected $db; @@ -41,6 +39,49 @@ abstract class CommonObject // No constructor as it is an abstract class + /** + * Return full name (civility+' '+name+' '+lastname) + * + * @param Translate $langs Language object for translation of civility + * @param int $option 0=No option, 1=Add civility + * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * @param int $maxlen Maximum length + * @return string String with full name + */ + function getFullName($langs,$option=0,$nameorder=-1,$maxlen=0) + { + global $conf; + + $lastname=$this->lastname; + $firstname=$this->firstname; + if (empty($lastname)) $lastname=($this->name?$this->name:$this->nom); + if (empty($firstname)) $firstname=$this->prenom; + + $ret=''; + if ($option && $this->civilite_id) + { + if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; + else $ret.=$this->civilite_id.' '; + } + + // If order not defined, we use the setup + if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION); + + if ($nameorder) + { + $ret.=$firstname; + if ($firstname && $lastname) $ret.=' '; + $ret.=$lastname; + } + else + { + $ret.=$lastname; + if ($firstname && $lastname) $ret.=' '; + $ret.=$firstname; + } + return dol_trunc($ret,$maxlen); + } + /** * Check if ref is used. * @@ -72,11 +113,11 @@ abstract class CommonObject /** * Add a link between element $this->element and a contact * - * @param fk_socpeople Id of contact to link - * @param type_contact Type of contact (code or id) - * @param source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) - * @param notrigger Disable all triggers - * @return int <0 if KO, >0 if OK + * @param int $fk_socpeople Id of contact to link + * @param int $type_contact Type of contact (code or id) + * @param int $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) + * @param int $notrigger Disable all triggers + * @return int <0 if KO, >0 if OK */ function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0) { @@ -168,10 +209,10 @@ abstract class CommonObject /** * Update a link to contact line * - * @param rowid Id of line contact-element - * @param statut New status of link - * @param type_contact_id Id of contact type (not modified if 0) - * @return int <0 if KO, >= 0 if OK + * @param int $rowid Id of line contact-element + * @param int $statut New status of link + * @param int $type_contact_id Id of contact type (not modified if 0) + * @return int <0 if KO, >= 0 if OK */ function update_contact($rowid, $statut, $type_contact_id=0) { @@ -195,9 +236,9 @@ abstract class CommonObject /** * Delete a link to contact line * - * @param rowid Id of contact link line to delete - * @param notrigger Disable all triggers - * @return int >0 if OK, <0 if KO + * @param int $rowid Id of contact link line to delete + * @param int $notrigger Disable all triggers + * @return int >0 if OK, <0 if KO */ function delete_contact($rowid, $notrigger=0) { @@ -269,10 +310,10 @@ abstract class CommonObject /** * Get array of all contacts for an object * - * @param int $statut Status of lines to get (-1=all) - * @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user) - * @param int $list 0:Return array contains all properties, 1:Return array contains just id - * @return array Array of contacts + * @param int $statut Status of lines to get (-1=all) + * @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user) + * @param int $list 0:Return array contains all properties, 1:Return array contains just id + * @return array Array of contacts */ function liste_contact($statut=-1,$source='external',$list=0) { @@ -339,8 +380,8 @@ abstract class CommonObject /** * Update status of a contact linked to object * - * @param $rowid Id of link between object and contact - * @return int <0 if KO, >=0 if OK + * @param int $rowid Id of link between object and contact + * @return int <0 if KO, >=0 if OK */ function swapContactStatus($rowid) { @@ -375,10 +416,10 @@ abstract class CommonObject /** * Return array with list of possible values for type of contacts * - * @param source internal, external or all if not defined - * @param order Sort order by : code or rowid - * @param option 0=Return array id->label, 1=Return array code->label - * @return array Array list of type of contacts (id->label if option=0, code->label if option=1) + * @param string $source 'internal', 'external' or 'all' + * @param string $order Sort order by : 'code' or 'rowid' + * @param string $option 0=Return array id->label, 1=Return array code->label + * @return array Array list of type of contacts (id->label if option=0, code->label if option=1) */ function liste_type_contact($source='internal', $order='code', $option=0) { @@ -423,10 +464,10 @@ abstract class CommonObject * Example: contact client de livraison ('external', 'SHIPPING') * Example: contact interne suivi paiement ('internal', 'SALESREPFOLL') * - * @param source 'external' or 'internal' - * @param code 'BILLING', 'SHIPPING', 'SALESREPFOLL', ... - * @param status limited to a certain status - * @return array List of id for such contacts + * @param string $source 'external' or 'internal' + * @param string $code 'BILLING', 'SHIPPING', 'SALESREPFOLL', ... + * @param int $status limited to a certain status + * @return array List of id for such contacts */ function getIdContact($source,$code,$status=0) { @@ -473,8 +514,8 @@ abstract class CommonObject /** * Charge le contact d'id $id dans this->contact * - * @param contactid Id du contact - * @return int <0 if KO, >0 if OK + * @param int $contactid Id du contact + * @return int <0 if KO, >0 if OK */ function fetch_contact($contactid) { @@ -488,7 +529,7 @@ abstract class CommonObject /** * Load the third party of object from id $this->socid into this->thirdpary * - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK */ function fetch_thirdparty() { @@ -577,8 +618,8 @@ abstract class CommonObject /** * Charge le user d'id userid dans this->user * - * @param userid Id du contact - * @return int <0 if KO, >0 if OK + * @param int $userid Id du contact + * @return int <0 if KO, >0 if OK */ function fetch_user($userid) { @@ -589,7 +630,9 @@ abstract class CommonObject } /** - * Read linked origin object + * Read linked origin object + * + * @return void */ function fetch_origin() { @@ -607,10 +650,10 @@ abstract class CommonObject /** * Load object from specific field * - * @param table Table element or element line - * @param field Field selected - * @param key Import key - * @return int <0 if KO, >0 if OK + * @param string $table Table element or element line + * @param string $field Field selected + * @param string $key Import key + * @return int <0 if KO, >0 if OK */ function fetchObjectFrom($table,$field,$key) { @@ -698,11 +741,11 @@ abstract class CommonObject /** * Load properties id_previous and id_next * - * @param filter Optional filter - * @param fieldid Name of field to use for the select MAX and MIN - * @return int <0 if KO, >0 if OK + * @param string $filter Optional filter + * @param int $fieldid Name of field to use for the select MAX and MIN + * @return int <0 if KO, >0 if OK */ - function load_previous_next_ref($filter='',$fieldid) + function load_previous_next_ref($filter,$fieldid) { global $conf, $user; @@ -766,9 +809,9 @@ abstract class CommonObject /** * Return list of id of contacts of project * - * @param source Source of contact: external (llx_socpeople) or internal (llx_user) or thirdparty (llx_societe) - * @return array Array of id of contacts (if source=external or internal) - * Array of id of third parties with at least one contact on project (if source=thirdparty) + * @param string $source Source of contact: external (llx_socpeople) or internal (llx_user) or thirdparty (llx_societe) + * @return array Array of id of contacts (if source=external or internal) + * Array of id of third parties with at least one contact on project (if source=thirdparty) */ function getListContactId($source='external') { @@ -822,9 +865,9 @@ abstract class CommonObject /** * Set last model used by doc generator * - * @param user User object that make change - * @param modelpdf Modele name - * @return int <0 if KO, >0 if OK + * @param User $user User object that make change + * @param string $modelpdf Modele name + * @return int <0 if KO, >0 if OK */ function setDocModel($user, $modelpdf) { @@ -862,6 +905,7 @@ abstract class CommonObject * * @param boolean $renum true to renum all already ordered lines, false to renum only not already ordered lines. * @param string $rowidorder ASC or DESC + * @return void */ function line_order($renum=false, $rowidorder='ASC') { @@ -891,7 +935,7 @@ abstract class CommonObject if ($nl > 0) { $rows=array(); - + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql.= ' WHERE '.$this->fk_element.' = '.$this->id; $sql.= ' AND fk_parent_line IS NULL'; @@ -928,21 +972,22 @@ abstract class CommonObject } } } - + /** * Get childrens of line - * + * * @param int $id Id of parent line + * @return array Array with list of child lines id */ function getChildrensOfLine($id) { $rows=array(); - + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql.= ' WHERE '.$this->fk_element.' = '.$this->id; $sql.= ' AND fk_parent_line = '.$id; $sql.= ' ORDER BY rang ASC'; - + dol_syslog(get_class($this)."::getChildrenOfLines sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -956,14 +1001,15 @@ abstract class CommonObject $i++; } } - + return $rows; } /** * Update a line to have a lower rank * - * @param int $rowid + * @param int $rowid Id of line + * @return void */ function line_up($rowid) { @@ -979,7 +1025,8 @@ abstract class CommonObject /** * Update a line to have a higher rank * - * @param int $rowid + * @param int $rowid Id of line + * @return void */ function line_down($rowid) { @@ -998,8 +1045,9 @@ abstract class CommonObject /** * Update position of line (rang) * - * @param int $rowid - * @param int $rang + * @param int $rowid Id of line + * @param int $rang Position + * @return void */ function updateRangOfLine($rowid,$rang) { @@ -1017,6 +1065,7 @@ abstract class CommonObject * Update position of line with ajax (rang) * * @param array $rows Array of rows + * @return void */ function line_ajaxorder($rows) { @@ -1030,8 +1079,9 @@ abstract class CommonObject /** * Update position of line up (rang) * - * @param int $rowid - * @param int $rang + * @param int $rowid Id of line + * @param int $rang Position + * @return void */ function updateLineUp($rowid,$rang) { @@ -1059,9 +1109,10 @@ abstract class CommonObject /** * Update position of line down (rang) * - * @param int $rowid - * @param int $rang - * @param int $max + * @param int $rowid Id of line + * @param int $rang Position + * @param int $max Max + * @return void */ function updateLineDown($rowid,$rang,$max) { @@ -1582,10 +1633,10 @@ abstract class CommonObject /** * Set statut of an object * - * @param statut Statut to set - * @param elementId Id of element to force (use this->id by default) - * @param elementType Type of element to force (use ->this->element by default) - * @return int <0 if ko, >0 if ok + * @param int $statut Statut to set + * @param int $elementId Id of element to force (use this->id by default) + * @param string $elementType Type of element to force (use ->this->element by default) + * @return int <0 if KO, >0 if OK */ function setStatut($statut,$elementId='',$elementType='') { @@ -1655,7 +1706,8 @@ abstract class CommonObject /** * Get special code of line * - * @param lineid Id of line + * @param int $lineid Id of line + * @return int Special code */ function getSpecialCode($lineid) { @@ -1673,8 +1725,9 @@ abstract class CommonObject /** * Function to get extra fields of a member into $this->array_options * - * @param rowid - * @param optionsArray Array resulting of call of extrafields->fetch_name_optionals_label() + * @param int $rowid Id of line + * @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label() + * @return void */ function fetch_optionals($rowid,$optionsArray='') { @@ -1725,12 +1778,45 @@ abstract class CommonObject /** - * Add/Update extra fields + * Add/Update all extra fields values for the current object. + * All data to describe values to insert are stored into $this->array_options=array('keyextrafield'=>'valueextrafieldtoadd') + * + * @return void */ function insertExtraFields() { + global $langs; + if (count($this->array_options) > 0) { + // Check parameters + $langs->load('admin'); + require_once(DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"); + $extrafields = new ExtraFields($this->db); + $optionsArray = $extrafields->fetch_name_optionals_label($this->elementType); + + foreach($this->array_options as $key => $value) + { + $attributeKey = substr($key,8); // Remove 'options_' prefix + $attributeType = $extrafields->attribute_type[$attributeKey]; + $attributeSize = $extrafields->attribute_size[$attributeKey]; + $attributeLabel = $extrafields->attribute_label[$attributeKey]; + switch ($attributeType) + { + case 'int': + if (!is_numeric($value) && $value!='') + { + $error++; $this->errors[]=$langs->trans("ExtraFieldHasWrongValue",$attributeLabel); + return -1; + } + elseif ($value=='') + { + $this->array_options[$key] = null; + } + break; + } + } + $this->db->begin(); $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id; @@ -1858,10 +1944,11 @@ abstract class CommonObject /** * List urls of elemùent * - * @param unknown_type $objectid - * @param unknown_type $objecttype - * @param unknown_type $withpicto - * @param unknown_type $option + * @param int $objectid Id of record + * @param string $objecttype Type of object + * @param int $withpicto Picto to show + * @param string $option More options + * @return void */ function getElementUrl($objectid,$objecttype,$withpicto=0,$option='') { @@ -1932,6 +2019,8 @@ abstract class CommonObject * Show linked object block * TODO Move this into html.class.php * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. + * + * @return void */ function showLinkedObjectBlock() { @@ -1990,10 +2079,11 @@ abstract class CommonObject * TODO Edit templates to use global variables and include them directly in controller call * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. * - * @param int $dateSelector 1=Show also date range input fields - * @param Societe $seller Object thirdparty who sell - * @param Societe $buyer Object thirdparty who buy - * @param HookManager $hookmanager Hook manager instance + * @param int $dateSelector 1=Show also date range input fields + * @param Societe $seller Object thirdparty who sell + * @param Societe $buyer Object thirdparty who buy + * @param HookManager $hookmanager Hook manager instance + * @return void */ function formAddPredefinedProduct($dateSelector,$seller,$buyer,$hookmanager=false) { @@ -2009,10 +2099,11 @@ abstract class CommonObject * TODO Edit templates to use global variables and include them directly in controller call * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects. * - * @param int $dateSelector 1=Show also date range input fields - * @param Societe $seller Object thirdparty who sell - * @param Societe $buyer Object thirdparty who buy - * @param HookManager $hookmanager Hook manager instance + * @param int $dateSelector 1=Show also date range input fields + * @param Societe $seller Object thirdparty who sell + * @param Societe $buyer Object thirdparty who buy + * @param HookManager $hookmanager Hook manager instance + * @return void */ function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false) { @@ -2034,13 +2125,15 @@ abstract class CommonObject * If lines are into a template, title must also be into a template * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects. * - * @param $action Action code - * @param $seller Object of seller third party - * @param $buyer Object of buyer third party - * @param $selected Object line selected - * @param $dateSelector 1=Show also date range input fields + * @param string $action Action code + * @param string $seller Object of seller third party + * @param string $buyer Object of buyer third party + * @param string $selected Object line selected + * @param int $dateSelector 1=Show also date range input fields + * @param HookManager $hookmanager Hookmanager + * @return void */ - function printObjectLines($action='viewline',$seller,$buyer,$selected=0,$dateSelector=0,$hookmanager=false) + function printObjectLines($action,$seller,$buyer,$selected=0,$dateSelector=0,$hookmanager=false) { global $conf,$langs; @@ -2112,17 +2205,19 @@ abstract class CommonObject * If lines are into a template, title must also be into a template * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. * - * @param $action GET/POST action - * @param $line Selected object line to output - * @param $var Is it a an odd line - * @param $num Number of line - * @param $i - * @param $dateSelector 1=Show also date range input fields - * @param $seller Object of seller third party - * @param $buyer Object of buyer third party - * @param $selected Object line selected + * @param string $action GET/POST action + * @param array $line Selected object line to output + * @param string $var Is it a an odd line + * @param int $num Number of line + * @param int $i I + * @param int $dateSelector 1=Show also date range input fields + * @param string $seller Object of seller third party + * @param string $buyer Object of buyer third party + * @param string $selected Object line selected + * @param HookManager $hookmanager Hook manager + * @return void */ - function printLine($action='viewline',$line,$var=true,$num=0,$i=0,$dateSelector=0,$seller,$buyer,$selected=0,$hookmanager=false) + function printLine($action,$line,$var=true,$num=0,$i=0,$dateSelector=0,$seller,$buyer,$selected=0,$hookmanager=false) { global $conf,$langs,$user; global $form,$bc,$bcdd; @@ -2150,7 +2245,7 @@ abstract class CommonObject { $this->fetch_thirdparty(); $prod = new Product($this->db, $line->fk_product); - + $outputlangs = $langs; $newlang=''; if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); @@ -2160,13 +2255,13 @@ abstract class CommonObject $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $line->product_label; } else { $label = $line->product_label; } - + $product_static->type=$line->fk_product_type; $product_static->id=$line->fk_product; $product_static->ref=$line->ref; @@ -2211,6 +2306,9 @@ abstract class CommonObject * TODO Move this and previous function into output html class file (htmlline.class.php). * If lines are into a template, title must also be into a template * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. + * + * @param HookManager $hookmanager Hook manager + * @return void */ function printOriginLinesList($hookmanager=false) { @@ -2255,8 +2353,10 @@ abstract class CommonObject * TODO Move this and previous function into output html class file (htmlline.class.php). * If lines are into a template, title must also be into a template * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. - * @param line - * @param var + * + * @param array $line Line + * @param string $var Var + * @return void */ function printOriginLine($line,$var) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 86ebf20bf6f..ce3860412fe 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -27,8 +27,7 @@ */ /** - * \class ExtraFields - * \brief Class to manage standard extra fields + * Class to manage standard extra fields */ class ExtraFields { @@ -46,11 +45,11 @@ class ExtraFields /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function ExtraFields($DB) + function ExtraFields($db) { - $this->db = $DB ; + $this->db = $db; $this->error = array(); $this->attribute_type = array(); $this->attribute_label = array(); @@ -60,6 +59,7 @@ class ExtraFields /** * Add a new extra field parameter + * * @param attrname code of attribute * @param label label of attribute * @param type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour') @@ -88,6 +88,7 @@ class ExtraFields /** * Add a new optionnal attribute + * * @param attrname code of attribute * @param type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour') * @param length Size/length of attribute @@ -129,6 +130,7 @@ class ExtraFields /** * Add description of a new optionnal attribute + * * @param attrname code of attribute * @param label label of attribute * @param type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour') @@ -172,6 +174,7 @@ class ExtraFields /** * Delete an optionnal attribute + * * @param attrname Code of attribute to delete * @param elementtype Element type ('member', 'product', 'company', ...) * @return int < 0 if KO, 0 if nothing is done, 1 if OK @@ -211,6 +214,7 @@ class ExtraFields /** * Delete description of an optionnal attribute + * * @param attrname Code of attribute to delete * @param elementtype Element type ('member', 'product', 'company', ...) * @return int < 0 if KO, 0 if nothing is done, 1 if OK @@ -246,6 +250,7 @@ class ExtraFields /** * Modify type of a personalized attribute + * * @param attrname name of attribute * @param type type of attribute * @param length length of attribute @@ -288,11 +293,12 @@ class ExtraFields /** * Modify description of personalized attribute - * @param attrname name of attribute - * @param label label of attribute - * @param type type of attribute - * @param length length of attribute - * @param elementtype Element type ('member', 'product', 'company', ...) + * + * @param string $attrname Name of attribute + * @param string $label Label of attribute + * @param string $type Type of attribute + * @param int $length Length of attribute + * @param string $elementtype Element type ('member', 'product', 'company', ...) */ function update_label($attrname,$label,$type,$size,$elementtype='member') { @@ -350,6 +356,8 @@ class ExtraFields /** * Load array of labels + * + * @return void */ function fetch_optionals() { @@ -359,6 +367,9 @@ class ExtraFields /** * Load array this->attribute_label + * + * @param string $elementtype Type of element + * @return array Array of attributes for all extra fields */ function fetch_name_optionals_label($elementtype='member') { @@ -429,7 +440,11 @@ class ExtraFields if ($showsize > 48) $showsize=48; } - if ($type == 'varchar') + if ($type == 'int') + { + $out=''; + } + else if ($type == 'varchar') { $out=''; } @@ -446,8 +461,10 @@ class ExtraFields /** * Return HTML string to put an output field into a page - * @param key Key of attribute - * @param value Value to show + * + * @param string $key Key of attribute + * @param string $value Value to show + * @return string Formated value */ function showOutputField($key,$value,$moreparam='') { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f2c0f2aedc4..6283d6ab087 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -353,13 +353,13 @@ class Form /** * Show a text with a picto and a tooltip on picto * - * @param text Text to show - * @param htmltooltip Content of tooltip - * @param direction 1=Icon is after text, -1=Icon is before text, 0=no icon - * @param type Type of picto (info, help, warning, superadmin...) - * @param extracss Add a CSS style to td tags - * @param noencodehtmltext Do not encode into html entity the htmltext - * @return string HTML code of text, picto, tooltip + * @param string $text Text to show + * @param string $htmltooltip Content of tooltip + * @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon + * @param string $type Type of picto (info, help, warning, superadmin...) + * @param string $extracss Add a CSS style to td tags + * @param int $noencodehtmltext Do not encode into html entity the htmltext + * @return string HTML code of text, picto, tooltip */ function textwithpicto($text,$htmltext,$direction=1,$type='help',$extracss='',$noencodehtmltext=0) { @@ -745,7 +745,7 @@ class Form $sql = "SELECT s.rowid, s.nom, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX ."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE s.entity = ".$conf->entity; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; if ($filter) $sql.= " AND ".$filter; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY nom ASC"; @@ -885,13 +885,13 @@ class Form global $conf,$langs; // On recherche les societes - $sql = "SELECT s.rowid, s.name, s.firstname, s.poste FROM"; + $sql = "SELECT s.rowid, s.name as name, s.firstname, s.poste FROM"; $sql.= " ".MAIN_DB_PREFIX ."socpeople as s"; $sql.= " WHERE entity = ".$conf->entity; if ($socid > 0) $sql.= " AND fk_soc=".$socid; $sql.= " ORDER BY s.name ASC"; - dol_syslog("Form::select_contacts sql=".$sql); + dol_syslog(get_class($this)."::select_contacts sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -913,6 +913,7 @@ class Form $contactstatic->id=$obj->rowid; $contactstatic->name=$obj->name; + $contactstatic->lastname=$obj->name; $contactstatic->firstname=$obj->firstname; if ($htmlname != 'none') diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 062ad198f73..efb5fde0093 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -1,5 +1,5 @@ +/* Copyright (c) 2008-2012 Laurent Destailleur * Copyright (C) 2010-2011 Regis Houssin * Copyright (C) 2010 Juanjo Menent * @@ -25,8 +25,7 @@ /** - * \class FormActions - * \brief Class to manage building of HTML components + * Class to manage building of HTML components */ class FormActions { @@ -37,23 +36,23 @@ class FormActions /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function FormActions($DB) + function FormActions($db) { - $this->db = $DB; - + $this->db = $db; return 1; } /** - * Show list of action status + * Show list of action status * - * @param formname Name of form where select in included - * @param selected Preselected value - * @param canedit 1=can edit, 0=read only - * @param htmlname Name of html prefix for html fields (selectX and valX) + * @param string $formname Name of form where select in included + * @param string $selected Preselected value + * @param int $canedit 1=can edit, 0=read only + * @param string $htmlname Name of html prefix for html fields (selectX and valX) + * @return void */ function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete') { @@ -101,11 +100,12 @@ class FormActions /** - * Show list of actions for element - * @param object Object - * @param typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter' - * @param socid socid of user - * @return int <0 if KO, >=0 if OK + * Show list of actions for element + * + * @param Object $object Object + * @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter' + * @param int $socid socid of user + * @return int <0 if KO, >=0 if OK */ function showactions($object,$typeelement,$socid=0) { @@ -133,7 +133,7 @@ class FormActions print_titre($title); $total = 0; $var=true; - print ''; + print '
'; print ''; print "\n"; @@ -146,8 +146,8 @@ class FormActions print ''; $userstatic = new User($this->db); $userstatic->id = $action->author->id; - $userstatic->prenom = $action->author->firstname; - $userstatic->nom = $action->author->lastname; + $userstatic->firstname = $action->author->firstname; + $userstatic->lastname = $action->author->lastname; print ''; print ''; } @@ -159,9 +159,11 @@ class FormActions /** - * Output list of type of event - * @param selected Type pre-selectionne - * @param htmlname Nom champ formulaire + * Output list of type of event + * + * @param string $selected Type pre-selectionne + * @param string $htmlname Nom champ formulaire + * @return void */ function select_type_actions($selected='',$htmlname='actioncode') { diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index d408b7d8ee6..b7ac9f7e49b 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2007 Patrick Raguin * @@ -25,8 +25,7 @@ /** - * \class FormAdmin - * \brief Class to generate html code for admin pages + * Class to generate html code for admin pages */ class FormAdmin { @@ -42,7 +41,6 @@ class FormAdmin function FormAdmin($db) { $this->db = $db; - return 1; } @@ -279,7 +277,7 @@ class FormAdmin /** - * Retourne la liste deroulante des menus disponibles (eldy) + * Return a HTML select list of timezones * * @param string $selected Menu pre-selectionnee * @param string $htmlname Nom de la zone select diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index cd526042024..1eb70c4ae3b 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2008-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,8 +24,7 @@ /** - * \class Form - * \brief Classe permettant la generation de composants html + * Class to manage barcode HTML */ class FormBarCode { @@ -41,7 +40,6 @@ class FormBarCode function FormBarCode($db) { $this->db = $db; - return 1; } diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 7f22b659c1f..c0adef92519 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,9 +23,8 @@ /** - * \class FormCompany - * \brief Class to build HTML component for third parties management - * \remarks Only common components must be here. + * Class to build HTML component for third parties management + * Only common components are here. */ class FormCompany { @@ -517,19 +516,19 @@ class FormCompany // On recherche les societes $sql = "SELECT s.rowid, s.nom FROM"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; - if ($selected && $conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) $sql.= " WHERE rowid = ".$selected; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; + if ($selected && $conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) $sql.= " AND rowid = ".$selected; else { // For ajax search we limit here. For combo list, we limit later if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && is_array($limitto) && count($limitto)) { - $sql.= " WHERE rowid in (".join(',',$limitto).")"; + $sql.= " AND rowid IN (".join(',',$limitto).")"; } } - $sql .= " ORDER BY nom ASC"; - - //print $sql; + $sql.= " ORDER BY nom ASC"; + $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index eff452e6ff2..daba7b363fe 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -25,8 +25,7 @@ /** - * \class FormFile - * \brief Class to offer components to list and upload files + * Class to offer components to list and upload files */ class FormFile { @@ -375,7 +374,7 @@ class FormFile $out.= ''; $out.= '
'.$titletoshow.'
'; - $out.= '
'.$langs->trans('Ref').''.$langs->trans('Date').''.$langs->trans('Action').''.$langs->trans('By').'
'.dol_trunc($action->label,32).''.$userstatic->getNomUrl(1).'
'; + $out.= '
'; $out.= ''; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 092dd13f6c1..7d95b981b1a 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * @@ -25,11 +25,11 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); -/** \class FormMail - * \brief Classe permettant la generation du formulaire html d'envoi de mail unitaire - * \remarks Utilisation: $formail = new FormMail($db) - * \remarks $formmail->proprietes=1 ou chaine ou tableau de valeurs - * \remarks $formmail->show_form() affiche le formulaire +/** + * Classe permettant la generation du formulaire html d'envoi de mail unitaire + * Usage: $formail = new FormMail($db) + * $formmail->proprietes=1 ou chaine ou tableau de valeurs + * $formmail->show_form() affiche le formulaire */ class FormMail { @@ -69,12 +69,13 @@ class FormMail /** - * \brief Constructeur - * \param DB handler d'acces base de donnee + * Constructor + * + * @param DoliDB $DB Database handler */ - function FormMail($DB) + function FormMail($db) { - $this->db = $DB; + $this->db = $db; $this->withform=1; @@ -103,6 +104,8 @@ class FormMail /** * Clear list of attached files in send mail form (stored in session) + * + * @return void */ function clear_attached_files() { @@ -125,6 +128,7 @@ class FormMail * @param string $path Full absolute path on filesystem of file, including file name * @param string $file Only filename * @param string $type Mime type + * @return void */ function add_attached_files($path,$file,$type) { @@ -148,7 +152,8 @@ class FormMail /** * Remove a file from the list of attached files (stored in SECTION array) * - * @param $keytodelete Key in file array + * @param string $keytodelete Key in file array + * @return void */ function remove_attached_files($keytodelete) { @@ -190,8 +195,9 @@ class FormMail * Show the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * - * @param addfileaction Name of action when posting file attachments - * @param removefileaction Name of action when removing file attachments + * @param string $addfileaction Name of action when posting file attachments + * @param string $removefileaction Name of action when removing file attachments + * @return void */ function show_form($addfileaction='addfile',$removefileaction='removefile') { @@ -202,8 +208,9 @@ class FormMail * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * - * @param addfileaction Name of action when posting file attachments - * @param removefileaction Name of action when removing file attachments + * @param string $addfileaction Name of action when posting file attachments + * @param string $removefileaction Name of action when removing file attachments + * @return string Form to show */ function get_form($addfileaction='addfile',$removefileaction='removefile') { diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 68c4a21b688..0b2e6a999df 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,9 +23,8 @@ /** - * \class FormOrder - * \brief Classe permettant la generation de composants html - * \remarks Only common components must be here. + * Classe permettant la generation de composants html + * Only common components are here. */ class FormOrder { @@ -35,24 +34,24 @@ class FormOrder /** - * \brief Constructeur - * \param DB handler d'acces base de donnee + * Constructor + * + * @param DoliDB $db Database handler */ - function FormOrder($DB) + function FormOrder($db) { - $this->db = $DB; - + $this->db = $db; return 1; } /** - * Renvoie la liste des sources de commandes + * Return list of way to order * - * @param selected Id de la source pre-selectionnee - * @param htmlname Nom de la liste deroulante - * @param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue - * @return array Tableau des sources de commandes + * @param string $selected Id of preselected order origin + * @param string $htmlname Name of HTML select list + * @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @return array Tableau des sources de commandes */ function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0) { @@ -74,8 +73,12 @@ class FormOrder /** + * Return list of way to order * - * + * @param string $selected Id of preselected input method + * @param string $htmlname Name of HTML select list + * @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @return array Tableau des sources de commandes */ function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0) { @@ -89,7 +92,7 @@ class FormOrder $sql.= " FROM ".MAIN_DB_PREFIX."c_input_method"; $sql.= " WHERE active = 1"; - dol_syslog("Form::select_methodes_commande sql=".$sql); + dol_syslog(get_class($this)."::select_methodes_commande sql=".$sql); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 16682a7b7a2..09e00ed12cf 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Eric Seigne @@ -32,9 +32,8 @@ /** - * \class FormOther - * \brief Classe permettant la generation de composants html autre - * \remarks Only common components must be here. + * Classe permettant la generation de composants html autre + * Only common components are here. */ class FormOther { @@ -210,12 +209,12 @@ class FormOther /** * Return a HTML select list to select a percent * - * @param selected pourcentage pre-selectionne - * @param htmlname nom de la liste deroulante - * @param increment increment value - * @param start start value - * @param end end value - * @return return combo + * @param string $selected pourcentage pre-selectionne + * @param string $htmlname nom de la liste deroulante + * @param int $increment increment value + * @param int $start start value + * @param int $end end value + * @return string HTML select string */ function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100) { @@ -243,10 +242,10 @@ class FormOther /** * Return select list for categories (to use in form search selectors) * - * @param type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) - * @param selected Preselected value - * @param htmlname Name of combo list - * @return return Html combo list code + * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) + * @param string $selected Preselected value + * @param string $htmlname Name of combo list + * @return string Html combo list code */ function select_categories($type,$selected=0,$htmlname='search_categ') { @@ -279,10 +278,10 @@ class FormOther /** * Return select list for categories (to use in form search selectors) * - * @param selected Preselected value - * @param htmlname Name of combo list - * @param user Object user - * @return return Html combo list code + * @param string $selected Preselected value + * @param string $htmlname Name of combo list + * @param User $user Object user + * @return string Html combo list code */ function select_salesrepresentatives($selected=0,$htmlname='search_sale',$user) { @@ -373,11 +372,11 @@ class FormOther /** * Output a HTML code to select a color * - * @param set_color Pre-selected color - * @param prefix Name of HTML field - * @param form_name Name of form - * @param showcolorbox 1=Show color code and color box, 0=Show only color code - * @param arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param string $set_color Pre-selected color + * @param string $prefix Name of HTML field + * @param string $form_name Name of form + * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code + * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @return void */ function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 46fae163e01..0337578eb39 100755 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -24,11 +24,11 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); -/** \class FormSms - * \brief Classe permettant la generation du formulaire d'envoi de Sms - * \remarks Utilisation: $formsms = new FormSms($db) - * \remarks $formsms->proprietes=1 ou chaine ou tableau de valeurs - * \remarks $formsms->show_form() affiche le formulaire +/** + * Classe permettant la generation du formulaire d'envoi de Sms + * Usage: $formsms = new FormSms($db) + * $formsms->proprietes=1 ou chaine ou tableau de valeurs + * $formsms->show_form() affiche le formulaire */ class FormSms { @@ -62,11 +62,11 @@ class FormSms /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function FormSms($DB) + function FormSms($db) { - $this->db = $DB; + $this->db = $db; $this->withfrom=1; $this->withto=1; diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 1b4c124f019..c13aa28800b 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -25,8 +25,7 @@ /** - * \class Interfaces - * \brief Classe de la gestion des triggers + * Class to manage triggers */ class Interfaces @@ -45,28 +44,36 @@ class Interfaces } /** - * \brief Fonction appelee lors du declenchement d'un evenement Dolibarr. - * Cette fonction declenche tous les triggers trouves actifs. - * \param action Trigger event code - * \param object Objet concern - * \param user Objet user - * \param lang Objet lang - * \param conf Objet conf - * \return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. + * Function called when a Dolibarr business event occurs + * This function call all qualified triggers. + * + * @param string $action Trigger event code + * @param Object $object Objet concern + * @param User $user Objet user + * @param Lang $lang Objet lang + * @param Conf $conf Objet conf + * @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. */ function run_triggers($action,$object,$user,$langs,$conf) { // Check parameters if (! is_object($object) || ! is_object($conf)) // Error { - dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERR); + dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERR); return -1; } if (! is_object($user) || ! is_object($langs)) // Warning { - dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); + dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); } + $nbfile = $nbtotal = $nbok = $nbko = 0; + + $files = array(); + $modules = array(); + $orders = array(); + $i=0; + foreach($conf->triggers_modules as $reldir) { $dir=dol_buildpath($reldir,0); @@ -76,110 +83,116 @@ class Interfaces if (!is_dir($dir)) continue; $handle=opendir($dir); - $modules = array(); - $nbfile = $nbtotal = $nbok = $nbko = 0; if (is_resource($handle)) { while (($file = readdir($handle))!==false) { - if (is_readable($dir."/".$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php$/i',$file,$reg)) + if (is_readable($dir."/".$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php$/i',$file,$reg)) { + $part1=$reg[1]; + $part2=$reg[2]; + $part3=$reg[3]; + $nbfile++; - $modName = "Interface".ucfirst($reg[2]); + $modName = "Interface".ucfirst($reg[3]); //print "file=$file"; print "modName=$modName"; exit; if (in_array($modName,$modules)) { $langs->load("errors"); - dol_syslog("Interface::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/core/triggers/"),LOG_ERR); + dol_syslog(get_class($this)."::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/core/triggers/"),LOG_ERR); continue; } + else + { + include_once($dir.'/'.$file); + } // Check if trigger file is disabled by name - if (preg_match('/NORUN$/i',$file)) - { - continue; - } + if (preg_match('/NORUN$/i',$file)) continue; // Check if trigger file is for a particular module $qualified=true; - if (strtolower($reg[1]) != 'all') + if (strtolower($reg[2]) != 'all') { - $module=preg_replace('/^mod/i','',$reg[1]); + $module=preg_replace('/^mod/i','',$reg[2]); $constparam='MAIN_MODULE_'.strtoupper($module); if (empty($conf->global->$constparam)) $qualified=false; } if (! $qualified) { - dol_syslog("Interfaces::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled",LOG_INFO); + dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled",LOG_INFO); continue; } - - include_once($dir."/".$file); - $objMod = new $modName($this->db); - $i=0; - if ($objMod) - { - // Bypass if workflow module is enabled and if the trigger asked to be disable in such case - if (! empty($conf->workflow->enabled) && ! empty($objMod->disabled_if_workflow)) - { - dol_syslog("Interfaces::run_triggers action=".$action." Bypass triggers for file '".$file."'",LOG_INFO); - continue; - } - - dol_syslog("Interfaces::run_triggers action=".$action." Launch triggers for file '".$file."'",LOG_INFO); - - $modules[$i] = $modName; - //dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO); - $result=$objMod->run_trigger($action,$object,$user,$langs,$conf); - if ($result > 0) - { - // Action OK - $nbtotal++; - $nbok++; - } - if ($result == 0) - { - // Aucune action faite - $nbtotal++; - } - if ($result < 0) - { - // Action KO - $nbtotal++; - $nbko++; - $this->errors[]=$objMod->error; - } - $i++; - } - else - { - dol_syslog("Interfaces::run_triggers action=".$action." Failed to instantiate trigger for file '".$file."'",LOG_ERR); - } + + $modules[$i] = $modName; + $files[$i] = $file; + $orders[$i] = $part1.'_'.$part2.'_'.$part3; // Set sort criteria value + + $i++; } } - closedir($handle); + } + } + + asort($orders); + + // Loop on each trigger + foreach ($orders as $key => $value) + { + $modName = $modules[$key]; + if (empty($modName)) continue; + + $objMod = new $modName($this->db); + if ($objMod) + { + dol_syslog(get_class($this)."::run_triggers action=".$action." Launch triggers for file '".$files[$key]."'",LOG_INFO); + + $result=$objMod->run_trigger($action,$object,$user,$langs,$conf); + if ($result > 0) + { + // Action OK + $nbtotal++; + $nbok++; + } + if ($result == 0) + { + // Aucune action faite + $nbtotal++; + } + if ($result < 0) + { + // Action KO + $nbtotal++; + $nbko++; + $this->errors[]=$objMod->error; + } + } + else + { + dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'",LOG_ERR); } } if ($nbko) { - dol_syslog("Interfaces::run_triggers action=".$action." Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_ERR); + dol_syslog(get_class($this)."::run_triggers action=".$action." Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_ERR); return -$nbko; } else { - //dol_syslog("Interfaces::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_DEBUG); + //dol_syslog(get_class($this)."::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_DEBUG); return $nbok; } } /** - * Return list of triggers. Function used by admin page htdoc/admin/triggers - * @param workflow 0=Return all triggers, 1=Return only triggers not disabled if workflow module activated - * @return array Array list of triggers + * Return list of triggers. Function used by admin page htdoc/admin/triggers. + * List is sorted by trigger filename so by priority to run. + * + * @return array Array list of triggers */ - function getTriggersList($workflow=0) + function getTriggersList() { global $conf, $langs; @@ -203,31 +216,29 @@ class Interfaces { while (($file = readdir($handle))!==false) { - if (is_readable($dir.'/'.$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php/',$file,$reg)) + if (is_readable($dir.'/'.$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/',$file,$reg)) { - $modName = 'Interface'.ucfirst($reg[2]); + $part1=$reg[1]; + $part2=$reg[2]; + $part3=$reg[3]; + + $modName = 'Interface'.ucfirst($reg[3]); //print "file=$file"; print "modName=$modName"; exit; if (in_array($modName,$modules)) { $langs->load("errors"); print '
'.$langs->trans("Error").' : '.$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/core/triggers/").'
'; - $objMod = new $modName($this->db); - - $modules[$i] = $modName; - $files[$i] = $file; - $orders[$i] = $objMod->family; // Tri par famille - $i++; } else { include_once($dir.'/'.$file); - $objMod = new $modName($this->db); - - $modules[$i] = $modName; - $files[$i] = $file; - $orders[$i] = $objMod->family; // Tri par famille - $i++; } + + $files[$i] = $file; + $modules[$i] = $modName; + $orders[$i] = $part1.'_'.$part2.'_'.$part3; // Set sort criteria value + + $i++; } } closedir($handle); @@ -243,27 +254,27 @@ class Interfaces foreach ($orders as $key => $value) { $modName = $modules[$key]; - if ($modName) - { - $objMod = new $modName($this->db); - // Bypass if workflow module is enabled and if the trigger is compatible - if ($workflow && ! empty($objMod->disabled_if_workflow)) continue; - } + if (empty($modName)) continue; + + $objMod = new $modName($this->db); // Define disabledbyname and disabledbymodule $disabledbyname=0; $disabledbymodule=1; $module=''; + + // Check if trigger file is disabled by name if (preg_match('/NORUN$/i',$files[$key])) $disabledbyname=1; - if (preg_match('/^interface_([^_]+)_(.+)\.class\.php/i',$files[$key],$reg)) + // Check if trigger file is for a particular module + if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i',$files[$key],$reg)) { - // Check if trigger file is for a particular module - $module=preg_replace('/^mod/i','',$reg[1]); + $module=preg_replace('/^mod/i','',$reg[2]); $constparam='MAIN_MODULE_'.strtoupper($module); - if (strtolower($reg[1]) == 'all') $disabledbymodule=0; + if (strtolower($reg[2]) == 'all') $disabledbymodule=0; else if (empty($conf->global->$constparam)) $disabledbymodule=2; } + // We set info of modules $triggers[$j]['picto'] = $objMod->picto?img_object('',$objMod->picto):img_object('','generic'); $triggers[$j]['file'] = $files[$key]; $triggers[$j]['version'] = $objMod->getVersion(); diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 862a213ef76..ce2a91d0c47 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -30,7 +30,6 @@ */ class Ldap { - /** * Tableau des serveurs (IP addresses ou nom d'hotes) */ @@ -90,7 +89,6 @@ class Ldap var $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded - // 1.2 Private properties ---------------------------------------------------- /** * The internal LDAP connection handle */ @@ -135,15 +133,16 @@ class Ldap - // 2.1 Connection handling methods ------------------------------------------- + // Connection handling methods ------------------------------------------- /** - * 2.1.1 : Connects to the server. Just creates a connection which is used + * Connects to the server. Just creates a connection which is used * in all later access to the LDAP server. If it can't connect and bind * anonymously, it creates an error code of -1. Returns true if connected, * false if failed. Takes an array of possible servers - if one doesn't work, * it tries the next and so on. - * \deprecated Utiliser connect_bind a la place + * + * @deprecated Utiliser connect_bind a la place */ function connect() { @@ -181,10 +180,11 @@ class Ldap /** - * \brief Connect and bind - * \return <0 si KO, 1 si bind anonymous, 2 si bind auth - * \remarks Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword - * After return, this->connection and $this->bind are defined + * Connect and bind + * Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword + * After return, this->connection and $this->bind are defined + * + * @return int <0 si KO, 1 si bind anonymous, 2 si bind auth */ function connect_bind() { @@ -283,8 +283,10 @@ class Ldap /** - * 2.1.2 : Simply closes the connection set up earlier. + * Simply closes the connection set up earlier. * Returns true if OK, false if there was an error. + * + * @return boolean true or false */ function close() { @@ -299,8 +301,10 @@ class Ldap } /** - * 2.1.3 : Anonymously binds to the connection. After this is done, + * Anonymously binds to the connection. After this is done, * queries and searches can be done - but read-only. + * + * @return boolean true or false */ function bind() { @@ -318,10 +322,14 @@ class Ldap } /** - * 2.1.4 : Binds as an authenticated user, which usually allows for write + * Binds as an authenticated user, which usually allows for write * access. The FULL dn must be passed. For a directory manager, this is * "cn=Directory Manager" under iPlanet. For a user, it will be something * like "uid=jbloggs,ou=People,dc=foo,dc=com". + * + * @param string $bindDn DN + * @param string $pass Password + * @return boolean true or false */ function bindauth($bindDn,$pass) { @@ -339,9 +347,9 @@ class Ldap } /** - * \brief Unbind du serveur ldap. - * \param ds - * \return bool + * Unbind du serveur ldap. + * + * @return boolean true or false */ function unbind() { @@ -355,9 +363,9 @@ class Ldap /** - * \brief verification de la version du serveur ldap. - * \param ds - * \return version + * Verification de la version du serveur ldap. + * + * @return string version */ function getVersion() { @@ -367,8 +375,9 @@ class Ldap } /** - * \brief changement de la version du serveur ldap. - * \return version + * Change ldap protocol version to use. + * + * @return string version */ function setVersion() { // LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17 @@ -377,8 +386,9 @@ class Ldap } /** - * \brief changement du referrals. - * \return referrals + * changement du referrals. + * + * @return string referrals */ function setReferrals() { // LDAP_OPT_REFERRALS est une constante qui vaut ? @@ -388,12 +398,13 @@ class Ldap /** - * \brief Add a LDAP entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Add a LDAP entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function add($dn, $info, $user) { @@ -439,12 +450,13 @@ class Ldap } /** - * \brief Modify a LDAP entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that modify - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Modify a LDAP entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param string $user Objet user that modify + * @return int <0 if KO, >0 if OK */ function modify($dn, $info, $user) { @@ -490,13 +502,14 @@ class Ldap } /** - * \brief Modify a LDAP entry (to use if dn != olddn) - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that delete - * \param olddn Old DN entry key (before update) - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Modify a LDAP entry (to use if dn != olddn) + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that delete + * @param string $olddn Old DN entry key (before update) + * @return int <0 if KO, >0 if OK */ function update($dn,$info,$user,$olddn) { @@ -544,10 +557,11 @@ class Ldap /** - * \brief Delete a LDAP entry - * \param dn DN entry key - * \return int <0 si KO, >0 si OK - * \remarks Ldap object connect and bind must have been done + * Delete a LDAP entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @return int <0 if KO, >0 if OK */ function delete($dn) { @@ -577,10 +591,11 @@ class Ldap } /** - * \brief Build a LDAP message - * \param dn DN entry key - * \param info Attributes array - * \return string Content of file + * Build a LDAP message + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @return string Content of file */ function dump_content($dn, $info) { @@ -618,10 +633,11 @@ class Ldap } /** - * \brief Dump a LDAP message to ldapinput.in file - * \param dn DN entry key - * \param info Attributes array - * \return int <0 if KO, >0 if OK + * Dump a LDAP message to ldapinput.in file + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @return int <0 if KO, >0 if OK */ function dump($dn, $info) { @@ -650,15 +666,16 @@ class Ldap } - // 2.4 Attribute methods ----------------------------------------------------- + // Attribute methods ----------------------------------------------------- /** - * \brief Add a LDAP attribute in entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Add a LDAP attribute in entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function addAttribute($dn, $info, $user) { @@ -704,12 +721,13 @@ class Ldap } /** - * \brief Update a LDAP attribute in entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Update a LDAP attribute in entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function updateAttribute($dn, $info, $user) { @@ -755,12 +773,13 @@ class Ldap } /** - * \brief Delete a LDAP attribute in entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Delete a LDAP attribute in entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function deleteAttribute($dn, $info, $user) { @@ -807,6 +826,10 @@ class Ldap /** * Returns an array containing attributes and values for first record + * + * @param string $dn DN entry key + * @param string $filter Filter + * @return int <0 if KO, >0 if OK */ function getAttribute($dn,$filter) { @@ -848,6 +871,10 @@ class Ldap /** * Returns an array containing values for an attribute and for first record matching filterrecord + * + * @param string $filterrecord Record + * @param string $attribute Attributes + * @return void */ function getAttributeValues($filterrecord,$attribute) { @@ -882,14 +909,15 @@ class Ldap } /** - * \brief Returns an array containing a details of elements - * \param $search Valeur champ cle recherche, sinon '*' pour tous. - * \param $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) - * \param $useridentifier Nom du champ cle (Ex: uid) - * \param $attributeArray Array of fields required (Ex: sn,userPassword) - * \param $activefilter 1=utilise le champ this->filter comme filtre - * \return array Array of [id_record][ldap_field]=value - * \remarks ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword + * Returns an array containing a details of elements + * ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword + * + * @param string $search Valeur champ cle recherche, sinon '*' pour tous. + * @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) + * @param string $useridentifier Name of key field (Ex: uid) + * @param array $attributeArray Array of fields required (Ex: sn,userPassword) + * @param int $activefilter 1=utilise le champ this->filter comme filtre + * @return array Array of [id_record][ldap_field]=value */ function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0) { @@ -980,9 +1008,12 @@ class Ldap /** * Converts a little-endian hex-number to one, that 'hexdec' can convert - * Indispensable pour Active Directory + * Required by Active Directory + * + * @param string $hex */ - function littleEndian($hex) { + function littleEndian($hex) + { for ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) { $result .= substr($hex,$x,2); } @@ -991,9 +1022,10 @@ class Ldap /** - * Recupere le SID de l'utilisateur - * ldapuser. le login de l'utilisateur - * Indispensable pour Active Directory + * Recupere le SID de l'utilisateur + * Required by Active Directory + * + * @param string $ldapuser Login de l'utilisateur */ function getObjectSid($ldapUser) { @@ -1050,8 +1082,12 @@ class Ldap /** * Returns the textual SID * Indispensable pour Active Directory + * + * @param string $binsid Binary SID + * @return string Textual SID */ - function binSIDtoText($binsid) { + function binSIDtoText($binsid) + { $hex_sid=bin2hex($binsid); $rev = hexdec(substr($hex_sid,0,2)); // Get revision-part of SID $subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries @@ -1066,14 +1102,15 @@ class Ldap /** - * \brief Fonction de recherche avec filtre - * \remarks this->connection doit etre defini donc la methode bind ou bindauth doit avoir deja ete appelee - * \param checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com) - * \param filter Filtre de recherche (ex: (sn=nom_personne) ) - * \return array Tableau des reponses (cle en minuscule-valeur) - * \remarks Ne pas utiliser pour recherche d'une liste donnee de proprietes - * car conflit majuscule-minuscule. A n'utiliser que pour les pages - * 'Fiche LDAP' qui affiche champ lisibles par defaut. + * Fonction de recherche avec filtre + * this->connection doit etre defini donc la methode bind ou bindauth doit avoir deja ete appelee + * Ne pas utiliser pour recherche d'une liste donnee de proprietes + * car conflit majuscule-minuscule. A n'utiliser que pour les pages + * 'Fiche LDAP' qui affiche champ lisibles par defaut. + * + * @param checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com) + * @param filter Filtre de recherche (ex: (sn=nom_personne) ) + * @return array Tableau des reponses (cle en minuscule-valeur) */ function search($checkDn, $filter) { @@ -1105,10 +1142,11 @@ class Ldap /** * Load all attribute of a LDAP user - * @param $user User to search for. Not used if a filter is provided. - * @param filter Filter for search. Must start with &. - * Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com) - * @return int >0 if ok, <0 if ko + * + * @param User $user User to search for. Not used if a filter is provided. + * @param string $filter Filter for search. Must start with &. + * Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com) + * @return int >0 if OK, <0 if KO */ function fetch($user,$filter) { @@ -1195,12 +1233,15 @@ class Ldap } - // 2.6 helper methods + // helper methods /** - * Returns the correct user identifier to use, based on the ldap server type + * Returns the correct user identifier to use, based on the ldap server type + * + * @return string Login */ - function getUserIdentifier() { + function getUserIdentifier() + { if ($this->serverType == "activedirectory") { return $this->attr_sambalogin; } else { @@ -1209,10 +1250,13 @@ class Ldap } /** - * \brief UserAccountControl Flgs to more human understandable form... + * UserAccountControl Flgs to more human understandable form... * + * @param string $uacf UACF + * @return void */ - function parseUACF($uacf) { + function parseUACF($uacf) + { //All flags array $flags = array( "TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216, "PASSWORD_EXPIRED" => 8388608, @@ -1250,10 +1294,13 @@ class Ldap } /** - * \brief SamAccountType value to text + * SamAccountType value to text * + * @param string $samtype SamType + * @return string Sam string */ - function parseSAT($samtype) { + function parseSAT($samtype) + { $stypes = array( 805306368 => "NORMAL_ACCOUNT", 805306369 => "WORKSTATION_TRUST", 805306370 => "INTERDOMAIN_TRUST", @@ -1275,9 +1322,10 @@ class Ldap } /** - * \brief Convertit le temps ActiveDirectory en Unix timestamp - * \param string AD time to convert - * \return string Unix timestamp + * Convertit le temps ActiveDirectory en Unix timestamp + * + * @param string $value AD time to convert + * @return string Unix timestamp */ function convert_time($value) { @@ -1292,9 +1340,9 @@ class Ldap /** * Convert a string into output/memory charset * - * @param str String to convert - * @param pagecodefrom Page code of src string - * @return string Converted string + * @param string $str String to convert + * @param string $pagecodefrom Page code of src string + * @return string Converted string */ private function convToOutputCharset($str,$pagecodefrom='UTF-8') { @@ -1307,21 +1355,22 @@ class Ldap /** * Convert a string from output/memory charset * - * @param str String to convert - * @param pagecodeto Page code for result string - * @return string Converted string + * @param string $str String to convert + * @param string $pagecodeto Page code for result string + * @return string Converted string */ function convFromOutputCharset($str,$pagecodeto='UTF-8') { global $conf; - if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str); - if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str); + if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str); + if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str); return $str; } /** * Return available value of group GID + * * @return int gid number */ function getNextGroupGid() diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index d31be260e31..cde57a97053 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -24,8 +24,7 @@ /** - * \class Menu - * \brief Class to manage left menus + * Class to manage left menus */ class Menu { diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 70bb2737757..e4024f77366 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -24,8 +24,7 @@ /** - * \class Menubase - * \brief Class to manage menu entries + * Class to manage menu entries */ class Menubase { diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 65c294b0077..9c51db1dd4f 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -25,8 +25,7 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/CMailFile.class.php"); /** - * \class Notify - * \brief Classe de gestion des notifications + * Class to manage notifications */ class Notify { @@ -97,7 +96,7 @@ class Notify $sql.= " AND n.fk_soc = s.rowid"; if (is_numeric($action)) $sql.= " AND n.fk_action = ".$action; // Old usage else $sql.= " AND a.code = '".$action."'"; // New usage - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND s.rowid = ".$socid; dol_syslog("Notify.class::countDefinedNotifications ".$action.", ".$socid." sql=".$sql); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index bc33c0d9020..d420062d118 100755 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -39,9 +39,8 @@ /** - * \class SMTPs - * \brief Class to construct and send SMTP compliant email, even - * to a secure SMTP server, regardless of platform. + * Class to construct and send SMTP compliant email, even + * to a secure SMTP server, regardless of platform. */ class SMTPs { @@ -1293,7 +1292,7 @@ class SMTPs { if ( $strContent ) { - $strContent = rtrim(chunk_split(base64_encode($strContent), 76, "\r\n")); + $strContent = rtrim(chunk_split(base64_encode($strContent), 76, "\r\n")); // 76 max is defined into http://tools.ietf.org/html/rfc2047 $this->_msgContent['attachment'][$strFileName]['mimeType'] = $strMimeType; $this->_msgContent['attachment'][$strFileName]['fileName'] = $strFileName; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 9f004232f22..bdd4f89b414 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -21,14 +21,11 @@ * \file htdocs/core/class/translate.class.php * \ingroup core * \brief File for Tanslate class - * \author Eric Seigne - * \author Laurent Destailleur */ /** - * \class Translate - * \brief Class to manage translations + * Class to manage translations */ class Translate { @@ -166,6 +163,7 @@ class Translate dol_print_error('',get_class($this)."::Load ErrorWrongParameters"); exit; } + if ($this->defaultlang == 'none_NONE') return; // Special language code to not translate keys //dol_syslog("Translate::Load Start domain=".$domain." alt=".$alt." forcelangdir=".$forcelangdir." this->defaultlang=".$this->defaultlang); @@ -193,7 +191,7 @@ class Translate $langarray=explode('_',$langofdir); if ($alt < 1 && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1; if ($alt < 2 && (strtolower($langofdir) == 'en_us' || strtolower($langofdir) == 'fr_fr' || strtolower($langofdir) == 'es_es')) $alt=2; - + foreach($this->dir as $keydir => $searchdir) { // Directory of translation files diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index a9a3ac1afd4..04952615a0a 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -467,10 +467,11 @@ class DoliDBMssql } /** - \brief Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE - \see num_rows - \param resultset Curseur de la requete voulue - \return int Nombre de lignes + * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE + * + * @param resultset $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows */ function affected_rows($resultset) { @@ -485,8 +486,10 @@ class DoliDBMssql /** - * \brief Libere le dernier resultset utilise sur cette connexion. - * \param resultset Curseur de la requete voulue + * Free last resultset used. + * + * @param resultset $resultset Curseur de la requete voulue + * @return void */ function free($resultset=0) { @@ -498,10 +501,11 @@ class DoliDBMssql /** - * \brief Defini les limites de la requete. - * \param limit nombre maximum de lignes retournees - * \param offset numero de la ligne a partir de laquelle recuperer les ligne - * \return string chaine exprimant la syntax sql de la limite + * Define limits of request + * + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite */ function plimit($limit=0,$offset=0) { @@ -514,10 +518,11 @@ class DoliDBMssql /** * Define sort criteria of request - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class + * + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class */ function order($sortfield=0,$sortorder=0) { @@ -543,10 +548,10 @@ class DoliDBMssql /** - * Escape a string to insert data. + * Escape a string to insert data * - * @param stringtoencode String to escape - * @return string String escaped + * @param string $stringtoencode String to escape + * @return string String escaped */ function escape($stringtoencode) { @@ -582,11 +587,12 @@ class DoliDBMssql } /** - * Formate a SQL IF - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string chaine formate SQL + * Formate a SQL IF + * + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string */ function ifsql($test,$resok,$resko) { @@ -595,8 +601,9 @@ class DoliDBMssql /** - * \brief Renvoie la derniere requete soumise par la methode query() - * \return lastquery + * Return last request executed with query() + * + * @return string Last query */ function lastquery() { @@ -604,8 +611,9 @@ class DoliDBMssql } /** - \brief Renvoie la derniere requete en erreur - \return string lastqueryerror + * Return last query in error + * + * @return string lastqueryerror */ function lastqueryerror() { @@ -613,8 +621,9 @@ class DoliDBMssql } /** - \brief Renvoie le libelle derniere erreur - \return string lasterror + * Return last error label + * + * @return string lasterror */ function lasterror() { @@ -622,8 +631,9 @@ class DoliDBMssql } /** - \brief Renvoie le code derniere erreur - \return string lasterrno + * Return last error code + * + * @return string lasterrno */ function lasterrno() { @@ -631,16 +641,19 @@ class DoliDBMssql } /** - \brief Renvoie le code erreur generique de l'operation precedente. - \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * Return generic error code of last operation. + * + * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno() { - if (! $this->connected) { + if (! $this->connected) + { // Si il y a eu echec de connexion, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } - else { + else + { // Constants to convert a MSSql error code to a generic Dolibarr error code $errorcode_map = array( 1004 => 'DB_ERROR_CANNOT_CREATE', @@ -680,8 +693,9 @@ class DoliDBMssql } /** - \brief Renvoie le texte de l'erreur mssql de l'operation precedente. - \return error_text + * Return description of last error + * + * @return string Error text */ function error() { @@ -717,9 +731,10 @@ class DoliDBMssql /** * Encrypt sensitive data in database * Warning: This function includes the escape, so it must use direct value - * @param fieldorvalue Field name or value to encrypt - * @param withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return return XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { @@ -736,9 +751,10 @@ class DoliDBMssql } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -755,12 +771,10 @@ class DoliDBMssql } - // Next function are not required. Only minor features use them. - //-------------------------------------------------------------- - /** - * \brief Renvoie l'id de la connexion - * \return string Id connexion + * Return connexion ID + * + * @return string Id connexion */ function DDLGetConnectId() { @@ -770,15 +784,17 @@ class DoliDBMssql } /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \return resource resource defined if OK, null if KO - * \remarks Ne pas utiliser les fonctions xxx_create_db (xxx=mssql, ...) car elles sont deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ - function DDLCreateDb($database,$charset='',$collation='') + function DDLCreateDb($database,$charset='',$collation='',$owner='') { // ALTER DATABASE dolibarr_db DEFAULT CHARACTER SET latin DEFAULT COLLATE latin1_swedish_ci $sql = 'CREATE DATABASE '.$database; diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index c51b995d382..73850cc70a5 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2007 Rodolphe Quiedeville - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2009 Regis Houssin * @@ -42,7 +42,7 @@ class DoliDBMysql //! Collate used to force collate when creating database static $forcecollate='utf8_general_ci'; // latin1_swedish_ci, utf8_general_ci //! Version min database - static $versionmin=array(3,1,0); + static $versionmin=array(4,1,0); //! Resultset of last request private $results; //! 1 if connected, 0 else @@ -446,9 +446,9 @@ class DoliDBMysql /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * - * @see num_rows - * @param resultset Curseur de la requete voulue - * @return int Nombre de lignes + * @param resultset $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows */ function affected_rows($resultset) { @@ -461,9 +461,10 @@ class DoliDBMysql /** - * Libere le dernier resultset utilise sur cette connexion. + * Free last resultset used. * - * @param resultset Curseur de la requete voulue + * @param resultset $resultset Curseur de la requete voulue + * @return void */ function free($resultset=0) { @@ -475,11 +476,11 @@ class DoliDBMysql /** - * Defini les limites de la requete + * Define limits of request * - * @param limit nombre maximum de lignes retournees - * @param offset numero de la ligne a partir de laquelle recuperer les ligne - * @return string chaine exprimant la syntax sql de la limite + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite */ function plimit($limit=0,$offset=0) { @@ -493,10 +494,10 @@ class DoliDBMysql /** * Define sort criteria of request * - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class */ function order($sortfield=0,$sortorder=0) { @@ -522,10 +523,10 @@ class DoliDBMysql /** - * Escape a string to insert data + * Escape a string to insert data * - * @param stringtoencode String to escape - * @return string String escaped + * @param string $stringtoencode String to escape + * @return string String escaped */ function escape($stringtoencode) { @@ -534,11 +535,11 @@ class DoliDBMysql /** - * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. - * Function to use to build INSERT, UPDATE or WHERE predica + * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. + * Function to use to build INSERT, UPDATE or WHERE predica * - * @param string $param Date TMS to convert - * @return string Date in a string YYYYMMDDHHMMSS + * @param string $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param) { @@ -563,10 +564,10 @@ class DoliDBMysql /** * Formate a SQL IF * - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string chaine formate SQL + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string */ function ifsql($test,$resok,$resko) { @@ -575,8 +576,9 @@ class DoliDBMysql /** - * \brief Renvoie la derniere requete soumise par la methode query() - * \return lastquery + * Return last request executed with query() + * + * @return string Last query */ function lastquery() { @@ -584,8 +586,9 @@ class DoliDBMysql } /** - * \brief Renvoie la derniere requete en erreur - * \return string lastqueryerror + * Return last query in error + * + * @return string lastqueryerror */ function lastqueryerror() { @@ -593,8 +596,9 @@ class DoliDBMysql } /** - * \brief Renvoie le libelle derniere erreur - * \return string lasterror + * Return last error label + * + * @return string lasterror */ function lasterror() { @@ -602,8 +606,9 @@ class DoliDBMysql } /** - * \brief Renvoie le code derniere erreur - * \return string lasterrno + * Return last error code + * + * @return string lasterrno */ function lasterrno() { @@ -611,16 +616,19 @@ class DoliDBMysql } /** - * \brief Renvoie le code erreur generique de l'operation precedente. - * \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * Return generic error code of last operation. + * + * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno() { - if (! $this->connected) { + if (! $this->connected) + { // Si il y a eu echec de connexion, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } - else { + else + { // Constants to convert a MySql error code to a generic Dolibarr error code $errorcode_map = array( 1004 => 'DB_ERROR_CANNOT_CREATE', @@ -647,6 +655,7 @@ class DoliDBMysql 1146 => 'DB_ERROR_NOSUCHTABLE', 1216 => 'DB_ERROR_NO_PARENT', 1217 => 'DB_ERROR_CHILD_EXISTS', + 1396 => 'DB_ERROR_USER_ALREADY_EXISTS', // When creating user already existing 1451 => 'DB_ERROR_CHILD_EXISTS' ); @@ -660,8 +669,9 @@ class DoliDBMysql } /** - \brief Renvoie le texte de l'erreur mysql de l'operation precedente. - \return error_text + * Return description of last error + * + * @return string Error text */ function error() { @@ -694,9 +704,10 @@ class DoliDBMysql /** * Encrypt sensitive data in database * Warning: This function includes the escape, so it must use direct value - * @param fieldorvalue Field name or value to encrypt - * @param withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return string XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { @@ -726,9 +737,10 @@ class DoliDBMysql } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -759,8 +771,9 @@ class DoliDBMysql /** - * \brief Renvoie l'id de la connexion - * \return string Id connexion + * Return connexion ID + * + * @return string Id connexion */ function DDLGetConnectId() { @@ -771,14 +784,15 @@ class DoliDBMysql /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \param owner Username of database owner - * \return resource resource defined if OK, null if KO - * \remarks Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { @@ -1036,36 +1050,27 @@ class DoliDBMysql */ function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { - $sql = "INSERT INTO user "; - $sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; - $sql.= " VALUES ('".addslashes($dolibarr_main_db_host)."','".addslashes($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')"; - $sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y','Y')"; + $sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."'"; + dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log + $resql=$this->query($sql); + if (! $resql) + { + dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); + return -1; + } + $sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'"; + dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log + $resql=$this->query($sql); + if (! $resql) + { + dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); + return -1; + } - dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log - $resql=$this->query($sql); - if (! $resql) - { - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); - return -1; - } + $sql="FLUSH Privileges"; - $sql = "INSERT INTO db "; - $sql.= "(Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; - $sql.= " VALUES ('".addslashes($dolibarr_main_db_host)."','".addslashes($dolibarr_main_db_name)."','".addslashes($dolibarr_main_db_user)."'"; - $sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y','Y')"; - - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql,LOG_DEBUG); - $resql=$this->query($sql); - if (! $resql) - { - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); - return -1; - } - - $sql="FLUSH Privileges"; - - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql,LOG_DEBUG); - $resql=$this->query($sql); + dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql); + $resql=$this->query($sql); if (! $resql) { dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); @@ -1138,7 +1143,7 @@ class DoliDBMysql /** * Return list of available collation that can be used for database * - * @return array Liste of Collation + * @return array List of Collation */ function getListOfCollation() { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 8f9a1aea674..5384dfb0517 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -249,9 +249,6 @@ class DoliDBMysqli */ function getVersion() { - // $resql=$this->query('SELECT VERSION()'); - // $row=$this->fetch_row($resql); - // return $row[0]; return mysqli_get_server_info($this->db); } @@ -458,9 +455,10 @@ class DoliDBMysqli /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE - * @see num_rows - * @param resultset Curseur de la requete voulue - * @return int Nombre de lignes + * + * @param resultset $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows */ function affected_rows($resultset) @@ -476,7 +474,8 @@ class DoliDBMysqli /** * Libere le dernier resultset utilise sur cette connexion * - * @param resultset Curseur de la requete voulue + * @param resultset $resultset Curseur de la requete voulue + * @return void */ function free($resultset=0) { @@ -490,9 +489,9 @@ class DoliDBMysqli /** * Defini les limites de la requete * - * @param limit nombre maximum de lignes retournees - * @param offset numero de la ligne a partir de laquelle recuperer les ligne - * @return string chaine exprimant la syntax sql de la limite + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite */ function plimit($limit=0,$offset=0) { @@ -506,10 +505,10 @@ class DoliDBMysqli /** * Define sort criteria of request * - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class */ function order($sortfield=0,$sortorder=0) { @@ -537,8 +536,8 @@ class DoliDBMysqli /** * Escape a string to insert data * - * @param stringtoencode String to escape - * @return string String escaped + * @param string $stringtoencode String to escape + * @return string String escaped */ function escape($stringtoencode) { @@ -546,7 +545,7 @@ class DoliDBMysqli } /** - * Convert (by PHP) a GM Timestamp date into a PHP server TZ to insert into a date field. + * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. * Function to use to build INSERT, UPDATE or WHERE predica * * @param string $param Date TMS to convert @@ -575,10 +574,10 @@ class DoliDBMysqli /** * Formate a SQL IF * - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string chaine formatee SQL + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string */ function ifsql($test,$resok,$resko) { @@ -587,8 +586,9 @@ class DoliDBMysqli /** - * \brief Renvoie la derniere requete soumise par la methode query() - * \return lastquery + * Return last request executed with query() + * + * @return string Last query */ function lastquery() { @@ -596,8 +596,9 @@ class DoliDBMysqli } /** - * \brief Renvoie la derniere requete en erreur - * \return string lastqueryerror + * Renvoie la derniere requete en erreur + * + * @return string lastqueryerror */ function lastqueryerror() { @@ -605,8 +606,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le libelle derniere erreur - * \return string lasterror + * Renvoie le libelle derniere erreur + * + * @return string lasterror */ function lasterror() { @@ -614,8 +616,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le code derniere erreur - * \return string lasterrno + * Renvoie le code derniere erreur + * + * @return string lasterrno */ function lasterrno() { @@ -623,8 +626,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le code erreur generique de l'operation precedente. - * \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * Return generic error code of last operation. + * + * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno() { @@ -659,6 +663,7 @@ class DoliDBMysqli 1146 => 'DB_ERROR_NOSUCHTABLE', 1216 => 'DB_ERROR_NO_PARENT', 1217 => 'DB_ERROR_CHILD_EXISTS', + 1396 => 'DB_ERROR_USER_ALREADY_EXISTS', // When creating user already existing 1451 => 'DB_ERROR_CHILD_EXISTS' ); @@ -672,8 +677,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le texte de l'erreur mysql de l'operation precedente. - * \return error_text + * Return description of last error + * + * @return string Error text */ function error() { @@ -702,9 +708,9 @@ class DoliDBMysqli * Encrypt sensitive data in database * Warning: This function includes the escape, so it must use direct value * - * @param fieldorvalue Field name or value to encrypt - * @param withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return string XXX(field) or XXX('value') or field or 'value' * */ function encrypt($fieldorvalue, $withQuotes=0) @@ -735,9 +741,10 @@ class DoliDBMysqli } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -767,12 +774,10 @@ class DoliDBMysqli } - // Next functions are not required. Only minor features use them. - //--------------------------------------------------------------- - /** - * \brief Renvoie l'id de la connexion - * \return string Id connexion + * Return connexion ID + * + * @return string Id connexion */ function DDLGetConnectId() { @@ -782,14 +787,15 @@ class DoliDBMysqli } /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \param owner Username of database owner - * \return resource resource defined if OK, null if KO - * \remarks Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { @@ -1047,11 +1053,7 @@ class DoliDBMysqli */ function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { - $sql = "INSERT INTO user "; - $sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; - $sql.= " VALUES ('".addslashes($dolibarr_main_db_host)."','".addslashes($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')"; - $sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y','Y')"; - + $sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."'"; dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log $resql=$this->query($sql); if (! $resql) @@ -1059,13 +1061,8 @@ class DoliDBMysqli dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); return -1; } - - $sql = "INSERT INTO db "; - $sql.= "(Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; - $sql.= " VALUES ('".addslashes($dolibarr_main_db_host)."','".addslashes($dolibarr_main_db_name)."','".addslashes($dolibarr_main_db_user)."'"; - $sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y','Y')"; - - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql); + $sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'"; + dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log $resql=$this->query($sql); if (! $resql) { diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index a28d6762a30..e0e3716473a 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -940,12 +940,8 @@ class DoliDBPgsql } - // Next function are not required. Only minor features use them. - //-------------------------------------------------------------- - - /** - * Renvoie l'id de la connexion + * Return connexion ID * * @return string Id connexion */ @@ -958,13 +954,14 @@ class DoliDBPgsql /** * Create a new database - * Ne pas utiliser les fonctions xxx_create_db (xxx=mysql, ...) car elles sont deprecated + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate * * @param string $database Database name to create * @param string $charset Charset used to store data * @param string $collation Charset used to sort data * @param string $owner Username of database owner - * @return resource Resource defined if OK, null if KO + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 9155baa830b..52d6a05d4ce 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -585,13 +585,12 @@ class DoliDBSqlite } /** - * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE + * Return number of lines for result of a SELECT * - * @see num_rows - * @param resultset Curseur de la requete voulue - * @return int Nombre de lignes + * @param Resultset $resultset Resulset of requests + * @return int Nb of lines + * @see affected_rows */ - function affected_rows($resultset) { // If resultset not provided, we take the last used by connexion @@ -602,11 +601,12 @@ class DoliDBSqlite } - /** - * Libere le dernier resultset utilise sur cette connexion - * - * @param resultset Curseur de la requete voulue - */ + /** + * Free last resultset used. + * + * @param resultset $resultset Curseur de la requete voulue + * @return void + */ function free($resultset=0) { // If resultset not provided, we take the last used by connexion @@ -616,13 +616,13 @@ class DoliDBSqlite } - /** - * Defini les limites de la requete - * - * @param limit nombre maximum de lignes retournees - * @param offset numero de la ligne a partir de laquelle recuperer les ligne - * @return string chaine exprimant la syntax sql de la limite - */ + /** + * Define limits of request + * + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite + */ function plimit($limit=0,$offset=0) { global $conf; @@ -632,14 +632,14 @@ class DoliDBSqlite } - /** - * Define sort criteria of request - * - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class - */ + /** + * Define sort criteria of request + * + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class + */ function order($sortfield=0,$sortorder=0) { if ($sortfield) @@ -663,12 +663,12 @@ class DoliDBSqlite } - /** - * Escape a string to insert data - * - * @param stringtoencode String to escape - * @return string String escaped - */ + /** + * Escape a string to insert data + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ function escape($stringtoencode) { return PDO::quote($stringtoencode); @@ -701,14 +701,14 @@ class DoliDBSqlite return $date; } - /** - * Formate a SQL IF - * - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string chaine formatee SQL - */ + /** + * Formate a SQL IF + * + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string + */ function ifsql($test,$resok,$resko) { return 'IF('.$test.','.$resok.','.$resko.')'; @@ -725,31 +725,31 @@ class DoliDBSqlite return $this->lastquery; } - /** - * Renvoie la derniere requete en erreur - * - * @return string lastqueryerror - */ + /** + * Return last query in error + * + * @return string lastqueryerror + */ function lastqueryerror() { return $this->lastqueryerror; } - /** - * Renvoie le libelle derniere erreur - * - * @return string lasterror - */ + /** + * Return last error label + * + * @return string lasterror + */ function lasterror() { return $this->lasterror; } - /** - * Renvoie le code derniere erreur - * - * @return string lasterrno - */ + /** + * Return last error code + * + * @return string lasterrno + */ function lasterrno() { return $this->lasterrno; @@ -846,13 +846,12 @@ class DoliDBSqlite } /** - * Encrypt sensitive data in database + * Encrypt sensitive data in database * Warning: This function includes the escape, so it must use direct value * - * @param fieldorvalue Field name or value to encrypt - * @param withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' - * + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return return XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { @@ -882,9 +881,10 @@ class DoliDBSqlite } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -914,29 +914,27 @@ class DoliDBSqlite } - // Next functions are not required. Only minor features use them. - //--------------------------------------------------------------- - /** - * \brief Renvoie l'id de la connexion - * \return string Id connexion + * Return connexion ID + * + * @return string Id connexion */ function DDLGetConnectId() { - $resql=$this->query('SELECT CONNECTION_ID()'); - $row=$this->fetch_row($resql); - return $row[0]; + return '?'; } + /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \param owner Username of database owner - * \return resource resource defined if OK, null if KO - * \remarks Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { @@ -1234,19 +1232,21 @@ class DoliDBSqlite return 1; } - /** - * \brief Return charset used to store data in database - * \return string Charset - */ + /** + * Return charset used to store data in database + * + * @return string Charset + */ function getDefaultCharacterSetDatabase() { return 'UTF-8'; } - /** - * \brief Return list of available charset that can be used to store data in database - * \return array List of Charset - */ + /** + * Return list of available charset that can be used to store data in database + * + * @return array List of Charset + */ function getListOfCharacterSet() { $liste = array(); @@ -1256,19 +1256,21 @@ class DoliDBSqlite return $liste; } - /** - * \brief Return collation used in database - * \return string Collation value - */ + /** + * Return collation used in database + * + * @return string Collation value + */ function getDefaultCollationDatabase() { return 'UTF-8'; } - /** - * \brief Return list of available collation that can be used for database - * \return array Liste of Collation - */ + /** + * Return list of available collation that can be used for database + * + * @return array List of Collation + */ function getListOfCollation() { $liste = array(); @@ -1278,11 +1280,12 @@ class DoliDBSqlite return $liste; } - /** + /** * Return full path of dump program + * * @return string Full path of dump program - */ - function getPathOfDump() + */ + function getPathOfDump() { $fullpathofdump='/pathtomysqldump/mysqldump'; @@ -1296,10 +1299,11 @@ class DoliDBSqlite return $fullpathofdump; } - /** - * Return full path of restore program - * @return string Full path of restore program - */ + /** + * Return full path of restore program + * + * @return string Full path of restore program + */ function getPathOfRestore() { $fullpathofimport='/pathtomysql/mysql'; @@ -1314,11 +1318,12 @@ class DoliDBSqlite return $fullpathofimport; } - /** - * \brief Return value of server parameters - * \param filter Filter list on a particular value - * \return string Value for parameter - */ + /** + * Return value of server parameters + * + * @param string $filter Filter list on a particular value + * @return string Value for parameter + */ function getServerParametersValues($filter='') { $result=array(); @@ -1335,11 +1340,12 @@ class DoliDBSqlite return $result; } - /** - * \brief Return value of server status - * \param filter Filter list on a particular value - * \return string Value for parameter - */ + /** + * Return value of server status + * + * @param string $filter Filter list on a particular value + * @return string Value for parameter + */ function getServerStatusValues($filter='') { $result=array(); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 14424322984..6dd2a1bb0b4 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -185,8 +185,9 @@ function show_array_actions_to_do($max=5) $sql.= " ".MAIN_DB_PREFIX."actioncomm as a"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ")"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " WHERE c.id = a.fk_action"; + $sql.= " AND a.entity = ".$conf->entity; $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; @@ -283,8 +284,9 @@ function show_array_last_actions_done($max=5) $sql.= " ".MAIN_DB_PREFIX."actioncomm as a"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.=")"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " WHERE c.id = a.fk_action"; + $sql.= " AND a.entity = ".$conf->entity; $sql.= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a6d96583054..2b2a1110b57 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -989,7 +989,7 @@ function show_subsidiaries($conf,$langs,$db,$object) $sql = "SELECT s.rowid, s.nom as name, s.address, s.cp as zip, s.ville as town, s.code_client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.parent = ".$object->id; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " ORDER BY s.nom"; $result = $db->query($sql); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7bcd1016ce6..ac4b13c00dc 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -536,7 +536,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if ($result < 0) // If virus or error, we stop here { $reterrors=$antivir->errors; - dol_syslog('Functions.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$file_name.'") KO with antivirus: result='.$result.' errors='.join(',',$antivir->errors), LOG_WARNING); + dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$file_name.'") KO with antivirus: result='.$result.' errors='.join(',',$antivir->errors), LOG_WARNING); return 'ErrorFileIsInfectedWithAVirus: '.join(',',$reterrors); } } @@ -578,7 +578,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable { if (file_exists($file_name_osencoded)) { - dol_syslog("Functions.lib::dol_move_uploaded_file File ".$file_name." already exists", LOG_WARNING); + dol_syslog("Files.lib::dol_move_uploaded_file File ".$file_name." already exists. Return 'ErrorFileAlreadyExists'", LOG_WARNING); return 'ErrorFileAlreadyExists'; } } @@ -588,7 +588,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if ($return) { if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); - dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); + dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); if (! $notrigger && is_object($object)) { @@ -606,7 +606,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } else { - dol_syslog("Functions.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR); + dol_syslog("Files.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR); return -3; // Unknown error } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1b0fcd09ddf..b2d1782a7b2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4021,7 +4021,7 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) * * @param string $mesgstring Message * @param array $mesgarray Messages array - * @param string $style Which style to use ('ok', 'error') + * @param string $style Which style to use ('ok', 'warning', 'error') * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) * @return void * @@ -4033,21 +4033,25 @@ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb if (empty($mesgstring) && (! is_array($mesgarray) || count($mesgarray) == 0)) return; $iserror=0; + $iswarning=0; if (is_array($mesgarray)) { foreach($mesgarray as $val) { if ($val && preg_match('/class="error"/i',$val)) { $iserror++; break; } + if ($val && preg_match('/class="warning"/i',$val)) { $iswarning++; break; } } } else if ($mesgstring && preg_match('/class="error"/i',$mesgstring)) $iserror++; + else if ($mesgstring && preg_match('/class="warning"/i',$mesgstring)) $iswarning++; if ($style=='error') $iserror++; + if ($style=='warning') $iswarning++; - if ($iserror) + if ($iserror || $iswarning) { // Remove div from texts - $mesgstring=preg_replace('/<\/div>
/','
',$mesgstring); - $mesgstring=preg_replace('/
/','',$mesgstring); + $mesgstring=preg_replace('/<\/div>
/','
',$mesgstring); + $mesgstring=preg_replace('/
/','',$mesgstring); $mesgstring=preg_replace('/<\/div>/','',$mesgstring); // Remove div from texts array if (is_array($mesgarray)) @@ -4055,14 +4059,14 @@ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb $newmesgarray=array(); foreach($mesgarray as $val) { - $tmpmesgstring=preg_replace('/<\/div>
/','
',$val); - $tmpmesgstring=preg_replace('/
/','',$tmpmesgstring); + $tmpmesgstring=preg_replace('/<\/div>
/','
',$val); + $tmpmesgstring=preg_replace('/
/','',$tmpmesgstring); $tmpmesgstring=preg_replace('/<\/div>/','',$tmpmesgstring); $newmesgarray[]=$tmpmesgstring; } $mesgarray=$newmesgarray; } - print get_htmloutput_mesg($mesgstring,$mesgarray,'error',$keepembedded); + print get_htmloutput_mesg($mesgstring,$mesgarray,($iserror?'error':'warning'),$keepembedded); } else print get_htmloutput_mesg($mesgstring,$mesgarray,'ok',$keepembedded); } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index f0b0e38ffbb..f6a1f7ad58b 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -510,7 +510,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; - $sql.= " AND entity = ".getEntity($table); + $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -547,7 +547,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql = "SELECT facnumber as ref"; $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE facnumber LIKE '".$maskLike."'"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity IN (".getEntity($table, 1).")"; dol_syslog("mod_facture_terre::getNextValue sql=".$sql); $resql=$db->query($sql); @@ -592,7 +592,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskrefclient_sql.= " FROM ".MAIN_DB_PREFIX.$table; //$sql.= " WHERE ".$field." not like '(%'"; $maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'"; - $maskrefclient_sql.= " AND entity = ".$conf->entity; + $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask $maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')"; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php new file mode 100644 index 00000000000..66824db4005 --- /dev/null +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -0,0 +1,496 @@ + + * Copyright (C) 2012 Juanjo Menent + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * 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 . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/commande/doc_generic_order_odt.modules.php + * \ingroup societe + * \brief File of class to build ODT documents for third parties + */ + +require_once(DOL_DOCUMENT_ROOT."/core/modules/commande/modules_commande.php"); +require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); + + +/** + * \class doc_generic_order_odt + * \brief Class to build documents using ODF templates generator + */ +class doc_generic_order_odt extends ModelePDFCommandes +{ + var $emetteur; // Objet societe qui emet + + var $phpmin = array(5,2,0); // Minimum version of PHP required by module + var $version = 'development'; + + + /** + * Constructor + * + * @param DoliDB $DB Database handler + */ + function doc_generic_order_odt($db) + { + global $conf,$langs,$mysoc; + + $langs->load("main"); + $langs->load("companies"); + + $this->db = $db; + $this->name = "ODT templates"; + $this->description = $langs->trans("DocumentModelOdt"); + $this->scandir = 'COMMANDE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan + + // Dimension page pour format A4 + $this->type = 'odt'; + $this->page_largeur = 0; + $this->page_hauteur = 0; + $this->format = array($this->page_largeur,$this->page_hauteur); + $this->marge_gauche=0; + $this->marge_droite=0; + $this->marge_haute=0; + $this->marge_basse=0; + + $this->option_logo = 1; // Affiche logo + $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION + $this->option_modereg = 0; // Affiche mode reglement + $this->option_condreg = 0; // Affiche conditions reglement + $this->option_codeproduitservice = 0; // Affiche code produit-service + $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_credit_note = 0; // Support credit notes + $this->option_freetext = 1; // Support add of a personalised text + $this->option_draft_watermark = 0; // Support add of a watermark on drafts + + // Recupere emetteur + $this->emetteur=$mysoc; + if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini + } + + + /** + * Define array with couple substitution key => substitution value + * + * @param Object $object Main object to use as data source + * @param Translate $outputlangs Lang object to use for output + */ + function get_substitutionarray_object($object,$outputlangs) + { + global $conf; + + return array( + 'object_id'=>$object->id, + 'object_ref'=>$object->ref, + 'object_ref_ext'=>$object->ref_ext, + 'object_ref_customer'=>$object->ref_client, + 'object_date'=>dol_print_date($object->date,'day'), + 'object_date_delivery'=>dol_print_date($object->date_livraison,'dayhour'), + 'object_date_creation'=>dol_print_date($object->date_creation,'day'), + 'object_date_modification'=>dol_print_date($object->date_modification,'day'), + 'object_date_validation'=>dol_print_date($object->date_validation,'dayhour'), + 'object_date_close'=>dol_print_date($object->date_cloture,'dayhour'), + 'object_payment_mode'=>$object->mode_reglement, + 'object_payment_term'=>$object->cond_reglement, + 'object_total_ht'=>price($object->total_ht,0,$outputlangs), + 'object_total_vat'=>price($object->total_tva,0,$outputlangs), + 'object_total_ttc'=>price($object->total_ttc,0,$outputlangs), + 'object_vatrate'=>vatrate($object->tva), + 'object_note_private'=>$object->note, + 'object_note'=>$object->note_public, + ); + } + + /** + * Define array with couple substitution key => substitution value + * + * @param array $line + * @param Translate $outputlangs Lang object to use for output + */ + function get_substitutionarray_lines($line,$outputlangs) + { + global $conf; + + return array( + 'line_fulldesc'=>$line->product_ref.(($line->product_ref && $line->desc)?' - ':'').$line->desc, + 'line_product_ref'=>$line->product_ref, + 'line_desc'=>$line->desc, + 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), + 'line_up'=>price($line->subprice, 0, $outputlangs), + 'line_qty'=>$line->qty, + 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), + 'line_price_ht'=>price($line->total_ht, 0, $outputlangs), + 'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs), + 'line_price_vat'=>price($line->total_tva, 0, $outputlangs), + 'line_date_start'=>$line->date_start, + 'line_date_end'=>$line->date_end + ); + } + + /** + * Return description of a module + * @param langs Lang object to use for output + * @return string Description + */ + function info($langs) + { + global $conf,$langs; + + $langs->load("companies"); + $langs->load("errors"); + + $form = new Form($this->db); + + $texte = $this->description.".
\n"; + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= '
'; + + // List of directories area + $texte.= ''; + + + $texte.= ''; + $texte.= ''; + + /*$texte.= ''; + $texte.= ''; + $texte.= '';*/ + + $texte.= '
'; + $texttitle=$langs->trans("ListOfDirectories"); + $listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->COMMANDE_ADDON_PDF_ODT_PATH))); + $listoffiles=array(); + foreach($listofdir as $key=>$tmpdir) + { + $tmpdir=trim($tmpdir); + $tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir); + if (! $tmpdir) { unset($listofdir[$key]); continue; } + if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); + else + { + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); + if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); + } + } + $texthelp=$langs->trans("ListOfDirectoriesForModelGenODT"); + // Add list of substitution keys + $texthelp.='
'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'
'; + $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it + + $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1); + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= '
'; + $texte.= ''; + $texte.= '  '; + $texte.= ''; + $texte.= '
'; + + // Scan directories + if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; + + $texte.= '
'; + $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); + $texte.= '
'; + $texte.= ''; + $texte.= '
'; + $texte.= ''; + + return $texte; + } + + /** + * Function to build a document on disk using the generic odt module. + * + * @param Commande $object Object source to build document + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @return int 1 if OK, <=0 if KO + */ + function write_file($object,$outputlangs,$srctemplatepath) + { + global $user,$langs,$conf,$mysoc; + + if (empty($srctemplatepath)) + { + dol_syslog("doc_generic_odt::write_file parameter srctemplatepath empty", LOG_WARNING); + return -1; + } + + if (! is_object($outputlangs)) $outputlangs=$langs; + $sav_charset_output=$outputlangs->charset_output; + $outputlangs->charset_output='UTF-8'; + + $outputlangs->load("main"); + $outputlangs->load("dict"); + $outputlangs->load("companies"); + $outputlangs->load("bills"); + + if ($conf->commande->dir_output) + { + // If $object is id instead of object + if (! is_object($object)) + { + $id = $object; + $object = new Commande($this->db); + $result=$object->fetch($id); + if ($result < 0) + { + dol_print_error($this->db,$object->error); + return -1; + } + } + + $dir = $conf->commande->dir_output; + $objectref = dol_sanitizeFileName($object->ref); + if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; + $file = $dir . "/" . $objectref . ".odt"; + + if (! file_exists($dir)) + { + if (create_exdir($dir) < 0) + { + $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); + return -1; + } + } + + if (file_exists($dir)) + { + //print "srctemplatepath=".$srctemplatepath; // Src filename + $newfile=basename($srctemplatepath); + $newfiletmp=preg_replace('/\.odt/i','',$newfile); + $newfiletmp=preg_replace('/template_/i','',$newfiletmp); + $newfiletmp=preg_replace('/modele_/i','',$newfiletmp); + $newfiletmp=$objectref.'_'.$newfiletmp; + //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; + $file=$dir.'/'.$newfiletmp.'.odt'; + //print "newdir=".$dir; + //print "newfile=".$newfile; + //print "file=".$file; + //print "conf->societe->dir_temp=".$conf->societe->dir_temp; + + create_exdir($conf->commande->dir_temp); + + + // If BILLING contact defined on invoice, we use it + $usecontact=false; + $arrayidcontact=$object->getIdContact('external','BILLING'); + if (count($arrayidcontact) > 0) + { + $usecontact=true; + $result=$object->fetch_contact($arrayidcontact[0]); + } + + // Recipient name + if (! empty($usecontact)) + { + // On peut utiliser le nom de la societe du contact + if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact; + else $socobject = $object->client; + } + else + { + $socobject=$object->client; + } + + // Make substitution + $substitutionarray=array( + '__FROM_NAME__' => $this->emetteur->nom, + '__FROM_EMAIL__' => $this->emetteur->email, + '__TOTAL_TTC__' => $object->total_ttc, + '__TOTAL_HT__' => $object->total_ht, + '__TOTAL_VAT__' => $object->total_vat + ); + complete_substitutions_array($substitutionarray, $langs, $object); + + // Line of free text + $newfreetext=''; + $paramfreetext='COMMANDE_FREE_TEXT'; + if (! empty($conf->global->$paramfreetext)) + { + $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray); + } + + // Open and load template + require_once(ODTPHP_PATH.'odf.php'); + $odfHandler = new odf($srctemplatepath, array( + 'PATH_TO_TMP' => $conf->commande->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}') + ); + // After construction $odfHandler->contentXml contains content and + // [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by + // [!-- BEGIN lines --]*[!-- END lines --] + //print html_entity_decode($odfHandler->__toString()); + //print exit; + + + // Make substitutions into odt of freetext + try { + $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + + // Make substitutions into odt of user info + $tmparray=$this->get_substitutionarray_user($user,$outputlangs); + //var_dump($tmparray); exit; + foreach($tmparray as $key=>$value) + { + try { + if (preg_match('/logo$/',$key)) // Image + { + //var_dump($value);exit; + if (file_exists($value)) $odfHandler->setImage($key, $value); + else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); + } + else // Text + { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + } + catch(OdfException $e) + { + } + } + // Make substitutions into odt of mysoc + $tmparray=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); + //var_dump($tmparray); exit; + foreach($tmparray as $key=>$value) + { + try { + if (preg_match('/logo$/',$key)) // Image + { + //var_dump($value);exit; + if (file_exists($value)) $odfHandler->setImage($key, $value); + else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); + } + else // Text + { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + } + catch(OdfException $e) + { + } + } + // Make substitutions into odt of thirdparty + $tmparray=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); + foreach($tmparray as $key=>$value) + { + try { + if (preg_match('/logo$/',$key)) // Image + { + if (file_exists($value)) $odfHandler->setImage($key, $value); + else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); + } + else // Text + { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + } + catch(OdfException $e) + { + } + } + // Replace tags of object + external modules + $tmparray=$this->get_substitutionarray_object($object,$outputlangs); + complete_substitutions_array($tmparray, $outputlangs, $object); + foreach($tmparray as $key=>$value) + { + try { + if (preg_match('/logo$/',$key)) // Image + { + if (file_exists($value)) $odfHandler->setImage($key, $value); + else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); + } + else // Text + { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + } + catch(OdfException $e) + { + } + } + // Replace tags of lines + try + { + $listlines = $odfHandler->setSegment('lines'); + foreach ($object->lines as $line) + { + $tmparray=$this->get_substitutionarray_lines($line,$outputlangs); + foreach($tmparray as $key => $val) + { + try + { + $listlines->setVars($key, $val, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + catch(SegmentException $e) + { + } + } + $listlines->merge(); + } + $odfHandler->mergeSegment($listlines); + } + catch(OdfException $e) + { + $this->error=$e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + return -1; + } + + // Write new file + //$result=$odfHandler->exportAsAttachedFile('toto'); + $odfHandler->saveToDisk($file); + + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + $odfHandler=null; // Destroy object + + return 1; // Success + } + else + { + $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); + return -1; + } + } + + return -1; + } + +} + +?> diff --git a/htdocs/core/modules/commande/pdf_edison.modules.php b/htdocs/core/modules/commande/doc/pdf_edison.modules.php similarity index 100% rename from htdocs/core/modules/commande/pdf_edison.modules.php rename to htdocs/core/modules/commande/doc/pdf_edison.modules.php diff --git a/htdocs/core/modules/commande/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php similarity index 100% rename from htdocs/core/modules/commande/pdf_einstein.modules.php rename to htdocs/core/modules/commande/doc/pdf_einstein.modules.php diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index 00d3d858f9a..f0a282725ad 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -156,46 +157,55 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0 $langs->load("orders"); $error=0; - + $dir = "/core/modules/commande/"; $srctemplatepath=''; - $modelisok=0; - $liste=array(); - // Positionne modele sur le nom du modele de commande a utiliser - $file = "pdf_".$modele.".modules.php"; - // On verifie l'emplacement du modele - $file = dol_buildpath($dir.$file); - if ($modele && file_exists($file)) $modelisok=1; - - // Si model pas encore bon - if (! $modelisok) + // Positionne le modele sur le nom du modele a utiliser + if (! dol_strlen($modele)) { - if ($conf->global->COMMANDE_ADDON_PDF) $modele = $conf->global->COMMANDE_ADDON_PDF; - $file = "pdf_".$modele.".modules.php"; - // On verifie l'emplacement du modele - $file = dol_buildpath($dir.$file); - if (file_exists($file)) $modelisok=1; + if (! empty($conf->global->COMMANDE_ADDON_PDF)) + { + $modele = $conf->global->COMMANDE_ADDON_PDF; + } + else + { + $modele = 'einstein'; + } } - // Si model pas encore bon - if (! $modelisok) + // If selected modele is a filename template (then $modele="modelname:filename") + $tmp=explode(':',$modele,2); + if (! empty($tmp[1])) + { + $modele=$tmp[0]; + $srctemplatepath=$tmp[1]; + } + + // Search template file + $file=''; $classname=''; $filefound=0; + foreach(array('doc','pdf') as $prefix) { - $liste=ModelePDFCommandes::liste_modeles($db); - $modele=key($liste); // Renvoie premiere valeur de cle trouvee dans le tableau - $file = "pdf_".$modele.".modules.php"; - // On verifie l'emplacement du modele - $file = dol_buildpath($dir.$file); - if (file_exists($file)) $modelisok=1; + $file = $prefix."_".$modele.".modules.php"; + + // On verifie l'emplacement du modele + $file = dol_buildpath($dir.'doc/'.$file); + + if (file_exists($file)) + { + $filefound=1; + $classname=$prefix.'_'.$modele; + break; + } } // Charge le modele - if ($modelisok) + if ($filefound) { - $classname = "pdf_".$modele; require_once($file); $obj = new $classname($db); + $obj->message = $message; // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. @@ -204,10 +214,13 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0 { $outputlangs->charset_output=$sav_charset_output; - // we delete preview files - require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); + // We delete old preview + require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); dol_delete_preview($object); + // Success in building document. We build meta file. + dol_meta_create($object); + // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); $interface=new Interfaces($db); @@ -220,22 +233,15 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0 else { $outputlangs->charset_output=$sav_charset_output; - dol_syslog("Error"); - dol_print_error($db,$obj->error); - return 0; + dol_print_error($db,"order_pdf_create Error: ".$obj->error); + return -1; } + } else { - if (! $conf->global->COMMANDE_ADDON_PDF) - { - print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_ADDON_PDF_NotDefined"); - } - else - { - print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); - } - return 0; + dol_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file)); + return -1; } } ?> diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index df917b1f5d9..4bda754c752 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -38,8 +38,10 @@ abstract class ModeleDon extends CommonDocGenerator var $error=''; /** - * \brief Return list of active generation modules - * \param $db Database handler + * Return list of active generation modules + * + * @param DoliDB $db Database handler + * @return array List of donation templates */ function liste_modeles($db) { diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index 713f7004df0..c3e2dd85838 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -442,8 +442,9 @@ Class pdf_expedition_merou extends ModelePdfExpedition $blSocX2=$blSocW+$blSocX; // Sender name - $pdf->SetTextColor(0,0,60); - $pdf->SetXY($blSocX,$blSocY); + $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','B', $default_font_size - 3); + $pdf->SetXY($blSocX,$blSocY+1); $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); $pdf->SetTextColor(0,0,0); @@ -451,7 +452,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); $pdf->SetFont('','', $default_font_size - 3); - $pdf->SetXY($blSocX,$blSocY+3); + $pdf->SetXY($blSocX,$blSocY+4); $pdf->MultiCell(80, 2, $carac_emetteur, 0, 'L'); @@ -504,12 +505,11 @@ Class pdf_expedition_merou extends ModelePdfExpedition /**********************************/ //Emplacement Informations Expediteur (My Company) /**********************************/ + $Yoff = $blSocY; $blExpX=$Xoff-20; $blW=52; - $Yoff = $Yoff+5; $Ydef = $Yoff; - $blSocY = 1; - $pdf->Rect($blExpX, $Yoff, $blW, 20); + $pdf->Rect($blExpX, $Yoff, $blW, 26); $object->fetch_thirdparty(); @@ -542,7 +542,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition $blW=50; $Yoff = $Ydef +1; - $pdf->Rect($blDestX, $Yoff-1, $blW, 20); + $pdf->Rect($blDestX, $Yoff-1, $blW, 26); //Titre $pdf->SetFont('','B', $default_font_size - 3); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 760b175a42f..5a5882c2454 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -521,7 +521,7 @@ class pdf_crabe extends ModelePDFFactures $sql.= " cp.code"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; - $sql.= " WHERE pf.fk_paiement = p.rowid and pf.fk_facture = ".$object->id; + $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; $sql.= " ORDER BY p.datep"; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php index 26ae580d4d3..0c43cb2e5e2 100755 --- a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php @@ -406,7 +406,7 @@ class pdf_oursin extends ModelePDFFactures $sql.= " cp.code"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; - $sql.= " WHERE pf.fk_paiement = p.rowid and pf.fk_facture = ".$object->id; + $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; $sql.= " ORDER BY p.datep"; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index e0b7fb782c4..7ef9713bd46 100755 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -73,8 +73,7 @@ class mailing_contacts1 extends MailingTargets $statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $statssql[0].= " ".MAIN_DB_PREFIX."societe as s"; $statssql[0].= " WHERE s.rowid = c.fk_soc"; - $statssql[0].= " AND s.entity = ".$conf->entity; - $statssql[0].= " AND c.entity = ".$conf->entity; + $statssql[0].= " AND c.entity IN (".getEntity('societe', 1).")"; $statssql[0].= " AND s.client IN (1, 3)"; $statssql[0].= " AND c.email != ''"; // Note that null != '' is false @@ -97,8 +96,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.rowid = c.fk_soc"; - $sql .= " AND c.entity = ".$conf->entity; - $sql .= " AND s.entity = ".$conf->entity; + $sql .= " AND c.entity IN (".getEntity('societe', 1).")"; $sql .= " AND c.email != ''"; // Note that null != '' is false // La requete doit retourner un champ "nb" pour etre comprise @@ -204,8 +202,7 @@ class mailing_contacts1 extends MailingTargets $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.rowid = c.fk_soc"; - $sql.= " AND c.entity = ".$conf->entity; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity IN (".getEntity('societe', 1).")"; $sql.= " AND c.email != ''"; foreach($filtersarray as $key) { diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php index 386c1d20666..21fd42c95ec 100755 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ b/htdocs/core/modules/mailings/contacts2.modules.php @@ -163,8 +163,7 @@ class mailing_contacts2 extends MailingTargets $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND s.entity = ".$conf->entity; - $sql.= " AND sp.entity = ".$conf->entity; + $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email != ''"; // Note that null != '' is false //$sql.= " AND sp.poste != ''"; // La requete doit retourner un champ "nb" pour etre comprise diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php index a9973722d6c..228961fe990 100755 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ b/htdocs/core/modules/mailings/contacts3.modules.php @@ -169,8 +169,7 @@ class mailing_contacts3 extends MailingTargets $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.rowid = c.fk_soc"; - $sql.= " AND c.entity = ".$conf->entity; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity IN (".getEntity('societe', 1).")"; $sql.= " AND c.email != ''"; // Note that null != '' is false /* $sql = "SELECT count(distinct(sp.email)) as nb"; @@ -179,8 +178,7 @@ class mailing_contacts3 extends MailingTargets $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND sp.entity = ".$conf->entity; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email != ''"; // Note that null != '' is false $sql.= " AND cs.fk_categorie = c.rowid"; $sql.= " AND cs.fk_societe = sp.fk_soc"; diff --git a/htdocs/core/modules/mailings/framboise.modules.php b/htdocs/core/modules/mailings/framboise.modules.php index fbb0aeea420..86afa59054b 100644 --- a/htdocs/core/modules/mailings/framboise.modules.php +++ b/htdocs/core/modules/mailings/framboise.modules.php @@ -63,19 +63,19 @@ class mailing_framboise extends MailingTargets // CHANGE THIS // Select the members from category - $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,"; + $sql = "SELECT a.rowid as id, a.email as email, a.nom as name, null as fk_contact, null as firstname,"; if ($_POST['filter']) $sql.= " c.label"; else $sql.=" null as label"; - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as s"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; if ($_POST['filter']) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = s.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = a.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie"; } - $sql.= " WHERE s.email != ''"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " WHERE a.email != ''"; + $sql.= " AND a.entity = ".$conf->entity; if ($_POST['filter']) $sql.= " AND c.rowid='".$_POST['filter']."'"; - $sql.= " ORDER BY s.email"; + $sql.= " ORDER BY a.email"; // Stocke destinataires dans cibles $result=$this->db->query($sql); @@ -150,10 +150,10 @@ class mailing_framboise extends MailingTargets { global $conf; - $sql = "SELECT count(distinct(s.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as s"; - $sql.= " WHERE s.email != ''"; - $sql.= " AND s.entity = ".$conf->entity; + $sql = "SELECT count(distinct(a.email)) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; + $sql.= " WHERE a.email != ''"; + $sql.= " AND a.entity = ".$conf->entity; // La requete doit retourner un champ "nb" pour etre comprise // par parent::getNbOfRecipients diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 7cf0eb6ef4a..9bfda30d8f9 100755 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -67,14 +67,14 @@ class mailing_thirdparties extends MailingTargets $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, null as label"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.email != ''"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; } else { $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql.= " WHERE s.email != ''"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND cs.fk_societe = s.rowid"; $sql.= " AND c.rowid = cs.fk_categorie"; $sql.= " AND c.rowid='".$this->db->escape($_POST['filter'])."'"; @@ -82,7 +82,7 @@ class mailing_thirdparties extends MailingTargets $sql.= "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_fournisseur as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql.= " WHERE s.email != ''"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND cs.fk_societe = s.rowid"; $sql.= " AND c.rowid = cs.fk_categorie"; $sql.= " AND c.rowid='".$this->db->escape($_POST['filter'])."'"; @@ -164,7 +164,7 @@ class mailing_thirdparties extends MailingTargets $sql = "SELECT count(distinct(s.email)) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.email != ''"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; // La requete doit retourner un champ "nb" pour etre comprise // par parent::getNbOfRecipients diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 64ac2ec3c2b..9e4cea75084 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -89,6 +90,13 @@ class modCommande extends DolibarrModules $this->const[$r][2] = "mod_commande_marbre"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des commandes'; $this->const[$r][4] = 0; + + $r++; + $this->const[$r][0] = "COMMANDE_ADDON_PDF_ODT_PATH"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/orders"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; // Boites $this->boxes = array(); @@ -192,6 +200,12 @@ class modCommande extends DolibarrModules // Permissions $this->remove(); + //ODT template + require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); + $dirodt=DOL_DATA_ROOT.'/doctemplates/orders'; + create_exdir($dirodt); + dol_copy(DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt',$dirodt.'/template_order.odt',0,0); + $sql = array( "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."'", "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES('".$this->const[0][2]."','order')" diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 6aa523b18cc..e06da8453f9 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -182,7 +182,7 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; - $this->export_sql_end[$r] .=' AND s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index f716fa4c8cc..ab20a588b15 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -222,7 +222,7 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; - $this->export_sql_end[$r] .=' WHERE s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe', 1).')'; // Export list of contacts and attributes $r++; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index ff1522267de..c6c083c7efd 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -115,16 +115,17 @@ class pdf_paiement $sql = "SELECT p.datep as dp, f.facnumber"; //$sql .= ", c.libelle as paiement_type, p.num_paiement"; - $sql .= ", c.code as paiement_code, p.num_paiement"; - $sql .= ", p.amount as paiement_amount, f.total_ttc as facture_amount "; - $sql .= ", pf.amount as pf_amount "; - $sql .= ", p.rowid as prowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."facture as f,"; - $sql .= " ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement_facture as pf"; - $sql .= " WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid"; - $sql .= " AND p.fk_paiement = c.id "; - $sql .= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'"; - $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; + $sql.= ", c.code as paiement_code, p.num_paiement"; + $sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount "; + $sql.= ", pf.amount as pf_amount "; + $sql.= ", p.rowid as prowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."facture as f,"; + $sql.= " ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement_facture as pf"; + $sql.= " WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND p.fk_paiement = c.id "; + $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'"; + $sql.= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; dol_syslog("pdf_paiement::write_file sql=".$sql); $result = $this->db->query($sql); diff --git a/htdocs/core/triggers/interface_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php old mode 100644 new mode 100755 similarity index 96% rename from htdocs/core/triggers/interface_all_Logevents.class.php rename to htdocs/core/triggers/interface_20_all_Logevents.class.php index bba2794b177..508cfa19541 --- a/htdocs/core/triggers/interface_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/triggers/interface_all_Logevents.class.php + * \file htdocs/core/triggers/interface_20_all_Logevents.class.php * \ingroup core * \brief Trigger file for */ @@ -38,12 +38,13 @@ class InterfaceLogevents var $desc; /** - * Constructor. - * @param DB Database handler + * Constructor + * + * @param DoliDB $db Database handler */ - function InterfaceLogevents($DB) + function InterfaceLogevents($db) { - $this->db = $DB ; + $this->db = $db; $this->name = preg_replace('/^Interface/i','',get_class($this)); $this->family = "core"; @@ -243,7 +244,7 @@ class InterfaceLogevents $error ="Failed to insert security event: ".$event->error; $this->error=$error; - dol_syslog("interface_all_Logevents.class.php: ".$this->error, LOG_ERR); + dol_syslog(get_class($this).": ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/core/triggers/interface_modPaypal_PaypalWorkflow.class.php b/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php old mode 100644 new mode 100755 similarity index 95% rename from htdocs/core/triggers/interface_modPaypal_PaypalWorkflow.class.php rename to htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php index c44554ba466..219087a0922 --- a/htdocs/core/triggers/interface_modPaypal_PaypalWorkflow.class.php +++ b/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php @@ -16,7 +16,7 @@ */ /** - * \file /htdocs/core/triggers/interface_modPaypal_PaypalWorkflow.class.php + * \file /htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php * \ingroup paypal * \brief Trigger file for paypal workflow */ @@ -32,11 +32,12 @@ class InterfacePaypalWorkflow /** * Constructor - * @param DB Database handler + * + * @param DoliDB $db Database handler */ - function InterfacePaypalWorkflow($DB) + function InterfacePaypalWorkflow($db) { - $this->db = $DB ; + $this->db = $db; $this->name = preg_replace('/^Interface/i','',get_class($this)); $this->family = "paypal"; diff --git a/htdocs/core/triggers/interface_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php similarity index 94% rename from htdocs/core/triggers/interface_modWorkflow_WorkflowManager.class.php rename to htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index a123bd63842..4d9c5a42ac0 100755 --- a/htdocs/core/triggers/interface_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/triggers/interface_modWorkflow_WorkflowManager.class.php + * \file htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php * \ingroup core * \brief Trigger file for workflows */ @@ -33,12 +33,13 @@ class InterfaceWorkflowManager var $db; /** - * Constructor. - * @param DB Database handler + * Constructor + * + * @param DoliDB $db Database handler */ - function InterfaceWorkflowManager($DB) + function InterfaceWorkflowManager($db) { - $this->db = $DB ; + $this->db = $db; $this->name = preg_replace('/^Interface/i','',get_class($this)); $this->family = "core"; diff --git a/htdocs/core/triggers/interface_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php old mode 100644 new mode 100755 similarity index 99% rename from htdocs/core/triggers/interface_modAgenda_ActionsAuto.class.php rename to htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 2551fba0731..77d4755134e --- a/htdocs/core/triggers/interface_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/triggers/interface_modAgenda_ActionsAuto.class.php + * \file htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php * \ingroup agenda * \brief Trigger file for agenda module */ @@ -39,12 +39,13 @@ class InterfaceActionsAuto var $desc; /** - * Constructor. - * @param DB Database handler + * Constructor + * + * @param DoliDB $db Database handler */ - function InterfaceActionsAuto($DB) + function InterfaceActionsAuto($db) { - $this->db = $DB ; + $this->db = $db; $this->name = preg_replace('/^Interface/i','',get_class($this)); $this->family = "agenda"; diff --git a/htdocs/core/triggers/interface_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php old mode 100644 new mode 100755 similarity index 98% rename from htdocs/core/triggers/interface_modLdap_Ldapsynchro.class.php rename to htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 542150f217b..89595d96169 --- a/htdocs/core/triggers/interface_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/core/triggers/interface_modLdap_Ldapsynchro.class.php + * \file htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php * \ingroup core * \brief Fichier de gestion des triggers LDAP */ @@ -34,12 +34,13 @@ class InterfaceLdapsynchro /** - * Constructor. - * @param DB Database handler + * Constructor + * + * @param DoliDB $db Database handler */ - function InterfaceLdapsynchro($DB) + function InterfaceLdapsynchro($db) { - $this->db = $DB ; + $this->db = $db; $this->name = preg_replace('/^Interface/i','',get_class($this)); $this->family = "ldap"; diff --git a/htdocs/core/triggers/interface_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php old mode 100644 new mode 100755 similarity index 97% rename from htdocs/core/triggers/interface_modNotification_Notification.class.php rename to htdocs/core/triggers/interface_50_modNotification_Notification.class.php index eff1ded2345..d98c1ec0b93 --- a/htdocs/core/triggers/interface_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/triggers/interface_modNotification_Notification.class.php + * \file htdocs/core/triggers/interface_50_modNotification_Notification.class.php * \ingroup notification * \brief File of class of triggers for notification module */ @@ -34,12 +34,13 @@ class InterfaceNotification 'FICHEINTER_VALIDATE','ORDER_SUPPLIER_APPROVE','ORDER_SUPPLIER_REFUSE'); /** - * Constructor. - * @param DB Database handler + * Constructor + * + * @param DoliDB $db Database handler */ - function InterfaceNotification($DB) + function InterfaceNotification($db) { - $this->db = $DB ; + $this->db = $db; $this->name = preg_replace('/^Interface/i','',get_class($this)); $this->family = "notification"; diff --git a/htdocs/core/triggers/interface_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN old mode 100644 new mode 100755 similarity index 98% rename from htdocs/core/triggers/interface_all_Demo.class.php-NORUN rename to htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index 8c02ba961d2..7d28d98760f --- a/htdocs/core/triggers/interface_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -17,12 +17,12 @@ */ /** - * \file htdocs/core/triggers/interface_all_Demo.class.php + * \file htdocs/core/triggers/interface_90_all_Demo.class.php * \ingroup core * \brief Fichier de demo de personalisation des actions du workflow * \remarks Son propre fichier d'actions peut etre cree par recopie de celui-ci: - * - Le nom du fichier doit etre: interface_modMymodule_Mytrigger.class.php - * ou: interface_all_Mytrigger.class.php + * - Le nom du fichier doit etre: interface_99_modMymodule_Mytrigger.class.php + * ou: interface_99_all_Mytrigger.class.php * - Le fichier doit rester stocke dans core/triggers * - Le nom de la classe doit etre InterfaceMytrigger * - Le nom de la methode constructeur doit etre InterfaceMytrigger @@ -39,12 +39,13 @@ class InterfaceDemo var $db; /** - * Constructor. - * @param DB Database handler + * Constructor + * + * @param DoliDB $db Database handler */ - function InterfaceDemo($DB) + function InterfaceDemo($db) { - $this->db = $DB ; + $this->db = $db; $this->name = preg_replace('/^Interface/i','',get_class($this)); $this->family = "demo"; diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 7547616ca46..4ab066e0dc8 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -739,7 +739,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti // Info print '
'; $userstatic->id=$val['fk_user_c']; - $userstatic->nom=$val['login_c']; + $userstatic->lastname=$val['login_c']; $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].'
'; $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMSectionManual").'
'; $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$userstatic->getNomUrl(1).'
'; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index fa93422cec4..2593fac3984 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -850,7 +850,7 @@ else $head=shipping_prepare_head($object); dol_fiche_head($head, 'shipping', $langs->trans("Sending"), 0, 'sending'); - if ($mesg) print $mesg; + dol_htmloutput_mesg($mesg); /* * Confirmation de la suppression @@ -970,7 +970,7 @@ else // Date creation print '
'.$langs->trans("DateCreation").''.dol_print_date($object->date_creation,"daytext")."'.dol_print_date($object->date_creation,"day")."
'; $userstatic->id=$obj->rowid; - $userstatic->nom=$obj->name; - $userstatic->prenom=$obj->firstname; + $userstatic->lastname=$obj->name; + $userstatic->firstname=$obj->firstname; print $userstatic->getNomUrl(1); print '
'; @@ -483,7 +484,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; print ''.$langs->trans("Error").' '.$db->error()."
'.$langs->trans("Error").': '.$db->errno().' '.$db->error()."
'.$langs->trans("CustomCode").'
'.$langs->trans("CustomCode").'
'.$langs->trans("CustomCode").''.$object->customcode.'
\n"; print "\n"; -if ($mesg) print $mesg; + +dol_htmloutput_mesg($mesg); /* ************************************************************************** */ @@ -281,7 +282,7 @@ if ($mesg) print $mesg; /* */ /* ************************************************************************** */ -if ($action == 'delete') +if (! $action || $action == 'delete') { print "\n".'
'."\n"; @@ -531,5 +532,4 @@ else llxFooter(); $db->close(); - ?> diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 7b2c54fee8b..9c07675e474 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -121,7 +121,7 @@ if ($_GET["id"] || $_GET["ref"]) $sql.= ", ".MAIN_DB_PREFIX."commandedet as d"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND d.fk_commande = c.rowid"; $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 35ef2e9c310..bcaca43d05a 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -115,7 +115,7 @@ if ($_GET["id"] || $_GET["ref"]) $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseurdet as d"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND d.fk_commande = c.rowid"; $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 92786ff9516..0d483acfd2b 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -127,7 +127,7 @@ if ($_GET["id"] || $_GET["ref"]) $sql.= ", ".MAIN_DB_PREFIX."contratdet as cd"; $sql.= " WHERE c.rowid = cd.fk_contrat"; $sql.= " AND c.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND cd.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index dde6d04e2ab..209d6266ecc 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -124,7 +124,7 @@ if ($_GET["id"] || $_GET["ref"]) $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND d.fk_facture = f.rowid"; $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index bdaaf1e20da..eb92ae363e8 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -124,7 +124,7 @@ if ($_GET["id"] || $_GET["ref"]) $sql.= ", ".MAIN_DB_PREFIX."facture_fourn_det as d"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND d.fk_facture_fourn = f.rowid"; $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 170f786fda5..84180d01a62 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -118,7 +118,7 @@ if ($_GET["id"] || $_GET["ref"]) $sql.= ", ".MAIN_DB_PREFIX."propaldet as d"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND d.fk_propal = p.rowid"; $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index fc90693fa4f..8ba96764615 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -106,14 +106,14 @@ print ''; // Last movements $max=10; $sql = "SELECT p.rowid, p.label as produit,"; -$sql.= " s.label as stock, s.rowid as entrepot_id,"; +$sql.= " e.label as stock, e.rowid as entrepot_id,"; $sql.= " m.value, m.datem"; -$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as s"; +$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE m.fk_product = p.rowid"; -$sql.= " AND m.fk_entrepot = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND m.fk_entrepot = e.rowid"; +$sql.= " AND e.entity = ".$conf->entity; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0"; $sql.= $db->order("datem","DESC"); $sql.= $db->plimit($max,0); @@ -159,7 +159,8 @@ if ($resql) print ''; +llxFooter(); + $db->close(); -llxFooter(); ?> diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 1de22cd3e2c..24705f4069a 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -75,20 +75,20 @@ $form=new Form($db); $formother=new FormOther($db); $sql = "SELECT p.rowid, p.label as produit, p.fk_product_type as type,"; -$sql.= " s.label as stock, s.rowid as entrepot_id,"; +$sql.= " e.label as stock, e.rowid as entrepot_id,"; $sql.= " m.rowid as mid, m.value, m.datem, m.fk_user_author, m.label,"; $sql.= " u.login"; -$sql.= " FROM (".MAIN_DB_PREFIX."entrepot as s,"; +$sql.= " FROM (".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " ".MAIN_DB_PREFIX."stock_mouvement as m,"; $sql.= " ".MAIN_DB_PREFIX."product as p)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON m.fk_user_author = u.rowid"; $sql.= " WHERE m.fk_product = p.rowid"; -$sql.= " AND m.fk_entrepot = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND m.fk_entrepot = e.rowid"; +$sql.= " AND e.entity = ".$conf->entity; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0"; if ($_GET["id"]) { - $sql.= " AND s.rowid ='".$_GET["id"]."'"; + $sql.= " AND e.rowid ='".$_GET["id"]."'"; } if ($month > 0) { @@ -111,7 +111,7 @@ if (! empty($search_product)) } if (! empty($search_warehouse)) { - $sql.= " AND s.label LIKE '%".$db->escape($search_warehouse)."%'"; + $sql.= " AND e.label LIKE '%".$db->escape($search_warehouse)."%'"; } if (! empty($search_user)) { @@ -321,7 +321,7 @@ if ($resql) // Author print ''; $userstatic->id=$objp->fk_user_author; - $userstatic->nom=$objp->login; + $userstatic->lastname=$objp->login; print $userstatic->getNomUrl(1); print "\n"; // Value @@ -341,8 +341,8 @@ else dol_print_error($db); } +llxFooter(); $db->close(); -llxFooter(); ?> diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 24e4a7ab3b5..9409a9dc997 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -245,7 +245,7 @@ if ($id > 0 || ! empty($ref)) print ''; $var=!$var; - print ""; + print ""; print ''; print img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); @@ -327,14 +327,14 @@ if ($id > 0 || ! empty($ref)) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['nom']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['nom']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d60cd2fab74..87e35a9c8ba 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,15 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); -$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +$langs->load("users"); +$langs->load("projects"); + +$action = GETPOST('action', 'alpha'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$mode = GETPOST('mode', 'alpha'); +$mine = ($mode == 'mine' ? 1 : 0); //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects // Security check @@ -39,20 +47,20 @@ if ($user->societe_id > 0) $socid = $user->societe_id; //$result = restrictedArea($user, 'projet', $projectid); if (!$user->rights->projet->lire) accessforbidden(); -$langs->load("users"); -$langs->load("projects"); - -$progress=GETPOST('progress'); -$description=GETPOST('description'); +$progress=GETPOST('progress', 'int'); +$label=GETPOST('label', 'alpha'); +$description=GETPOST('description', 'alpha'); $userAccess=0; +$object = new Project($db); + /* * Actions */ -if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) +if ($action == 'createtask' && $user->rights->projet->creer) { $error=0; @@ -61,16 +69,16 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) if (empty($_POST["cancel"])) { - if (empty($_POST['label'])) + if (empty($label)) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); - $_GET["action"]='create'; + $action='create'; $error++; } else if (empty($_POST['task_parent'])) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("ChildOfTask")); - $_GET["action"]='create'; + $action='create'; $error++; } @@ -78,20 +86,20 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) { $tmparray=explode('_',$_POST['task_parent']); $projectid=$tmparray[0]; - if (empty($projectid)) $projectid = $_POST["id"]; // If projectid is '' + if (empty($projectid)) $projectid = $id; // If projectid is '' $task_parent=$tmparray[1]; if (empty($task_parent)) $task_parent = 0; // If task_parent is '' $task = new Task($db); $task->fk_project = $projectid; - $task->label = $_POST["label"]; - $task->description = $_POST['description']; + $task->label = $label; + $task->description = $description; $task->fk_task_parent = $task_parent; $task->date_c = dol_now(); $task->date_start = $date_start; $task->date_end = $date_end; - $task->progress = $_POST['progress']; + $task->progress = $progress; $taskid = $task->create($user); @@ -105,7 +113,7 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) { if (empty($projectid)) { - Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($_REQUEST["mode"])?'':'?mode='.$_REQUEST["mode"])); + Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($mode)?'':'?mode='.$mode)); exit; } else @@ -117,10 +125,10 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) } else { - if (empty($_GET["id"]) && empty($_POST["id"])) + if (empty($id)) { // We go back on task list - Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($_REQUEST["mode"])?'':'?mode='.$_REQUEST["mode"])); + Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($mode)?'':'?mode='.$mode)); exit; } } @@ -132,27 +140,21 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) $form=new Form($db); $formother=new FormOther($db); -$projectstatic = new Project($db); $taskstatic = new Task($db); $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("",$langs->trans("Tasks"),$help_url); -$task = new Task($db); - -$id = (! empty($_GET['id']))?$_GET['id']:$_POST['id']; -$ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) { - $project = new Project($db); - $project->fetch($_REQUEST["id"],$_GET["ref"]); - if ($project->societe->id > 0) $result=$project->societe->fetch($project->societe->id); + $object->fetch($id, $ref); + if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id); // To verify role of users - $userAccess = $project->restrictedProjectArea($user); + $userAccess = $object->restrictedProjectArea($user); } -if ($_GET["action"] == 'create' && $user->rights->projet->creer && (empty($project->societe->id) || $userAccess)) +if ($action == 'create' && $user->rights->projet->creer && (empty($object->societe->id) || $userAccess)) { print_fiche_titre($langs->trans("NewTask")); @@ -161,18 +163,18 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer && (empty($proje print '
'; print ''; print ''; - if ($_GET['id']) print ''; - if ($_GET['mode']) print ''; + if (! empty($object->id)) print ''; + if (! empty($mode)) print ''; print ''; print ''; // List of projects print ''; print '
'.$langs->trans("Label").''; - print ''; + print ''; print '
'.$langs->trans("ChildOfTask").''; - print $formother->selectProjectTasks('',$projectid?$projectid:$_GET["id"], 'task_parent', 0, 0, 1, 1); + print $formother->selectProjectTasks('',$projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1); print '
'.$langs->trans("AffectedTo").''; @@ -220,10 +222,10 @@ else $tab='tasks'; - $head=project_prepare_head($project); - dol_fiche_head($head, $tab, $langs->trans("Project"),0,($project->public?'projectpub':'project')); + $head=project_prepare_head($object); + dol_fiche_head($head, $tab, $langs->trans("Project"),0,($object->public?'projectpub':'project')); - $param=($_REQUEST["mode"]=='mine'?'&mode=mine':''); + $param=($mode=='mine'?'&mode=mine':''); print ''; @@ -232,27 +234,27 @@ else print $langs->trans("Ref"); print ''; - print ''; + print ''; print ''; print ''; // Visibility print ''; // Statut - print ''; + print ''; print '
'; // Define a complementary filter for search of next/prev ref. - $projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); - $project->next_prev_filter=" rowid in (".$projectsListId.")"; - print $form->showrefnav($project,'ref','',1,'ref','ref','',$param); + $projectsListId = $object->getProjectsAuthorizedForUser($user,$mine,1); + $object->next_prev_filter=" rowid in (".$projectsListId.")"; + print $form->showrefnav($object,'ref','',1,'ref','ref','',$param); print '
'.$langs->trans("Label").''.$project->title.'
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("Company").''; - if (! empty($project->societe->id)) print $project->societe->getNomUrl(1); + if (! empty($object->societe->id)) print $object->societe->getNomUrl(1); else print ' '; print '
'.$langs->trans("Visibility").''; - if ($project->public) print $langs->trans('SharedProject'); + if ($object->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
'.$langs->trans("Status").''.$project->getLibStatut(4).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; @@ -265,9 +267,9 @@ else if ($user->rights->projet->all->creer || $user->rights->projet->creer) { - if ($project->public || $userAccess) + if ($object->public || $userAccess) { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } else { @@ -286,9 +288,9 @@ else // Link to switch in "my task" / "all task" print '
'; - if ($_REQUEST["mode"] == 'mine') + if ($mode == 'mine') { - print ''.$langs->trans("DoNotShowMyTasksOnly").''; + print ''.$langs->trans("DoNotShowMyTasksOnly").''; //print ' - '; //print $langs->trans("ShowMyTaskOnly"); } @@ -296,22 +298,22 @@ else { //print $langs->trans("DoNotShowMyTaskOnly"); //print ' - '; - print ''.$langs->trans("ShowMyTasksOnly").''; + print ''.$langs->trans("ShowMyTasksOnly").''; } print '
'; // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user // can have a parent that is not affected to him). - $tasksarray=$task->getTasksArray(0, 0, $project->id, $socid, 0); + $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $socid, 0); // We load also tasks limited to a particular user - $tasksrole=($_REQUEST["mode"]=='mine' ? $task->getUserRolesForProjectsOrTasks(0,$user,$project->id,0) : ''); + $tasksrole=($mode=='mine' ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$object->id,0) : ''); //var_dump($tasksarray); //var_dump($tasksrole); print ''; print ''; - if ($projectstatic->id) print ''; + if (! empty($object->id)) print ''; print ''; print ''; print ''; @@ -325,14 +327,14 @@ else } else { - print ''; + print ''; } print "
'.$langs->trans("Project").''.$langs->trans("Project").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("Progress").'
'.$langs->trans("NoTasks").'
'.$langs->trans("NoTasks").'
"; // Test if database is clean. If not we clean it. //print 'mode='.$_REQUEST["mode"].' $nboftaskshown='.$nboftaskshown.' count($tasksarray)='.count($tasksarray).' count($tasksrole)='.count($tasksrole).'
'; - if ($_REQUEST["mode"]=='mine') + if ($mode=='mine') { if ($nboftaskshown < count($tasksrole)) clean_orphelins($db); } @@ -342,7 +344,8 @@ else } } +llxFooter(); + $db->close(); -llxFooter(); ?> diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index e800599a70e..26934f1c767 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -328,14 +328,14 @@ if ($id > 0 || ! empty($ref)) if ($tab[$i]['source']=='internal') { $userstatic->id=$tab[$i]['id']; - $userstatic->nom=$tab[$i]['nom']; - $userstatic->prenom=$tab[$i]['firstname']; + $userstatic->lastname=$tab[$i]['lastname']; + $userstatic->firstname=$tab[$i]['firstname']; print $userstatic->getNomUrl(1); } if ($tab[$i]['source']=='external') { $contactstatic->id=$tab[$i]['id']; - $contactstatic->name=$tab[$i]['nom']; + $contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->firstname=$tab[$i]['firstname']; print $contactstatic->getNomUrl(1); } diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index b009c9694b0..13987f7a05c 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -37,31 +37,47 @@ $langs->load("other"); global $dolibarr_main_demo; if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page',1,1,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->callHooks(array('demo')); $demoprofiles=array( array('default'=>'-1', 'key'=>'profdemofun','label'=>'DemoFundation', - 'disablemodules'=>'banque,barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,prelevement,product,projet,propal,propale,service,societe,stock,tax', + 'disablemodules'=>'banque,barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,mailmanspip,prelevement,product,projet,propal,propale,service,societe,stock,tax', 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png'), array('default'=>'0', 'key'=>'profdemofun2','label'=>'DemoFundation2', - 'disablemodules'=>'barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,prelevement,product,projet,propal,propale,service,societe,stock,tax', + 'disablemodules'=>'barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,mailmanspip,prelevement,product,projet,propal,propale,service,societe,stock,tax', 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png'), array('default'=>'1', 'key'=>'profdemoservonly','label'=>'DemoCompanyServiceOnly', - 'disablemodules'=>'adherent,barcode,boutique,cashdesk,categorie,don,expedition,externalsite,prelevement,product,stock', + 'disablemodules'=>'adherent,barcode,boutique,cashdesk,categorie,don,expedition,externalsite,mailmanspip,prelevement,product,stock', 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot8.png'), array('default'=>'-1','key'=>'profdemoshopwithdesk','label'=>'DemoCompanyShopWithCashDesk', - 'disablemodules'=>'adherent,boutique,categorie,don,externalsite,ficheinter,prelevement,product,stock', + 'disablemodules'=>'adherent,boutique,categorie,don,externalsite,ficheinter,mailmanspip,prelevement,product,stock', 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png'), array('default'=>'0', 'key'=>'profdemoprodstock','label'=>'DemoCompanyProductAndStocks', - 'disablemodules'=>'adherent,boutique,contrat,categorie,don,externalsite,ficheinter,prelevement,service', + 'disablemodules'=>'adherent,boutique,contrat,categorie,don,externalsite,ficheinter,mailmanspip,prelevement,service', 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png'), array('default'=>'0', 'key'=>'profdemoall','label'=>'DemoCompanyAll', - 'disablemodules'=>'adherent,boutique,don,externalsite', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'), + 'disablemodules'=>'adherent,boutique,don,externalsite,mailmanspip', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png') ); + +$tmpaction = 'view'; +$parameters=array(); +$object=(object) 'nothing'; +$reshook=$hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks +$error=$hookmanager->error; $errors=$hookmanager->errors; +/* +$demoprofiles[]=array('default'=>'0', 'key'=>'profdemomed', 'lang'=>'cabinetmed@cabinetmed', 'label'=>'DemoCabinetMed', 'url'=>'http://demodolimed.dolibarr.org', + 'disablemodules'=>'adherent,boutique,don,externalsite', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png'); +*/ + $alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want $alwaysuncheckedmodules=array('paybox','paypal','filemanager','google','scanner','workflow'); // Module we never want -$alwayshiddenmodules=array('accounting','barcode','bookmark','boutique','clicktodial','document','domain','externalrss','externalsite','fckeditor','ftp','geoipmaxmind','gravatar','label','ldap','mantis','memcached','notification', +$alwayshiddenmodules=array('accounting','barcode','bookmark','boutique','clicktodial','document','domain','externalrss','externalsite','fckeditor','ftp','geoipmaxmind','gravatar','label','ldap','mailmanspip','mantis','memcached','notification', 'syslog','user','webservices', // Extended modules 'awstats','bittorrent','cabinetmed','concatpdf','filemanager','monitoring','nltechno','numberwords','ovh','phenix','phpsysinfo','postnuke','submiteverywhere', @@ -226,66 +242,72 @@ print '
'; print ''."\n"; $i=0; -foreach ($demoprofiles as $profilarray) +foreach ($demoprofiles as $profilearray) { - if ($profilarray['default'] >= 0) + if ($profilearray['default'] >= 0) { + //print $profilearray['lang']; + if (! empty($profilearray['lang'])) $langs->load($profilearray['lang']); + $url=$_SERVER["PHP_SELF"].'?action=gotodemo&urlfrom='.urlencode($_SERVER["PHP_SELF"]); - $urlwithmod=$url.'&demochoice='.$profilarray['key']; + $urlwithmod=$url.'&demochoice='.$profilearray['key']; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' //print "xx".$_SERVER["PHP_SELF"].' '.DOL_URL_ROOT.'
'; $urlfrom=preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/i','',$_SERVER["PHP_SELF"]); //print $urlfrom; + if (! empty($profilearray['url'])) $urlwithmod=$profilearray['url']; //if ($i % $NBOFCOLS == 0) print ''; print ''; print ''; @@ -365,9 +387,36 @@ function llxHeaderVierge($title, $head = "") print ''."\n"; print ''."\n"; if ($head) print $head."\n"; - print ''; print "\n"; print ''."\n"; diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index a1b73fdc711..307ee163c9e 100755 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -208,7 +208,7 @@ if ($_GET["attrname"] && $action == 'edit') } -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index b8264ea29cd..1127542dc78 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -61,7 +61,7 @@ if (GETPOST('newcompany') || GETPOST('socid') || GETPOST('id_fourn')) $sql = "SELECT rowid, nom"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.entity = ".$conf->entity; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; if ($socid) { $sql.=" AND ("; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index be165ef3b24..ff0696f237b 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -603,8 +603,8 @@ abstract class ActionsCardCommon foreach($listsalesrepresentatives as $val) { $userstatic->id=$val['id']; - $userstatic->nom=$val['name']; - $userstatic->prenom=$val['firstname']; + $userstatic->lastname=$val['name']; + $userstatic->firstname=$val['firstname']; $this->tpl['sales_representatives'].= $userstatic->getNomUrl(1); $i++; if ($i < $nbofsalesrepresentative) $this->tpl['sales_representatives'].= ', '; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 95916e06388..ad2d55d0c1b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -650,13 +650,13 @@ class Societe extends CommonObject $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id'; if ($rowid) $sql .= ' WHERE s.rowid = '.$rowid; - if ($ref) $sql .= " WHERE s.nom = '".$this->db->escape($ref)."' AND s.entity = ".$conf->entity; - if ($ref_ext) $sql .= " WHERE s.ref_ext = '".$this->db->escape($ref_ext)."' AND s.entity = ".$conf->entity; - if ($ref_int) $sql .= " WHERE s.ref_int = '".$this->db->escape($ref_int)."' AND s.entity = ".$conf->entity; - if ($idprof1) $sql .= " WHERE s.siren = '".$this->db->escape($idprof1)."' AND s.entity = ".$conf->entity; - if ($idprof2) $sql .= " WHERE s.siret = '".$this->db->escape($idprof2)."' AND s.entity = ".$conf->entity; - if ($idprof3) $sql .= " WHERE s.ape = '".$this->db->escape($idprof3)."' AND s.entity = ".$conf->entity; - if ($idprof4) $sql .= " WHERE s.idprof4 = '".$this->db->escape($idprof4)."' AND s.entity = ".$conf->entity; + if ($ref) $sql .= " WHERE s.nom = '".$this->db->escape($ref)."' AND s.entity IN (".getEntity($this->element, 1).")"; + if ($ref_ext) $sql .= " WHERE s.ref_ext = '".$this->db->escape($ref_ext)."' AND s.entity IN (".getEntity($this->element, 1).")"; + if ($ref_int) $sql .= " WHERE s.ref_int = '".$this->db->escape($ref_int)."' AND s.entity IN (".getEntity($this->element, 1).")"; + if ($idprof1) $sql .= " WHERE s.siren = '".$this->db->escape($idprof1)."' AND s.entity IN (".getEntity($this->element, 1).")"; + if ($idprof2) $sql .= " WHERE s.siret = '".$this->db->escape($idprof2)."' AND s.entity IN (".getEntity($this->element, 1).")"; + if ($idprof3) $sql .= " WHERE s.ape = '".$this->db->escape($idprof3)."' AND s.entity IN (".getEntity($this->element, 1).")"; + if ($idprof4) $sql .= " WHERE s.idprof4 = '".$this->db->escape($idprof4)."' AND s.entity IN (".getEntity($this->element, 1).")"; $resql=$this->db->query($sql); dol_syslog(get_class($this)."::fetch ".$sql); @@ -678,7 +678,7 @@ class Societe extends CommonObject $this->ref = $obj->rowid; $this->name = $obj->name; - $this->nom = $obj->name; // TODO obsolete + $this->nom = $obj->name; // deprecated $this->ref_ext = $obj->ref_ext; $this->ref_int = $obj->ref_int; @@ -1333,6 +1333,8 @@ class Societe extends CommonObject { global $conf,$langs; + $name=$this->name?$this->name:$this->nom; + $result=''; $lien=$lienfin=''; @@ -1365,8 +1367,6 @@ class Societe extends CommonObject $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'">'; $lienfin=''; - $name=$this->name?$this->name:$this->nom; - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin; diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php index 4b52f35ac13..6ae5d7fb4dc 100644 --- a/htdocs/societe/lien.php +++ b/htdocs/societe/lien.php @@ -239,7 +239,7 @@ if ($socid) $sql.= ", ".MAIN_DB_PREFIX."c_typent as te"; if (! $user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_typent = te.id"; - $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (! $user->rights->societe->client->voir) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (dol_strlen(trim($_GET["search_nom"]))) $sql.= " AND s.nom LIKE '%".$_GET["search_nom"]."%'"; $sql.= $db->order("s.nom","ASC"); diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php index e931b35d570..18ce7e898a7 100644 --- a/htdocs/societe/notify/fiche.php +++ b/htdocs/societe/notify/fiche.php @@ -26,7 +26,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/triggers/interface_modNotification_Notification.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/triggers/interface_50_modNotification_Notification.class.php"); $langs->load("companies"); $langs->load("mails"); diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index f0944e5d930..42aad61b93b 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -65,7 +65,7 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE n.fk_contact = c.rowid"; $sql.= " AND a.rowid = n.fk_action"; $sql.= " AND n.fk_soc = s.rowid"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if ($socid > 0) $sql.= " AND s.rowid = " . $user->societe_id; $sql.= $db->order($sortfield,$sortorder); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 14fecace66e..6060fc0f06a 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1802,8 +1802,8 @@ else foreach($listsalesrepresentatives as $val) { $userstatic->id=$val['id']; - $userstatic->nom=$val['name']; - $userstatic->prenom=$val['firstname']; + $userstatic->lastname=$val['name']; + $userstatic->firstname=$val['firstname']; print $userstatic->getNomUrl(1); $i++; if ($i < $nbofsalesrepresentative) print ', '; diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 3de7fe71666..99f456cdd73 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,13 +75,13 @@ if ($mode == 'search') if ($search_sale || !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We'll need this table joined to the select in order to filter by categ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE ("; - $sql.= " s.nom like '%".$db->escape($socname)."%'"; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; + $sql.= " AND ("; + $sql.= " s.nom LIKE '%".$db->escape($socname)."%'"; $sql.= " OR s.code_client LIKE '%".$db->escape($socname)."%'"; - $sql.= " OR s.email like '%".$db->escape($socname)."%'"; - $sql.= " OR s.url like '%".$db->escape($socname)."%'"; + $sql.= " OR s.email LIKE '%".$db->escape($socname)."%'"; + $sql.= " OR s.url LIKE '%".$db->escape($socname)."%'"; $sql.= ")"; - $sql.= " AND s.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale @@ -175,7 +175,7 @@ if ($search_sale || !$user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_P // We'll need this table joined to the select in order to filter by categ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND s.entity = ".$conf->entity; +$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale @@ -204,8 +204,8 @@ if ($search_all) $sql.= " AND ("; $sql.= "s.nom LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.code_client LIKE '%".$db->escape($search_all)."%'"; - $sql.= " OR s.email like '%".$db->escape($search_all)."%'"; - $sql.= " OR s.url like '%".$db->escape($search_all)."%'"; + $sql.= " OR s.email LIKE '%".$db->escape($search_all)."%'"; + $sql.= " OR s.url LIKE '%".$db->escape($search_all)."%'"; $sql.= ")"; } if ($search_nom) @@ -213,8 +213,8 @@ if ($search_nom) $sql.= " AND ("; $sql.= "s.nom LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.code_client LIKE '%".$db->escape($search_nom)."%'"; - $sql.= " OR s.email like '%".$db->escape($search_nom)."%'"; - $sql.= " OR s.url like '%".$db->escape($search_nom)."%'"; + $sql.= " OR s.email LIKE '%".$db->escape($search_nom)."%'"; + $sql.= " OR s.url LIKE '%".$db->escape($search_nom)."%'"; $sql.= ")"; } @@ -417,7 +417,8 @@ else dol_print_error($db); } +llxFooter(); + $db->close(); -llxFooter(); ?> diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index d07f3e1f852..a8a6a0c1ffb 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -19,8 +19,9 @@ */ /** - * \file htdocs/support/inc.php - * \brief File that define environment for support pages + * \file htdocs/support/inc.php + * \ingroup core + * \brief File that define environment for support pages */ define('DOL_VERSION','3.2.0-alpha'); // Also defined in htdocs/master.inc.php @@ -49,27 +50,26 @@ if (isset($_SERVER["DOCUMENT_URI"]) && $_SERVER["DOCUMENT_URI"]) } -// Definition des constantes syslog -if (function_exists("define_syslog_variables")) +// Define syslog constants +if (! defined('LOG_DEBUG')) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) - { - define_syslog_variables(); // Deprecated since php 5.3.0, syslog variables no longer need to be initialized - } + if (function_exists("define_syslog_variables")) + { + define_syslog_variables(); // Deprecated since php 5.3.0, syslog variables no longer need to be initialized + } + else + { + // Pour PHP sans syslog (comme sous Windows) + define('LOG_EMERG',0); + define('LOG_ALERT',1); + define('LOG_CRIT',2); + define('LOG_ERR',3); + define('LOG_WARNING',4); + define('LOG_NOTICE',5); + define('LOG_INFO',6); + define('LOG_DEBUG',7); + } } -else -{ - // Pour PHP sans syslog (comme sous Windows) - define('LOG_EMERG',0); - define('LOG_ALERT',1); - define('LOG_CRIT',2); - define('LOG_ERR',3); - define('LOG_WARNING',4); - define('LOG_NOTICE',5); - define('LOG_INFO',6); - define('LOG_DEBUG',7); -} - $includeconferror=''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 8735efe5fdc..9681c41e3e3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -136,6 +136,13 @@ $colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( $colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); $colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); +// Set text color to black or white +$tmppart=explode(',',$colorback1); +$tmpval=$tmppart[1]+$tmppart[2]+$tmppart[3]; +//print $tmpval; +if ($tmpval < 340) $colortextmain='FFFFFF'; +else $colortextmain='101010'; + print '/*'."\n"; print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; @@ -379,27 +386,28 @@ a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudis a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { font-weight: normal; - color: #234046; padding: 0px 5px 0px 5px; margin: 0px 1px 2px 1px; white-space: nowrap; - text-shadow: 1px 2px 3px #AFAFAF; + text-shadow: 1px 2px 4px #BFBFBF; +} +a.tmenu:link, a.tmenu:visited { + color: #; } a.tmenu:hover, a.tmenu:active { + color: #233030; margin: 0px 0px 0px 0px; border-: 1px solid #555555; border-: 1px solid #D8D8D8; border-top: 1px solid #D8D8D8; border-bottom: 2px solid #F4F4F4; -} -a.tmenu:hover, a.tmenu:active { background: #F4F4F4; - text-shadow: 1px 2px 3px #AFAFAF; + text-shadow: 1px 2px 4px #BFBFBF; } a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active { font-weight: normal; - color: #234046; + color: #233030; padding: 0px 5px 0px 5px; margin: 0px 0px 0px 0px; background: #F4F4F4; @@ -408,7 +416,7 @@ a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active { border-: 1px solid #D8D8D8; border-bottom: 2px solid #F4F4F4; white-space: nowrap; - text-shadow: 1px 2px 3px #AFAFAF; + text-shadow: 1px 2px 4px #BFBFBF; } @@ -629,7 +637,7 @@ div.login { font-weight: bold; } div.login a { - color: #234046; + color: #233030; } div.login a:hover { color: black; @@ -666,9 +674,11 @@ td.vmenu { a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:px; font-family: ; text-align: ; font-weight: bold; } font.vmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #93a5aa; } +a.vmenu:link, a.vmenu:visited { color: #; } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 6px; } font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #93a5aa; margin: 1px 1px 1px 6px; } +a.vsmenu:link, a.vsmenu:visited { color: #; } a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #666666; } @@ -1059,7 +1069,7 @@ div.tabs { } div.tabBar { - color: #234046; + color: #; padding-top: 9px; padding-left: 8px; padding-right: 8px; @@ -1106,7 +1116,6 @@ a.tabTitle { a.tab:link { background: #dee7ec; - color: #434956; font-family: ; padding: 0px 6px; margin: 0em 0.2em; @@ -1130,7 +1139,6 @@ background-image: -ms-linear-gradient(bottom, rgb() } a.tab:visited { background: #dee7ec; - color: #434956; font-family: ; padding: 0px 6px; margin: 0em 0.2em; @@ -1155,7 +1163,6 @@ background-image: -ms-linear-gradient(bottom, rgb() a.tab#active { background: white; font-family: ; - color: #434956; padding: 0px 6px; margin: 0em 0.2em; text-decoration: none; @@ -1180,7 +1187,6 @@ background-image: -ms-linear-gradient(bottom, rgb() } a.tab:hover { background: white; - color: #434956; font-family: ; padding: 0px 6px; margin: 0em 0.2em; @@ -1201,6 +1207,11 @@ background-image: -webkit-linear-gradient(bottom, rgb() 35%, rgb() 100%); } +a.tab:link, a.tab:visited, a.tab#active, a.tab:hover +{ + color: #; +} + a.tabimage { color: #434956; font-family: ; @@ -1309,8 +1320,8 @@ span.butAction, span.butActionDelete { } .nocellnopadd { list-style-type:none; -margin: 0px; -padding: 0px; +margin: 0px !important; +padding: 0px !important; } .notopnoleft { @@ -1455,7 +1466,7 @@ background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); - color: #234046; + color: #; font-family: ; font-weight: normal; border-bottom: 1px solid #FDFFFF; @@ -1510,6 +1521,7 @@ background: -ms-linear-gradient(bottom, rgb( font-family: ; border: 0px; margin-bottom: 1px; +color: #202020; } /* .impair:hover { @@ -1532,6 +1544,7 @@ background: -ms-linear-gradient(bottom, rgb() font-family: ; border: 0px; margin-bottom: 1px; +color: #202020; } /* .pair:hover { @@ -1570,7 +1583,7 @@ background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-repeat: repeat-x; -color: #334444; +color: #; font-family: , sans-serif; font-weight: normal; border-bottom: 1px solid #FDFFFF; @@ -1693,7 +1706,7 @@ div.titre { font-weight: bold; color: rgb(); text-decoration: none; - text-shadow: 1px 2px 3px #AFAFAF; + text-shadow: 2px 2px 4px #BFBFBF; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4cd8677cc74..f2ee406311e 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1705,45 +1705,6 @@ class User extends CommonObject return $result; } - /** - * Return full name (civility+' '+name+' '+lastname) - * - * @param Translate $langs Language object for translation of civility - * @param int $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname - * @return string String with full name - */ - function getFullName($langs,$option=0,$nameorder=-1) - { - global $conf; - - $ret=''; - if ($option && $this->civilite_id) - { - if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; - else $ret.=$this->civilite_id.' '; - } - - // If order not defined, we use the setup - if ($nameorder < 0) $nameorder=empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?1:0; - - if ($nameorder) - { - if ($this->firstname) $ret.=$this->firstname; - if ($this->firstname && $this->lastname) $ret.=' '; - if ($this->lastname) $ret.=$this->lastname; - } - else - { - if ($this->lastname) $ret.=$this->lastname; - if ($this->firstname && $this->lastname) $ret.=' '; - if ($this->firstname) $ret.=$this->firstname; - } - - return trim($ret); - } - - /** * Retourne le libelle du statut d'un user (actif, inactif) * diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index a1b95bec331..9162dc04e39 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -75,7 +75,7 @@ class UserGroup extends CommonObject $this->id = $id; - $sql = "SELECT g.rowid, g.entity, g.nom, g.note, g.datec, g.tms as datem"; + $sql = "SELECT g.rowid, g.entity, g.nom as name, g.note, g.datec, g.tms as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql.= " WHERE g.rowid = ".$this->id; @@ -90,7 +90,8 @@ class UserGroup extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->entity = $obj->entity; - $this->nom = $obj->nom; + $this->nom = $obj->name; // depecated + $this->name = $obj->name; $this->note = $obj->note; $this->datec = $obj->datec; $this->datem = $obj->datem; @@ -106,7 +107,7 @@ class UserGroup extends CommonObject else { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::Fetch ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; } } diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php index 613f4b52495..bdef2e43d40 100644 --- a/scripts/company/export-contacts-xls-example.php +++ b/scripts/company/export-contacts-xls-example.php @@ -70,7 +70,7 @@ $objPHPExcel->getActiveSheet()->setTitle('Contacts'); //$page->set_column(0,4,18); // A -$sql = "SELECT distinct c.name, c.firstname, c.email, s.nom"; +$sql = "SELECT distinct c.name as lastname, c.firstname, c.email, s.nom as name"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = c.fk_soc"; @@ -84,27 +84,19 @@ if ($resql) $i = 0; $j = 1; - //$page->write_string(0, 0, $langs->trans("ThirdParty")); $objPHPExcel->getActiveSheet()->SetCellValue('A1', $langs->trans("Firstname")); - //$page->write_string(0, 1, $langs->trans("Firstname")); $objPHPExcel->getActiveSheet()->SetCellValue('B1', $langs->trans("Lastname")); - //$page->write_string(0, 2, $langs->trans("Lastname")); $objPHPExcel->getActiveSheet()->SetCellValue('C1', $langs->trans("Email")); - //$page->write_string(0, 3, $langs->trans("Email")); $objPHPExcel->getActiveSheet()->SetCellValue('D1', $langs->trans("ThirdPart")); while ($i < $num) { $obj = $db->fetch_object($resql); - //$page->write_string($j, 0, $obj->nom); $objPHPExcel->getActiveSheet()->SetCellValue('A'.($i+2), $obj->firstname); - //$page->write_string($j, 1, $obj->firstname); - $objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+2), $obj->name); - //$page->write_string($j, 2, $obj->name); + $objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+2), $obj->lastname); $objPHPExcel->getActiveSheet()->SetCellValue('C'.($i+2), $obj->email); - //$page->write_string($j, 3, $obj->email); - $objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+2), $obj->nom); + $objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+2), $obj->name); $j++; $i++; diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 9a456a73767..aaf966eb3dc 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -93,7 +93,7 @@ $nbok=0; $nbko=0; // On choisit les mails non deja envoyes pour ce mailing (statut=0) // ou envoyes en erreur (statut=-1) -$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type"; +$sql = "SELECT mc.rowid, mc.nom as lastname, mc.prenom as firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id; @@ -123,7 +123,7 @@ if ($resql) $obj = $db->fetch_object($resql); // sendto en RFC2822 - $sendto = str_replace(',',' ',$obj->prenom." ".$obj->nom) ." <".$obj->email.">"; + $sendto = str_replace(',',' ',$obj->firstname." ".$obj->lastname) ." <".$obj->email.">"; // Make subtsitutions on topic and body $other=explode(';',$obj->other); @@ -135,8 +135,8 @@ if ($resql) $substitutionarray=array( '__ID__' => $obj->source_id, '__EMAIL__' => $obj->email, - '__LASTNAME__' => $obj->nom, - '__FIRSTNAME__' => $obj->prenom, + '__LASTNAME__' => $obj->lastname, + '__FIRSTNAME__' => $obj->firstname, '__OTHER1__' => $other1, '__OTHER2__' => $other2, '__OTHER3__' => $other3, diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index ea7ad071599..5007e69b5a6 100644 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -47,7 +47,7 @@ require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); $error = 0; -$sql = "SELECT f.facnumber, f.total_ttc, s.nom, u.name, u.firstname, u.email"; +$sql = "SELECT f.facnumber, f.total_ttc, s.nom as name, u.name, u.firstname, u.email"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -85,7 +85,7 @@ if ($resql) $total = 0; } - $message .= "Facture ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->nom."\n"; + $message .= "Facture ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n"; $total += $obj->total_ttc; dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email); diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 37a7898527e..b54d3f1a33e 100644 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -181,23 +181,25 @@ if ($result >= 0) $member = new Adherent($db); // Propriete membre - $member->prenom=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; - $member->nom=$ldapuser[$conf->global->LDAP_FIELD_NAME]; + $member->prenom=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; // deprecated + $member->nom=$ldapuser[$conf->global->LDAP_FIELD_NAME]; // deprecated + $member->firstname=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; + $member->lastname=$ldapuser[$conf->global->LDAP_FIELD_NAME]; $member->login=$ldapuser[$conf->global->LDAP_FIELD_LOGIN]; $member->pass=$ldapuser[$conf->global->LDAP_FIELD_PASSWORD]; //$member->societe; - $member->adresse=$ldapuser[$conf->global->LDAP_FIELD_ADDRESS]; // TODO obsolete + $member->adresse=$ldapuser[$conf->global->LDAP_FIELD_ADDRESS]; // deprecated $member->address=$ldapuser[$conf->global->LDAP_FIELD_ADDRESS]; - $member->cp=$ldapuser[$conf->global->LDAP_FIELD_ZIP]; // TODO obsolete + $member->cp=$ldapuser[$conf->global->LDAP_FIELD_ZIP]; // deprecated $member->zip=$ldapuser[$conf->global->LDAP_FIELD_ZIP]; - $member->ville=$ldapuser[$conf->global->LDAP_FIELD_TOWN]; // TODO obsolete + $member->ville=$ldapuser[$conf->global->LDAP_FIELD_TOWN]; // deprecated $member->town=$ldapuser[$conf->global->LDAP_FIELD_TOWN]; - $member->pays=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; // TODO obsolete + $member->pays=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; // deprecated $member->country=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; - $member->pays_id=$countries[$hashlib2rowid[strtolower($member->country)]]['rowid']; // TODO obsolete + $member->pays_id=$countries[$hashlib2rowid[strtolower($member->country)]]['rowid']; // deprecated $member->country_id=$countries[$hashlib2rowid[strtolower($member->country)]]['rowid']; - $member->pays_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; // TODO obsolete + $member->pays_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; // deprecated $member->country_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; $member->phone=$ldapuser[$conf->global->LDAP_FIELD_PHONE]; diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php index 8eaa5051894..0deafa514e9 100644 --- a/scripts/user/sync_groups_dolibarr2ldap.php +++ b/scripts/user/sync_groups_dolibarr2ldap.php @@ -82,7 +82,7 @@ if ($resql) $fgroup->id = $obj->rowid; $fgroup->fetch($fgroup->id); - print $langs->trans("UpdateGroup")." rowid=".$fgroup->id." ".$fgroup->nom; + print $langs->trans("UpdateGroup")." rowid=".$fgroup->id." ".$fgroup->name; $oldobject=$fgroup; diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index bd2a80350a8..238ddd48351 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -40,8 +40,8 @@ require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/doc/pdf_crabe require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/doc/pdf_oursin.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/doc/pdf_azur.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/doc/pdf_jaune.modules.php'; -require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/pdf_edison.modules.php'; -require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/pdf_einstein.modules.php'; +require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/doc/pdf_edison.modules.php'; +require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/doc/pdf_einstein.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/project/pdf/pdf_baleine.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php'; diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index ea26e4f528a..fccf9e2a3cb 100755 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -139,6 +139,11 @@ class CMailFileTest extends PHPUnit_Framework_TestCase $localobject=new CMailFile('','','',''); + $src='John Doe '; + $result=$localobject->getValidAddress($src,0); + print __METHOD__." result=".$result."\n"; + $this->assertEquals($result,'John Doe '); + $src='John Doe '; $result=$localobject->getValidAddress($src,1); print __METHOD__." result=".$result."\n"; @@ -149,6 +154,16 @@ class CMailFileTest extends PHPUnit_Framework_TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals($result,'john@doe.com'); + $src='John Doe '; + $result=$localobject->getValidAddress($src,3,0); + print __METHOD__." result=".$result."\n"; + $this->assertEquals($result,'"John Doe" '); + + $src='John Doe '; + $result=$localobject->getValidAddress($src,3,1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals($result,'"=?UTF-8?B?Sm9obiBEb2U=?=" '); + return $result; } diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 40c6dc3cc20..7e3f36e6ada 100755 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -77,6 +77,8 @@ class ProductTest extends PHPUnit_Framework_TestCase { global $conf,$user,$langs,$db; + if (empty($conf->produit->enabled)) { print __METHOD__." Module Product must be enabled.\n"; die(); } + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. print __METHOD__."\n";
'."\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; - print ''; - print ''; - //print ''; - print ''."\n"; - - print ''; - print ''; + print '
Demo '.$profilarray['label'].''.$langs->trans($profilarray['label']).'
'; - print $langs->trans("ThisIsListOfModules").'
'; - print ''; - $listofdisabledmodules=explode(',',$profilarray['disablemodules']); - $j=0;$nbcolsmod=4; - foreach($modules as $val) // Loop on qualified (enabled) modules - { - $modulekeyname=strtolower($val->name); - - $modulequalified=1; - if (! empty($val->always_enabled) || in_array($modulekeyname,$alwayshiddenmodules)) $modulequalified=0; - if ($val->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; - if ($val->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; - if (! $modulequalified) continue; - - $modulo=($j % $nbcolsmod); - if ($modulo == 0) print ''; - print ''; - if ($modulo == ($nbcolsmod - 1)) print ''; - $j++; - } - print '
'.$val->getName().'  '; - print ''; - print '
'; - print '
'."\n"; + // Title + print ''; + print ''; + print ''; print ''."\n"; + // Modules + if (empty($profilearray['url'])) + { + print ''; + print ''; + print ''."\n"; + + print ''; + } print '
Demo '.$profilearray['label'].''.$langs->trans($profilearray['label']).'
'; + print $langs->trans("ThisIsListOfModules").'
'; + print ''; + $listofdisabledmodules=explode(',',$profilearray['disablemodules']); + $j=0;$nbcolsmod=4; + foreach($modules as $val) // Loop on qualified (enabled) modules + { + $modulekeyname=strtolower($val->name); - print ''; + $modulequalified=1; + if (! empty($val->always_enabled) || in_array($modulekeyname,$alwayshiddenmodules)) $modulequalified=0; + if ($val->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; + if ($val->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + if (! $modulequalified) continue; + + $modulo=($j % $nbcolsmod); + if ($modulo == 0) print ''; + print ''; + if ($modulo == ($nbcolsmod - 1)) print ''; + $j++; + } + print '
'.$val->getName().'  '; + print ''; + print '
'; + print '
'."\n"; print '