Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c93488e078
16
ChangeLog
16
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:
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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).
|
||||
@ -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"
|
||||
@ -1 +0,0 @@
|
||||
1.0
|
||||
@ -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
|
||||
@ -1 +0,0 @@
|
||||
[type: gettext/rfc822deb] templates
|
||||
@ -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 $@
|
||||
@ -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
|
||||
#
|
||||
12
build/debian/README.source
Normal file
12
build/debian/README.source
Normal file
@ -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
|
||||
@ -6,4 +6,4 @@ dolibarr (3.2.0+nmu1) unstable; urgency=low
|
||||
|
||||
-- Dolibarr team <contact@dolibarr.org> Mon, 10 Aug 2011 12:00:00 +0100
|
||||
|
||||
# For a changelog file dedicated to users, see /usr/share/doc/dolibarr/UserChangeLog.gz file.
|
||||
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz
|
||||
@ -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
|
||||
@ -5,7 +5,8 @@ Maintainer: Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
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,
|
||||
@ -5,24 +5,39 @@ Source: git@github.com:Dolibarr/dolibarr.git
|
||||
|
||||
Files: *
|
||||
Copyright: 2002-2009, Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
2003-2011, Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
2004-2011, Regis Houssin <regis@dolibarr.fr>
|
||||
2006-2011, Auguria SARL <info@auguria.org>
|
||||
2010-2011, Juanjo Menent <jmenent@2byte.es>
|
||||
2003-2006, Jean-Louis Bergamo <jlb@j1b.org>
|
||||
2003-2012, Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
2003, Xavier Dutoit <doli@sydesy.com>
|
||||
2004-2012, Regis Houssin <regis@dolibarr.fr>
|
||||
2004, Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
2004, Benoit Mortier <benoit.mortier@opensides.be>
|
||||
2004, Christophe Combelles <ccomb@free.fr>
|
||||
2004, Guillaume Delecourt <guillaume.delecourt@opensides.be>
|
||||
2004, Eric Seigne <eric.seigne@ryxeo.com>
|
||||
2005, Brice Davoleau <brice.davoleau@gmail.com>
|
||||
2005, Kai Blankenhorn <kaib@bitfolge.de>
|
||||
2005-2006, Marc Barilley/Ocebo <marc@ocebo.com>
|
||||
2005, Matthieu Valleton <mv@seeschloss.org>
|
||||
2005, Patrick Rouillon <patrick@rouillon.net>
|
||||
2005, Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
2005, Simon TOSSER <simon@kornog-computing.com>
|
||||
2006, Andre Cianfarani <acianfa@free.fr>
|
||||
2006-2011, Auguria SARL <info@auguria.org>
|
||||
2006, Jean Heimburger <jean@tiaris.info>
|
||||
2006, Roman Ozana <ozana@omdesign.cz>
|
||||
2006, Yannick Warnier <ywarnier@beeznest.org>
|
||||
2007, Patrick Raguin <patrick.raguin@gmail.com>
|
||||
2007, Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
|
||||
2007-2008, Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
2008, Matteli <unknown@unknown.com>
|
||||
2008, Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
2010, Francois Legastelois <flegastelois@teclib.com>
|
||||
2010-2012, Juanjo Menent <jmenent@2byte.es>
|
||||
2010-2012, Philippe Grand <philippe.grand@atoo-net.com>
|
||||
2010, Pierre Morin <pierre.morin@auguria.net>
|
||||
2010, Servitux Servicios Informaticos <info@servitux.es>
|
||||
2011, Herve Prot <herve.prot@symeos.com>
|
||||
2011, Remy Younes <ryounes@gmail.com>
|
||||
2012, Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
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
|
||||
|
||||
10
build/debian/dolibarr.doc-base
Normal file
10
build/debian/dolibarr.doc-base
Normal file
@ -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
|
||||
13
build/debian/dolibarr.install
Executable file
13
build/debian/dolibarr.install
Executable file
@ -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
|
||||
@ -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"
|
||||
|
||||
1
build/debian/patches/00list
Normal file
1
build/debian/patches/00list
Normal file
@ -0,0 +1 @@
|
||||
install.dpatch
|
||||
50
build/debian/patches/install.dpatch
Executable file
50
build/debian/patches/install.dpatch
Executable file
@ -0,0 +1,50 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## install.patch by <eldy@users.sourceforge.net>
|
||||
##
|
||||
## 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))
|
||||
1
build/debian/po/POTFILES.in
Executable file
1
build/debian/po/POTFILES.in
Executable file
@ -0,0 +1 @@
|
||||
[type: gettext/rfc822deb] dolibarr.templates
|
||||
@ -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 "
|
||||
112
build/debian/rules
Executable file
112
build/debian/rules
Executable file
@ -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:
|
||||
|
||||
1
build/debian/source/format
Normal file
1
build/debian/source/format
Normal file
@ -0,0 +1 @@
|
||||
3.0 (native)
|
||||
3
build/debian/wash
Normal file
3
build/debian/wash
Normal file
@ -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
|
||||
@ -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"
|
||||
|
||||
@ -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 <email@email.com>"
|
||||
- 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="<Your name>"
|
||||
DEBEMAIL="<Your email address>"
|
||||
|
||||
- ...
|
||||
# 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 <working-dir>/<project>_<version>.dsc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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 (<SPECFROM>) {
|
||||
$_ =~ 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";
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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/*
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -156,7 +156,7 @@ if ($action == 'setsocid')
|
||||
$thirdparty=new Societe($db);
|
||||
$thirdparty->fetch(GETPOST("socid"));
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -894,11 +894,11 @@ if ($rowid)
|
||||
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.($bankdirect?' checked="checked"':'');
|
||||
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
|
||||
}
|
||||
if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled)
|
||||
if ($conf->societe->enabled && $conf->facture->enabled)
|
||||
{
|
||||
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.($bankviainvoice?' checked="checked"':'');
|
||||
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.($invoiceonly?' checked="checked"':'');
|
||||
if (empty($adh->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 '<br>';
|
||||
}
|
||||
if ($conf->societe->enabled && $conf->facture->enabled)
|
||||
if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled)
|
||||
{
|
||||
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.($invoiceonly?' checked="checked"':'');
|
||||
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.($bankviainvoice?' checked="checked"':'');
|
||||
if (empty($adh->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 '<tr class="bankswitchclass2 fieldrequireddyn"><td>'.$langs->trans('CheckTransmitter');
|
||||
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||
print '</td>';
|
||||
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->nom:$_POST['chqemetteur']).'"></td></tr>';
|
||||
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->name:$_POST['chqemetteur']).'"></td></tr>';
|
||||
|
||||
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Bank');
|
||||
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -64,7 +64,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu
|
||||
if ($msg) print $msg.'<br>';
|
||||
|
||||
// Liste des cotisations
|
||||
$sql = "SELECT d.rowid, d.login, d.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;
|
||||
|
||||
|
||||
@ -172,11 +172,11 @@ if ($id > 0)
|
||||
print '</tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->nom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prenom
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->prenom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
|
||||
@ -137,7 +137,7 @@ if ($_POST['action'] == 'setsocid')
|
||||
$thirdparty=new Societe($db);
|
||||
$thirdparty->fetch($_POST["socid"]);
|
||||
$error++;
|
||||
$errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
|
||||
$errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->nom).'" size="40"></td>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->lastname).'" size="40"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->prenom).'"></td>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Password
|
||||
@ -923,11 +927,11 @@ if ($action == 'edit')
|
||||
print '</tr>';
|
||||
|
||||
// Name
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" size="40" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->nom).'"></td>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" size="40" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->lastname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->prenom).'"></td>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// 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 '</tr>';
|
||||
|
||||
// Name
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->nom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->prenom.' </td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.' </td></tr>';
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
|
||||
@ -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 "<tr ".$bc[$var].">";
|
||||
$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 '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
|
||||
print '<td>'.$staticmember->getNomUrl(1,24,'subscription').'</td>';
|
||||
|
||||
@ -109,11 +109,11 @@ print $form->showrefnav($adh,'id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prenom
|
||||
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->prenom.' </td>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Login
|
||||
|
||||
@ -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 "<tr ".$bc[$var].">";
|
||||
$memberstatic->nom=$objp->nom;
|
||||
$memberstatic->prenom=$objp->prenom;
|
||||
$memberstatic->lastname=$objp->lastname;
|
||||
$memberstatic->firstname=$objp->firstname;
|
||||
if ($objp->societe != '')
|
||||
{
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";
|
||||
|
||||
@ -120,11 +120,11 @@ if ($id)
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur" colspan="3">'.$adh->nom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur" colspan="3">'.$adh->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" colspan="3">'.$adh->prenom.' </td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" colspan="3">'.$adh->firstname.' </td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$adh->getLibStatut(4).'</td></tr>';
|
||||
|
||||
@ -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 '<tr '.$bc[$var].'>';
|
||||
if ($objp->societe != '')
|
||||
{
|
||||
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom,12).' / '.dol_trunc($objp->societe,12).'</a></td>'."\n";
|
||||
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).'</a></td>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom).'</a></td>'."\n";
|
||||
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).'</a></td>'."\n";
|
||||
}
|
||||
|
||||
// Login
|
||||
@ -627,7 +629,7 @@ if ($rowid > 0)
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* 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 "</tr>\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 "<tr ".$bc[$var].">\n <td>";
|
||||
print "$name";
|
||||
print "</td>\n <td>\n";
|
||||
require_once($dir.$file);
|
||||
$module = new $classname($db);
|
||||
print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
// Activated
|
||||
print "<td align=\"center\">\n";
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
//if ($conf->global->COMMANDE_ADDON_PDF != "$name")
|
||||
//{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// print img_picto($langs->trans("Activated"),'switch_on');
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->COMMANDE_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_picto($langs->trans("Yes"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("No"),'off');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$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.='<br>'.$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 '<tr '.$bc[$var].'><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module,'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->PROPALE_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_picto($langs->trans("Default"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
}
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
|
||||
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td align="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_object($langs->trans("PreviewNotAvailable"),'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
|
||||
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -353,7 +353,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
// Logo
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Logo").' (png,jpg)</td><td>';
|
||||
print '<table width="100%" class="nocellnopadd"><tr><td valign="center">';
|
||||
print '<table width="100%" class="nocellnopadd"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print '<input type="file" class="flat" name="logo" size="50">';
|
||||
print '</td><td valign="middle" align="right">';
|
||||
if ($mysoc->logo_mini)
|
||||
@ -708,7 +708,7 @@ else
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Logo").'</td><td>';
|
||||
|
||||
print '<table width="100%" class="nocellnopadd"><tr><td valign="center">';
|
||||
print '<table width="100%" class="nocellnopadd"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print $mysoc->logo;
|
||||
print '</td><td valign="center" align="right">';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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 = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
@ -115,8 +115,8 @@ if ($_POST['addfile'] || $_POST['addfilehtml'])
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
|
||||
}
|
||||
|
||||
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='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")).'</div>';
|
||||
$_GET["action"]='test';
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($sendto))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")).'</div>';
|
||||
$_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='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
|
||||
}
|
||||
|
||||
$_GET["action"]='';
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ if ($action == 'edit')
|
||||
// Server
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
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 '</td><td>';
|
||||
@ -367,6 +367,7 @@ if ($action == 'edit')
|
||||
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity))
|
||||
{
|
||||
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" size="18" value="' . $conf->global->MAIN_MAIL_SMTP_SERVER . '">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="' . $conf->global->MAIN_MAIL_SMTP_SERVER . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -381,7 +382,7 @@ if ($action == 'edit')
|
||||
// Port
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
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 '</td><td>';
|
||||
@ -397,6 +398,7 @@ if ($action == 'edit')
|
||||
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity))
|
||||
{
|
||||
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT" name="MAIN_MAIL_SMTP_PORT" size="3" value="' . $conf->global->MAIN_MAIL_SMTP_PORT . '">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_sav" name="MAIN_MAIL_SMTP_PORT_sav" value="' . $conf->global->MAIN_MAIL_SMTP_PORT . '">';
|
||||
}
|
||||
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 '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
|
||||
}
|
||||
@ -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 '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -223,11 +223,18 @@ else // Show
|
||||
// Show pdf format
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DictionnaryPaperFormat").'</td><td>';
|
||||
$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)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -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 "<br>\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();
|
||||
?>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,152 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/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 "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print '<div class="titre">Nouvel Editeur</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print '<td>Nom</td><td><input name="nom" size="40" value=""></td></tr>';
|
||||
print '<tr><td> </td><td><input type="submit" value="Cr<43>er"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($id)
|
||||
{
|
||||
|
||||
$editeur = new Editeur($dbosc);
|
||||
$result = $editeur->fetch($id);
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<div class="titre">Edition de la fiche Editeur : '.$editeur->titre.'</div><br>';
|
||||
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Nom</td><td><input name="nom" size="40" value="'.$editeur->nom.'"></td>';
|
||||
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Save").'"> <input type="submit" value="'.$langs->trans("Cancel").'" name="cancel"></td></tr>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</table><hr>';
|
||||
|
||||
}
|
||||
|
||||
print '<div class="titre">Fiche Editeur : '.$editeur->titre.'</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Nom</td><td width="30%">'.$editeur->nom.'</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Fetch failed";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error";
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
if ($action != 'create')
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?action=edit&id='.$id.'">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
|
||||
$dbosc->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 <EFBFBD>ric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -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();
|
||||
?>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -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 '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -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<br>";
|
||||
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='<div class="error">'.$obj->error.'</div>';
|
||||
$mesg='<div class="error">'.$langs->trans("Error").($obj->error?' '.$obj->error:'').'</div>';
|
||||
}
|
||||
$_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 "</div>";
|
||||
|
||||
if ($mesg) print "$mesg<br>\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<br>";
|
||||
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 '<tr '.$bc[$var].'>';
|
||||
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print '<form name="'.$modulename.'" action="cibles.php?action=add&rowid='.$mil->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
if (! $obj->picto) $obj->picto='generic';
|
||||
print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc();
|
||||
print '</td>';
|
||||
|
||||
/*
|
||||
print '<td width=\"100\">';
|
||||
print $modulename;
|
||||
print "</td>";
|
||||
*/
|
||||
$nbofrecipient=$obj->getNbOfRecipients();
|
||||
print '<td align="center">';
|
||||
if ($nbofrecipient >= 0)
|
||||
{
|
||||
print $nbofrecipient;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("Error").' '.img_error($obj->error);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="left">';
|
||||
$filter=$obj->formFilter();
|
||||
if ($filter) print $filter;
|
||||
else print $langs->trans("None");
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
//print $langs->trans("MailNoChangePossible");
|
||||
print " ";
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
if ($mil->statut == 0) print '</form>';
|
||||
|
||||
print "</tr>\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 '<tr '.$bc[$var].'>';
|
||||
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print '<form name="'.$modulename.'" action="cibles.php?action=add&rowid='.$mil->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
if (! $obj->picto) $obj->picto='generic';
|
||||
print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc();
|
||||
print '</td>';
|
||||
|
||||
/*
|
||||
print '<td width=\"100\">';
|
||||
print $modulename;
|
||||
print "</td>";
|
||||
*/
|
||||
$nbofrecipient=$obj->getNbOfRecipients();
|
||||
print '<td align="center">';
|
||||
if ($nbofrecipient >= 0)
|
||||
{
|
||||
print $nbofrecipient;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("Error").' '.img_error($obj->error);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="left">';
|
||||
$filter=$obj->formFilter();
|
||||
if ($filter) print $filter;
|
||||
else print $langs->trans("None");
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
//print $langs->trans("MailNoChangePossible");
|
||||
print " ";
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
if ($mil->statut == 0) print '</form>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
} // End foreach dir
|
||||
@ -511,7 +541,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -152,7 +152,7 @@ if ($_socid > 0)
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>';
|
||||
print '<td>'.$obj->price_level.' </td>';
|
||||
$userstatic->id=$obj->uid;
|
||||
$userstatic->nom=$obj->login;
|
||||
$userstatic->lastname=$obj->login;
|
||||
print '<td align="right">'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -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 '<table class="border" width="100%">';
|
||||
|
||||
$linkback="<a href=\"".DOL_URL_ROOT.'/comm/propal.php'."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/comm/propal.php?page='.$page.'&socid='.$socid.'&viewstatut='.$viewstatut.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
@ -179,17 +175,15 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Lignes de contacts
|
||||
*/
|
||||
print '<br><table class="noborder" width="100%">';
|
||||
|
||||
/*
|
||||
* Lignes de contacts
|
||||
*/
|
||||
echo '<br><table class="noborder" width="100%">';
|
||||
|
||||
/*
|
||||
* 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 '<tr class="liste_titre">';
|
||||
@ -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 '<a href="contact.php?id='.$propal->id.'&action=deleteline&lineid='.$tab[$i]['rowid'].'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$propal->id.'&action=deleteline&lineid='.$tab[$i]['rowid'].'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
}
|
||||
@ -370,7 +364,8 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -79,16 +79,16 @@ print "</form></table><br>\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)
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -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);
|
||||
|
||||
@ -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 '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -78,15 +78,15 @@ print "</form></table><br>\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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -87,30 +87,30 @@ if ($_GET["mode"] == 'sconly')
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
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 "</tr>\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 '</td>';
|
||||
// Type
|
||||
print '<td><a href="../sociales/index.php?filtre=s.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>';
|
||||
print '<td><a href="../sociales/index.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td align="right">'.price($obj->total).'</td>';
|
||||
// Ref payment
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -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"];
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -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
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -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();
|
||||
?>
|
||||
|
||||
@ -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)."'";
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ else
|
||||
|
||||
if ($fac->statut == 0 && $user->rights->facture->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche-rec.php?action=delete&facid='.$fac->id.'">'.$langs->trans('Delete').'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&facid='.$fac->id.'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
@ -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 "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
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 '</td><td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print "</td>\n";
|
||||
@ -528,11 +528,11 @@ else
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td><a href="fiche-rec.php?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
|
||||
print "</a></td>\n";
|
||||
print '<td><a href="../fiche.php?socid='.$objp->socid.'">'.$objp->nom.'</a></td>';
|
||||
|
||||
print "<td align=\"right\">".price($objp->total)."</td>\n";
|
||||
print '<td align="right">'.price($objp->total).'</td>'."\n";
|
||||
|
||||
if (! $objp->paye)
|
||||
{
|
||||
@ -566,7 +566,8 @@ else
|
||||
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
|
||||
@ -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)."'";
|
||||
|
||||
@ -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 '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>';
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
@ -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 '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user