Merge remote-tracking branch 'upstream/develop' into develop
Conflicts: htdocs/public/agenda/agendaexport.php
@ -18,13 +18,13 @@ GeoIP 2004 LGPL 2.1 Yes Sample code to m
|
||||
NuSoap 0.9.5 LGPL 2.1 Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||
OdtPHP 1.0.1 GPL 2.0 Yes Library to build/edit ODT files
|
||||
PHPExcel 1.7.6 LGPL 2.1 Yes Read/Write XLS files, read ODS files
|
||||
TCPDF 5.9.098 LGPL 3.0 Yes PDF generation
|
||||
TCPDF 5.9.156 LGPL 3.0 Yes PDF generation
|
||||
|
||||
JS libraries:
|
||||
jQuery 1.7.1 GPL and MIT Licence Yes JS library
|
||||
jQuery UI 1.8.17 GPL and MIT Licence Yes JS library plugin UI
|
||||
jQuery Colorpicker 1.1 MIT Licence Yes JS library for color picker for a defined list of colors
|
||||
jQuery DataTable 1.8.1 BSD Yes JS library for tables output
|
||||
jQuery DataTables 1.9.1 BSD Yes JS library for tables output
|
||||
jQuery Flot 0.7 MIT Licence Yes JS library to build graph
|
||||
jQuery FileUpload 5.0.3 GPL and MIT Licence Yes JS library to upload files
|
||||
jQuery JCrop 0.9.8 GPL and MIT Licence Yes JS library plugin Crop (to crop images)
|
||||
|
||||
15
ChangeLog
@ -2,13 +2,23 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 3.3 compared to 3.2 *****
|
||||
For users:
|
||||
- New: Add supplier ref on supplier orders.
|
||||
- New: Can export supplier orders.
|
||||
|
||||
For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 3.2 compared to 3.1 *****
|
||||
WARNING: PHP lower than 5.x are no more supported.
|
||||
WARNING: Because of a major datastructure change onto supplier prices tabkes, be aware
|
||||
WARNING: Because of a major datastructure change onto supplier prices tables, be aware
|
||||
to make a backup of your database before making upgrade.
|
||||
|
||||
For users:
|
||||
- New: Each user can remove/add its own boxes.
|
||||
- New: Add signature at end of predefined email text.
|
||||
- New: Can use personalized fields of products/services.
|
||||
- New: Can attach files on social contributions.
|
||||
- New: Show payments terms and conditions onto muscadet template.
|
||||
@ -61,9 +71,12 @@ For users:
|
||||
- New: Add hidden option MAIN_ADD_PDF_BACKGROUND to add a PDF as background of invoice/order generated PDF.
|
||||
- New: Can convert a product/service into service/product.
|
||||
- New: Show delivery date into proposal template azur.
|
||||
- New: Support tags into header and footer into ODT templates.
|
||||
- Fix: Can use POS module with several concurrent users.
|
||||
- Fix: Installer don't fails with Mysql version that added a ssl_cypher field.
|
||||
- Fix: Sanitize input parameters.
|
||||
- Fix: [ bug #368 ] Product list
|
||||
- Fix: [ bug #370 ] Filter in accountancy -> suppliers_bills
|
||||
|
||||
For developers:
|
||||
- New: Can add a left menu into an existing top menu or left menu.
|
||||
|
||||
@ -8,9 +8,7 @@ script to build a package, ready to be distributed,
|
||||
with format .DEB (for Debian, Ubuntu, ...).
|
||||
|
||||
# To build a debian package, you need first
|
||||
# apt-get -i debhelper
|
||||
# apt-get -i dpkg-source
|
||||
# apt-get -i gpg
|
||||
# apt-get -i debhelper dpkg-source gpg lintian
|
||||
|
||||
|
||||
# This is standard command to work on Debian packaging:
|
||||
@ -35,7 +33,8 @@ with format .DEB (for Debian, Ubuntu, ...).
|
||||
# dpkg --purge Remove config files and interactive saved answers
|
||||
#
|
||||
# dpkg-buildpackage -us -uc Build a source and binary package
|
||||
|
||||
#
|
||||
# gdebi package.deb Install a package + dependencies
|
||||
|
||||
To submit a package to Debian:
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
dolibarr (3.2.0+nmu1) unstable; urgency=low
|
||||
dolibarr (3.3.0+nmu1) unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload.
|
||||
* New upstream release.
|
||||
|
||||
@ -9,13 +9,11 @@ Build-Depends: debhelper (>= 7), po-debconf, dpatch
|
||||
Package: dolibarr
|
||||
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, php-fpdf,
|
||||
php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, php5-geoip,
|
||||
libphp-adodb,
|
||||
libfpdi-php,
|
||||
libfpdf-tpl-php,
|
||||
libnusoap-php,
|
||||
libphp-pclzip,
|
||||
libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor,
|
||||
libjs-jquery, libjs-jquery-ui, ckeditor,
|
||||
ttf-dejavu-core,
|
||||
xdg-utils,
|
||||
mysql-server,
|
||||
|
||||
@ -6,11 +6,10 @@ 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,
|
||||
libphp-adodb,
|
||||
libnusoap-php,
|
||||
libphp-pclzip,
|
||||
libfpdi-php,
|
||||
libfpdf-tpl-php,
|
||||
ckeditor,
|
||||
libjs-jquery, libjs-jquery-ui, ckeditor,
|
||||
ttf-dejavu-core,
|
||||
xdg-utils,
|
||||
mysql-server
|
||||
@ -27,6 +26,7 @@ Description: Web based software to manage a small company or foundation
|
||||
.
|
||||
Dolibarr was designed to be easy to use. Only features you need are
|
||||
visible, depending on which module were activated.
|
||||
Most common used modules are:
|
||||
.
|
||||
Customers, Suppliers or Prospects directory,
|
||||
Contacts directory,
|
||||
|
||||
@ -83,8 +83,9 @@ case "$1" in
|
||||
chown -R root:www-data $installconfig
|
||||
chmod -R 660 $installconfig
|
||||
|
||||
if [ ! -f $config ]
|
||||
then
|
||||
# If a conf already exists and its content was already completed by installer
|
||||
if [ ! -s $config ] || ! grep -q "File generated by" $config
|
||||
then
|
||||
# Create an empty conf.php with permission to web server
|
||||
echo Create empty file $config
|
||||
touch $config
|
||||
@ -92,18 +93,18 @@ case "$1" in
|
||||
chown -R root:www-data $config
|
||||
else
|
||||
# File already exist. We add params not found.
|
||||
// Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_UI" $config || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_FLOT" $config || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config
|
||||
grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "<?php \$dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; ?>" >> $config
|
||||
fi
|
||||
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
#set -e
|
||||
set +e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postrm> `remove'
|
||||
|
||||
@ -27,7 +27,7 @@ $force_install_lockinstall='444';
|
||||
|
||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||
//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||
$force_dolibarr_lib_GEOIP_PATH='';
|
||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
@ -36,7 +36,7 @@ $force_dolibarr_lib_TCPDF_PATH='';
|
||||
$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||
$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf';
|
||||
|
||||
?>
|
||||
@ -104,6 +104,7 @@ clean:
|
||||
rm -fr htdocs/includes/jquery/plugins/jstree
|
||||
rm -fr htdocs/includes/jquery/plugins/lightbox
|
||||
rm -fr htdocs/includes/jquery/plugins/mobile
|
||||
rm -fr htdocs/includes/jquery/plugins/multiselect
|
||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
|
||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
|
||||
rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33
|
||||
|
||||
@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.2.0
|
||||
PROJECT_NUMBER = 3.3.0
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.2.0
|
||||
PROJECT_NUMBER = 3.3.0
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@ -17,12 +17,13 @@
|
||||
; ----- Change this -----
|
||||
AppName=DoliWamp
|
||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
||||
AppVerName=DoliWamp-3.2.0-alpha
|
||||
AppVerName=DoliWamp-3.3.0-alpha
|
||||
; DoliWamp-x.x x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
||||
OutputBaseFilename=DoliWamp-3.2.0-alpha
|
||||
OutputBaseFilename=DoliWamp-3.3.0-alpha
|
||||
; Define full path from wich all relative path are defined
|
||||
; You must modify this to put here your dolibarr root directory
|
||||
SourceDir=c:\Documents and Settings\ldestail\git\dolibarr
|
||||
;SourceDir=C:\Documents and Settings\ldestail\git\dolibarrold
|
||||
SourceDir=Z:\home\ldestail\git\dolibarrold
|
||||
; ----- End of change
|
||||
;OutputManifestFile=build\doliwampbuild.log
|
||||
AppId=doliwamp
|
||||
|
||||
@ -61,5 +61,25 @@ DEBEMAIL="<Your email address>"
|
||||
sudo pbuilder build <working-dir>/<project>_<version>.dsc
|
||||
|
||||
|
||||
# To get/download package:
|
||||
Add signing key of the Launchpad repository:
|
||||
> gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD
|
||||
> sudo apt-key add ~/.gnupg/pubring.gpg
|
||||
|
||||
Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list
|
||||
For the development snapshot version:
|
||||
deb http://ppa.launchpad.net/eldy/dolibarr-dev/ubuntu precise main
|
||||
deb-src http://ppa.launchpad.net/eldy/dolibarr-dev/ubuntu precise main
|
||||
For the stable version:
|
||||
deb http://ppa.launchpad.net/eldy/dolibarr-stable/ubuntu precise main
|
||||
deb-src http://ppa.launchpad.net/eldy/dolibarr-stable/ubuntu precise main
|
||||
|
||||
Update your package cache:
|
||||
> apt-get update
|
||||
|
||||
Install Dolibarr:
|
||||
> apt-get install dolibarr
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ use Cwd;
|
||||
|
||||
$PROJECT="dolibarr";
|
||||
$MAJOR="3";
|
||||
$MINOR="2";
|
||||
$MINOR="3";
|
||||
$BUILD="0-alpha"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
|
||||
@ -38,7 +38,7 @@ $FILENAMEZIP="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMERPM="$PROJECT-$MAJOR.$MINOR.$BUILD-$RPMSUBVERSION";
|
||||
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${BUILD}";
|
||||
$FILENAMEAPS="$PROJECT-$MAJOR.$MINOR.$BUILD.app";
|
||||
$FILENAMEEXEDOLIWAMP="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEEXEDOLIWAMP="DoliWamp-$MAJOR.$MINOR.$BUILD";
|
||||
if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat
|
||||
if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake
|
||||
|
||||
@ -763,8 +763,10 @@ if ($nboftargetok) {
|
||||
print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n";
|
||||
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
|
||||
|
||||
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
||||
$cmd= "iscc.exe \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"";
|
||||
$SOURCEBACK=$SOURCE;
|
||||
$SOURCEBACK =~ s/\//\\/g;
|
||||
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
||||
$cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"";
|
||||
print "$cmd\n";
|
||||
$ret= `$cmd`;
|
||||
#print "$ret\n";
|
||||
@ -772,6 +774,8 @@ if ($nboftargetok) {
|
||||
# Move to final dir
|
||||
print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
|
||||
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ beta version of Dolibarr, step by step.
|
||||
- Update version number with x.x.x in build/doxygen/dolibarr-doxygen.doxyfile
|
||||
- Update version number with x.x.x in build/perl/virtualmin/dolibarr.pl
|
||||
- Update version number with x.x.x-y in build/makepack-dolibarr.pl
|
||||
- Update version number with x.x.x-y in build/deb/changelog
|
||||
- Update version number with x.x.x-y in build/debian/changelog
|
||||
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number with x.x.x-y in htdocs/filefunc.inc.php
|
||||
- Update version number with x.x.x-y in htdocs/install/inc.php
|
||||
|
||||
@ -30,7 +30,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.1.0", "3.0.1", "2.9.0" );
|
||||
return ( "3.3.0", "3.2.0", "3.1.0", "3.0.1", "2.9.0" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
|
||||
@ -217,6 +217,26 @@ echo Create document directory $docdir
|
||||
# Set correct owner on config files
|
||||
%{__chown} -R root:$apachegroup /etc/dolibarr/*
|
||||
|
||||
# If a conf already exists and its content was already completed by installer
|
||||
export config=%{_sysconfdir}/dolibarr/conf.php
|
||||
if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config
|
||||
grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "<?php \$dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf'; ?>" >> $config
|
||||
fi
|
||||
|
||||
# Create config for se $seconfig
|
||||
echo Add SE Linux permissions for dolibarr
|
||||
# semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local
|
||||
@ -292,5 +312,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.2.0-0.1.a
|
||||
* Wed Mar 4 2012 Laurent Destailleur 3.3.0-0.1.a
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -254,6 +254,26 @@ fi
|
||||
# Set correct owner on config files
|
||||
%{__chown} -R root:$apachegroup /etc/dolibarr/*
|
||||
|
||||
# If a conf already exists and its content was already completed by installer
|
||||
export config=%{_sysconfdir}/dolibarr/conf.php
|
||||
if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config
|
||||
grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "<?php \$dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; ?>" >> $config
|
||||
fi
|
||||
|
||||
# Create config for se $seconfig
|
||||
if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then
|
||||
echo Add SE Linux permissions for dolibarr
|
||||
@ -348,5 +368,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.2.0-0.1.a
|
||||
* Wed Mar 4 2012 Laurent Destailleur 3.3.0-0.1.a
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -214,6 +214,26 @@ echo Create document directory $docdir
|
||||
# Set correct owner on config files
|
||||
%{__chown} -R root:$apachegroup /etc/dolibarr/*
|
||||
|
||||
# If a conf already exists and its content was already completed by installer
|
||||
export confcomplete=`grep -c "File generated by" %{_sysconfdir}/dolibarr/conf.php 2>/dev/null`
|
||||
if [ -s %{_sysconfdir}/dolibarr/conf.php -a "x$confcomplete" != "x0" ]
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config
|
||||
grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "<?php \$dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/TTF/dejavu/DejaVuSans-Bold.ttf'; ?>" >> $config
|
||||
fi
|
||||
|
||||
# Create a config link dolibarr.conf
|
||||
if [ ! -L $apachelink ]; then
|
||||
echo Create dolibarr web server config link $apachelink
|
||||
@ -281,5 +301,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.2.0-0.1.a
|
||||
* Wed Mar 4 2012 Laurent Destailleur 3.3.0-0.1.a
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -219,6 +219,26 @@ echo Create document directory $docdir
|
||||
# Set correct owner on config files
|
||||
%{__chown} -R root:$apachegroup /etc/dolibarr/*
|
||||
|
||||
# If a conf already exists and its content was already completed by installer
|
||||
export config=%{_sysconfdir}/dolibarr/conf.php
|
||||
if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config
|
||||
grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "<?php \$dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/DejaVuSans-Bold.ttf'; ?>" >> $config
|
||||
fi
|
||||
|
||||
# Create a config link dolibarr.conf
|
||||
if [ ! -L $apachelink ]; then
|
||||
echo Create dolibarr web server config link $apachelink
|
||||
@ -286,5 +306,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.2.0-0.1.a
|
||||
* Wed Mar 4 2012 Laurent Destailleur 3.3.0-0.1.a
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -30,6 +30,6 @@ $force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype';
|
||||
$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/DejaVuSans-Bold.ttf';
|
||||
|
||||
?>
|
||||
@ -87,6 +87,4 @@ cvschangelogbuilder_dolibarr*
|
||||
*/huitre/*
|
||||
*/pdf_huitre.modules.php
|
||||
doxygen_warnings.log
|
||||
dolibarr_install.log
|
||||
*/doc_generic_invoice_odt.modules.php
|
||||
*/htdocs/theme/bureau2crea/*
|
||||
dolibarr_install.log
|
||||
@ -30,7 +30,7 @@ public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=
|
||||
by
|
||||
public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=false, $maxh=0, $valign='T', $fitcell=false) {
|
||||
|
||||
* Removed all fonts except dejavu* (greek, arab, persan, romanian, turkish), freemono* (russian), stsongstdlight* (chinese), helvetica* (all other) and useless directories (fonts/utils, docs, cache, images)
|
||||
* Removed all fonts except dejavu* (used by greek, arab, persan, romanian, turkish), freemono* (russian), stsongstdlight* (chinese), helvetica* (all other) and useless directories (fonts/utils, docs, cache, images)
|
||||
|
||||
* Replace in tcpdf_config.php
|
||||
define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
#------------------------------------------------------
|
||||
|
||||
|
||||
export dumpfile="mysqldump_dolibarr_3.1.0.sql"
|
||||
export dumpfile=`ls mysqldump_dolibarr_*.sql | sort | tail -n 1`
|
||||
export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`;
|
||||
if [ "x$mydir" = "x" ]
|
||||
then
|
||||
|
||||
6200
dev/initdata/mysqldump_dolibarr_3.2.0.sql
Normal file
@ -81,6 +81,7 @@ class modMyModule extends DolibarrModules
|
||||
// 'models' => 0, // Set this to 1 if module has its own models directory
|
||||
// 'css' => '/mymodule/css/mymodule.css.php', // Set this to relative path of css if module has its own css file
|
||||
// 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module
|
||||
// 'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) // Set here all workflow context managed by module
|
||||
// );
|
||||
$this->module_parts = array();
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
doc/images/dolibarr_124x124.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 14 KiB |
BIN
doc/images/dolibarr_256x256.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
doc/images/dolibarr_logo.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
@ -59,9 +59,11 @@ class AccountancyAccount
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
|
||||
$sql.= " (date_creation, fk_user_author, numero,intitule)";
|
||||
$sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
$sql.= " VALUES (".$this->db->idate($now).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -39,7 +39,7 @@ if (! $user->admin) accessforbidden();
|
||||
|
||||
$type=array('yesno','texte','chaine');
|
||||
|
||||
$action = GETPOST("action");
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
|
||||
/*
|
||||
@ -49,8 +49,8 @@ $action = GETPOST("action");
|
||||
// Action mise a jour ou ajout d'une constante
|
||||
if ($action == 'update' || $action == 'add')
|
||||
{
|
||||
$constname=GETPOST("constname");
|
||||
$constvalue=GETPOST("constvalue");
|
||||
$constname=GETPOST('constname','alpha');
|
||||
$constvalue=(GETPOST('constvalue_'.$constname,'alpha') ? GETPOST('constvalue_'.$constname,'alpha') : GETPOST('constvalue','alpha'));
|
||||
|
||||
if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue='';
|
||||
if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
|
||||
@ -59,9 +59,8 @@ if ($action == 'update' || $action == 'add')
|
||||
else $constvalue=1;
|
||||
}
|
||||
|
||||
if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname];
|
||||
$consttype=$_POST["consttype"];
|
||||
$constnote=GETPOST("constnote");
|
||||
$consttype=GETPOST('consttype','alpha');
|
||||
$constnote=GETPOST('constnote','alpha');
|
||||
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -79,7 +78,7 @@ if ($action == 'update' || $action == 'add')
|
||||
// Action activation d'un sous module du module adherent
|
||||
if ($action == 'set')
|
||||
{
|
||||
$result=dolibarr_set_const($db, $_GET["name"],$_GET["value"],'',0,'',$conf->entity);
|
||||
$result=dolibarr_set_const($db, GETPOST('name','alpha'),GETPOST('value','alpha'),'',0,'',$conf->entity);
|
||||
if ($result < 0)
|
||||
{
|
||||
print $db->error();
|
||||
@ -89,7 +88,7 @@ if ($action == 'set')
|
||||
// Action desactivation d'un sous module du module adherent
|
||||
if ($action == 'unset')
|
||||
{
|
||||
$result=dolibarr_del_const($db,$_GET["name"],$conf->entity);
|
||||
$result=dolibarr_del_const($db,GETPOST('name','alpha'),$conf->entity);
|
||||
if ($result < 0)
|
||||
{
|
||||
print $db->error();
|
||||
|
||||
@ -125,7 +125,6 @@ print $langs->trans("EnablePublicSubscriptionForm");
|
||||
print '</td><td width="60" align="right">';
|
||||
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1);
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Type
|
||||
/*$var=! $var;
|
||||
|
||||
@ -39,8 +39,12 @@ $langs->load("users");
|
||||
$langs->load("mails");
|
||||
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
$typeid=GETPOST('typeid','int');
|
||||
|
||||
// Security check
|
||||
if (! $user->rights->adherent->cotisation->lire) accessforbidden();
|
||||
$result=restrictedArea($user,'adherent',$rowid);
|
||||
|
||||
$object = new Adherent($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -50,10 +54,6 @@ $errmsg='';
|
||||
$defaultdelay=1;
|
||||
$defaultdelayunit='y';
|
||||
|
||||
$action=GETPOST('action');
|
||||
$rowid=GETPOST('rowid');
|
||||
$typeid=GETPOST('typeid');
|
||||
|
||||
if ($rowid)
|
||||
{
|
||||
// Load member
|
||||
|
||||
@ -182,54 +182,56 @@ class Adherent extends CommonObject
|
||||
* @param string $text Text to make substitution to
|
||||
* @return string Value of input text string with substitutions done
|
||||
*/
|
||||
function makeSubstitution($text)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$birthday = dol_print_date($this->naiss,'day');
|
||||
|
||||
$msgishtml = 0;
|
||||
if (dol_textishtml($text,1)) $msgishtml = 1;
|
||||
|
||||
$infos='';
|
||||
if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n";
|
||||
$infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
|
||||
$infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
|
||||
$infos.= $langs->transnoentities("Company").": ".$this->societe."\n";
|
||||
$infos.= $langs->transnoentities("Address").": ".$this->address."\n";
|
||||
$infos.= $langs->transnoentities("Zip").": ".$this->zip."\n";
|
||||
$infos.= $langs->transnoentities("Town").": ".$this->town."\n";
|
||||
$infos.= $langs->transnoentities("Country").": ".$this->country."\n";
|
||||
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
|
||||
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
|
||||
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n";
|
||||
$infos.= $langs->transnoentities("Birthday").": ".$birthday."\n";
|
||||
$infos.= $langs->transnoentities("Photo").": ".$this->photo."\n";
|
||||
$infos.= $langs->transnoentities("Public").": ".yn($this->public);
|
||||
|
||||
// Substitutions
|
||||
$substitutionarray=array(
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||
'%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1),
|
||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass
|
||||
);
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
return make_substitutions($text,$substitutionarray);
|
||||
}
|
||||
function makeSubstitution($text)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$birthday = dol_print_date($this->naiss,'day');
|
||||
|
||||
$msgishtml = 0;
|
||||
if (dol_textishtml($text,1)) $msgishtml = 1;
|
||||
|
||||
$infos='';
|
||||
if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n";
|
||||
$infos.= $langs->transnoentities("id").": ".$this->id."\n";
|
||||
$infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
|
||||
$infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
|
||||
$infos.= $langs->transnoentities("Company").": ".$this->societe."\n";
|
||||
$infos.= $langs->transnoentities("Address").": ".$this->address."\n";
|
||||
$infos.= $langs->transnoentities("Zip").": ".$this->zip."\n";
|
||||
$infos.= $langs->transnoentities("Town").": ".$this->town."\n";
|
||||
$infos.= $langs->transnoentities("Country").": ".$this->country."\n";
|
||||
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
|
||||
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
|
||||
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n";
|
||||
$infos.= $langs->transnoentities("Birthday").": ".$birthday."\n";
|
||||
$infos.= $langs->transnoentities("Photo").": ".$this->photo."\n";
|
||||
$infos.= $langs->transnoentities("Public").": ".yn($this->public);
|
||||
|
||||
// Substitutions
|
||||
$substitutionarray=array(
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
|
||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||
'%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1),
|
||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass
|
||||
);
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
return make_substitutions($text,$substitutionarray);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -966,7 +968,7 @@ class Adherent extends CommonObject
|
||||
*/
|
||||
function fetch($rowid,$ref='',$fk_soc='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT d.rowid, d.civilite, d.prenom as firstname, d.nom as lastname, d.societe, d.fk_soc, d.statut, d.public, d.adresse as address, d.cp as zip, d.ville as town, d.note,";
|
||||
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
|
||||
@ -987,10 +989,12 @@ class Adherent extends CommonObject
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.fk_departement = dep.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid";
|
||||
$sql.= " AND d.entity = ".$conf->entity;
|
||||
if ($ref) $sql.= " AND d.rowid='".$ref."'";
|
||||
elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'";
|
||||
else $sql.= " AND d.rowid=".$rowid;
|
||||
if ($rowid) $sql.= " AND d.rowid=".$rowid;
|
||||
elseif ($ref || $fk_soc) {
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
if ($ref) $sql.= " AND d.rowid='".$ref."'";
|
||||
elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::fetch sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -31,18 +31,21 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
$langs->load('other');
|
||||
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$action=GETPOST('action','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$mesg = "";
|
||||
|
||||
// Security check
|
||||
$id = GETPOST('id','int');
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$id = $user->societe_id;
|
||||
}
|
||||
//$result = restrictedArea($user, 'societe', $id);
|
||||
$result=restrictedArea($user,'adherent',$id);
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@ -65,7 +68,7 @@ $upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $
|
||||
*/
|
||||
|
||||
// Envoie fichier
|
||||
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
@ -96,7 +99,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
}
|
||||
|
||||
// Suppression fichier
|
||||
if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes')
|
||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
{
|
||||
$file = $upload_dir . "/" . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
dol_delete_file($file);
|
||||
@ -197,21 +200,21 @@ if ($id > 0)
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
if ($_GET['action'] == 'delete')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$member->id.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/adherents/document.php?id='.$id,'',0,0,$user->rights->adherent->creer);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/adherents/document.php?id='.$member->id,'',0,0,$user->rights->adherent->creer);
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&socid='.$societe->id;
|
||||
$formfile->list_of_documents($filearray,$member,'member',$param, 0, get_exdir($id,2,0,1).'/'.$id.'/');
|
||||
$formfile->list_of_documents($filearray,$member,'member',$param, 0, get_exdir($member->id,2,0,1).'/'.$member->id.'/');
|
||||
|
||||
print "<br><br>";
|
||||
}
|
||||
@ -226,9 +229,7 @@ else
|
||||
print $langs->trans("ErrorRecordNotFound");
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -41,21 +41,22 @@ $langs->load("bills");
|
||||
$langs->load("members");
|
||||
$langs->load("users");
|
||||
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
$typeid=GETPOST('typeid','int');
|
||||
$userid=GETPOST('userid','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
// Security check
|
||||
if (! $user->rights->adherent->lire) accessforbidden();
|
||||
$result=restrictedArea($user,'adherent',$rowid);
|
||||
|
||||
$object = new Adherent($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
$errmsg=''; $errmsgs=array();
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
$typeid=GETPOST('typeid','int');
|
||||
$userid=GETPOST('userid','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
if ($rowid > 0)
|
||||
{
|
||||
// Load member
|
||||
@ -67,16 +68,12 @@ if ($rowid > 0)
|
||||
if ($object->user_id)
|
||||
{
|
||||
// $user est le user qui edite, $object->user_id est l'id de l'utilisateur lies au membre edite
|
||||
$caneditfielduser=( (($user->id == $object->user_id) && $user->rights->user->self->creer)
|
||||
|| (($user->id != $object->user_id) && $user->rights->user->user->creer) );
|
||||
$caneditpassworduser=( (($user->id == $object->user_id) && $user->rights->user->self->password)
|
||||
|| (($user->id != $adh->user_id) && $user->rights->user->user->password) );
|
||||
$caneditfielduser=((($user->id == $object->user_id) && $user->rights->user->self->creer)
|
||||
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
|
||||
$caneditpassworduser=((($user->id == $object->user_id) && $user->rights->user->self->password)
|
||||
|| (($user->id != $object->user_id) && $user->rights->user->user->password));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Define variables to know what current user can do on members
|
||||
$canaddmember=$user->rights->adherent->creer;
|
||||
|
||||
@ -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>
|
||||
*
|
||||
* 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
|
||||
@ -150,12 +150,7 @@ llxHeader('',$langs->trans("SubscriptionCard"),'EN:Module_Foundations|FR:Module_
|
||||
$form = new Form($db);
|
||||
|
||||
|
||||
|
||||
if ($errmsg)
|
||||
{
|
||||
print '<div class="error">'.$errmsg.'</div>';
|
||||
print "\n";
|
||||
}
|
||||
dol_htmloutput_errors($errmsg);
|
||||
|
||||
|
||||
if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
||||
@ -316,9 +311,14 @@ if ($rowid && $action != 'edit')
|
||||
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1,0,'subscription').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date record
|
||||
/*print '<tr>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($subscription->datec,'dayhour').'</td>';
|
||||
print '</tr>';*/
|
||||
|
||||
// Date subscription
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($subscription->dateh,'dayhour').'</td>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($subscription->dateh,'day').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end subscription
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 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
|
||||
@ -59,7 +60,10 @@ $AdherentType=array();
|
||||
$sql = "SELECT t.rowid, t.libelle, t.cotisation,";
|
||||
$sql.= " d.statut, count(d.rowid) as somme";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as d ON t.rowid = d.fk_adherent_type";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.= " ON t.rowid = d.fk_adherent_type";
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
$sql.= " WHERE t.entity IN (".getEntity().")";
|
||||
$sql.= " GROUP BY t.rowid, t.libelle, t.cotisation, d.statut";
|
||||
|
||||
dol_syslog("index.php::select nb of members by type sql=".$sql, LOG_DEBUG);
|
||||
@ -87,14 +91,16 @@ if ($result)
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// List members up to date
|
||||
// current rule: uptodate = the end date is in future whatever is type
|
||||
// old rule: uptodate = if type does not need payment, that end date is null, if type need payment that end date is in future)
|
||||
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
//$sql.= " WHERE d.statut = 1 AND ((t.cotisation = 0 AND d.datefin IS NULL) OR d.datefin >= ".$db->idate(gmmktime()).')';
|
||||
$sql.= " WHERE d.statut = 1 AND d.datefin >= ".$db->idate(gmmktime());
|
||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||
//$sql.= " AND d.statut = 1 AND ((t.cotisation = 0 AND d.datefin IS NULL) OR d.datefin >= ".$db->idate($now).')';
|
||||
$sql.= " AND d.statut = 1 AND d.datefin >= ".$db->idate($now);
|
||||
$sql.= " AND t.rowid = d.fk_adherent_type";
|
||||
$sql.= " GROUP BY d.fk_adherent_type";
|
||||
|
||||
@ -128,8 +134,12 @@ print "</tr>\n";
|
||||
$var=false;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
print $langs->trans("Name").':</td><td><input type="text" name="search" class="flat" size="16">';
|
||||
print '</td><td rowspan="2"><input class="button" type="submit" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print $langs->trans("Ref").':</td><td><input type="text" name="search_ref" class="flat" size="16">';
|
||||
print '</td><td rowspan="3"><input class="button" type="submit" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
print $langs->trans("Name").':</td><td><input type="text" name="search_nom" class="flat" size="16">';
|
||||
print '</td></tr>';
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
print $langs->trans("Other").':</td><td><input type="text" name="sall" class="flat" size="16">';
|
||||
@ -207,7 +217,8 @@ $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";
|
||||
$sql.= " WHERE a.fk_adherent_type = ta.rowid";
|
||||
$sql.= " WHERE a.entity IN (".getEntity().")";
|
||||
$sql.= " AND a.fk_adherent_type = ta.rowid";
|
||||
$sql.= $db->order("a.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
@ -259,7 +270,8 @@ $sql = "SELECT a.rowid, a.statut, a.nom, a.prenom,";
|
||||
$sql.= " datefin as date_end_subscription,";
|
||||
$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."cotisation as c";
|
||||
$sql.= " WHERE c.fk_adherent = a.rowid";
|
||||
$sql.= " WHERE a.entity IN (".getEntity().")";
|
||||
$sql.= " AND c.fk_adherent = a.rowid";
|
||||
$sql.= $db->order("c.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
@ -321,7 +333,7 @@ foreach ($AdherentType as $key => $adhtype)
|
||||
print '<td><a href="type.php?rowid='.$adhtype->id.'">'.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,dol_size(16)).'</a></td>';
|
||||
print '<td align="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td align="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td align="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,gmmktime(),3).'</td>';
|
||||
print '<td align="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).'</td>';
|
||||
print '<td align="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -329,7 +341,7 @@ print '<tr class="liste_total">';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td class="liste_total" align="right">'.$SommeA.' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td class="liste_total" align="right">'.$SommeB.' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td class="liste_total" align="right">'.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->cotisation,gmmktime(),3).'</td>';
|
||||
print '<td class="liste_total" align="right">'.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).'</td>';
|
||||
print '<td class="liste_total" align="right">'.$SommeD.' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -345,7 +357,8 @@ $numb=0;
|
||||
|
||||
$sql = "SELECT c.cotisation, c.dateadh";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
|
||||
$sql.= " WHERE d.rowid = c.fk_adherent";
|
||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||
$sql.= " AND d.rowid = c.fk_adherent";
|
||||
if(isset($date_select) && $date_select != '')
|
||||
{
|
||||
$sql .= " AND dateadh LIKE '$date_select%'";
|
||||
@ -401,7 +414,6 @@ print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2006 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
|
||||
@ -32,8 +32,10 @@ $langs->load("bills");
|
||||
$langs->load("members");
|
||||
$langs->load("users");
|
||||
|
||||
if (!$user->rights->adherent->lire)
|
||||
accessforbidden();
|
||||
$id=(GETPOST('id','int') ? GETPOST('id','int') : GETPOST('rowid','int'));
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$id);
|
||||
|
||||
|
||||
/*
|
||||
@ -43,9 +45,8 @@ if (!$user->rights->adherent->lire)
|
||||
llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
||||
|
||||
$adh = new Adherent($db);
|
||||
$adh->id=$_GET["id"];
|
||||
$adh->fetch($_GET["id"]);
|
||||
$adh->info($_GET["id"]);
|
||||
$adh->fetch($id);
|
||||
$adh->info($id);
|
||||
|
||||
$head = member_prepare_head($adh);
|
||||
|
||||
@ -59,7 +60,6 @@ print '</td></tr></table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2010 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
|
||||
@ -31,8 +31,6 @@ require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
@ -43,27 +41,32 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="ASC"; }
|
||||
if (! $sortfield) { $sortfield="d.nom"; }
|
||||
|
||||
$filter=$_GET["filter"];
|
||||
$statut=isset($_GET["statut"])?$_GET["statut"]:'';
|
||||
$action=GETPOST("action");
|
||||
$filter=GETPOST("filter");
|
||||
$statut=GETPOST("statut");
|
||||
$search=GETPOST("search");
|
||||
$search_ref=GETPOST("search_ref");
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_prenom=GETPOST("search_prenom");
|
||||
$search_login=GETPOST("search_login");
|
||||
$type=GETPOST("type");
|
||||
$search_email=GETPOST("search_email");
|
||||
$search_categ=GETPOST("search_categ");
|
||||
$sall=GETPOST("sall",'int');
|
||||
|
||||
|
||||
if ($_REQUEST["button_removefilter"])
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$_GET["search_nom"]="";
|
||||
$_REQUEST["search_nom"]="";
|
||||
$_GET["search_prenom"]="";
|
||||
$_REQUEST["search_prenom"]="";
|
||||
$_GET["type"]="";
|
||||
$_REQUEST["type"]="";
|
||||
$_GET["search_email"]="";
|
||||
$_REQUEST["search_email"]="";
|
||||
$_GET["search_categ"]="";
|
||||
$_REQUEST["search_categ"]="";
|
||||
$search="";
|
||||
$search_ref="";
|
||||
$search_nom="";
|
||||
$search_prenom="";
|
||||
$search_login="";
|
||||
$type="";
|
||||
$search_email="";
|
||||
$search_categ="";
|
||||
$sall="";
|
||||
}
|
||||
|
||||
// Load categ filters
|
||||
$search_categ = isset($_GET["search_categ"])?$_GET["search_categ"]:$_POST["search_categ"];
|
||||
|
||||
|
||||
/*
|
||||
@ -90,44 +93,44 @@ if ($search_categ) $sql.= " AND d.rowid = cf.fk_member"; // Join for the needed
|
||||
$sql.= " AND d.entity = ".$conf->entity;
|
||||
if ($sall)
|
||||
{
|
||||
$sql.=" AND (d.prenom like '%".$sall."%' OR d.nom like '%".$sall."%' OR d.societe like '%".$sall."%'";
|
||||
$sql.=" OR d.email like '%".$sall."%' OR d.login like '%".$sall."%' OR d.adresse like '%".$sall."%'";
|
||||
$sql.=" OR d.ville like '%".$sall."%' OR d.note like '%".$sall."%')";
|
||||
$sql.=" AND (";
|
||||
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR ";
|
||||
$sql.=" d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.adresse LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
}
|
||||
if ($_REQUEST["type"] > 0)
|
||||
if ($type > 0)
|
||||
{
|
||||
$sql.=" AND t.rowid=".$_REQUEST["type"];
|
||||
$sql.=" AND t.rowid=".$type;
|
||||
}
|
||||
if (isset($_GET["statut"]))
|
||||
if (isset($_GET["statut"]) || isset($_POST["statut"]))
|
||||
{
|
||||
$sql.=" AND d.statut in ($statut)"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
$sql.=" AND d.statut in (".$statut.")"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
}
|
||||
if ( $_POST["action"] == 'search')
|
||||
if ($search_ref)
|
||||
{
|
||||
if (isset($_POST['search']) && $_POST['search'] != '')
|
||||
{
|
||||
$sql.= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')";
|
||||
}
|
||||
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$search_ref.")";
|
||||
else $sql.=" AND 1 = 2"; // Always wrong
|
||||
}
|
||||
if ($_GET["search_nom"])
|
||||
if ($search_nom)
|
||||
{
|
||||
$sql.= " AND (d.prenom LIKE '%".$_GET["search_nom"]."%' OR d.nom LIKE '%".$_GET["search_nom"]."%')";
|
||||
$sql.= " AND (d.prenom LIKE '%".$search_nom."%' OR d.nom LIKE '%".$search_nom."%')";
|
||||
}
|
||||
if ($_GET["search_login"])
|
||||
if ($search_login)
|
||||
{
|
||||
$sql.= " AND d.login LIKE '%".$_GET["search_login"]."%'";
|
||||
$sql.= " AND d.login LIKE '%".$search_login."%'";
|
||||
}
|
||||
if ($_GET["search_email"])
|
||||
if ($search_email)
|
||||
{
|
||||
$sql.= " AND (d.email LIKE '%".$_GET["search_email"]."%')";
|
||||
$sql.= " AND (d.email LIKE '%".$search_email."%')";
|
||||
}
|
||||
if ($filter == 'uptodate')
|
||||
{
|
||||
$sql.=" AND datefin >= ".$db->idate($now);
|
||||
$sql.=" AND datefin >= '".$db->idate($now)."'";
|
||||
}
|
||||
if ($filter == 'outofdate')
|
||||
{
|
||||
$sql.=" AND datefin < ".$db->idate($now);
|
||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||
}
|
||||
// Insert categ filter
|
||||
if ($search_categ)
|
||||
@ -147,6 +150,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
dol_syslog("get list sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -163,12 +167,12 @@ if ($resql)
|
||||
if ($statut == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
|
||||
if ($statut == '0') { $titre=$langs->trans("MembersListResiliated"); }
|
||||
}
|
||||
elseif ($_POST["action"] == 'search')
|
||||
elseif ($action == 'search')
|
||||
{
|
||||
$titre=$langs->trans("MembersListQualified");
|
||||
}
|
||||
|
||||
if ($_REQUEST["type"] > 0)
|
||||
if ($type > 0)
|
||||
{
|
||||
$membertype=new AdherentType($db);
|
||||
$result=$membertype->fetch($_REQUEST["type"]);
|
||||
@ -176,16 +180,16 @@ if ($resql)
|
||||
}
|
||||
|
||||
$param="";
|
||||
if (isset($_GET["statut"])) $param.="&statut=".$_GET["statut"];
|
||||
if (isset($_GET["search_nom"])) $param.="&search_nom=".$_GET["search_nom"];
|
||||
if (isset($_GET["search_login"])) $param.="&search_login=".$_GET["search_login"];
|
||||
if (isset($_GET["search_email"])) $param.="&search_email=".$_GET["search_email"];
|
||||
if (isset($_GET["filter"])) $param.="&filter=".$_GET["filter"];
|
||||
if (isset($_GET["statut"])) $param.="&statut=".$statut;
|
||||
if ($search_nom) $param.="&search_nom=".$search_nom;
|
||||
if ($search_login) $param.="&search_login=".$search_login;
|
||||
if ($search_email) $param.="&search_email=".$search_email;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
||||
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
||||
}
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -202,40 +206,44 @@ if ($resql)
|
||||
if ($moreforfilter)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" colspan="8">';
|
||||
print '<td class="liste_titre" colspan="9">';
|
||||
print $moreforfilter;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),"liste.php","d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),"liste.php","d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),"liste.php","t.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),"liste.php","d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),"liste.php","d.email",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),"liste.php","",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"t.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_nom" value="'.$_REQUEST["search_nom"].'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_ref" value="'.$search_ref.'" size="4"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$_REQUEST["search_login"].'" size="7"></td>';
|
||||
print '<input class="flat" type="text" name="search_nom" value="'.$search_nom.'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
$listetype=$membertypestatic->liste_array();
|
||||
print $form->selectarray("type", $listetype, $_REQUEST["type"], 1, 0, 0, '', 0, 12);
|
||||
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 12);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_email" value="'.$_REQUEST["search_email"].'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_email" value="'.$search_email.'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
@ -254,19 +262,27 @@ if ($resql)
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$datefin=$db->jdate($objp->datefin);
|
||||
|
||||
// Nom
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
$memberstatic->id=$objp->rowid;
|
||||
$memberstatic->ref=$objp->rowid;
|
||||
$memberstatic->lastname=$objp->lastname;
|
||||
$memberstatic->firstname=$objp->firstname;
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
// Ref
|
||||
print "<td>";
|
||||
print $memberstatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
// Lastname
|
||||
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";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))."</a></td>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))."</a></td>\n";
|
||||
}
|
||||
|
||||
// Login
|
||||
@ -343,7 +359,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -27,14 +27,15 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
|
||||
|
||||
$action=GETPOST('action');
|
||||
$id=GETPOST('id','int');
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
$langs->load("members");
|
||||
$langs->load("bills");
|
||||
|
||||
if (!$user->rights->adherent->lire) accessforbidden();
|
||||
$action=GETPOST('action','alpha');
|
||||
$id=GETPOST('id','int');
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$id);
|
||||
|
||||
$object = new Adherent($db);
|
||||
$result=$object->fetch($id);
|
||||
@ -49,7 +50,7 @@ if ($result > 0)
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"] == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
|
||||
if ($action == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
@ -174,7 +175,7 @@ if ($id)
|
||||
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -73,7 +73,8 @@ if ($mode)
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.libelle as label";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.pays = c.rowid";
|
||||
$sql.=" WHERE d.statut = 1";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY c.libelle, c.code";
|
||||
//print $sql;
|
||||
}
|
||||
@ -88,7 +89,8 @@ if ($mode)
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.fk_departement = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid";
|
||||
$sql.=" WHERE d.statut = 1";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY p.libelle, p.code, c.nom";
|
||||
//print $sql;
|
||||
}
|
||||
@ -102,7 +104,8 @@ if ($mode)
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.ville as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid";
|
||||
$sql.=" WHERE d.statut = 1";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY p.libelle, p.code, d.ville";
|
||||
//print $sql;
|
||||
}
|
||||
@ -194,7 +197,11 @@ else
|
||||
// Show graphics
|
||||
if ($mode == 'memberbycountry')
|
||||
{
|
||||
$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/graph-color.php';
|
||||
if (is_readable($color_file)) include_once($color_file);
|
||||
|
||||
// Assume we've already included the proper headers so just call our script inline
|
||||
// More doc: https://developers.google.com/chart/interactive/docs/gallery/geomap?hl=fr-FR
|
||||
print "\n<script type='text/javascript'>\n";
|
||||
print "google.load('visualization', '1', {'packages': ['geomap']});\n";
|
||||
print "google.setOnLoadCallback(drawMap);\n";
|
||||
@ -209,10 +216,9 @@ if ($mode == 'memberbycountry')
|
||||
$i=0;
|
||||
foreach($data as $val)
|
||||
{
|
||||
//$valcountry=ucfirst($val['code']);
|
||||
$valcountry=ucfirst($val['label_en']);
|
||||
// fix case of uk
|
||||
if ($valcountry == 'Great Britain') { $valcountry = 'United Kingdom'; }
|
||||
$valcountry=strtoupper($val['code']); // Should be ISO-3166 code (faster)
|
||||
//$valcountry=ucfirst($val['label_en']);
|
||||
if ($valcountry == 'Great Britain') { $valcountry = 'United Kingdom'; } // fix case of uk (when we use labels)
|
||||
print "\tdata.setValue(".$i.", 0, \"".$valcountry."\");\n";
|
||||
print "\tdata.setValue(".$i.", 1, ".$val['nb'].");\n";
|
||||
// Google's Geomap only supports up to 400 entries
|
||||
@ -226,6 +232,7 @@ if ($mode == 'memberbycountry')
|
||||
//print "\toptions['zoomOutLabel'] = '".dol_escape_js($langs->transnoentitiesnoconv("Numbers"))."';\n";
|
||||
print "\toptions['width'] = ".$graphwidth.";\n";
|
||||
print "\toptions['height'] = ".$graphheight.";\n";
|
||||
print "\toptions['colors'] = [0x".colorArrayToHex($theme_datacolor[1],'BBBBBB').", 0x".colorArrayToHex($theme_datacolor[0],'444444')."];\n";
|
||||
print "\tvar container = document.getElementById('".$mode."');\n";
|
||||
print "\tvar geomap = new google.visualization.GeoMap(container);\n";
|
||||
print "\tgeomap.draw(data, options);\n";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 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
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 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
|
||||
@ -49,8 +49,8 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="d.nom"; }
|
||||
|
||||
// Security check
|
||||
if (! $user->rights->adherent->lire) accessforbidden();
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');
|
||||
|
||||
if (GETPOST('button_removefilter'))
|
||||
{
|
||||
@ -153,7 +153,8 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@ -267,10 +268,8 @@ if ($rowid > 0)
|
||||
if ($action != 'edit')
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$adht->id = $rowid;
|
||||
$adht->fetch($rowid);
|
||||
|
||||
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].'?rowid='.$adht->id;
|
||||
@ -344,7 +343,7 @@ if ($rowid > 0)
|
||||
$sql.= " t.libelle as type, t.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
|
||||
$sql.= " AND d.entity = ".$conf->entity;
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
$sql.= " AND t.rowid = ".$adht->id;
|
||||
if ($sall)
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -33,7 +33,8 @@ if (!$user->admin)
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
|
||||
$action=$_POST["action"];
|
||||
$action = GETPOST('action','alpha');
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
|
||||
// Get list of triggers available
|
||||
$sql = "SELECT a.rowid, a.code, a.label, a.elementtype";
|
||||
@ -66,7 +67,7 @@ else
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ($action == "save" && empty($_POST["cancel"]))
|
||||
if ($action == "save" && empty($cancel))
|
||||
{
|
||||
$i=0;
|
||||
|
||||
@ -76,7 +77,7 @@ if ($action == "save" && empty($_POST["cancel"]))
|
||||
{
|
||||
$param='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
|
||||
//print "param=".$param." - ".$_POST[$param];
|
||||
if (! empty($_POST[$param])) $res = dolibarr_set_const($db,$param,$_POST[$param],'chaine',0,'',$conf->entity);
|
||||
if (GETPOST($param,'alpha')) $res = dolibarr_set_const($db,$param,GETPOST($param,'alpha'),'chaine',0,'',$conf->entity);
|
||||
else $res = dolibarr_del_const($db,$param,$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
@ -141,7 +142,7 @@ if (! empty($triggers))
|
||||
print '<td align="right" width="40">';
|
||||
$key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
|
||||
$value=$conf->global->$key;
|
||||
print '<input '.$bc[$var].' type="checkbox" name="'.$key.'" value="1"'.((($_GET["action"]=='selectall'||$value) && $_GET["action"]!="selectnone")?' checked="checked"':'').'>';
|
||||
print '<input '.$bc[$var].' type="checkbox" name="'.$key.'" value="1"'.((($action=='selectall'||$value) && $action!="selectnone")?' checked="checked"':'').'>';
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -37,8 +37,8 @@ $langs->load("admin");
|
||||
$langs->load("other");
|
||||
|
||||
$def = array();
|
||||
$actiontest=GETPOST("test");
|
||||
$actionsave=GETPOST("save");
|
||||
$actiontest=GETPOST('test','alpha');
|
||||
$actionsave=GETPOST('save','alpha');
|
||||
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||
@ -53,7 +53,7 @@ if ($actionsave)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$disableext=GETPOST("AGENDA_DISABLE_EXT");
|
||||
$disableext=GETPOST('AGENDA_DISABLE_EXT','alpha');
|
||||
if ($disableext) $disableext=0; else $disableext=1;
|
||||
$res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0);
|
||||
|
||||
@ -63,20 +63,20 @@ if ($actionsave)
|
||||
// Save agendas
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
$color=trim(GETPOST("agenda_ext_color".$i));
|
||||
$color=trim(GETPOST('agenda_ext_color'.$i,'alpha'));
|
||||
if ($color=='-1') $color='';
|
||||
|
||||
//print 'color='.$color;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,trim(GETPOST("agenda_ext_name".$i)),'chaine',0);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,trim(GETPOST('agenda_ext_name'.$i),'alpha'),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,trim(GETPOST("agenda_ext_src".$i)),'chaine',0);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,trim(GETPOST('agenda_ext_src'.$i,'alpha')),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$i++;
|
||||
}
|
||||
// Save nb of agenda
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST("AGENDA_EXT_NB")),'chaine',0);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||
@ -119,7 +119,7 @@ dol_fiche_head($head, 'extsites', $langs->trans("Agenda"));
|
||||
|
||||
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
||||
$selectedvalue=(GETPOST("AGENDA_DISABLE_AGENDA"))?GETPOST("AGENDA_DISABLE_EXT"):$conf->global->AGENDA_DISABLE_EXT;
|
||||
$selectedvalue=(GETPOST('AGENDA_DISABLE_AGENDA','alpha'))?GETPOST('AGENDA_DISABLE_EXT','alpha'):$conf->global->AGENDA_DISABLE_EXT;
|
||||
if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
|
||||
print $langs->trans("ExtSitesEnableThisTool").' '.$form->selectyesno("AGENDA_DISABLE_EXT",$selectedvalue,1).'<br><br>';
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -34,7 +35,7 @@ $langs->load("other");
|
||||
$langs->load("agenda");
|
||||
|
||||
$def = array();
|
||||
$actionsave=$_POST["save"];
|
||||
$actionsave=GETPOST('save','alpha');
|
||||
|
||||
// Sauvegardes parametres
|
||||
if ($actionsave)
|
||||
@ -43,9 +44,9 @@ if ($actionsave)
|
||||
|
||||
$db->begin();
|
||||
|
||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim($_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_PAST_DELAY',trim($_POST["MAIN_AGENDA_EXPORT_PAST_DELAY"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim($_POST["MAIN_AGENDA_EXPORT_CACHE"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_PAST_DELAY',trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')),'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($i >= 3)
|
||||
{
|
||||
@ -94,19 +95,19 @@ print "</tr>";
|
||||
|
||||
print "<tr class=\"impair\">";
|
||||
print '<td class="fieldrequired">'.$langs->trans("PasswordTogetVCalExport")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_XCAL_EXPORTKEY\" value=\"". ($_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]?$_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]:$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_XCAL_EXPORTKEY\" value=\"". (GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')?GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha'):$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\"></td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
print "<tr class=\"pair\">";
|
||||
print "<td>".$langs->trans("PastDelayVCalExport")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_PAST_DELAY\" value=\"". ($_POST["MAIN_AGENDA_EXPORT_PAST_DELAY"]?$_POST["MAIN_AGENDA_EXPORT_PAST_DELAY"]:$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY) . "\" size=\"10\"> ".$langs->trans("days")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_PAST_DELAY\" value=\"". (GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')?GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha'):$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY) . "\" size=\"10\"> ".$langs->trans("days")."</td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
print "<tr class=\"impair\">";
|
||||
print "<td>".$langs->trans("UseACacheDelay")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_CACHE\" value=\"". ($_POST["MAIN_AGENDA_EXPORT_CACHE"]?$_POST["MAIN_AGENDA_EXPORT_CACHE"]:$conf->global->MAIN_AGENDA_EXPORT_CACHE) . "\" size=\"10\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_CACHE\" value=\"". (GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')?GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha'):$conf->global->MAIN_AGENDA_EXPORT_CACHE) . "\" size=\"10\"></td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -31,7 +32,7 @@ $langs->load("admin");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
|
||||
/*
|
||||
@ -40,8 +41,8 @@ $action = GETPOST("action");
|
||||
|
||||
if ($action == 'setcoder')
|
||||
{
|
||||
$coder = GETPOST("coder");
|
||||
$code_id = GETPOST("code_id");
|
||||
$coder = GETPOST('coder','alpha');
|
||||
$code_id = GETPOST('code_id','alpha');
|
||||
$sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sqlp.= " SET coder = '" . $coder."'";
|
||||
$sqlp.= " WHERE rowid = ". $code_id;
|
||||
@ -52,17 +53,17 @@ if ($action == 'setcoder')
|
||||
}
|
||||
else if ($action == 'setgenbarcodelocation')
|
||||
{
|
||||
$location = GETPOST("genbarcodelocation");
|
||||
$location = GETPOST('genbarcodelocation','alpha');
|
||||
$res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
else if ($action == 'setdefaultbarcodetype')
|
||||
{
|
||||
$coder_id = GETPOST("coder_id");
|
||||
$coder_id = GETPOST('coder_id','alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
else if ($action == 'GENBARCODE_BARCODETYPE_THIRDPARTY')
|
||||
{
|
||||
$coder_id = GETPOST("coder_id");
|
||||
$coder_id = GETPOST('coder_id','alpha');
|
||||
$res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
/*
|
||||
|
||||
@ -169,14 +169,25 @@ if ($action == 'switch')
|
||||
$objto=new ModeleBoxes($db);
|
||||
$objto->fetch($_GET["switchto"]);
|
||||
|
||||
$resultupdatefrom=0;
|
||||
$resultupdateto=0;
|
||||
if (is_object($objfrom) && is_object($objto))
|
||||
{
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order='".$objto->box_order."' WHERE rowid=".$objfrom->rowid;
|
||||
//print "xx".$sql;
|
||||
$newfirst=$objto->box_order;
|
||||
$newsecond=$objfrom->box_order;
|
||||
if ($newfirst == $newsecond)
|
||||
{
|
||||
$newsecondchar=preg_replace('/[0-9]+/','',$newsecond);
|
||||
$newsecondnum=preg_replace('/[a-zA-Z]+/','',$newsecond);
|
||||
$newsecond=sprintf("%s%02d",$newsecondchar?$newsecondchar:'A',$newsecondnum+1);
|
||||
}
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order='".$newfirst."' WHERE rowid=".$objfrom->rowid;
|
||||
dol_syslog($sql);
|
||||
$resultupdatefrom = $db->query($sql);
|
||||
if (! $resultupdatefrom) { dol_print_error($db); }
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order='".$objfrom->box_order."' WHERE rowid=".$objto->rowid;
|
||||
//print "xx".$sql;
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order='".$newsecond."' WHERE rowid=".$objto->rowid;
|
||||
dol_syslog($sql);
|
||||
$resultupdateto = $db->query($sql);
|
||||
if (! $resultupdateto) { dol_print_error($db); }
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php');
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("errors");
|
||||
$langs->load("orders");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@ -47,8 +48,8 @@ $value = GETPOST('value','alpha');
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstorder=GETPOST("maskconstorder");
|
||||
$maskorder=GETPOST("maskorder");
|
||||
$maskconstorder=GETPOST('maskconstorder','alpha');
|
||||
$maskorder=GETPOST('maskorder','alpha');
|
||||
|
||||
if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -66,7 +67,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$commande = new Commande($db);
|
||||
$commande->initAsSpecimen();
|
||||
@ -111,8 +112,8 @@ if ($action == 'specimen')
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$type='order';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
@ -142,8 +143,8 @@ if ($action == 'del')
|
||||
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
@ -312,7 +313,7 @@ foreach ($dirmodels as $reldir)
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type=0;
|
||||
$commande->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$commande);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
|
||||
@ -34,6 +34,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
||||
|
||||
$action=GETPOST('action');
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("companies");
|
||||
|
||||
@ -44,8 +46,8 @@ if (!$user->admin) accessforbidden();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ( (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["cancel"]))
|
||||
|| (isset($_POST["action"]) && $_POST["action"] == 'updateedit') )
|
||||
if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
|| ($action == 'updateedit') )
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
@ -136,6 +138,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["c
|
||||
dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_TRAINER",$_POST["trainer"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID6",$_POST["MAIN_INFO_PROFID6"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"],'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -147,16 +150,16 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["c
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($_POST['action'] != 'updateedit' && ! $message)
|
||||
if ($action != 'updateedit' && ! $message)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'addthumb')
|
||||
if ($action == 'addthumb')
|
||||
{
|
||||
if (file_exists($conf->societe->dir_output.'/logos/'.$_GET["file"]))
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"]))
|
||||
{
|
||||
$isimage=image_format_supported($_GET["file"]);
|
||||
|
||||
@ -199,7 +202,7 @@ if ($_GET["action"] == 'addthumb')
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'removelogo')
|
||||
if ($action == 'removelogo')
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
@ -263,8 +266,7 @@ print_fiche_titre($langs->trans("CompanyFoundation"),'','setup');
|
||||
print $langs->trans("CompanyFundationDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
|| (isset($_POST["action"]) && $_POST["action"] == 'updateedit') )
|
||||
if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
/**
|
||||
* Edition des parametres
|
||||
@ -488,6 +490,22 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// ProfId6
|
||||
if ($langs->transcountry("ProfId6",$country_code) != '-')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId6",$country_code).'</td><td>';
|
||||
if ($country_code)
|
||||
{
|
||||
print '<input name="MAIN_INFO_PROFID6" size="20" value="' . $conf->global->MAIN_INFO_PROFID6 . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $countrynotdefined;
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// TVA Intra
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("VATIntra").'</td><td>';
|
||||
@ -805,6 +823,18 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// ProfId6
|
||||
if ($langs->transcountry("ProfId6",$country_code) != '-')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId6",$country_code).'</td><td>';
|
||||
if ($langs->transcountry("ProfId6",$country_code) != '-')
|
||||
{
|
||||
print $conf->global->MAIN_INFO_PROFID6;
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// TVA
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATIntra").'</td>';
|
||||
@ -969,6 +999,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -33,13 +33,13 @@ $langs->load('compta');
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
$compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES';
|
||||
|
||||
if ($action == 'setcomptamode')
|
||||
{
|
||||
$compta_mode = GETPOST("compta_mode");
|
||||
$compta_mode = GETPOST('compta_mode','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode,'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -58,10 +58,10 @@ if ($action == 'setcomptamode')
|
||||
|
||||
if ($action == 'update' || $action == 'add')
|
||||
{
|
||||
$constname = GETPOST("constname");
|
||||
$constvalue = GETPOST("constvalue");
|
||||
$consttype = GETPOST("consttype");
|
||||
$constnote = GETPOST("constnote");
|
||||
$constname = GETPOST('constname','alpha');
|
||||
$constvalue = GETPOST('constvalue','alpha');
|
||||
$consttype = GETPOST('consttype','alpha');
|
||||
$constnote = GETPOST('constnote','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -34,7 +34,7 @@ $langs->load("deliveries");
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action=GETPOST("action");
|
||||
$action=GETPOST('action','alpha');
|
||||
|
||||
// Shipment note
|
||||
if ($action == 'activate_sending')
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -30,8 +30,8 @@ $langs->load("errors");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$value = GETPOST("value");
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
|
||||
if (empty($conf->global->CONTRACT_ADDON))
|
||||
{
|
||||
@ -45,8 +45,8 @@ if (empty($conf->global->CONTRACT_ADDON))
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconst=$_POST['maskconstcontract'];
|
||||
$maskvalue=$_POST['maskcontract'];
|
||||
$maskconst = GETPOST('maskconstcontract','alpha');
|
||||
$maskvalue = GETPOST('maskcontract','alpha');
|
||||
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -156,7 +156,6 @@ if (is_resource($handle))
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$contract);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -31,14 +32,16 @@ if (!$user->admin) accessforbidden();
|
||||
|
||||
$typeconst=array('yesno','texte','chaine');
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'specimen')
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=$_GET["module"];
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$don = new Don($db);
|
||||
$don->initAsSpecimen();
|
||||
@ -71,25 +74,29 @@ if ($_GET["action"] == 'specimen')
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'setdoc')
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "DON_ADDON_MODEL",$_GET["value"],'chaine',0,'',$conf->entity))
|
||||
if (dolibarr_set_const($db, "DON_ADDON_MODEL",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->DON_ADDON_MODEL = $_GET["value"];
|
||||
$conf->global->DON_ADDON_MODEL = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='donation';
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($_GET["value"])."' AND type = '".$type."'";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."' AND type = '".$type."'";
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($_GET["value"])."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
|
||||
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
|
||||
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
@ -102,22 +109,28 @@ if ($_GET["action"] == 'setdoc')
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'set')
|
||||
if ($action == 'set')
|
||||
{
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$type='donation';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($_GET["value"])."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
|
||||
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$resql=$db->query($sql);
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'del')
|
||||
if ($action == 'del')
|
||||
{
|
||||
$value = GETPOST('value','alpha');
|
||||
|
||||
$type='donation';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||
$sql .= " WHERE nom = '".$value."' AND type = '".$type."'";
|
||||
$resql=$db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,8 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -37,8 +38,11 @@ $langs->load("deliveries");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action=GETPOST("action");
|
||||
$value=GETPOST("value");
|
||||
$action=GETPOST('action','alpha');
|
||||
$value=GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type='shipping';
|
||||
|
||||
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
|
||||
{
|
||||
@ -49,34 +53,95 @@ if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconst=GETPOST('maskconstexpedition','alpha');
|
||||
$maskvalue=GETPOST('maskexpedition','alpha');
|
||||
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_SHIPPING_FREE_TEXT')
|
||||
{
|
||||
$freetext=GETPOST('SHIPPING_FREE_TEXT','alpha');
|
||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$exp = new Expedition($db);
|
||||
$exp->initAsSpecimen();
|
||||
//$exp->fetch_commande();
|
||||
|
||||
// Charge le modele
|
||||
$dir = "/core/modules/expedition/doc/";
|
||||
$file = "pdf_expedition_".$modele.".modules.php";
|
||||
$file = dol_buildpath($dir.$file);
|
||||
if (file_exists($file))
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$file=dol_buildpath($reldir."core/modules/expedition/doc/pdf_expedition_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_expedition_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
$classname = "pdf_expedition_".$modele;
|
||||
require_once($file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($obj->write_file($exp,$langs) > 0)
|
||||
if ($module->write_file($exp,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$obj->error.'</font>';
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -89,30 +154,13 @@ if ($action == 'specimen')
|
||||
// Activate a model
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$type='shipping';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
if ($db->query($sql))
|
||||
{
|
||||
|
||||
}
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
{
|
||||
$type='shipping';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql.= " AND type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
if ($db->query($sql))
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
@ -121,46 +169,27 @@ if ($action == 'del')
|
||||
// Set default model
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
$conf->global->EXPEDITION_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='shipping';
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql_del.= " AND type = '".$type."'";
|
||||
$sql_del.= " AND entity = ".$conf->entity;
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO A quoi servent les methode d'expedition ?
|
||||
if ($action == 'setmethod' || $action== 'setmod')
|
||||
{
|
||||
$module=GETPOST("module");
|
||||
$moduleid=GETPOST("moduleid");
|
||||
$statut=GETPOST("statut");
|
||||
$module=GETPOST('module','alpha');
|
||||
$moduleid=GETPOST('moduleid','alpha');
|
||||
$statut=GETPOST('statut','alpha');
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_$module.modules.php");
|
||||
|
||||
@ -231,28 +260,8 @@ if ($action == 'setmod')
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
||||
$module=GETPOST("module");
|
||||
dolibarr_set_const($db, "EXPEDITION_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "EXPEDITION_ADDON",$module,'chaine',0,'',$conf->entity);
|
||||
|
||||
}
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconst=GETPOST("maskconstexpedition");
|
||||
$maskvalue=GETPOST("maskexpedition");
|
||||
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setmodel')
|
||||
@ -260,46 +269,14 @@ if ($action == 'setmodel')
|
||||
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft=GETPOST("SHIPPING_DRAFT_WATERMARK");
|
||||
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_SHIPPING_FREE_TEXT')
|
||||
{
|
||||
$free=GETPOST("SHIPPING_FREE_TEXT");
|
||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
llxHeader("","");
|
||||
|
||||
@ -349,9 +326,9 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = $dirroot . "/core/modules/expedition/";
|
||||
$dir = dol_buildpath($reldir."core/modules/expedition/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
@ -409,7 +386,6 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$expedition);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
@ -482,15 +458,14 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
$var=true;
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = $dirroot . "/core/modules/expedition/doc/";
|
||||
$dir = dol_buildpath($reldir."core/modules/expedition/doc/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle=opendir($dir);
|
||||
$var=true;
|
||||
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
@ -501,7 +476,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $name;
|
||||
print "</td><td>\n";
|
||||
require_once($dir.$file);
|
||||
@ -513,17 +488,10 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
//if ($conf->global->EXPEDITION_ADDON_PDF != $name)
|
||||
//{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// print img_picto($langs->trans("Activated"),'switch_on');
|
||||
//}
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
@ -613,4 +581,4 @@ dol_htmloutput_mesg($mesg);
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
?>
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -44,10 +45,10 @@ $value = GETPOST('value','alpha');
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstinvoice=GETPOST("maskconstinvoice");
|
||||
$maskconstcredit=GETPOST("maskconstcredit");
|
||||
$maskinvoice=GETPOST("maskinvoice");
|
||||
$maskcredit=GETPOST("maskcredit");
|
||||
$maskconstinvoice=GETPOST('maskconstinvoice','alpha');
|
||||
$maskconstcredit=GETPOST('maskconstcredit','alpha');
|
||||
$maskinvoice=GETPOST('maskinvoice','alpha');
|
||||
$maskcredit=GETPOST('maskcredit','alpha');
|
||||
if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity);
|
||||
if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -65,7 +66,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$facture = new Facture($db);
|
||||
$facture->initAsSpecimen();
|
||||
@ -116,8 +117,8 @@ if ($action == 'setModuleOptions')
|
||||
{
|
||||
if (array_key_exists('param'.$i,$_POST))
|
||||
{
|
||||
$param=$_POST["param".$i];
|
||||
$value=$_POST["value".$i];
|
||||
$param=GETPOST("param".$i,'alpha');
|
||||
$value=GETPOST("value".$i,'alpha');
|
||||
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
}
|
||||
@ -135,8 +136,8 @@ if ($action == 'setModuleOptions')
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$type='invoice';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
@ -166,8 +167,8 @@ if ($action == 'del')
|
||||
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
@ -214,8 +215,8 @@ if ($action == 'setmod')
|
||||
|
||||
if ($action == 'setribchq')
|
||||
{
|
||||
$rib = GETPOST("rib");
|
||||
$chq = GETPOST("chq");
|
||||
$rib = GETPOST('rib','alpha');
|
||||
$chq = GETPOST('chq','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib,'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq,'chaine',0,'',$conf->entity);
|
||||
@ -234,7 +235,7 @@ if ($action == 'setribchq')
|
||||
|
||||
if ($action == 'set_FACTURE_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft = GETPOST("FACTURE_DRAFT_WATERMARK");
|
||||
$draft = GETPOST('FACTURE_DRAFT_WATERMARK','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -252,7 +253,7 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK')
|
||||
|
||||
if ($action == 'set_FACTURE_FREE_TEXT')
|
||||
{
|
||||
$free = GETPOST("FACTURE_FREE_TEXT");
|
||||
$free = GETPOST('FACTURE_FREE_TEXT','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "FACTURE_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -270,7 +271,7 @@ if ($action == 'set_FACTURE_FREE_TEXT')
|
||||
|
||||
if ($action == 'setforcedate')
|
||||
{
|
||||
$forcedate = GETPOST("forcedate");
|
||||
$forcedate = GETPOST('forcedate','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION",$forcedate,'chaine',0,'',$conf->entity);
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +31,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$langs->load("admin");
|
||||
$langs->load("fckeditor");
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
// Constante et traduction de la description du module
|
||||
@ -62,7 +65,7 @@ $picto = array(
|
||||
|
||||
foreach($modules as $const => $desc)
|
||||
{
|
||||
if ($_GET["action"] == 'activate_'.strtolower($const))
|
||||
if ($action == 'activate_'.strtolower($const))
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity);
|
||||
// Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
|
||||
@ -73,7 +76,7 @@ foreach($modules as $const => $desc)
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
if ($_GET["action"] == 'disable_'.strtolower($const))
|
||||
if ($action == 'disable_'.strtolower($const))
|
||||
{
|
||||
dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const,$conf->entity);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
@ -81,9 +84,9 @@ foreach($modules as $const => $desc)
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["save"])
|
||||
if (GETPOST('save','alpha'))
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_TEST", $_POST["formtestfield"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FCKEDITOR_TEST", GETPOST('formtestfield','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2012 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 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -36,11 +36,13 @@ $langs->load("admin");
|
||||
$langs->load("errors");
|
||||
$langs->load("interventions");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$value = GETPOST("value");
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type='ficheinter';
|
||||
|
||||
|
||||
/*
|
||||
@ -48,8 +50,8 @@ $value = GETPOST("value");
|
||||
*/
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconst=GETPOST("maskconst");
|
||||
$maskvalue=GETPOST("maskvalue");
|
||||
$maskconst=GETPOST('maskconst','alpha');
|
||||
$maskvalue=GETPOST('maskvalue','alpha');
|
||||
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -66,7 +68,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($action == 'set_FICHINTER_FREE_TEXT')
|
||||
{
|
||||
$freetext= GETPOST("FICHINTER_FREE_TEXT");
|
||||
$freetext= GETPOST('FICHINTER_FREE_TEXT','alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -83,7 +85,7 @@ if ($action == 'set_FICHINTER_FREE_TEXT')
|
||||
|
||||
if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft= GETPOST("FICHINTER_DRAFT_WATERMARK");
|
||||
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -101,23 +103,32 @@ if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=$_GET["module"];
|
||||
$modele= GETPOST('module','alpha');
|
||||
|
||||
$inter = new Fichinter($db);
|
||||
$inter->initAsSpecimen();
|
||||
|
||||
// Charge le modele
|
||||
$dir = "/core/modules/fichinter/doc/";
|
||||
$file = "pdf_".$modele.".modules.php";
|
||||
$file = dol_buildpath($dir.$file);
|
||||
if (file_exists($file))
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$file=dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
$classname = "pdf_".$modele;
|
||||
require_once($file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($obj->write_file($inter,$langs) > 0)
|
||||
if ($module->write_file($inter,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
|
||||
return;
|
||||
@ -137,30 +148,13 @@ if ($action == 'specimen')
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$type='ficheinter';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
if ($db->query($sql))
|
||||
{
|
||||
|
||||
}
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
{
|
||||
$type='ficheinter';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql.= " AND type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
if ($db->query($sql))
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
@ -168,11 +162,6 @@ if ($action == 'del')
|
||||
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
@ -181,28 +170,10 @@ if ($action == 'setdoc')
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='ficheinter';
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql_del.= " AND type = '".$type."'";
|
||||
$sql_del.= " AND entity = ".$conf->entity;
|
||||
dol_syslog("fichinter: sql_del=".$sql_del);
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
dol_syslog("fichinter: sql_del=".$sql_del);
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,6 +190,8 @@ if ($action == 'setmod')
|
||||
* View
|
||||
*/
|
||||
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
@ -242,9 +215,9 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = $dirroot . "/core/modules/fichinter/";
|
||||
$dir = dol_buildpath($reldir."core/modules/fichinter/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
@ -260,7 +233,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
$file = $reg[1];
|
||||
$classname = substr($file,4);
|
||||
|
||||
require_once($dir.$file.".php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/modules/fichinter/".$file.".php");
|
||||
|
||||
$module = new $file;
|
||||
|
||||
@ -361,9 +334,9 @@ print "</tr>\n";
|
||||
clearstatcache();
|
||||
|
||||
$var=true;
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
{
|
||||
$dir = $dirroot . "/core/modules/fichinter/doc/";
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = dol_buildpath($reldir."core/modules/fichinter/doc/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-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
|
||||
@ -38,9 +38,9 @@ $langs->load("admin");
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$type=GETPOST('type');
|
||||
$value=GETPOST('value');
|
||||
$action=GETPOST('action');
|
||||
$type=GETPOST('type', 'alpha');
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
|
||||
$specimenthirdparty=new Societe($db);
|
||||
$specimenthirdparty->initAsSpecimen();
|
||||
@ -52,8 +52,9 @@ $specimenthirdparty->initAsSpecimen();
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstorder=$_POST['maskconstorder'];
|
||||
$maskorder=$_POST['maskorder'];
|
||||
$maskconstorder=GETPOST('maskconstorder','alpha');
|
||||
$maskorder=GETPOST('maskorder','alpha');
|
||||
|
||||
if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -70,7 +71,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($action == 'specimen') // For orders
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$commande = new CommandeFournisseur($db);
|
||||
$commande->initAsSpecimen();
|
||||
@ -116,7 +117,7 @@ if ($action == 'specimen') // For orders
|
||||
|
||||
if ($action == 'specimenfacture') // For invoices
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$facture = new FactureFournisseur($db);
|
||||
$facture->initAsSpecimen();
|
||||
@ -162,10 +163,13 @@ if ($action == 'specimenfacture') // For invoices
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
|
||||
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$res=$db->query($sql);
|
||||
if ($res)
|
||||
@ -191,14 +195,17 @@ if ($action == 'del')
|
||||
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
if ($_GET["type"] == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
if ($type == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
if ($_GET["type"] == 'invoice_supplier' && dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
if ($type == 'invoice_supplier' && dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value;
|
||||
}
|
||||
@ -212,8 +219,8 @@ if ($action == 'setdoc')
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
|
||||
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
@ -242,7 +249,7 @@ if ($action == 'addcat')
|
||||
|
||||
if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
|
||||
{
|
||||
$free = GETPOST("SUPPLIER_INVOICE_FREE_TEXT");
|
||||
$free = GETPOST('SUPPLIER_INVOICE_FREE_TEXT','alpha');
|
||||
$res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@ -218,7 +218,7 @@ if ($action == 'edit') // Edit
|
||||
|
||||
// Hide wiki link on login page
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1)).'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td>';
|
||||
print $form->selectyesno('MAIN_HELP_DISABLELINK',isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
@ -366,7 +366,7 @@ else // Show
|
||||
|
||||
// Link to wiki help
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1)).'</td><td colspan="2">';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img//helpdoc.png','',1)).'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_HELP_DISABLELINK,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -4,8 +4,9 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -36,8 +37,11 @@ $langs->load("deliveries");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$value = GETPOST("value");
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type='delivery';
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -45,8 +49,8 @@ $value = GETPOST("value");
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstdelivery=GETPOST("maskconstdelivery");
|
||||
$maskdelivery=GETPOST("maskdelivery");
|
||||
$maskconstdelivery=GETPOST('maskconstdelivery','alpha');
|
||||
$maskdelivery=GETPOST('maskdelivery','alpha');
|
||||
if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -61,108 +65,9 @@ if ($action == 'updateMask')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
|
||||
$sending = new Livraison($db);
|
||||
$sending->initAsSpecimen();
|
||||
//$sending->fetch_commande();
|
||||
|
||||
// Charge le modele
|
||||
$dir = DOL_DOCUMENT_ROOT . "/core/modules/livraison/pdf/";
|
||||
$file = "pdf_".$modele.".modules.php";
|
||||
if (file_exists($dir.$file))
|
||||
{
|
||||
$classname = "pdf_".$modele;
|
||||
require_once($dir.$file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
|
||||
if ($obj->write_file($sending,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$obj->error.'</font>';
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$type='delivery';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$resql=$db->query($sql);
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
{
|
||||
$type='delivery';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql.= " AND type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->LIVRAISON_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='delivery';
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql_del.= " AND type = '".$type."'";
|
||||
$sql_del.= " AND entity = ".$conf->entity;
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_DELIVERY_FREE_TEXT')
|
||||
{
|
||||
$free=GETPOST("DELIVERY_FREE_TEXT");
|
||||
$free=GETPOST('DELIVERY_FREE_TEXT','alpha');
|
||||
$res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -177,6 +82,82 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$sending = new Livraison($db);
|
||||
$sending->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$file=dol_buildpath($reldir."core/modules/livraison/pdf/pdf_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
require_once($file);
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($sending,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
$conf->global->LIVRAISON_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
@ -190,10 +171,12 @@ if ($action == 'setmod')
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader("","");
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("SendingsSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
@ -236,9 +219,9 @@ print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = $dirroot . "/core/modules/livraison/";
|
||||
$dir = dol_buildpath($reldir."core/modules/livraison/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
@ -292,7 +275,6 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$livraison);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
@ -366,9 +348,10 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
$var=true;
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = $dirroot . "/core/modules/livraison/pdf/";
|
||||
$dir = dol_buildpath($reldir."core/modules/livraison/pdf/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
@ -383,7 +366,8 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $name;
|
||||
print "</td><td>\n";
|
||||
require_once($dir.$file);
|
||||
@ -395,17 +379,10 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
// Activ
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
//if ($conf->global->LIVRAISON_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("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
//}
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
@ -448,11 +425,9 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
* Autres Options
|
||||
*/
|
||||
print "<br>";
|
||||
print_titre($langs->trans("OtherOptions"));
|
||||
|
||||
@ -483,4 +458,4 @@ dol_htmloutput_mesg($mesg);
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
?>
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -32,7 +32,7 @@ $langs->load("mails");
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -42,13 +42,16 @@ if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$mailfrom = GETPOST("MAILING_EMAIL_FROM");
|
||||
$mailerror = GETPOST("MAILING_EMAIL_ERRORSTO");
|
||||
$mailfrom = GETPOST('MAILING_EMAIL_FROM','alpha');
|
||||
$mailerror = GETPOST('MAILING_EMAIL_ERRORSTO','alpha');
|
||||
$checkread = GETPOST('value','alpha');
|
||||
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_FROM",$mailfrom,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",$checkread,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -101,6 +104,25 @@ print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf
|
||||
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail"));
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("ActivateCheckRead").'</td><td>';
|
||||
if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE==1)
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=0">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
||||
print '</table></form>';
|
||||
|
||||
|
||||
@ -162,8 +162,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml']))
|
||||
/*
|
||||
* Send mail
|
||||
*/
|
||||
if (($action == 'send' || $action == 'sendhtml')
|
||||
&& ! $_POST['addfile'] && ! $_POST['addfilehtml'] && ! $_POST["removedfile"] && ! $_POST['cancel'])
|
||||
if (($action == 'send' || $action == 'sendhtml') && ! $_POST['addfile'] && ! $_POST['addfilehtml'] && ! $_POST["removedfile"] && ! $_POST['cancel'])
|
||||
{
|
||||
$error=0;
|
||||
|
||||
@ -212,9 +211,18 @@ if (($action == 'send' || $action == 'sendhtml')
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
|
||||
$mailfile = new CMailFile(
|
||||
$subject, $sendto, $email_from, $body,
|
||||
$filepath, $mimetype, $filename,
|
||||
$sendtocc, $sendtoccc, $deliveryreceipt, $msgishtml, $errors_to
|
||||
$subject,
|
||||
$sendto,
|
||||
$email_from,
|
||||
$body,
|
||||
$filepath,
|
||||
$mimetype,
|
||||
$filename,
|
||||
$sendtocc,
|
||||
$sendtoccc,
|
||||
$deliveryreceipt,
|
||||
$msgishtml,
|
||||
$errors_to
|
||||
);
|
||||
|
||||
$result=$mailfile->sendfile();
|
||||
|
||||
@ -35,7 +35,7 @@ $langs->load("withdrawals");
|
||||
// Security check
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,14 +30,17 @@ require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/projet/class/task.class.php');
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("errors");
|
||||
$langs->load("other");
|
||||
$langs->load("projects");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$value=GETPOST('value');
|
||||
$action=GETPOST('action');
|
||||
$value = GETPOST('value','alpha');
|
||||
$action = GETPOST('action','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type='project';
|
||||
|
||||
|
||||
/*
|
||||
@ -45,8 +49,9 @@ $action=GETPOST('action');
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstproject=GETPOST("maskconstproject");
|
||||
$maskproject=GETPOST("maskproject");
|
||||
$maskconstproject=GETPOST('maskconstproject','alpha');
|
||||
$maskproject=GETPOST('maskproject','alpha');
|
||||
|
||||
if ($maskconstproject) $res = dolibarr_set_const($db,$maskconstproject,$maskproject,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -63,22 +68,32 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$project = new Project($db);
|
||||
$project->initAsSpecimen();
|
||||
|
||||
// Charge le modele
|
||||
$dir = DOL_DOCUMENT_ROOT . "/core/modules/project/pdf/";
|
||||
$file = "pdf_".$modele.".modules.php";
|
||||
if (file_exists($dir.$file))
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$classname = "pdf_".$modele;
|
||||
require_once($dir.$file);
|
||||
$file=dol_buildpath($reldir."core/modules/project/pdf/pdf_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
require_once($file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($obj->write_file($project,$langs) > 0)
|
||||
if ($module->write_file($project,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf");
|
||||
return;
|
||||
@ -98,26 +113,13 @@ if ($action == 'specimen')
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$type='project';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$resql=$db->query($sql);
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
{
|
||||
$type='project';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql.= " AND type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
if ($db->query($sql))
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->PROJECT_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROJECT_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
@ -125,37 +127,18 @@ if ($action == 'del')
|
||||
|
||||
if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
$conf->global->PROJECT_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='project';
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql_del.= " AND type = '".$type."'";
|
||||
$sql_del.= " AND entity = ".$conf->entity;
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,17 +147,19 @@ if ($action == 'setmod')
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
||||
dolibarr_set_const($db, "PROJECT_ADDON",$_GET["value"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "PROJECT_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup');
|
||||
|
||||
@ -182,9 +167,6 @@ print "<br>";
|
||||
|
||||
|
||||
// Project numbering module
|
||||
|
||||
$dir = DOL_DOCUMENT_ROOT."/core/modules/project/";
|
||||
|
||||
print_titre($langs->trans("ProjectsNumberingModules"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -198,80 +180,89 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$var=true;
|
||||
$dir = dol_buildpath($reldir."core/modules/project/");
|
||||
|
||||
while (($file = readdir($handle))!==false)
|
||||
if (is_dir($dir))
|
||||
{
|
||||
if (substr($file, 0, 12) == 'mod_project_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
$var=true;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.".php");
|
||||
|
||||
$module = new $file;
|
||||
|
||||
if ($module->isEnabled())
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->PROJECT_ADDON == "$file")
|
||||
if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
$file = $reg[1];
|
||||
$classname = substr($file,4);
|
||||
|
||||
$project=new Project($db);
|
||||
$project->initAsSpecimen();
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.".php");
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$nextval=$module->getNextValue($mysoc,$project);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
if ($nextval)
|
||||
{
|
||||
$htmltooltip.=$nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
$module = new $file;
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->PROJECT_ADDON == 'mod_'.$classname)
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$project=new Project($db);
|
||||
$project->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$nextval=$module->getNextValue($mysoc,$project);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
if ($nextval)
|
||||
{
|
||||
$htmltooltip.=$nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
@ -281,8 +272,6 @@ print '</table><br>';
|
||||
* Modeles documents for projects
|
||||
*/
|
||||
|
||||
$dir = DOL_DOCUMENT_ROOT.'/core/modules/project/pdf/';
|
||||
|
||||
print_titre($langs->trans("ProjectsModelModule"));
|
||||
|
||||
// Defini tableau def de modele
|
||||
@ -322,76 +311,76 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$handle=opendir($dir);
|
||||
|
||||
$var=true;
|
||||
if (is_resource($handle))
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
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);
|
||||
$dir = dol_buildpath($reldir."core/modules/project/pdf/");
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">\n <td>$name";
|
||||
print "</td>\n <td>\n";
|
||||
require_once($dir.$file);
|
||||
$module = new $classname($db);
|
||||
print $module->description;
|
||||
print "</td>\n";
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle=opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
|
||||
{
|
||||
$name = substr($file, 4, dol_strlen($file) -16);
|
||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
//if ($conf->global->PROJECT_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("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// print img_picto($langs->trans("Enabled"),'on');
|
||||
//}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">\n <td>$name";
|
||||
print "</td>\n <td>\n";
|
||||
require_once($dir.$file);
|
||||
$module = new $classname($db);
|
||||
print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->PROJECT_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>';
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
print '<td align="center">';
|
||||
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||
print $form->textwithpicto(' '.$link,$htmltooltip,-1,0);
|
||||
print '</td>';
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->PROJECT_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>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
print '<td align="center">';
|
||||
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||
print $form->textwithpicto(' '.$link,$htmltooltip,-1,0);
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br/>';
|
||||
@ -401,4 +390,4 @@ dol_htmloutput_mesg($mesg);
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
?>
|
||||
@ -23,9 +23,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/propale.php
|
||||
* \file htdocs/admin/propal.php
|
||||
* \ingroup propale
|
||||
* \brief Page d'administration/configuration du module Propale
|
||||
* \brief Setup page for commercial proposal module
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -37,8 +37,11 @@ $langs->load("errors");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$action =GETPOST('action','alpha');
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type='propal';
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -46,8 +49,8 @@ $value = GETPOST('value','alpha');
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstpropal=GETPOST("maskconstpropal");
|
||||
$maskpropal=GETPOST("maskpropal");
|
||||
$maskconstpropal=GETPOST('maskconstpropal','alpha');
|
||||
$maskpropal=GETPOST('maskpropal','alpha');
|
||||
if ($maskconstpropal) $res = dolibarr_set_const($db,$maskconstpropal,$maskpropal,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -64,7 +67,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST("module");
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$propal = new Propal($db);
|
||||
$propal->initAsSpecimen();
|
||||
@ -109,7 +112,7 @@ if ($action == 'specimen')
|
||||
|
||||
if ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft = GETPOST("PROPALE_DRAFT_WATERMARK");
|
||||
$draft = GETPOST('PROPALE_DRAFT_WATERMARK','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "PROPALE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
@ -126,7 +129,7 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
||||
|
||||
if ($action == 'set_PROPALE_FREE_TEXT')
|
||||
{
|
||||
$freetext = GETPOST("PROPALE_FREE_TEXT");
|
||||
$freetext = GETPOST('PROPALE_FREE_TEXT','alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "PROPALE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -183,26 +186,13 @@ if ($action == 'setclassifiedinvoiced')
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$type='propal';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$resql=$db->query($sql);
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
{
|
||||
$type='propal';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql.= " AND type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
if ($db->query($sql))
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->PROPALE_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROPALE_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
@ -210,37 +200,16 @@ else if ($action == 'del')
|
||||
|
||||
else if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->PROPALE_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='propal';
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql_del.= " AND type = '".$type."'";
|
||||
$sql_del.= " AND entity = ".$conf->entity;
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($value?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($value)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,7 +313,7 @@ foreach ($dirmodels as $reldir)
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type=0;
|
||||
$propal->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$propal);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
|
||||
@ -161,7 +161,7 @@ if ($action == 'edit')
|
||||
{
|
||||
$form=new Form($db);
|
||||
|
||||
if (! count($listofmethods)) print '<div class="error">'.$langs->trans("NoSmsEngine").'</div>';
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=sms_manager">DoliStore</a>').'</div>';
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -217,6 +217,8 @@ else
|
||||
{
|
||||
$var=true;
|
||||
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=sms_manager">DoliStore</a>').'</div>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@ -272,7 +274,7 @@ else
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
}*/
|
||||
|
||||
if (! empty($conf->global->MAIN_SMS_SENDMODE))
|
||||
if (count($listofmethods) && ! empty($conf->global->MAIN_SMS_SENDMODE))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>';
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -31,7 +32,7 @@ $langs->load("stocks");
|
||||
// Securit check
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
|
||||
/*
|
||||
@ -41,7 +42,7 @@ $action = GETPOST("action");
|
||||
if ($action == 'STOCK_USERSTOCK_AUTOCREATE')
|
||||
{
|
||||
$db->begin();
|
||||
$res = dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", GETPOST("STOCK_USERSTOCK_AUTOCREATE"),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", GETPOST('STOCK_USERSTOCK_AUTOCREATE','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
// Mode of stock decrease
|
||||
if ($action == 'STOCK_CALCULATE_ON_BILL'
|
||||
@ -52,9 +53,9 @@ if ($action == 'STOCK_CALCULATE_ON_BILL'
|
||||
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", '','chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", '','chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", '','chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_BILL') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", GETPOST("STOCK_CALCULATE_ON_BILL"),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_VALIDATE_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", GETPOST("STOCK_CALCULATE_ON_VALIDATE_ORDER"),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SHIPMENT') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", GETPOST("STOCK_CALCULATE_ON_SHIPMENT"),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_BILL') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", GETPOST('STOCK_CALCULATE_ON_BILL','alpha'),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_VALIDATE_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", GETPOST('STOCK_CALCULATE_ON_VALIDATE_ORDER','alpha'),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SHIPMENT') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", GETPOST('STOCK_CALCULATE_ON_SHIPMENT','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
// Mode of stock increase
|
||||
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL'
|
||||
@ -65,9 +66,9 @@ if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL'
|
||||
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_BILL", '','chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", '','chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", '','chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_BILL", GETPOST("STOCK_CALCULATE_ON_SUPPLIER_BILL"),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", GETPOST("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER"),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", GETPOST("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER"),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_BILL", GETPOST('STOCK_CALCULATE_ON_SUPPLIER_BILL','alpha'),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", GETPOST('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER','alpha'),'chaine',0,'',$conf->entity);
|
||||
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", GETPOST('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if($action)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
@ -47,7 +47,7 @@ print '<ul>';
|
||||
print '<li>'.DOL_VERSION.' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL</a></li>';
|
||||
print '</ul>';
|
||||
|
||||
print "<br>\n";
|
||||
//print "<br>\n";
|
||||
|
||||
print $langs->trans("Developpers").':';
|
||||
print '<ul>';
|
||||
@ -55,37 +55,37 @@ print '<li>'.$langs->trans("SeeWikiForAllTeam").': <a href="http://wiki.dolibarr
|
||||
print '<li>'.$langs->trans("DoliForge").': <a href="http://www.doliforge.org" target="_blank">http://wwww.doliforge.org</a></li>';
|
||||
print '</ul>';
|
||||
|
||||
print "<br>\n";
|
||||
//print "<br>\n";
|
||||
|
||||
print $langs->trans("OtherInformations").':';
|
||||
|
||||
print '<ul>';
|
||||
print '<li>';
|
||||
print '<a target="blank" href="http://www.dolibarr.org/">'.$langs->trans("OfficialWebSite").'</a>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.org/">'.$langs->trans("OfficialWebSite").'</a>';
|
||||
print '</li>';
|
||||
// If the French language, it displays French website
|
||||
if (preg_match('/^fr_/i',$langs->getDefaultLang()))
|
||||
{
|
||||
print '<li>';
|
||||
print '<a target="blank" href="http://www.dolibarr.fr/">'.$langs->trans("OfficialWebSiteFr").'</a>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.fr/">'.$langs->trans("OfficialWebSiteFr").'</a>';
|
||||
print '</li>';
|
||||
}
|
||||
print '<li>';
|
||||
print '<a target="blank" href="http://wiki.dolibarr.org/">'.$langs->trans("OfficialWiki").'</a>';
|
||||
print '<a target="_blank" href="http://wiki.dolibarr.org/">'.$langs->trans("OfficialWiki").'</a>';
|
||||
print '</li>';
|
||||
print '</ul>';
|
||||
|
||||
print $langs->trans("Demo").':';
|
||||
print '<ul>';
|
||||
print '<li>';
|
||||
print '<a target="blank" href="http://www.dolibarr.org/onlinedemo/">'.$langs->trans("OfficialDemo").'</a>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.org/onlinedemo/">'.$langs->trans("OfficialDemo").'</a>';
|
||||
print '</li>';
|
||||
print '</ul>';
|
||||
|
||||
print $langs->trans("ModulesMarketPlaces").':';
|
||||
print '<ul>';
|
||||
print '<li>';
|
||||
print '<a target="blank" href="http://www.dolistore.com">'.$langs->trans("OfficialMarketPlace").'</a>';
|
||||
print '<a target="_blank" href="http://www.dolistore.com">'.$langs->trans("OfficialMarketPlace").'</a>';
|
||||
print '</li>';
|
||||
print '</ul>';
|
||||
|
||||
@ -103,7 +103,24 @@ print $langs->trans("Foundation").':<br>';
|
||||
print '<ul>';
|
||||
$url='http://wiki.dolibarr.org/index.php/Subscribe';
|
||||
if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Adh%C3%A9rer';
|
||||
print '<li><a href="'.$url.'">'.$langs->trans("SubscribeToFoundation").'</a></li>';
|
||||
if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Subscribirse';
|
||||
print '<li><a href="'.$url.'" target="_blank">'.$langs->trans("SubscribeToFoundation").'</a></li>';
|
||||
print '</ul>';
|
||||
|
||||
|
||||
print $langs->trans("OfficialWebHostingService");
|
||||
$url='http://www.dolicloud.com'; $title='DoliCloud';
|
||||
print '<ul>';
|
||||
print '<li>';
|
||||
print '<a target="_blank" href="'.$url.'">'.$title.'</a>';
|
||||
print '</li>';
|
||||
if (preg_match('/^fr_/i',$langs->getDefaultLang()))
|
||||
{
|
||||
$url='http://www.dolibox.fr'; $title='DoliBox';
|
||||
print '<li>';
|
||||
print '<a target="_blank" href="'.$url.'">'.$title.'</a>';
|
||||
print '</li>';
|
||||
}
|
||||
print '</ul>';
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2009-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
|
||||
@ -24,8 +24,7 @@ require("../../main.inc.php");
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action=GETPOST('action');
|
||||
|
||||
@ -49,8 +48,17 @@ if (!function_exists('xcache_info'))
|
||||
}
|
||||
|
||||
|
||||
print 'Opcode cache XCache is on<br>'."\n";
|
||||
print 'Opcode cache XCache is on<br><br>'."\n\n";
|
||||
|
||||
print $langs->trans("Split").': '.ini_get('xcache.count').' '.$langs->trans("Recommanded").': (cat /proc/cpuinfo | grep -c processor) + 1<br>'."\n";
|
||||
print $langs->trans("Size").': '.ini_get('xcache.size').' '.$langs->trans("Recommanded").': 16*Split<br>'."\n";
|
||||
|
||||
print $langs->trans("xcache.cacher").': '.yn(ini_get('xcache.cacher')).'<br>'."\n";
|
||||
print $langs->trans("xcache.optimizer").': '.yn(ini_get('xcache.optimizer')).' (will be usefull only with xcache v2)<br>'."\n";
|
||||
print $langs->trans("xcache.stat").': '.yn(ini_get('xcache.stat')).'<br>'."\n";
|
||||
print $langs->trans("xcache.coverager").': '.yn(ini_get('xcache.coverager')).'<br>'."\n";
|
||||
|
||||
//print xcache_get();
|
||||
/*
|
||||
$cacheinfos = array();
|
||||
for ($i = 0; $i < 10; $i ++)
|
||||
@ -69,4 +77,6 @@ if ($action == 'clear')
|
||||
*/
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2009-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
|
||||
* 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/>.
|
||||
*/
|
||||
* 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/admin/system/xdebug.php
|
||||
@ -25,11 +25,11 @@ require("../../main.inc.php");
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
@ -42,8 +42,8 @@ print "<br>\n";
|
||||
if (!function_exists('xdebug_is_enabled'))
|
||||
{
|
||||
print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.';
|
||||
llxFooter();
|
||||
exit;
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -56,48 +56,55 @@ if (function_exists('socket_create'))
|
||||
print 'XDEBUG_PORT: '.$port."<br>\n";
|
||||
print "<br>\n";
|
||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
if (empty($socket)) die('Unable to preapre a socket');
|
||||
//socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port);
|
||||
//socket_listen($sock);
|
||||
//$client = socket_accept($sock);
|
||||
$client=socket_connect($socket, $address, $port);
|
||||
if ($client)
|
||||
{
|
||||
echo "Connection established: ".$client." - address=".$address." port=".$port."<br>\n";
|
||||
echo "There is a Remote debug server at this address.<br>\n";
|
||||
echo "<br>\n";
|
||||
echo "To be sure this debugger accepts input from your PHP server, be sure to have\n";
|
||||
echo "your php.ini file with this :<br>\n";
|
||||
echo 'xdebug.remote_enable=on<br>
|
||||
xdebug.remote_handle=dbgp<br>
|
||||
xdebug.remote_host=localhost<br>
|
||||
xdebug.remote_port=9000<br>
|
||||
xdebug.profiler_enable=1<br>
|
||||
xdebug.show_local_vars=off<br>
|
||||
xdebug.profiler_output_dir=/tmp/xdebug<br>
|
||||
xdebug.profiler_append=0<br>
|
||||
'."\n";
|
||||
print "<br>\n";
|
||||
echo 'Then check in your debug server (Eclipse), you have setup:<br>
|
||||
if (empty($socket)) die('Unable to preapre a socket');
|
||||
//socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port);
|
||||
//socket_listen($sock);
|
||||
//$client = socket_accept($sock);
|
||||
$client=socket_connect($socket, $address, $port);
|
||||
if ($client)
|
||||
{
|
||||
echo "Connection established: ".$client." - address=".$address." port=".$port."<br>\n";
|
||||
echo "There is a Remote debug server at this address.<br>\n";
|
||||
echo "<br>\n";
|
||||
echo "To be sure this debugger accepts input from your PHP server, be sure to have\n";
|
||||
echo "your php.ini file with this :<br>\n";
|
||||
echo 'xdebug.remote_enable=on<br>
|
||||
xdebug.remote_handle=dbgp<br>
|
||||
xdebug.remote_host=localhost<br>
|
||||
xdebug.remote_port=9000<br>
|
||||
xdebug.profiler_enable=0<br>
|
||||
xdebug.profiler_enable_trigger=1<br>
|
||||
xdebug.show_local_vars=off<br>
|
||||
xdebug.profiler_output_dir=/tmp/xdebug<br>
|
||||
xdebug.profiler_append=0<br>
|
||||
<br>
|
||||
xdebug.trace_enable_trigger=1<br>
|
||||
xdebug.show_mem_delta=1<br>
|
||||
xdebug.trace_output_dir=/tmp/trace<br>
|
||||
xdebug.auto_trace=0<br>
|
||||
'."\n";
|
||||
print "<br>\n";
|
||||
echo 'Then check in your debug server (Eclipse), you have setup:<br>
|
||||
XDebug with same port than in php.ini<br>
|
||||
Allow Remote debug=yes or prompt<br>'."\n";
|
||||
print "<br>\n";
|
||||
echo "Then, to run a debug session, add parameter XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print socket_strerror(socket_last_error());
|
||||
print "<br>\n";
|
||||
echo "Then, to run a debug session, add parameter XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print socket_strerror(socket_last_error());
|
||||
echo "Failed to connect to address=".$address." port=".$port."<br>\n";
|
||||
echo "There is no Remote debug server at this address.\n";
|
||||
}
|
||||
socket_close($client);
|
||||
socket_close($socket);
|
||||
}
|
||||
socket_close($socket);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
|
||||
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -31,7 +31,7 @@ $langs->load('admin');
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -53,7 +53,7 @@ $tax_mode = empty($conf->global->TAX_MODE)?0:$conf->global->TAX_MODE;
|
||||
|
||||
if ($action == 'settaxmode')
|
||||
{
|
||||
$tax_mode = GETPOST("tax_mode");
|
||||
$tax_mode = GETPOST('tax_mode','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
@ -28,13 +28,13 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
$action=GETPOST('action');
|
||||
$what=GETPOST("what");
|
||||
$export_type=GETPOST("export_type");
|
||||
$file=GETPOST('filename_template');
|
||||
$action=GETPOST('action','alpha');
|
||||
$what=GETPOST('what','alpha');
|
||||
$export_type=GETPOST('export_type','alpha');
|
||||
$file=GETPOST('filename_template','alpha');
|
||||
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST("page");
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
@ -102,7 +102,7 @@ $time_start = time();
|
||||
// MYSQL
|
||||
if ($what == 'mysql')
|
||||
{
|
||||
$cmddump=$_POST["mysqldump"];
|
||||
$cmddump=GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by escapeshellarg
|
||||
if ($cmddump)
|
||||
{
|
||||
dolibarr_set_const($db, 'SYSTEMTOOLS_MYSQLDUMP', $cmddump,'chaine',0,'',$conf->entity);
|
||||
@ -111,7 +111,7 @@ if ($what == 'mysql')
|
||||
$outputdir = $conf->admin->dir_output.'/backup';
|
||||
$outputfile = $outputdir.'/'.$file;
|
||||
// for compression format, we add extension
|
||||
$compression=isset($_POST['compression']) ? $_POST['compression'] : 'none';
|
||||
$compression=GETPOST('compression') ? GETPOST('compression','alpha') : 'none';
|
||||
if ($compression == 'gz') $outputfile.='.gz';
|
||||
if ($compression == 'bz') $outputfile.='.bz2';
|
||||
$outputerror = $outputfile.'.err';
|
||||
@ -125,28 +125,28 @@ if ($what == 'mysql')
|
||||
$param=$dolibarr_main_db_name." -h ".$dolibarr_main_db_host;
|
||||
$param.=" -u ".$dolibarr_main_db_user;
|
||||
if (! empty($dolibarr_main_db_port)) $param.=" -P ".$dolibarr_main_db_port;
|
||||
if (! $_POST["use_transaction"]) $param.=" -l --single-transaction";
|
||||
if ($_POST["disable_fk"]) $param.=" -K";
|
||||
if ($_POST["sql_compat"] && $_POST["sql_compat"] != 'NONE') $param.=" --compatible=".$_POST["sql_compat"];
|
||||
if ($_POST["drop_database"]) $param.=" --add-drop-database";
|
||||
if ($_POST["sql_structure"])
|
||||
if (! GETPOST("use_transaction")) $param.=" -l --single-transaction";
|
||||
if (GETPOST("disable_fk")) $param.=" -K";
|
||||
if (GETPOST("sql_compat") && GETPOST("sql_compat") != 'NONE') $param.=" --compatible=".escapeshellarg(GETPOST("sql_compat","alpha"));
|
||||
if (GETPOST("drop_database")) $param.=" --add-drop-database";
|
||||
if (GETPOST("sql_structure"))
|
||||
{
|
||||
if ($_POST["drop"]) $param.=" --add-drop-table";
|
||||
if (GETPOST("drop")) $param.=" --add-drop-table";
|
||||
}
|
||||
else
|
||||
{
|
||||
$param.=" -t";
|
||||
}
|
||||
if ($_POST["disable-add-locks"]) $param.=" --add-locks=FALSE";
|
||||
if ($_POST["sql_data"])
|
||||
if (GETPOST("disable-add-locks")) $param.=" --add-locks=FALSE";
|
||||
if (GETPOST("sql_data"))
|
||||
{
|
||||
$param.=" --tables";
|
||||
if ($_POST["showcolumns"]) $param.=" -c";
|
||||
if ($_POST["extended_ins"]) $param.=" -e";
|
||||
if (GETPOST("showcolumns")) $param.=" -c";
|
||||
if (GETPOST("extended_ins")) $param.=" -e";
|
||||
else $param.=" --skip-extended-insert";
|
||||
if ($_POST["delayed"]) $param.=" --delayed-insert";
|
||||
if ($_POST["sql_ignore"]) $param.=" --insert-ignore";
|
||||
if ($_POST["hexforbinary"]) $param.=" --hex-blob";
|
||||
if (GETPOST("delayed")) $param.=" --delayed-insert";
|
||||
if (GETPOST("sql_ignore")) $param.=" --insert-ignore";
|
||||
if (GETPOST("hexforbinary")) $param.=" --hex-blob";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -244,7 +244,7 @@ if ($what == 'mysqlnobin')
|
||||
$outputfile = $outputdir.'/'.$file;
|
||||
$outputfiletemp = $outputfile.'-TMP.sql';
|
||||
// for compression format, we add extension
|
||||
$compression=isset($_POST['compression']) ? $_POST['compression'] : 'none';
|
||||
$compression=GETPOST('compression') ? GETPOST('compression','alpha') : 'none';
|
||||
if ($compression == 'gz') $outputfile.='.gz';
|
||||
if ($compression == 'bz') $outputfile.='.bz2';
|
||||
$outputerror = $outputfile.'.err';
|
||||
@ -265,7 +265,7 @@ if ($what == 'mysqlnobin')
|
||||
// POSTGRESQL
|
||||
if ($what == 'postgresql')
|
||||
{
|
||||
$cmddump=$_POST["postgresqldump"];
|
||||
$cmddump=GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by escapeshellarg
|
||||
if ($cmddump)
|
||||
{
|
||||
dolibarr_set_const($db, 'SYSTEMTOOLS_POSTGRESQLDUMP', $cmddump,'chaine',0,'',$conf->entity);
|
||||
@ -274,7 +274,7 @@ if ($what == 'postgresql')
|
||||
$outputdir = $conf->admin->dir_output.'/backup';
|
||||
$outputfile = $outputdir.'/'.$file;
|
||||
// for compression format, we add extension
|
||||
$compression=isset($_POST['compression']) ? $_POST['compression'] : 'none';
|
||||
$compression=GETPOST('compression') ? GETPOST('compression','alpha') : 'none';
|
||||
if ($compression == 'gz') $outputfile.='.gz';
|
||||
if ($compression == 'bz') $outputfile.='.bz2';
|
||||
$outputerror = $outputfile.'.err';
|
||||
@ -288,17 +288,17 @@ if ($what == 'postgresql')
|
||||
$param=" --no-tablespaces --inserts -h ".$dolibarr_main_db_host;
|
||||
$param.=" -U ".$dolibarr_main_db_user;
|
||||
if (! empty($dolibarr_main_db_port)) $param.=" -p ".$dolibarr_main_db_port;
|
||||
if ($_POST["sql_compat"] && $_POST["sql_compat"] == 'ANSI') $param.=" --disable-dollar-quoting";
|
||||
if ($_POST["drop_database"]) $param.=" -c -C";
|
||||
if ($_POST["sql_structure"])
|
||||
if (GETPOST("sql_compat") && GETPOST("sql_compat") == 'ANSI') $param.=" --disable-dollar-quoting";
|
||||
if (GETPOST("drop_database")) $param.=" -c -C";
|
||||
if (GETPOST("sql_structure"))
|
||||
{
|
||||
if ($_POST["drop"]) $param.=" --add-drop-table";
|
||||
if (empty($_POST["sql_data"])) $param.=" -s";
|
||||
if (GETPOST("drop")) $param.=" --add-drop-table";
|
||||
if (! GETPOST("sql_data")) $param.=" -s";
|
||||
}
|
||||
if ($_POST["sql_data"])
|
||||
if (GETPOST("sql_data"))
|
||||
{
|
||||
if (empty($_POST["sql_structure"])) $param.=" -a";
|
||||
if ($_POST["showcolumns"]) $param.=" -c";
|
||||
if (! GETPOST("sql_structure")) $param.=" -a";
|
||||
if (GETPOST("showcolumns")) $param.=" -c";
|
||||
}
|
||||
$param.=' -f "'.$outputfile.'"';
|
||||
//if ($compression == 'none')
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-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
|
||||
@ -167,10 +167,11 @@ if (preg_match('/^confirm/i',$choice))
|
||||
{
|
||||
print '<br>';
|
||||
$formquestion=array();
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?choice=allfiles',$langs->trans('Purge'),$langs->trans('ConfirmPurge').' '.img_warning(),'purge',$formquestion,'no',2);
|
||||
if ($ret == 'html') print '<br>';
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').' '.img_warning(), 'purge', $formquestion, 'no', 2);
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,7 +30,7 @@ $langs->load("other");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
if ($_GET["msg"]) $message='<div class="error">'.$_GET["msg"].'</div>';
|
||||
if (GETPOST('msg','alpha')) $message='<div class="error">'.GETPOST('msg','alpha').'</div>';
|
||||
|
||||
|
||||
$urldolibarr='http://www.dolibarr.org/downloads/';
|
||||
@ -39,13 +40,13 @@ $urldolibarrmodules='http://www.dolistore.com/';
|
||||
$urldolibarrthemes='http://www.dolistore.com/';
|
||||
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
||||
$dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot);
|
||||
|
||||
$dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"]=='install')
|
||||
if (GETPOST('action','alpha')=='install')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
@ -59,7 +60,7 @@ if ($_POST["action"]=='install')
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! preg_match('/\.tgz/i',$original_file))
|
||||
if (! preg_match('/\.tgz/i',$original_file) && ! preg_match('/\.zip/i',$original_file))
|
||||
{
|
||||
$mesg=$langs->trans("ErrorFileMustBeADolibarrPackage");
|
||||
$error++;
|
||||
@ -71,19 +72,50 @@ if ($_POST["action"]=='install')
|
||||
@dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$original_file);
|
||||
dol_mkdir($conf->admin->dir_temp.'/'.$original_file);
|
||||
|
||||
$result=dol_move_uploaded_file($_FILES["fileinstall"]["tmp_name"],$newfile,1,0,$_FILES['fileinstall']['error']);
|
||||
$result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'],$newfile,1,0,$_FILES['fileinstall']['error']);
|
||||
if ($result > 0)
|
||||
{
|
||||
//dol_uncompress($newfile);
|
||||
$documentrootalt=DOL_DOCUMENT_ROOT_ALT;
|
||||
$result=dol_uncompress($newfile,$_FILES['fileinstall']['type'],$documentrootalt);
|
||||
if (! empty($result['error']))
|
||||
{
|
||||
if ($result['error'] == -1)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorBadFileFormat").'</div>';
|
||||
}
|
||||
elseif ($result['error'] == -2)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorOSSystem").'</div>';
|
||||
}
|
||||
elseif ($result['error'] == -3)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="warning">'.$langs->trans("ErrorUncompFile",$_FILES['fileinstall']['name']).'</div>';
|
||||
}
|
||||
elseif ($result['error'] == -4)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorUncompFile",$_FILES['fileinstall']['name']).'</div>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupIsReadyForUse")."</font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$dirins=DOL_DOCUMENT_ROOT_ALT;
|
||||
$vale=(is_dir($dirins));
|
||||
$system=PHP_OS;
|
||||
|
||||
$wikihelp='EN:Installation_-_Upgrade|FR:Installation_-_Mise_à_jour|ES:Instalaci&omodulon_-_Actualizaci&omodulon';
|
||||
llxHeader('',$langs->trans("Upgrade"),$wikihelp);
|
||||
|
||||
@ -93,10 +125,8 @@ print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
|
||||
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("FeatureNotYetAvailable").'</b><br>';
|
||||
print '<br>';
|
||||
|
||||
if ($mesg)
|
||||
{
|
||||
print '<div class="error">'.$mesg.'</div><br>';
|
||||
}
|
||||
//dol_htmloutput_errors($mesg);
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print $langs->trans("Upgrade").'<br>';
|
||||
print '<hr>';
|
||||
@ -107,12 +137,12 @@ print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",2).'</b>: ';
|
||||
print $langs->trans("UnpackPackageInDolibarrRoot",$dolibarrroot).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
print $langs->trans("RemoveLock",$dolibarrroot.'install.lock').'<br>';
|
||||
print $langs->trans("RemoveLock",$dolibarrdataroot.'/install.lock').'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
$fullurl='<a href="'.DOL_URL_ROOT.'/install/" target="_blank">'.DOL_URL_ROOT.'/install/</a>';
|
||||
print $langs->trans("CallUpdatePage",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",5).'</b>: ';
|
||||
print $langs->trans("RestoreLock",$dolibarrroot.'install.lock').'<br>';
|
||||
print $langs->trans("RestoreLock",$dolibarrdataroot.'/install.lock').'<br>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
@ -129,16 +159,43 @@ print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
print $langs->trans("UnpackPackageInDolibarrRoot",$dolibarrroot).'<br>';
|
||||
if (! empty($conf->global->MAIN_ONLINE_INSTALL_MODULE))
|
||||
{
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
print '<input type="submit" name="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '</form>';
|
||||
if ($vale == 1 && $dirins != 'DOL_DOCUMENT_ROOT_ALT' && ($system=="Linux" || $system=="Darwin"))
|
||||
{
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
print '<input type="submit" name="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '</form>';
|
||||
}
|
||||
elseif ($system!='Linux')
|
||||
{
|
||||
$langs->load('errors');
|
||||
$message=info_admin($langs->transnoentities("ErrorOSSystem"));
|
||||
print $message;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message=info_admin($langs->trans("NotExistsDirect").$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
||||
print $message;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
}
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
if (! empty($result['return']))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
foreach($result['return'] as $value)
|
||||
{
|
||||
echo $value.'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
@ -77,10 +77,37 @@ print "</tr>\n";
|
||||
clearstatcache();
|
||||
|
||||
$workflowcodes=array();
|
||||
if ($conf->propal->enabled && $conf->commande->enabled) $workflowcodes['WORKFLOW_PROPAL_AUTOCREATE_ORDER']='WORKFLOW_PROPAL_AUTOCREATE_ORDER';
|
||||
//if ($conf->propal->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_PROPAL_AUTOCREATE_INVOICE']='WORKFLOW_PROPAL_AUTOCREATE_INVOICE';
|
||||
//if ($conf->contrat->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_CONTRACT_AUTOCREATE_INVOICE']='WORKFLOW_CONTRACT_AUTOCREATE_INVOICE';
|
||||
if ($conf->commande->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_ORDER_AUTOCREATE_INVOICE']='WORKFLOW_ORDER_AUTOCREATE_INVOICE';
|
||||
$workflow=array(
|
||||
'order' => array(
|
||||
'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_ORDER')
|
||||
),
|
||||
'invoice' => array (
|
||||
'order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')
|
||||
//,'contract' => array('WORKFLOW_CONTRACT_AUTOCREATE_INVOICE')
|
||||
//, 'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_INVOICE')
|
||||
)
|
||||
);
|
||||
|
||||
if (! empty($conf->modules_parts['workflow'])) $workflow = array_merge($workflow, $conf->modules_parts['workflow']);
|
||||
|
||||
foreach($workflow as $child => $parents)
|
||||
{
|
||||
if ($conf->$child->enabled)
|
||||
{
|
||||
$langs->Load($child.'@'.$child);
|
||||
|
||||
foreach($parents as $parent => $actions)
|
||||
{
|
||||
if ($conf->$parent->enabled)
|
||||
{
|
||||
foreach($actions as $action)
|
||||
{
|
||||
$workflowcodes[$action] = $action;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($workflowcodes) > 0)
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -30,11 +30,11 @@ $langs->load("admin");
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action=GETPOST("action");
|
||||
$action=GETPOST('action','alpha');
|
||||
|
||||
if ($action == 'setvalue')
|
||||
{
|
||||
$showmenu = GETPOST("BOOKMARKS_SHOW_IN_MENU");
|
||||
$showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU','alpha');
|
||||
$res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU",$showmenu,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
@ -53,8 +53,7 @@ if ($action == 'setvalue')
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
@ -101,6 +101,8 @@ class Bookmark
|
||||
$this->url=trim($this->url);
|
||||
$this->title=trim($this->title);
|
||||
if (empty($this->position)) $this->position=0;
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -109,7 +111,7 @@ class Bookmark
|
||||
if ($this->fk_soc) $sql.=",fk_soc";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= ($this->fk_user > 0?"'".$this->fk_user."'":"0").",";
|
||||
$sql.= " ".$this->db->idate(gmmktime()).",";
|
||||
$sql.= " ".$this->db->idate($now).",";
|
||||
$sql.= " '".$this->url."', '".$this->target."',";
|
||||
$sql.= " '".$this->db->escape($this->title)."', '".$this->favicon."', '".$this->position."'";
|
||||
if ($this->fk_soc) $sql.=",".$this->fk_soc;
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -39,17 +40,17 @@ if (!$user->admin) accessforbidden();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["save"])
|
||||
if (GETPOST('save','alpha'))
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$i=0;
|
||||
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_HOST',trim($_POST["oscommerce_dbhost"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_NAME',trim($_POST["oscommerce_dbname"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_USER',trim($_POST["oscommerce_dbuser"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_PASS',trim($_POST["oscommerce_dbpass"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_TABLE_PREFIX',trim($_POST["oscommerce_db_table_prefix"]),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_HOST',trim(GETPOST('oscommerce_dbhost','alpha')),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_NAME',trim(GETPOST('oscommerce_dbname','alpha')),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_USER',trim(GETPOST('oscommerce_dbuser','alpha')),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_PASS',trim(GETPOST('oscommerce_dbpass','alpha')),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_DB_TABLE_PREFIX',trim(GETPOST('oscommerce_db_table_prefix','alpha')),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'OSC_LANGUAGE_ID',1,'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($i >= 4)
|
||||
@ -64,18 +65,18 @@ if ($_POST["save"])
|
||||
exit;
|
||||
}
|
||||
}
|
||||
elseif ($_POST["test"])
|
||||
elseif (GETPOST('test','alpha'))
|
||||
{
|
||||
//$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const");
|
||||
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
|
||||
|
||||
// Test de la connexion a la database webcalendar
|
||||
$conf->oscommerce->db->type=$dolibarr_main_db_type;
|
||||
$conf->oscommerce->db->host=$_POST["oscommerce_dbhost"];
|
||||
$conf->oscommerce->db->port=$_POST["oscommerce_dbport"];
|
||||
$conf->oscommerce->db->name=$_POST["oscommerce_dbname"];
|
||||
$conf->oscommerce->db->user=$_POST["oscommerce_dbuser"];
|
||||
$conf->oscommerce->db->pass=$_POST["oscommerce_dbpass"];
|
||||
$conf->oscommerce->db->host=GETPOST('oscommerce_dbhost','alpha');
|
||||
$conf->oscommerce->db->port=GETPOST('oscommerce_dbport','alpha');
|
||||
$conf->oscommerce->db->name=GETPOST('oscommerce_dbname','alpha');
|
||||
$conf->oscommerce->db->user=GETPOST('oscommerce_dbuser','alpha');
|
||||
$conf->oscommerce->db->pass=GETPOST('oscommerce_dbpass','alpha');
|
||||
|
||||
$oscommercedb=getDoliDBInstance($conf->oscommerce->db->type,$conf->oscommerce->db->host,$conf->oscommerce->db->user,$conf->oscommerce->db->pass,$conf->oscommerce->db->name,$conf->oscommerce->db->port);
|
||||
|
||||
@ -87,11 +88,11 @@ elseif ($_POST["test"])
|
||||
$sql.=" WHERE configuration_key='STORE_NAME'";
|
||||
$resql=$oscommercedb->query($sql);
|
||||
if ($resql) {
|
||||
$mesg ="<div class=\"ok\">".$langs->trans("OSCommerceTestOk",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbname"],$_POST["oscommerce_dbuser"]);
|
||||
$mesg ="<div class=\"ok\">".$langs->trans("OSCommerceTestOk",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'),GETPOST('oscommerce_dbuser','alpha'));
|
||||
$mesg.="</div>";
|
||||
}
|
||||
else {
|
||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',$_POST["oscommerce_db_table_prefix"]."configuration");
|
||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',GETPOST('oscommerce_db_table_prefix','alpha')."configuration");
|
||||
$mesg.="</div>";
|
||||
}
|
||||
|
||||
@ -99,14 +100,14 @@ elseif ($_POST["test"])
|
||||
}
|
||||
elseif ($oscommercedb->connected == 1 && $oscommercedb->database_selected != 1)
|
||||
{
|
||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo1",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbname"]);
|
||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo1",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'));
|
||||
$mesg.="<br>".$oscommercedb->error();
|
||||
$mesg.="</div>";
|
||||
//$oscommercedb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo2",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbuser"]);
|
||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo2",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbuser','alpha'));
|
||||
$mesg.="<br>".$oscommercedb->error();
|
||||
$mesg.="</div>";
|
||||
}
|
||||
@ -142,7 +143,7 @@ print "</tr>";
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("OSCommerceServer")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbhost\" value=\"". ($_POST["oscommerce_dbhost"]?$_POST["oscommerce_dbhost"]:$conf->global->OSC_DB_HOST) . "\" size=\"30\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbhost\" value=\"". (GETPOST('oscommerce_dbhost','alpha')?GETPOST('oscommerce_dbhost','alpha'):$conf->global->OSC_DB_HOST) . "\" size=\"30\"></td>";
|
||||
print "<td>localhost";
|
||||
//print "<br>__dolibarr_main_db_host__ <i>(".$dolibarr_main_db_host.")</i>"
|
||||
print "</td>";
|
||||
@ -150,7 +151,7 @@ print "</tr>";
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("OSCommerceDatabaseName")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbname\" value=\"". ($_POST["oscommerce_dbname"]?$_POST["oscommerce_dbname"]:$conf->global->OSC_DB_NAME) . "\" size=\"30\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbname\" value=\"". (GETPOST('oscommerce_dbname','alpha')?GETPOST('oscommerce_dbname','alpha'):$conf->global->OSC_DB_NAME) . "\" size=\"30\"></td>";
|
||||
print "<td>oscommerce";
|
||||
//print "<br>__dolibarr_main_db_name__ <i>(".$dolibarr_main_db_name.")</i>";
|
||||
print "</td>";
|
||||
@ -158,14 +159,14 @@ print "</tr>";
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("OSCommercePrefix")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_db_table_prefix\" value=\"". ($_POST["oscommerce_db_table_prefix"]?$_POST["oscommerce_db_table_prefix"]:$conf->global->DB_TABLE_PREFIX) . "\" size=\"30\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_db_table_prefix\" value=\"". (GETPOST('oscommerce_db_table_prefix','alpha')?GETPOST('oscommerce_db_table_prefix','alpha'):$conf->global->DB_TABLE_PREFIX) . "\" size=\"30\"></td>";
|
||||
print "<td>osc_";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("OSCommerceUser")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbuser\" value=\"". ($_POST["oscommerce_dbuser"]?$_POST["oscommerce_dbuser"]:$conf->global->OSC_DB_USER) . "\" size=\"30\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbuser\" value=\"". (GETPOST('oscommerce_dbuser','alpha')?GETPOST('oscommerce_dbuser','alpha'):$conf->global->OSC_DB_USER) . "\" size=\"30\"></td>";
|
||||
print "<td>oscommerceuser";
|
||||
//print "<br>__dolibarr_main_db_user__ <i>(".$dolibarr_main_db_user.")</i>";
|
||||
print "</td>";
|
||||
@ -173,7 +174,7 @@ print "</tr>";
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("Password")."</td>";
|
||||
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass\" value=\"" . ($_POST["oscommerce_dbpass"]?$_POST["oscommerce_dbpass"]:$conf->global->OSC_DB_PASS) . "\" size=\"30\"></td>";
|
||||
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass\" value=\"" . (GETPOST('oscommerce_dbpass','alpha')?GETPOST('oscommerce_dbpass','alpha'):$conf->global->OSC_DB_PASS) . "\" size=\"30\"></td>";
|
||||
print '<td>';
|
||||
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
|
||||
print ' </td>';
|
||||
@ -181,7 +182,7 @@ print "</tr>";
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$langs->trans("PasswordRetype")."</td>";
|
||||
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass2\" value=\"" . ($_POST["oscommerce_dbpass2"]?$_POST["oscommerce_dbpass2"]:$conf->global->OSC_DB_PASS) ."\" size=\"30\"></td>";
|
||||
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass2\" value=\"" . (GETPOST('oscommerce_dbpass2','alpha')?GETPOST('oscommerce_dbpass2','alpha'):$conf->global->OSC_DB_PASS) ."\" size=\"30\"></td>";
|
||||
print '<td>';
|
||||
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
|
||||
print ' </td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,9 +29,9 @@ require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php");
|
||||
// If socid provided by ajax company selector
|
||||
if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id']))
|
||||
{
|
||||
$_GET['CASHDESK_ID_THIRDPARTY'] = $_GET['CASHDESK_ID_THIRDPARTY_id'];
|
||||
$_POST['CASHDESK_ID_THIRDPARTY'] = $_POST['CASHDESK_ID_THIRDPARTY_id'];
|
||||
$_REQUEST['CASHDESK_ID_THIRDPARTY'] = $_REQUEST['CASHDESK_ID_THIRDPARTY_id'];
|
||||
$_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
|
||||
$_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
|
||||
$_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
|
||||
}
|
||||
|
||||
// Security check
|
||||
@ -45,7 +45,7 @@ $langs->load("cashdesk");
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if (GETPOST("action") == 'set')
|
||||
if (GETPOST('action','alpha') == 'set')
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
@ -54,13 +54,13 @@ if (GETPOST("action") == 'set')
|
||||
if (GETPOST("CASHDESK_ID_WAREHOUSE") < 0) $_POST["CASHDESK_ID_WAREHOUSE"]='';*/
|
||||
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",GETPOST('socid','int'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",GETPOST("CASHDESK_ID_BANKACCOUNT_CASH"),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",GETPOST("CASHDESK_ID_BANKACCOUNT_CHEQUE"),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",GETPOST("CASHDESK_ID_BANKACCOUNT_CB"),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",GETPOST("CASHDESK_ID_WAREHOUSE"),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_SERVICES", GETPOST("CASHDESK_SERVICES"),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",GETPOST('CASHDESK_ID_WAREHOUSE','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES','alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dol_syslog("admin/cashdesk: level ".GETPOST("level"));
|
||||
dol_syslog("admin/cashdesk: level ".GETPOST('level','alpha'));
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
|
||||
@ -47,8 +47,8 @@ print '<div class="liste_articles">';
|
||||
|
||||
require ('tpl/liste_articles.tpl.php');
|
||||
|
||||
$obj_facturation->prix_total_ht($lst_total_ht);
|
||||
$obj_facturation->prix_total_ttc($lst_total_ttc);
|
||||
$obj_facturation->prixTotalHt($lst_total_ht);
|
||||
$obj_facturation->prixTotalTtc($lst_total_ttc);
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -253,9 +253,9 @@ class Facturation
|
||||
$this->montantRendu('RESET');
|
||||
$this->paiementLe('RESET');
|
||||
|
||||
$this->prix_total_ht('RESET');
|
||||
$this->montant_tva('RESET');
|
||||
$this->prix_total_ttc('RESET');
|
||||
$this->prixTotalHt('RESET');
|
||||
$this->montantTva('RESET');
|
||||
$this->prixTotalTtc('RESET');
|
||||
|
||||
}
|
||||
|
||||
@ -588,7 +588,7 @@ class Facturation
|
||||
* @param int $aTotalHt Total amount
|
||||
* @return int Total amount
|
||||
*/
|
||||
public function prix_total_ht( $aTotalHt=null )
|
||||
public function prixTotalHt( $aTotalHt=null )
|
||||
{
|
||||
if ( !$aTotalHt ) {
|
||||
|
||||
@ -611,7 +611,7 @@ class Facturation
|
||||
* @param int $aMontantTva Amount vat
|
||||
* @return int Amount vat
|
||||
*/
|
||||
public function montant_tva( $aMontantTva=null )
|
||||
public function montantTva( $aMontantTva=null )
|
||||
{
|
||||
if ( !$aMontantTva ) {
|
||||
|
||||
@ -635,7 +635,7 @@ class Facturation
|
||||
* @param int $aTotalTtc Amount ttc
|
||||
* @return int Amount ttc
|
||||
*/
|
||||
public function prix_total_ttc( $aTotalTtc=null )
|
||||
public function prixTotalTtc( $aTotalTtc=null )
|
||||
{
|
||||
if ( !$aTotalTtc )
|
||||
{
|
||||
|
||||
@ -169,7 +169,7 @@ $langs->load("cashdesk");
|
||||
<tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
|
||||
<tr>
|
||||
<!-- Affichage du montant du -->
|
||||
<td><input class="texte2_off" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prix_total_ttc(), 'MT'); ?>" disabled="disabled" /></td>
|
||||
<td><input class="texte2_off" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled="disabled" /></td>
|
||||
<!-- Choix du montant encaisse -->
|
||||
<td><input class="texte2" type="text" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" /></td>
|
||||
<!-- Affichage du montant rendu -->
|
||||
|
||||
@ -68,7 +68,7 @@ else
|
||||
}
|
||||
|
||||
$obj_facturation->calculTotaux();
|
||||
$total_ttc = $obj_facturation->prix_total_ttc();
|
||||
$total_ttc = $obj_facturation->prixTotalTtc();
|
||||
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price2num($total_ttc, 'MT').' '.$conf->currency.'<br></p>'."\n");
|
||||
|
||||
?></div>
|
||||
|
||||
@ -138,9 +138,9 @@ print $object->ref;
|
||||
|
||||
<table class="totaux">
|
||||
<?php
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalHT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prix_total_ht(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalVAT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->montant_tva(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalTTC").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prix_total_ttc(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalHT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalVAT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->montantTva(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalTTC").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prixTotalTtc(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
@ -26,12 +26,12 @@ $langs->load("main");
|
||||
<table class="table_resume">
|
||||
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prix_total_ht(),'MT').' '.$conf->currency; ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prixTotalHt(),'MT').' '.$conf->currency; ?></td></tr>
|
||||
<?php
|
||||
// Affichage de la tva par taux
|
||||
if ( $obj_facturation->montant_tva() ) {
|
||||
if ( $obj_facturation->montantTva() ) {
|
||||
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price2num($obj_facturation->montant_tva(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price2num($obj_facturation->montantTva(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
|
||||
}
|
||||
else
|
||||
@ -41,7 +41,7 @@ $langs->load("main");
|
||||
|
||||
}
|
||||
?>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price2num($obj_facturation->prix_total_ttc(),'MT').' '.$conf->currency; ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price2num($obj_facturation->prixTotalTtc(),'MT').' '.$conf->currency; ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
|
||||
<?php
|
||||
switch ($obj_facturation->getSetPaymentMode())
|
||||
|
||||
@ -57,7 +57,7 @@ switch ($action)
|
||||
// Si paiement autre qu'en especes, montant encaisse = prix total
|
||||
$mode_reglement = $obj_facturation->getSetPaymentMode();
|
||||
if ( $mode_reglement != 'ESP' ) {
|
||||
$montant = $obj_facturation->prix_total_ttc();
|
||||
$montant = $obj_facturation->prixTotalTtc();
|
||||
} else {
|
||||
$montant = $_POST['txtEncaisse'];
|
||||
}
|
||||
@ -66,7 +66,7 @@ switch ($action)
|
||||
$obj_facturation->montantEncaisse($montant);
|
||||
|
||||
//Determination de la somme rendue
|
||||
$total = $obj_facturation->prix_total_ttc();
|
||||
$total = $obj_facturation->prixTotalTtc();
|
||||
$encaisse = $obj_facturation->montantEncaisse();
|
||||
|
||||
$obj_facturation->montantRendu($encaisse - $total);
|
||||
@ -198,9 +198,9 @@ switch ($action)
|
||||
$invoice->date_creation=$now;
|
||||
$invoice->date=$now;
|
||||
$invoice->date_lim_reglement=0;
|
||||
$invoice->total_ht=$obj_facturation->prix_total_ht();
|
||||
$invoice->total_tva=$obj_facturation->montant_tva();
|
||||
$invoice->total_ttc=$obj_facturation->prix_total_ttc();
|
||||
$invoice->total_ht=$obj_facturation->prixTotalHt();
|
||||
$invoice->total_tva=$obj_facturation->montantTva();
|
||||
$invoice->total_ttc=$obj_facturation->prixTotalTtc();
|
||||
$invoice->note=$note;
|
||||
$invoice->cond_reglement_id=$cond_reglement_id;
|
||||
$invoice->mode_reglement_id=$mode_reglement_id;
|
||||
@ -234,7 +234,7 @@ switch ($action)
|
||||
$payment=new Paiement($db);
|
||||
$payment->datepaye=$now;
|
||||
$payment->bank_account=$conf_fkaccount;
|
||||
$payment->amounts[$invoice->id]=$obj_facturation->prix_total_ttc();
|
||||
$payment->amounts[$invoice->id]=$obj_facturation->prixTotalTtc();
|
||||
$payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
|
||||
$payment->paiementid=$invoice->mode_reglement_id;
|
||||
$payment->num_paiement='';
|
||||
@ -254,7 +254,7 @@ switch ($action)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if ($invoice->total_ttc == $obj_facturation->prix_total_ttc()
|
||||
if ($invoice->total_ttc == $obj_facturation->prixTotalTtc()
|
||||
&& $obj_facturation->getSetPaymentMode() != 'DIFF')
|
||||
{
|
||||
// We set status to payed
|
||||
|
||||
@ -75,7 +75,7 @@ if ($id || $ref)
|
||||
$objecttype = 'adherent&categorie';
|
||||
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
|
||||
$dbtablename = 'adherent';
|
||||
$fieldid = isset($ref)?'ref':'rowid';
|
||||
$fieldid = ! empty($ref)?'ref':'rowid';
|
||||
}
|
||||
}
|
||||
|
||||
@ -424,6 +424,7 @@ else if ($id || $ref)
|
||||
* @param DoliDb $db Database handler
|
||||
* @param Object $object Object we want to see categories it can be classified into
|
||||
* @param int $typeid Type of category (0, 1, 2, 3)
|
||||
* @param int $socid Id thirdparty
|
||||
* @return int 0
|
||||
*/
|
||||
function formCategory($db,$object,$typeid,$socid=0)
|
||||
|
||||
@ -55,14 +55,10 @@ class Categorie
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $id Id of category to fetch during init
|
||||
*/
|
||||
function Categorie($db, $id=-1)
|
||||
function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->id = $id;
|
||||
|
||||
if ($id != -1) $this->fetch($this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -73,7 +69,7 @@ class Categorie
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = "SELECT rowid, label, description, fk_soc, visible, type";
|
||||
$sql = "SELECT rowid, entity, label, description, fk_soc, visible, type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
|
||||
@ -83,12 +79,13 @@ class Categorie
|
||||
{
|
||||
$res = $this->db->fetch_array($resql);
|
||||
|
||||
$this->id = $res['rowid'];
|
||||
$this->label = $res['label'];
|
||||
$this->description = $res['description'];
|
||||
$this->socid = $res['fk_soc'];
|
||||
$this->visible = $res['visible'];
|
||||
$this->type = $res['type'];
|
||||
$this->id = $res['rowid'];
|
||||
$this->label = $res['label'];
|
||||
$this->description = $res['description'];
|
||||
$this->socid = $res['fk_soc'];
|
||||
$this->visible = $res['visible'];
|
||||
$this->type = $res['type'];
|
||||
$this->entity = $res['entity'];
|
||||
|
||||
$this->db->free($resql);
|
||||
}
|
||||
@ -523,22 +520,28 @@ class Categorie
|
||||
/**
|
||||
* Return list of contents of a category
|
||||
*
|
||||
* @param string $field Field name for select in table. Full field name will be fk_field.
|
||||
* @param string $classname PHP Class of object to store entity
|
||||
* @param string $table Table name for select in table. Full table name will be PREFIX_categorie_table.
|
||||
* @param string $field Field name for select in table. Full field name will be fk_field.
|
||||
* @param string $classname PHP Class of object to store entity
|
||||
* @param string $category_table Table name for select in table. Full table name will be PREFIX_categorie_table.
|
||||
* @param string $object_table Table name for select in table. Full table name will be PREFIX_table.
|
||||
* @return void
|
||||
*/
|
||||
function get_type($field,$classname,$table='')
|
||||
function get_type($field,$classname,$category_table='',$object_table='')
|
||||
{
|
||||
$objs = array();
|
||||
|
||||
// Clean parameters
|
||||
if (empty($table)) $table=$field;
|
||||
if (empty($category_table)) $category_table=$field;
|
||||
if (empty($object_table)) $object_table=$field;
|
||||
|
||||
$sql = "SELECT fk_".$field." FROM ".MAIN_DB_PREFIX."categorie_".$table;
|
||||
$sql.= " WHERE fk_categorie = ".$this->id;
|
||||
$sql = "SELECT c.fk_".$field;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$category_table." as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX.$object_table." as o";
|
||||
$sql.= " WHERE c.fk_categorie = ".$this->id;
|
||||
$sql.= " AND c.fk_".$field." = o.rowid";
|
||||
$sql.= " AND o.entity IN (".getEntity($field, 1).")";
|
||||
|
||||
dol_syslog("Categorie::get_type sql=".$sql);
|
||||
dol_syslog(get_class($this)."::get_type sql=".$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -553,7 +556,7 @@ class Categorie
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error().' sql='.$sql;
|
||||
dol_syslog("Categorie::get_type ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::get_type ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1278,6 +1281,8 @@ class Categorie
|
||||
*/
|
||||
function liste_photos($dir,$nbmax=0)
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php");
|
||||
|
||||
$nbphoto=0;
|
||||
$tabobj=array();
|
||||
|
||||
@ -1290,7 +1295,7 @@ class Categorie
|
||||
{
|
||||
while (($file = readdir($handle)) != false)
|
||||
{
|
||||
if (is_file($dir.$file))
|
||||
if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file))
|
||||
{
|
||||
$nbphoto++;
|
||||
$photo = $file;
|
||||
|
||||