Merge remote-tracking branch 'uptream/develop' into 6.0-multijournal
# Conflicts: # htdocs/install/mysql/migration/5.0.0-6.0.0.sql
This commit is contained in:
commit
aa924bf010
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -6,7 +6,7 @@ Bug reports and feature requests
|
|||||||
|
|
||||||
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
|
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
|
||||||
|
|
||||||
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
|
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
|
||||||
|
|
||||||
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
|
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
|
||||||
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
|
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
|
||||||
|
|||||||
10
COPYRIGHT
10
COPYRIGHT
@ -14,15 +14,15 @@ Component Version License GPL Compatible
|
|||||||
PHP libraries:
|
PHP libraries:
|
||||||
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
|
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
|
||||||
ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console
|
ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console
|
||||||
CKEditor 4.5.8 LGPL-2.1+ Yes Editor WYSIWYG
|
CKEditor 4.6.2 LGPL-2.1+ Yes Editor WYSIWYG
|
||||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||||
Escpos-php MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
Escpos-php MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||||
FPDI 1.5.2 Apache Software License 2.0 Yes PDF templates management
|
|
||||||
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
||||||
Mobiledetect 2.8.17 MIT License Yes Detect mobile devices browsers
|
Mobiledetect 2.8.17 MIT License Yes Detect mobile devices browsers
|
||||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
|
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
|
||||||
|
ParseDown 1.6 MIT License Yes Markdown parser
|
||||||
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||||
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
||||||
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||||
@ -44,10 +44,8 @@ jQuery JCrop 0.9.8 GPL and MIT License Yes
|
|||||||
jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place)
|
jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place)
|
||||||
jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups)
|
jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups)
|
||||||
jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors
|
jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors
|
||||||
jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors
|
jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for filetree
|
||||||
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors
|
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for filetree
|
||||||
jQuery Layout 1.4.3 GPL and MIT License Yes JS library plugin Layout
|
|
||||||
jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used)
|
|
||||||
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
|
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
|
||||||
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
|
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
|
||||||
jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips
|
jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips
|
||||||
|
|||||||
@ -2,6 +2,15 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.0 compared to 5.0.* *****
|
||||||
|
|
||||||
|
WARNING:
|
||||||
|
|
||||||
|
Following changes may create regression for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* The hook getNodeList has been replaced by a normalized 'addreplace' hook getDirList.
|
||||||
|
* The trigger USER_SETINGROUP and USER_REMOVEFROMGROUP has been replaced with trigger USER_MODIFY.
|
||||||
|
* The page societe/soc.php was renamed into societe/card.php to match page naming conventions.
|
||||||
|
* The page compta/facture.php was renamed into compta/facture/card.php to match page naming conventions.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 5.0.0 compared to 4.0.* *****
|
***** ChangeLog for 5.0.0 compared to 4.0.* *****
|
||||||
|
|||||||
@ -91,14 +91,15 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Standing orders management (European SEPA)
|
- Standing orders management (European SEPA)
|
||||||
- Bank accounts management
|
- Bank accounts management
|
||||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||||
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
- Opportunities and/or project management
|
||||||
- Projects management
|
- Projects management
|
||||||
- Contracts management
|
- Contracts management
|
||||||
- Stock management
|
- Stock management
|
||||||
- Shipping management
|
- Shipping management
|
||||||
- Interventions management
|
- Interventions management
|
||||||
- Employee's leave requests management
|
- Employee's leave requests management
|
||||||
- Expense report management
|
- Expense reports
|
||||||
|
- Timesheets
|
||||||
- Electronic Document Management (EDM)
|
- Electronic Document Management (EDM)
|
||||||
- Foundations members management
|
- Foundations members management
|
||||||
- Mass emailing
|
- Mass emailing
|
||||||
|
|||||||
@ -339,18 +339,20 @@ To update dolibarr debian package when only files into debian has changed:
|
|||||||
|
|
||||||
To update dolibarr debian package when only files not into debian has changed:
|
To update dolibarr debian package when only files not into debian has changed:
|
||||||
|
|
||||||
* Manually, add patches into debian/patches and update file debian/series, or do the 2 steps with "quilt import filepatch.patch"
|
* Checkout the branch you want to work on: master of debian/...
|
||||||
|
* Manually, add patches into debian/patches and update the file debian/series, or do the 2 steps with "quilt import filepatch.patch"
|
||||||
* You can test patching of serie with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revient a l'état du upstream sans les patch.
|
* You can test patching of serie with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revient a l'état du upstream sans les patch.
|
||||||
|
* Update the debian/changelog to add entry of change.
|
||||||
|
|
||||||
Once files has been prepared, it's time to test:
|
Once files has been prepared, it's time to test:
|
||||||
|
|
||||||
* Try to build package
|
* Try to build package
|
||||||
> rm -fr ../build-area;
|
> rm -fr ../build-area;
|
||||||
> git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x|3.5.5]
|
> git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
|
||||||
ou
|
ou
|
||||||
> git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-3.5.x|3.5.5]
|
> git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
|
||||||
|
|
||||||
Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-3.5.x]
|
Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
|
||||||
Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file
|
Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file
|
||||||
Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match
|
Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match
|
||||||
Note: Package is built into directory ../build-area
|
Note: Package is built into directory ../build-area
|
||||||
|
|||||||
@ -40,6 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
|||||||
* Main
|
* Main
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$includecustom=0;
|
||||||
$includeconstants=array();
|
$includeconstants=array();
|
||||||
|
|
||||||
if (empty($argv[1]))
|
if (empty($argv[1]))
|
||||||
@ -67,8 +68,6 @@ while ($i < $argc)
|
|||||||
|
|
||||||
if (empty($includecustom))
|
if (empty($includecustom))
|
||||||
{
|
{
|
||||||
$includecustom=0;
|
|
||||||
|
|
||||||
if (DOL_VERSION != $release)
|
if (DOL_VERSION != $release)
|
||||||
{
|
{
|
||||||
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n";
|
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n";
|
||||||
@ -80,7 +79,7 @@ else
|
|||||||
{
|
{
|
||||||
if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release))
|
if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release))
|
||||||
{
|
{
|
||||||
print 'Error: When parameter "includecustom" is not set, version declared into ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n";
|
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n";
|
||||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
@ -124,15 +123,20 @@ foreach ($includeconstants as $countrycode => $tmp)
|
|||||||
|
|
||||||
fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
|
fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
|
||||||
|
|
||||||
// TODO Replace RecursiveDirectoryIterator with dol_dir_list
|
/*$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||||
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
|
||||||
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||||
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
||||||
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||||
|
*/
|
||||||
|
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||||
|
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
|
||||||
|
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||||
$dir='';
|
$dir='';
|
||||||
$needtoclose=0;
|
$needtoclose=0;
|
||||||
foreach ($files as $file) {
|
foreach ($files as $filetmp) {
|
||||||
$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
$file = $filetmp['fullname'];
|
||||||
|
//$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
||||||
|
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||||
if ($newdir!=$dir) {
|
if ($newdir!=$dir) {
|
||||||
if ($needtoclose)
|
if ($needtoclose)
|
||||||
fputs($fp, ' </dir>'."\n");
|
fputs($fp, ' </dir>'."\n");
|
||||||
@ -161,13 +165,20 @@ $checksumconcat=array();
|
|||||||
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
||||||
|
|
||||||
// TODO Replace RecursiveDirectoryIterator with dol_dir_list
|
// TODO Replace RecursiveDirectoryIterator with dol_dir_list
|
||||||
$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/');
|
/*$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/');
|
||||||
$iterator2 = new RecursiveIteratorIterator($dir_iterator2);
|
$iterator2 = new RecursiveIteratorIterator($dir_iterator2);
|
||||||
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
||||||
$files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
$files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||||
|
*/
|
||||||
|
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||||
|
$regextoexclude='(custom|documents|conf|install)$'; // Exclude dirs
|
||||||
|
$files = dol_dir_list(dirname(__FILE__).'/../scripts/', 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||||
$dir='';
|
$dir='';
|
||||||
$needtoclose=0;
|
$needtoclose=0;
|
||||||
foreach ($files as $file) {
|
foreach ($files as $filetmp) {
|
||||||
|
$file = $filetmp['fullname'];
|
||||||
|
//$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||||
|
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||||
$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||||
if ($newdir!=$dir) {
|
if ($newdir!=$dir) {
|
||||||
if ($needtoclose)
|
if ($needtoclose)
|
||||||
|
|||||||
@ -532,8 +532,6 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||||
# Removed other test files
|
# Removed other test files
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/api/explorer`; # This is a dev tool
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||||
@ -547,8 +545,6 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
||||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extensions/TableTools/swf`; # Source of this flash is not available
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||||
@ -566,14 +562,15 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
@ -892,9 +889,6 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mike42/escpos-php/LICENSE.md`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mike42/escpos-php/LICENSE.md`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20120503/COPYING`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_2.0/COPYING`;
|
|
||||||
# Removed files we don't need
|
# Removed files we don't need
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`;
|
||||||
|
|
||||||
|
|||||||
@ -3,20 +3,18 @@ This file describe changes made on external library after beeing included
|
|||||||
in Dolibarr root.
|
in Dolibarr root.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ALL:
|
ALL:
|
||||||
----
|
----
|
||||||
Replace "& new" by "new"
|
Check "DOL_CHANGE"
|
||||||
|
|
||||||
|
|
||||||
|
CKEDITOR (4.6.2):
|
||||||
CKEDITOR:
|
-----------------
|
||||||
---------
|
|
||||||
* In ckeditor/ckeditor/contents.css
|
* In ckeditor/ckeditor/contents.css
|
||||||
Replace:
|
Replace:
|
||||||
margin: 20px;
|
body { ... margin: 20px;
|
||||||
With
|
With
|
||||||
margin: 5px;
|
body { ... margin: 5px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -33,21 +31,6 @@ Replace call to serialize_val with no bugged value
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
FPDI:
|
|
||||||
-----
|
|
||||||
Replace:
|
|
||||||
$this->_readXref($this->_xref, $this->_findXref());
|
|
||||||
with:
|
|
||||||
try {
|
|
||||||
$this->_readXref($this->_xref, $this->_findXref());
|
|
||||||
}
|
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
print $e->getMessage();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TCPDF:
|
TCPDF:
|
||||||
------
|
------
|
||||||
@ -56,7 +39,7 @@ define('QR_FIND_FROM_RANDOM', 2);
|
|||||||
with
|
with
|
||||||
define('QR_FIND_FROM_RANDOM', false);
|
define('QR_FIND_FROM_RANDOM', false);
|
||||||
|
|
||||||
* Removed useless directories (examples, tools)
|
* Removed useless directories ("examples", "tools")
|
||||||
|
|
||||||
* Fix
|
* Fix
|
||||||
// initialize subsetchars
|
// initialize subsetchars
|
||||||
|
|||||||
@ -5,5 +5,5 @@
|
|||||||
#
|
#
|
||||||
# ldapsearch -h hostname -x
|
# ldapsearch -h hostname -x
|
||||||
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
|
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
|
||||||
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -W "(objectclass=*)"
|
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||||
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -W "(objectclass=*)"
|
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||||
|
|||||||
@ -41,8 +41,59 @@ require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
|||||||
* Parameters
|
* Parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define(GEN_NUMBER_FACTURE, 5);
|
define(GEN_NUMBER_FACTURE, 1);
|
||||||
|
$year = 2016;
|
||||||
|
$dates = array (mktime(12,0,0,1,3,$year),
|
||||||
|
mktime(12,0,0,1,9,$year),
|
||||||
|
mktime(12,0,0,2,13,$year),
|
||||||
|
mktime(12,0,0,2,23,$year),
|
||||||
|
mktime(12,0,0,3,30,$year),
|
||||||
|
mktime(12,0,0,4,3,$year),
|
||||||
|
mktime(12,0,0,4,3,$year),
|
||||||
|
mktime(12,0,0,5,9,$year),
|
||||||
|
mktime(12,0,0,5,1,$year),
|
||||||
|
mktime(12,0,0,5,13,$year),
|
||||||
|
mktime(12,0,0,5,19,$year),
|
||||||
|
mktime(12,0,0,5,23,$year),
|
||||||
|
mktime(12,0,0,6,3,$year),
|
||||||
|
mktime(12,0,0,6,19,$year),
|
||||||
|
mktime(12,0,0,6,24,$year),
|
||||||
|
mktime(12,0,0,7,3,$year),
|
||||||
|
mktime(12,0,0,7,9,$year),
|
||||||
|
mktime(12,0,0,7,23,$year),
|
||||||
|
mktime(12,0,0,7,30,$year),
|
||||||
|
mktime(12,0,0,8,9,$year),
|
||||||
|
mktime(12,0,0,9,23,$year),
|
||||||
|
mktime(12,0,0,10,3,$year),
|
||||||
|
mktime(12,0,0,11,12,$year),
|
||||||
|
mktime(12,0,0,11,13,$year),
|
||||||
|
mktime(12,0,0,1,3,($year - 1)),
|
||||||
|
mktime(12,0,0,1,9,($year - 1)),
|
||||||
|
mktime(12,0,0,2,13,($year - 1)),
|
||||||
|
mktime(12,0,0,2,23,($year - 1)),
|
||||||
|
mktime(12,0,0,3,30,($year - 1)),
|
||||||
|
mktime(12,0,0,4,3,($year - 1)),
|
||||||
|
mktime(12,0,0,4,3,($year - 1)),
|
||||||
|
mktime(12,0,0,5,9,($year - 1)),
|
||||||
|
mktime(12,0,0,5,1,($year - 1)),
|
||||||
|
mktime(12,0,0,5,13,($year - 1)),
|
||||||
|
mktime(12,0,0,5,19,($year - 1)),
|
||||||
|
mktime(12,0,0,5,23,($year - 1)),
|
||||||
|
mktime(12,0,0,6,3,($year - 1)),
|
||||||
|
mktime(12,0,0,6,19,($year - 1)),
|
||||||
|
mktime(12,0,0,6,24,($year - 1)),
|
||||||
|
mktime(12,0,0,7,3,($year - 1)),
|
||||||
|
mktime(12,0,0,7,9,($year - 1)),
|
||||||
|
mktime(12,0,0,7,23,($year - 1)),
|
||||||
|
mktime(12,0,0,7,30,($year - 1)),
|
||||||
|
mktime(12,0,0,8,9,($year - 1)),
|
||||||
|
mktime(12,0,0,9,23,($year - 1)),
|
||||||
|
mktime(12,0,0,10,3,($year - 1)),
|
||||||
|
mktime(12,0,0,11,12,$year),
|
||||||
|
mktime(12,0,0,11,13,$year),
|
||||||
|
mktime(12,0,0,12,12,$year),
|
||||||
|
mktime(12,0,0,12,13,$year),
|
||||||
|
);
|
||||||
|
|
||||||
$ret=$user->fetch('','admin');
|
$ret=$user->fetch('','admin');
|
||||||
if (! $ret > 0)
|
if (! $ret > 0)
|
||||||
@ -54,16 +105,15 @@ $user->getrights();
|
|||||||
|
|
||||||
|
|
||||||
$socids = array();
|
$socids = array();
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client in (1, 3)";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num_socs = $db->num_rows($resql);
|
$num_thirdparties = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num_socs)
|
while ($i < $num_thirdparties)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$socids[$i] = $row[0];
|
$socids[$i] = $row[0];
|
||||||
}
|
}
|
||||||
@ -79,7 +129,6 @@ if ($resql)
|
|||||||
while ($i < $num_prods)
|
while ($i < $num_prods)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$prodids[$i] = $row[0];
|
$prodids[$i] = $row[0];
|
||||||
}
|
}
|
||||||
@ -90,20 +139,22 @@ $result=0;
|
|||||||
while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
$socid = mt_rand(1, $num_socs);
|
$socid = mt_rand(1, $num_thirdparties);
|
||||||
|
|
||||||
print "Invoice ".$i." for socid ".$socid;
|
print "Invoice ".$i." for socid ".$socid;
|
||||||
|
|
||||||
$facture = new Facture($db);
|
$object = new Facture($db);
|
||||||
$facture->date = time();
|
$object->socid = $socids[$socid];
|
||||||
$facture->cond_reglement_id = 3;
|
$object->date = $dates[mt_rand(1, count($dates)-1)];
|
||||||
$facture->mode_reglement_id = 3;
|
$object->cond_reglement_id = 3;
|
||||||
|
$object->mode_reglement_id = 3;
|
||||||
|
|
||||||
$result=$facture->create($user);
|
$fuser = new User($db);
|
||||||
|
$fuser->fetch(mt_rand(1,2));
|
||||||
|
$fuser->getRights();
|
||||||
|
|
||||||
|
$result=$object->create($fuser);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
|
||||||
$result=$facture->validate($user);
|
|
||||||
if ($result)
|
|
||||||
{
|
{
|
||||||
$nbp = mt_rand(2, 5);
|
$nbp = mt_rand(2, 5);
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
@ -112,7 +163,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
|||||||
$prodid = mt_rand(1, $num_prods);
|
$prodid = mt_rand(1, $num_prods);
|
||||||
$product=new Product($db);
|
$product=new Product($db);
|
||||||
$result=$product->fetch($prodids[$prodid]);
|
$result=$product->fetch($prodids[$prodid]);
|
||||||
$result=$facture->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
$result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$propal->error);
|
dol_print_error($db,$propal->error);
|
||||||
@ -120,16 +171,19 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
|||||||
$xnbp++;
|
$xnbp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print " OK with ref ".$facture->ref."\n";;
|
$result=$object->validate($fuser);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
print " OK with ref ".$object->ref."\n";;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db,$facture->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db,$facture->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,7 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -47,7 +48,58 @@ include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
define(GEN_NUMBER_COMMANDE, 10);
|
define(GEN_NUMBER_COMMANDE, 10);
|
||||||
|
$year = 2016;
|
||||||
|
$dates = array (mktime(12,0,0,1,3,$year),
|
||||||
|
mktime(12,0,0,1,9,$year),
|
||||||
|
mktime(12,0,0,2,13,$year),
|
||||||
|
mktime(12,0,0,2,23,$year),
|
||||||
|
mktime(12,0,0,3,30,$year),
|
||||||
|
mktime(12,0,0,4,3,$year),
|
||||||
|
mktime(12,0,0,4,3,$year),
|
||||||
|
mktime(12,0,0,5,9,$year),
|
||||||
|
mktime(12,0,0,5,1,$year),
|
||||||
|
mktime(12,0,0,5,13,$year),
|
||||||
|
mktime(12,0,0,5,19,$year),
|
||||||
|
mktime(12,0,0,5,23,$year),
|
||||||
|
mktime(12,0,0,6,3,$year),
|
||||||
|
mktime(12,0,0,6,19,$year),
|
||||||
|
mktime(12,0,0,6,24,$year),
|
||||||
|
mktime(12,0,0,7,3,$year),
|
||||||
|
mktime(12,0,0,7,9,$year),
|
||||||
|
mktime(12,0,0,7,23,$year),
|
||||||
|
mktime(12,0,0,7,30,$year),
|
||||||
|
mktime(12,0,0,8,9,$year),
|
||||||
|
mktime(12,0,0,9,23,$year),
|
||||||
|
mktime(12,0,0,10,3,$year),
|
||||||
|
mktime(12,0,0,11,12,$year),
|
||||||
|
mktime(12,0,0,11,13,$year),
|
||||||
|
mktime(12,0,0,1,3,($year - 1)),
|
||||||
|
mktime(12,0,0,1,9,($year - 1)),
|
||||||
|
mktime(12,0,0,2,13,($year - 1)),
|
||||||
|
mktime(12,0,0,2,23,($year - 1)),
|
||||||
|
mktime(12,0,0,3,30,($year - 1)),
|
||||||
|
mktime(12,0,0,4,3,($year - 1)),
|
||||||
|
mktime(12,0,0,4,3,($year - 1)),
|
||||||
|
mktime(12,0,0,5,9,($year - 1)),
|
||||||
|
mktime(12,0,0,5,1,($year - 1)),
|
||||||
|
mktime(12,0,0,5,13,($year - 1)),
|
||||||
|
mktime(12,0,0,5,19,($year - 1)),
|
||||||
|
mktime(12,0,0,5,23,($year - 1)),
|
||||||
|
mktime(12,0,0,6,3,($year - 1)),
|
||||||
|
mktime(12,0,0,6,19,($year - 1)),
|
||||||
|
mktime(12,0,0,6,24,($year - 1)),
|
||||||
|
mktime(12,0,0,7,3,($year - 1)),
|
||||||
|
mktime(12,0,0,7,9,($year - 1)),
|
||||||
|
mktime(12,0,0,7,23,($year - 1)),
|
||||||
|
mktime(12,0,0,7,30,($year - 1)),
|
||||||
|
mktime(12,0,0,8,9,($year - 1)),
|
||||||
|
mktime(12,0,0,9,23,($year - 1)),
|
||||||
|
mktime(12,0,0,10,3,($year - 1)),
|
||||||
|
mktime(12,0,0,11,12,$year),
|
||||||
|
mktime(12,0,0,11,13,$year),
|
||||||
|
mktime(12,0,0,12,12,$year),
|
||||||
|
mktime(12,0,0,12,13,$year),
|
||||||
|
);
|
||||||
|
|
||||||
$ret=$user->fetch('','admin');
|
$ret=$user->fetch('','admin');
|
||||||
if ($ret <= 0)
|
if ($ret <= 0)
|
||||||
@ -57,34 +109,34 @@ if ($ret <= 0)
|
|||||||
}
|
}
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
|
|
||||||
|
$societesid = array();
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe where client in (1, 3)";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num_thirdparties = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num_thirdparties) {
|
||||||
|
$i++;
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$societesid[$i] = $row[0];
|
$societesid[$i] = $row[0];
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { print "err"; }
|
else { print "err"; }
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
$commandesid = array();
|
||||||
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$commandesid[$i] = $row[0];
|
$commandesid[$i] = $row[0];
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { print "err"; }
|
else { print "err"; }
|
||||||
|
|
||||||
|
|
||||||
$prodids = array();
|
$prodids = array();
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -102,59 +154,6 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$dates = array (mktime(12,0,0,1,3,2003),
|
|
||||||
mktime(12,0,0,1,9,2003),
|
|
||||||
mktime(12,0,0,2,13,2003),
|
|
||||||
mktime(12,0,0,2,23,2003),
|
|
||||||
mktime(12,0,0,3,30,2003),
|
|
||||||
mktime(12,0,0,4,3,2003),
|
|
||||||
mktime(12,0,0,4,3,2003),
|
|
||||||
mktime(12,0,0,5,9,2003),
|
|
||||||
mktime(12,0,0,5,1,2003),
|
|
||||||
mktime(12,0,0,5,13,2003),
|
|
||||||
mktime(12,0,0,5,19,2003),
|
|
||||||
mktime(12,0,0,5,23,2003),
|
|
||||||
mktime(12,0,0,6,3,2003),
|
|
||||||
mktime(12,0,0,6,19,2003),
|
|
||||||
mktime(12,0,0,6,24,2003),
|
|
||||||
mktime(12,0,0,7,3,2003),
|
|
||||||
mktime(12,0,0,7,9,2003),
|
|
||||||
mktime(12,0,0,7,23,2003),
|
|
||||||
mktime(12,0,0,7,30,2003),
|
|
||||||
mktime(12,0,0,8,9,2003),
|
|
||||||
mktime(12,0,0,9,23,2003),
|
|
||||||
mktime(12,0,0,10,3,2003),
|
|
||||||
mktime(12,0,0,11,12,2003),
|
|
||||||
mktime(12,0,0,11,13,2003),
|
|
||||||
mktime(12,0,0,1,3,2002),
|
|
||||||
mktime(12,0,0,1,9,2002),
|
|
||||||
mktime(12,0,0,2,13,2002),
|
|
||||||
mktime(12,0,0,2,23,2002),
|
|
||||||
mktime(12,0,0,3,30,2002),
|
|
||||||
mktime(12,0,0,4,3,2002),
|
|
||||||
mktime(12,0,0,4,3,2002),
|
|
||||||
mktime(12,0,0,5,9,2002),
|
|
||||||
mktime(12,0,0,5,1,2002),
|
|
||||||
mktime(12,0,0,5,13,2002),
|
|
||||||
mktime(12,0,0,5,19,2002),
|
|
||||||
mktime(12,0,0,5,23,2002),
|
|
||||||
mktime(12,0,0,6,3,2002),
|
|
||||||
mktime(12,0,0,6,19,2002),
|
|
||||||
mktime(12,0,0,6,24,2002),
|
|
||||||
mktime(12,0,0,7,3,2002),
|
|
||||||
mktime(12,0,0,7,9,2002),
|
|
||||||
mktime(12,0,0,7,23,2002),
|
|
||||||
mktime(12,0,0,7,30,2002),
|
|
||||||
mktime(12,0,0,8,9,2002),
|
|
||||||
mktime(12,0,0,9,23,2002),
|
|
||||||
mktime(12,0,0,10,3,2002),
|
|
||||||
mktime(12,0,0,11,12,2003),
|
|
||||||
mktime(12,0,0,11,13,2003),
|
|
||||||
mktime(12,0,0,12,12,2003),
|
|
||||||
mktime(12,0,0,12,13,2003),
|
|
||||||
);
|
|
||||||
|
|
||||||
require(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
|
||||||
|
|
||||||
|
|
||||||
print "Build ".GEN_NUMBER_COMMANDE." orders\n";
|
print "Build ".GEN_NUMBER_COMMANDE." orders\n";
|
||||||
@ -162,22 +161,29 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
|
|||||||
{
|
{
|
||||||
print "Process order ".$s."\n";
|
print "Process order ".$s."\n";
|
||||||
|
|
||||||
$com = new Commande($db);
|
$object = new Commande($db);
|
||||||
|
|
||||||
$com->socid = 4;
|
$object->socid = $societesid[mt_rand(1, $num_thirdparties)];
|
||||||
$com->date_commande = $dates[mt_rand(1, count($dates)-1)];
|
$object->date_commande = $dates[mt_rand(1, count($dates)-1)];
|
||||||
$com->note = 'A comment';
|
$object->note = 'My small comment about this order. Hum. Nothing.';
|
||||||
$com->source = 1;
|
$object->source = 1;
|
||||||
$com->fk_project = 0;
|
$object->fk_project = 0;
|
||||||
$com->remise_percent = 0;
|
$object->remise_percent = 0;
|
||||||
|
$object->shipping_method_id = mt_rand(1, 2);
|
||||||
|
$object->cond_reglement_id = mt_rand(0, 2);
|
||||||
|
$object->more_reglement_id = mt_rand(0, 7);
|
||||||
|
$object->availability_id = mt_rand(0, 1);
|
||||||
|
|
||||||
|
$listofuserid=array(12,13,16);
|
||||||
|
|
||||||
|
$fuser = new User($db);
|
||||||
|
$fuser->fetch($listofuserid[mt_rand(0,2)]);
|
||||||
|
$fuser->getRights();
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result=$com->create($user);
|
$result=$object->create($fuser);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
|
||||||
$result=$com->valid($user);
|
|
||||||
if ($result > 0)
|
|
||||||
{
|
{
|
||||||
$nbp = mt_rand(2, 5);
|
$nbp = mt_rand(2, 5);
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
@ -186,29 +192,32 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
|
|||||||
$prodid = mt_rand(1, $num_prods);
|
$prodid = mt_rand(1, $num_prods);
|
||||||
$product=new Product($db);
|
$product=new Product($db);
|
||||||
$result=$product->fetch($prodids[$prodid]);
|
$result=$product->fetch($prodids[$prodid]);
|
||||||
$result=$com->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
|
$result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
|
||||||
if ($result < 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$propal->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
$xnbp++;
|
$xnbp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result=$object->valid($fuser);
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
print " OK with ref ".$com->ref."\n";
|
print " OK with ref ".$object->ref."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print " KO\n";
|
print " KO\n";
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dol_print_error($db,$com->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print " KO\n";
|
print " KO\n";
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dol_print_error($db,$com->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,8 +43,59 @@ require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
|||||||
* Parameters
|
* Parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define(GEN_NUMBER_PROPAL, 5);
|
define(GEN_NUMBER_PROPAL, 10);
|
||||||
|
$year = 2016;
|
||||||
|
$dates = array (mktime(12,0,0,1,3,$year),
|
||||||
|
mktime(12,0,0,1,9,$year),
|
||||||
|
mktime(12,0,0,2,13,$year),
|
||||||
|
mktime(12,0,0,2,23,$year),
|
||||||
|
mktime(12,0,0,3,30,$year),
|
||||||
|
mktime(12,0,0,4,3,$year),
|
||||||
|
mktime(12,0,0,4,3,$year),
|
||||||
|
mktime(12,0,0,5,9,$year),
|
||||||
|
mktime(12,0,0,5,1,$year),
|
||||||
|
mktime(12,0,0,5,13,$year),
|
||||||
|
mktime(12,0,0,5,19,$year),
|
||||||
|
mktime(12,0,0,5,23,$year),
|
||||||
|
mktime(12,0,0,6,3,$year),
|
||||||
|
mktime(12,0,0,6,19,$year),
|
||||||
|
mktime(12,0,0,6,24,$year),
|
||||||
|
mktime(12,0,0,7,3,$year),
|
||||||
|
mktime(12,0,0,7,9,$year),
|
||||||
|
mktime(12,0,0,7,23,$year),
|
||||||
|
mktime(12,0,0,7,30,$year),
|
||||||
|
mktime(12,0,0,8,9,$year),
|
||||||
|
mktime(12,0,0,9,23,$year),
|
||||||
|
mktime(12,0,0,10,3,$year),
|
||||||
|
mktime(12,0,0,11,12,$year),
|
||||||
|
mktime(12,0,0,11,13,$year),
|
||||||
|
mktime(12,0,0,1,3,($year - 1)),
|
||||||
|
mktime(12,0,0,1,9,($year - 1)),
|
||||||
|
mktime(12,0,0,2,13,($year - 1)),
|
||||||
|
mktime(12,0,0,2,23,($year - 1)),
|
||||||
|
mktime(12,0,0,3,30,($year - 1)),
|
||||||
|
mktime(12,0,0,4,3,($year - 1)),
|
||||||
|
mktime(12,0,0,4,3,($year - 1)),
|
||||||
|
mktime(12,0,0,5,9,($year - 1)),
|
||||||
|
mktime(12,0,0,5,1,($year - 1)),
|
||||||
|
mktime(12,0,0,5,13,($year - 1)),
|
||||||
|
mktime(12,0,0,5,19,($year - 1)),
|
||||||
|
mktime(12,0,0,5,23,($year - 1)),
|
||||||
|
mktime(12,0,0,6,3,($year - 1)),
|
||||||
|
mktime(12,0,0,6,19,($year - 1)),
|
||||||
|
mktime(12,0,0,6,24,($year - 1)),
|
||||||
|
mktime(12,0,0,7,3,($year - 1)),
|
||||||
|
mktime(12,0,0,7,9,($year - 1)),
|
||||||
|
mktime(12,0,0,7,23,($year - 1)),
|
||||||
|
mktime(12,0,0,7,30,($year - 1)),
|
||||||
|
mktime(12,0,0,8,9,($year - 1)),
|
||||||
|
mktime(12,0,0,9,23,($year - 1)),
|
||||||
|
mktime(12,0,0,10,3,($year - 1)),
|
||||||
|
mktime(12,0,0,11,12,$year),
|
||||||
|
mktime(12,0,0,11,13,$year),
|
||||||
|
mktime(12,0,0,12,12,$year),
|
||||||
|
mktime(12,0,0,12,13,$year),
|
||||||
|
);
|
||||||
|
|
||||||
$ret=$user->fetch('','admin');
|
$ret=$user->fetch('','admin');
|
||||||
if (! $ret > 0)
|
if (! $ret > 0)
|
||||||
@ -56,16 +107,15 @@ $user->getrights();
|
|||||||
|
|
||||||
|
|
||||||
$socids = array();
|
$socids = array();
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client in (1,3)";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num_socs = $db->num_rows($resql);
|
$num_thirdparties = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num_socs)
|
while ($i < $num_thirdparties)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$socids[$i] = $row[0];
|
$socids[$i] = $row[0];
|
||||||
}
|
}
|
||||||
@ -81,7 +131,6 @@ if ($resql)
|
|||||||
while ($i < $num_conts)
|
while ($i < $num_conts)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$contids[$row[1]][0] = $row[0]; // A ameliorer
|
$contids[$row[1]][0] = $row[0]; // A ameliorer
|
||||||
}
|
}
|
||||||
@ -97,7 +146,6 @@ if ($resql)
|
|||||||
while ($i < $num_prods)
|
while ($i < $num_prods)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$prodids[$i] = $row[0];
|
$prodids[$i] = $row[0];
|
||||||
}
|
}
|
||||||
@ -117,27 +165,25 @@ $result=0;
|
|||||||
while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
$socid = mt_rand(1, $num_socs);
|
$socid = mt_rand(1, $num_thirdparties);
|
||||||
print "Proposal ".$i." for socid ".$socid;
|
print "Proposal ".$i." for socid ".$socid;
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
|
|
||||||
|
|
||||||
$propal = new Propal($db);
|
$object = new Propal($db);
|
||||||
|
|
||||||
$obj = $conf->global->PROPALE_ADDON;
|
$fuser = new User($db);
|
||||||
$modPropale = new $obj;
|
$fuser->fetch(mt_rand(1,2));
|
||||||
$numpr = $modPropale->getNextValue($soc,$propal);
|
$fuser->getRights();
|
||||||
|
|
||||||
$propal->ref = $numpr;
|
$object->contactid = $contids[$socids[$socid]][0];
|
||||||
$propal->contactid = $contids[$socids[$socid]][0];
|
$object->socid = $socids[$socid];
|
||||||
$propal->socid = $socids[$socid];
|
$object->datep = $dates[mt_rand(1, count($dates)-1)];
|
||||||
$propal->datep = time();
|
$object->cond_reglement_id = 3;
|
||||||
$propal->cond_reglement_id = 3;
|
$object->mode_reglement_id = 3;
|
||||||
$propal->mode_reglement_id = 3;
|
|
||||||
$propal->author = $user->id;
|
|
||||||
|
|
||||||
$result=$propal->create($user);
|
$result=$object->create($fuser);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
$nbp = mt_rand(2, 5);
|
$nbp = mt_rand(2, 5);
|
||||||
@ -147,18 +193,30 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
|||||||
$prodid = mt_rand(1, $num_prods);
|
$prodid = mt_rand(1, $num_prods);
|
||||||
$product=new Product($db);
|
$product=new Product($db);
|
||||||
$result=$product->fetch($prodids[$prodid]);
|
$result=$product->fetch($prodids[$prodid]);
|
||||||
$result=$propal->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
|
$result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$propal->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
$xnbp++;
|
$xnbp++;
|
||||||
}
|
}
|
||||||
print " OK with ref ".$propal->ref."\n";
|
|
||||||
|
$result=$object->valid($fuser);
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
print " OK with ref ".$object->ref."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db,$propal->error);
|
print " KO\n";
|
||||||
|
$db->rollback();
|
||||||
|
dol_print_error($db,$object->error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,23 @@
|
|||||||
README
|
README
|
||||||
------
|
------
|
||||||
|
|
||||||
*** Demo
|
Scripts in this directory can be used to reload or save a demo database.
|
||||||
|
Install of package "dialog" is required.
|
||||||
|
|
||||||
Scripts in this directory can be used to reinit a demo database.
|
|
||||||
WARNING: This will erase current database with data into initdemo.sql.
|
*** Init demo
|
||||||
|
|
||||||
|
The script initdemo.sh will erase current database with data into mysqldump_dolibarr_x.y.z.sql and copy files into documents_demo into officiel document directory.
|
||||||
|
|
||||||
Do a chmod 700 initdemo.sh
|
Do a chmod 700 initdemo.sh
|
||||||
then run ./initdemo.sh to launch Graphic User Interface.
|
then run ./initdemo.sh to launch Graphic User Interface.
|
||||||
|
|
||||||
Install of package "dialog" is required.
|
|
||||||
|
*** Save demo
|
||||||
|
|
||||||
|
The script savedemo.sh will save current database into a database dump file.
|
||||||
|
|
||||||
|
|
||||||
*** Other
|
*** Update demo
|
||||||
|
|
||||||
Other scripts into initdata can be used to load data test.
|
The goal of script updatedemo.php is to update dates into the demo data so samples are up to date.
|
||||||
|
|||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -26,6 +26,11 @@ fi
|
|||||||
|
|
||||||
if [ "x$1" = "xall" ]
|
if [ "x$1" = "xall" ]
|
||||||
then
|
then
|
||||||
|
if [ "x$2" = "x" ]
|
||||||
|
then
|
||||||
|
echo "tx pull"
|
||||||
|
tx pull
|
||||||
|
else
|
||||||
for dir in `find htdocs/langs/* -type d`
|
for dir in `find htdocs/langs/* -type d`
|
||||||
do
|
do
|
||||||
fic=`basename $dir`
|
fic=`basename $dir`
|
||||||
@ -35,6 +40,7 @@ then
|
|||||||
tx pull -l $fic $2 $3
|
tx pull -l $fic $2 $3
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
cd -
|
cd -
|
||||||
else
|
else
|
||||||
echo "tx pull -l $1 $2 $3 $4 $5"
|
echo "tx pull -l $1 $2 $3 $4 $5"
|
||||||
|
|||||||
@ -161,7 +161,9 @@ $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.acco
|
|||||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON aa.account_parent = a2.rowid";
|
// Dirty hack wainting that foreign key account_parent is an integer to be compared correctly with rowid
|
||||||
|
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)";
|
||||||
|
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)";
|
||||||
$sql .= " WHERE asy.rowid = " . $pcgver;
|
$sql .= " WHERE asy.rowid = " . $pcgver;
|
||||||
|
|
||||||
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
||||||
@ -196,12 +198,15 @@ if ($resql)
|
|||||||
if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent);
|
if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent);
|
||||||
if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||||
if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||||
if ($optioncss) $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
|
||||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy');
|
|
||||||
|
|
||||||
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
|
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
|
|
||||||
|
$htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
||||||
|
|
||||||
|
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);
|
||||||
|
|
||||||
// Box to select active chart of account
|
// Box to select active chart of account
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
print $langs->trans("Selectchartofaccounts") . " : ";
|
print $langs->trans("Selectchartofaccounts") . " : ";
|
||||||
@ -229,24 +234,7 @@ if ($resql)
|
|||||||
print "</select>";
|
print "</select>";
|
||||||
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print "<br>\n";
|
print '<br>';
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
|
||||||
print '<input type="hidden" name="action" value="list">';
|
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|
||||||
|
|
||||||
print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
|
||||||
print '<a class="butAction" href="./categories.php">' . $langs->trans("ApplyMassCategories") . '</a>';
|
|
||||||
// print '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</a>';
|
|
||||||
// print '<a class="butAction" href="./productaccount.php">' . $langs->trans("CheckProductAccountancyCode") . '</a>';
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
@ -371,12 +359,12 @@ if ($resql)
|
|||||||
|
|
||||||
// Action
|
// Action
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($user->admin) {
|
if ($user->rights->accounting->chartofaccount) {
|
||||||
print '<a href="./card.php?action=update&id=' . $obj->rowid . '">';
|
print '<a href="./card.php?action=update&id=' . $obj->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a href="./card.php?action=delete&id=' . $obj->rowid . '">';
|
print '<a href="./card.php?action=delete&id=' . $obj->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id). '">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -736,11 +736,11 @@ if ($id)
|
|||||||
{
|
{
|
||||||
if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit')
|
if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit')
|
||||||
{
|
{
|
||||||
fieldList($fieldlist,$obj,$tabname[$id],'hide');
|
fieldListAccountModel($fieldlist,$obj,$tabname[$id],'hide');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fieldList($fieldlist,$obj,$tabname[$id],'add');
|
fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -928,7 +928,7 @@ if ($id)
|
|||||||
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
if (empty($reshook)) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'edit');
|
||||||
|
|
||||||
print '<td colspan="3" align="right"><a name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<td colspan="3" align="right"><a name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||||
@ -1252,7 +1252,7 @@ $db->close();
|
|||||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
global $form;
|
global $form;
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancysystem.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||||
|
|
||||||
@ -159,13 +160,15 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
|||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
|
$urltogo=$backtopage?$backtopage:($_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
|
header("Location: " . $urltogo);
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$mesg = $object->error;
|
$mesg = $object->error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
|
$urltogo=$backtopage?$backtopage:($_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
|
header("Location: " . $urltogo);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
} else if ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
} else if ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
||||||
@ -196,6 +199,9 @@ $form = new Form($db);
|
|||||||
$htmlacc = new FormVentilation($db);
|
$htmlacc = new FormVentilation($db);
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
|
$accountsystem = new AccountancySystem($db);
|
||||||
|
$accountsystem->fetch($conf->global->CHARTOFACCOUNTS);
|
||||||
|
|
||||||
// Create mode
|
// Create mode
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
print load_fiche_titre($langs->trans('NewAccountingAccount'));
|
print load_fiche_titre($langs->trans('NewAccountingAccount'));
|
||||||
@ -208,36 +214,45 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// Chart of account
|
||||||
|
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("Chartofaccounts") . '</span></td>';
|
||||||
|
print '<td>';
|
||||||
|
print $accountsystem->ref;
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||||
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
|
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"></td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||||
print '<td><input name="label" size="70" value="' . $object->label . '"</td></tr>';
|
print '<td><input name="label" size="70" value="' . $object->label . '"></td></tr>';
|
||||||
|
|
||||||
// Account parent
|
// Account parent
|
||||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $htmlacc->select_account($object->account_parent, 'account_parent', 1);
|
print $htmlacc->select_account($object->account_parent, 'account_parent', 1, null, 0, 0, 'minwidth200');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1);
|
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1, 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Chart of accounts type
|
// Chart of accounts type
|
||||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $htmlacc->select_pcgtype($object->pcg_type, 'pcg_type');
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type','alpha'):$object->pcg_type).'">';
|
||||||
|
//print $htmlacc->select_pcgtype($object->pcg_type, 'pcg_type', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Chart of acounts subtype
|
// Chart of acounts subtype
|
||||||
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $htmlacc->select_pcgsubtype($object->pcg_subtype, 'pcg_subtype');
|
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$object->pcg_subtype).'">';
|
||||||
|
//print $htmlacc->select_pcgsubtype($object->pcg_subtype, 'pcg_subtype', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -268,6 +283,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="edit">';
|
print '<input type="hidden" name="action" value="edit">';
|
||||||
print '<input type="hidden" name="id" value="' . $id . '">';
|
print '<input type="hidden" name="id" value="' . $id . '">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -294,13 +310,15 @@ if ($action == 'create') {
|
|||||||
// Chart of accounts type
|
// Chart of accounts type
|
||||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $htmlacc->select_pcgtype($object->pcg_type, 'pcg_type');
|
//print $htmlacc->select_pcgtype($object->pcg_type, 'pcg_type', 1);
|
||||||
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type','alpha'):$object->pcg_type).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Chart of accounts subtype
|
// Chart of accounts subtype
|
||||||
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $htmlacc->select_pcgsubtype($object->pcg_subtype, 'pcg_subtype');
|
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$object->pcg_subtype).'">';
|
||||||
|
//print $htmlacc->select_pcgsubtype($object->pcg_subtype, 'pcg_subtype', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Page to assign mass categories to accounts
|
* \brief Page to assign mass categories to accounts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php';
|
||||||
@ -45,7 +46,10 @@ if ($cat_id == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (! $user->admin) accessforbidden();
|
if (! empty($user->rights->accountancy->chartofaccount))
|
||||||
|
{
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$accountingcategory = new AccountancyCategory($db);
|
$accountingcategory = new AccountancyCategory($db);
|
||||||
|
|
||||||
@ -84,7 +88,7 @@ $formaccounting = new FormAccounting($db);
|
|||||||
|
|
||||||
llxheader('', $langs->trans('AccountAccounting'));
|
llxheader('', $langs->trans('AccountAccounting'));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans('Categories'));
|
print load_fiche_titre($langs->trans('AccountingCategory'));
|
||||||
|
|
||||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
@ -96,23 +100,24 @@ print '<table class="border" width="100%">';
|
|||||||
// Category
|
// Category
|
||||||
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formaccounting->select_accounting_category($cat_id, 'account_category', 1);
|
$formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 1);
|
||||||
print '<input class="button" type="submit" value="' . $langs->trans("Show") . '">';
|
print '<input class="button" type="submit" value="' . $langs->trans("Select") . '">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (! empty($cat_id)) {
|
if (! empty($cat_id))
|
||||||
$return = $accountingcategory->getCptBK($cat_id);
|
{
|
||||||
|
$return = $accountingcategory->getAccountsWithNoCategory($cat_id);
|
||||||
if ($return < 0) {
|
if ($return < 0) {
|
||||||
setEventMessages(null, $accountingcategory->errors, 'errors');
|
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||||
}
|
}
|
||||||
print '<tr><td>' . $langs->trans("AddAccountFromBookKeepingWithNoCategories") . '</td>';
|
print '<tr><td>' . $langs->trans("AddAccountFromBookKeepingWithNoCategories") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
|
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
|
||||||
print '<select size="' . count($obj) . '" name="cpt_bk[]" multiple>';
|
print '<select class="flat minwidth200" size="' . count($obj) . '" name="cpt_bk[]" multiple>';
|
||||||
foreach ( $accountingcategory->lines_cptbk as $cpt ) {
|
foreach ( $accountingcategory->lines_cptbk as $cpt ) {
|
||||||
print '<option value="' . length_accountg($cpt->numero_compte) . '">' . length_accountg($cpt->numero_compte) . ' (' . $cpt->label_compte . ' ' . $cpt->doc_ref . ')</option>';
|
print '<option value="' . length_accountg($cpt->numero_compte) . '">' . length_accountg($cpt->numero_compte) . ' (' . $cpt->label_compte . ' ' . $cpt->doc_ref . ')</option>';
|
||||||
}
|
}
|
||||||
print '</select>';
|
print '</select><br>';
|
||||||
print '<input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("Add") . '"> ';
|
print '<input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("Add") . '"> ';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -129,8 +134,8 @@ if ($action == 'display' || $action == 'delete') {
|
|||||||
|
|
||||||
print "<table class='noborder' width='100%'>\n";
|
print "<table class='noborder' width='100%'>\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("AccountAccounting")."</td>";
|
print '<td class="liste_titre">'.$langs->trans("AccountAccounting")."</td>";
|
||||||
print '<td colspan="2">'.$langs->trans("Label")."</td>";
|
print '<td class="liste_titre" colspan="2">'.$langs->trans("Label")."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if (! empty($cat_id)) {
|
if (! empty($cat_id)) {
|
||||||
|
|||||||
1324
htdocs/accountancy/admin/categories_list.php
Normal file
1324
htdocs/accountancy/admin/categories_list.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -39,6 +39,7 @@ $langs->load("bills");
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("accountancy");
|
$langs->load("accountancy");
|
||||||
$langs->load("salaries");
|
$langs->load("salaries");
|
||||||
|
$langs->load("loan");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (! empty($user->rights->accountancy->chartofaccount))
|
if (! empty($user->rights->accountancy->chartofaccount))
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -87,7 +87,8 @@ if ($action == 'update') {
|
|||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($list as $constname) {
|
foreach ($list as $constname)
|
||||||
|
{
|
||||||
$constvalue = GETPOST($constname, 'alpha');
|
$constvalue = GETPOST($constname, 'alpha');
|
||||||
|
|
||||||
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||||
@ -152,7 +153,6 @@ if ($action == 'setdisabledirectinput') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -278,13 +278,17 @@ foreach ($list as $key)
|
|||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
|
|
||||||
print '<tr ' . $bc[$var] . ' class="value">';
|
print '<tr ' . $bc[$var] . ' class="value">';
|
||||||
|
|
||||||
|
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
||||||
|
|
||||||
// Param
|
// Param
|
||||||
$label = $langs->trans($key);
|
$label = $langs->trans($key);
|
||||||
print '<td>'.$label.'</td>';
|
print '<td>'.$label.'</td>';
|
||||||
// Value
|
// Value
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
print '<input type="text" class="maxwidth100" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,7 +305,7 @@ print '<div class="center"><input type="submit" class="button" value="' . $langs
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print $langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy"));
|
print $langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy"));
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -184,7 +184,7 @@ else {
|
|||||||
print '<table class="liste ' . ($moreforfilter ? "listwithfilterbefore" : "") . '">';
|
print '<table class="liste ' . ($moreforfilter ? "listwithfilterbefore" : "") . '">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||||
@ -192,7 +192,7 @@ else {
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre center" colspan="2">';
|
print '<td class="liste_titre" colspan="2">';
|
||||||
print $langs->trans('From');
|
print $langs->trans('From');
|
||||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, '');
|
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, '');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -255,9 +255,9 @@ else {
|
|||||||
|
|
||||||
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
||||||
print '<td>' . $description . '</td>';
|
print '<td>' . $description . '</td>';
|
||||||
print '<td align="right">' . number_format($line->debit, 2, ',', ' ') . '</td>';
|
print '<td align="right">' . price($line->debit) . '</td>';
|
||||||
print '<td align="right">' . number_format($line->credit, 2, ',', ' ') . '</td>';
|
print '<td align="right">' . price($line->credit) . '</td>';
|
||||||
print '<td align="right">' . number_format($line->credit - $line->debit, 2, ',', ' ') . '</td>';
|
print '<td align="right">' . price($line->credit - $line->debit) . '</td>';
|
||||||
print '<td align="center">' . $link;
|
print '<td align="center">' . $link;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -202,9 +202,11 @@ else if ($action == "confirm_create") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
@ -274,12 +276,12 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("Docref") . '</td>';
|
print '<td>' . $langs->trans("Docref") . '</td>';
|
||||||
print '<td><input type="text" size="20" name="doc_ref" value=""/></td>';
|
print '<td><input type="text" class="minwidth200" name="doc_ref" value=""/></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("Doctype") . '</td>';
|
print '<td>' . $langs->trans("Doctype") . '</td>';
|
||||||
print '<td><input type="text" size="20" name="doc_type" value=""/></td>';
|
print '<td><input type="text" class="minwidth200" name="doc_type" value=""/></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -345,6 +347,8 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
|
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
|
||||||
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
|
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
|
||||||
|
|
||||||
|
$var=False;
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
if (count($book->linesmvt) > 0) {
|
if (count($book->linesmvt) > 0) {
|
||||||
|
|
||||||
@ -356,9 +360,9 @@ if ($action == 'create') {
|
|||||||
print_liste_field_titre($langs->trans("AccountAccountingShort"));
|
print_liste_field_titre($langs->trans("AccountAccountingShort"));
|
||||||
print_liste_field_titre($langs->trans("Code_tiers"));
|
print_liste_field_titre($langs->trans("Code_tiers"));
|
||||||
print_liste_field_titre($langs->trans("Labelcompte"));
|
print_liste_field_titre($langs->trans("Labelcompte"));
|
||||||
print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="center"');
|
print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="right"');
|
||||||
print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="center"');
|
print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="right"');
|
||||||
print_liste_field_titre($langs->trans("Amount"), "", "", "", "", 'align="center"');
|
print_liste_field_titre($langs->trans("Amount"), "", "", "", "", 'align="right"');
|
||||||
print_liste_field_titre($langs->trans("Sens"), "", "", "", "", 'align="center"');
|
print_liste_field_titre($langs->trans("Sens"), "", "", "", "", 'align="center"');
|
||||||
print_liste_field_titre($langs->trans("Action"), "", "", "", "", 'width="60" align="center"');
|
print_liste_field_titre($langs->trans("Action"), "", "", "", "", 'width="60" align="center"');
|
||||||
|
|
||||||
|
|||||||
@ -105,7 +105,6 @@ if ($action != 'export_csv' && ! isset($_POST['begin']) && ! isset($_GET['begin'
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
@ -132,74 +131,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
$search_date_end = '';
|
$search_date_end = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delbookkeeping') {
|
// Must be after the remove filter action, before the export.
|
||||||
|
|
||||||
$import_key = GETPOST('importkey', 'alpha');
|
|
||||||
|
|
||||||
if (! empty($import_key)) {
|
|
||||||
$result = $object->deleteByImportkey($import_key);
|
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
Header("Location: list.php");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($action == 'delbookkeepingyearconfirm') {
|
|
||||||
|
|
||||||
$delyear = GETPOST('delyear', 'int');
|
|
||||||
if ($delyear==-1) {
|
|
||||||
$delyear=0;
|
|
||||||
}
|
|
||||||
$deljournal = GETPOST('deljournal','alpha');
|
|
||||||
if ($deljournal==-1) {
|
|
||||||
$deljournal=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($delyear) || ! empty($deljournal))
|
|
||||||
{
|
|
||||||
$result = $object->deleteByYearAndJournal($delyear,$deljournal);
|
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
|
||||||
}
|
|
||||||
Header("Location: list.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages("NoRecordDeleted", null, 'warnings');
|
|
||||||
Header("Location: list.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($action == 'delmouvconfirm') {
|
|
||||||
|
|
||||||
$mvt_num = GETPOST('mvt_num', 'int');
|
|
||||||
|
|
||||||
if (! empty($mvt_num)) {
|
|
||||||
$result = $object->deleteMvtNum($mvt_num);
|
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
|
||||||
}
|
|
||||||
Header("Location: list.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
$filter = array ();
|
$filter = array ();
|
||||||
if (! empty($search_date_start)) {
|
if (! empty($search_date_start)) {
|
||||||
@ -266,6 +198,68 @@ if (! empty($search_mvt_num)) {
|
|||||||
$param .= '&search_mvt_num=' . $search_mvt_num;
|
$param .= '&search_mvt_num=' . $search_mvt_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'delbookkeeping') {
|
||||||
|
|
||||||
|
$import_key = GETPOST('importkey', 'alpha');
|
||||||
|
|
||||||
|
if (! empty($import_key)) {
|
||||||
|
$result = $object->deleteByImportkey($import_key);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
Header("Location: list.php");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($action == 'delbookkeepingyearconfirm') {
|
||||||
|
|
||||||
|
$delyear = GETPOST('delyear', 'int');
|
||||||
|
if ($delyear==-1) {
|
||||||
|
$delyear=0;
|
||||||
|
}
|
||||||
|
$deljournal = GETPOST('deljournal','alpha');
|
||||||
|
if ($deljournal==-1) {
|
||||||
|
$deljournal=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($delyear) || ! empty($deljournal))
|
||||||
|
{
|
||||||
|
$result = $object->deleteByYearAndJournal($delyear,$deljournal);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||||
|
}
|
||||||
|
Header("Location: list.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages("NoRecordDeleted", null, 'warnings');
|
||||||
|
Header("Location: list.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($action == 'delmouvconfirm') {
|
||||||
|
|
||||||
|
$mvt_num = GETPOST('mvt_num', 'int');
|
||||||
|
|
||||||
|
if (! empty($mvt_num)) {
|
||||||
|
$result = $object->deleteMvtNum($mvt_num);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
Header("Location: list.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'export_csv') {
|
if ($action == 'export_csv') {
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
|
||||||
@ -287,6 +281,11 @@ if ($action == 'export_csv') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
$title_page = $langs->trans("Bookkeeping");
|
$title_page = $langs->trans("Bookkeeping");
|
||||||
|
|
||||||
llxHeader('', $title_page);
|
llxHeader('', $title_page);
|
||||||
@ -378,15 +377,15 @@ print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_d
|
|||||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre center"><input type="text" name="search_mvt_num" size="6" value="' . $search_mvt_num . '"></td>';
|
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="' . dol_escape_htmltag($search_mvt_num) . '"></td>';
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print $langs->trans('From') . ': ';
|
print $langs->trans('From') . ': ';
|
||||||
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||||
@ -394,15 +393,15 @@ print '<br>';
|
|||||||
print $langs->trans('to') . ': ';
|
print $langs->trans('to') . ': ';
|
||||||
print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre center"><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
|
print '<td class="liste_titre"><input type="text" name="search_doc_ref" size="8" value="' . dol_escape_htmltag($search_doc_ref) . '"></td>';
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre">';
|
||||||
print $langs->trans('From');
|
print $langs->trans('From');
|
||||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans('to');
|
print $langs->trans('to');
|
||||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre">';
|
||||||
print $langs->trans('From');
|
print $langs->trans('From');
|
||||||
print $formventilation->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
print $formventilation->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -414,8 +413,8 @@ print '<input type="text" size="7" class="flat" name="search_mvt_label" value="'
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre center"> </td>';
|
print '<td class="liste_titre center"> </td>';
|
||||||
print '<td class="liste_titre center"> </td>';
|
print '<td class="liste_titre center"> </td>';
|
||||||
print '<td class="liste_titre center" align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||||
print '<td class="liste_titre center" align="right">';
|
print '<td class="liste_titre center">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -129,6 +129,47 @@ class AccountancyCategory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to select accounting category of an accounting account present in chart of accounts
|
||||||
|
*
|
||||||
|
* @param int $id Id category
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
|
*/
|
||||||
|
public function getAccountsWithNoCategory($id) {
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
|
$sql .= " WHERE (aa.fk_accounting_category != ".$id." OR aa.fk_accounting_category IS NULL)";
|
||||||
|
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||||
|
$sql .= " AND aa.active = 1";
|
||||||
|
$sql .= " GROUP BY aa.account_number, aa.label";
|
||||||
|
$sql .= " ORDER BY aa.account_number, aa.label";
|
||||||
|
|
||||||
|
$this->lines_CptBk = array ();
|
||||||
|
|
||||||
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
if ($num) {
|
||||||
|
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||||
|
$this->lines_cptbk[] = $obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $num;
|
||||||
|
} else {
|
||||||
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
dol_syslog(__METHOD__ . " " . implode(',' . $this->errors), LOG_ERR);
|
||||||
|
|
||||||
|
return - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to add an accounting account in an accounting category
|
* Function to add an accounting account in an accounting category
|
||||||
*
|
*
|
||||||
@ -149,23 +190,27 @@ class AccountancyCategory
|
|||||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||||
$sql .= " AND aa.active = 1";
|
$sql .= " AND aa.active = 1";
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = "Error " . $this->db->lasterror();
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
while ( $obj = $this->db->fetch_object($resql))
|
||||||
while ( $obj = $this->db->fetch_object($resql)) {
|
{
|
||||||
if (array_key_exists(length_accountg($obj->account_number), $cpts)) {
|
if (array_key_exists(length_accountg($obj->account_number), $cpts))
|
||||||
|
{
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account";
|
||||||
$sql .= " SET fk_accounting_category=" . $id_cat;
|
$sql .= " SET fk_accounting_category=" . $id_cat;
|
||||||
$sql .= " WHERE rowid=".$obj->rowid;
|
$sql .= " WHERE rowid=".$obj->rowid;
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resqlupdate = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resqlupdate) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = "Error " . $this->db->lasterror();
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,55 @@ class AccountancySystem
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load record in memory
|
||||||
|
*
|
||||||
|
* @param int $rowid Id
|
||||||
|
* @param string $ref ref
|
||||||
|
* @return int <0 if KO, Id of record if OK and found
|
||||||
|
*/
|
||||||
|
function fetch($rowid = 0, $ref = '')
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
if ($rowid > 0 || $ref)
|
||||||
|
{
|
||||||
|
$sql = "SELECT a.pcg_version, a.label, a.active";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system as a";
|
||||||
|
$sql .= " WHERE";
|
||||||
|
if ($rowid) {
|
||||||
|
$sql .= " a.rowid = '" . $rowid . "'";
|
||||||
|
} elseif ($ref) {
|
||||||
|
$sql .= " a.pcg_version = '" . $ref . "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
if ($obj) {
|
||||||
|
$this->id = $obj->rowid;
|
||||||
|
$this->rowid = $obj->rowid;
|
||||||
|
$this->pcg_version = $obj->pcg_version;
|
||||||
|
$this->ref = $obj->pcg_version;
|
||||||
|
$this->label = $obj->label;
|
||||||
|
$this->active = $obj->active;
|
||||||
|
|
||||||
|
return $this->id;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert accountancy system name into database
|
* Insert accountancy system name into database
|
||||||
*
|
*
|
||||||
|
|||||||
@ -150,12 +150,19 @@ class AccountingAccount extends CommonObject
|
|||||||
if (isset($this->active))
|
if (isset($this->active))
|
||||||
$this->active = trim($this->active);
|
$this->active = trim($this->active);
|
||||||
|
|
||||||
|
if (empty($this->pcg_type) || $this->pcg_type == '-1')
|
||||||
|
{
|
||||||
|
$this->pcg_type = 'XXXXXX';
|
||||||
|
}
|
||||||
|
if (empty($this->pcg_subtype) || $this->pcg_subtype == '-1')
|
||||||
|
{
|
||||||
|
$this->pcg_subtype = 'XXXXXX';
|
||||||
|
}
|
||||||
// Check parameters
|
// Check parameters
|
||||||
// Put here code to add control on parameters values
|
// Put here code to add control on parameters values
|
||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account(";
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account(";
|
||||||
|
|
||||||
$sql .= "datec";
|
$sql .= "datec";
|
||||||
$sql .= ", entity";
|
$sql .= ", entity";
|
||||||
$sql .= ", fk_pcg_version";
|
$sql .= ", fk_pcg_version";
|
||||||
@ -167,9 +174,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= ", fk_accounting_category";
|
$sql .= ", fk_accounting_category";
|
||||||
$sql .= ", fk_user_author";
|
$sql .= ", fk_user_author";
|
||||||
$sql .= ", active";
|
$sql .= ", active";
|
||||||
|
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
|
|
||||||
$sql .= " '" . $this->db->idate($now) . "'";
|
$sql .= " '" . $this->db->idate($now) . "'";
|
||||||
$sql .= ", " . $conf->entity;
|
$sql .= ", " . $conf->entity;
|
||||||
$sql .= ", " . (empty($this->fk_pcg_version) ? 'NULL' : "'" . $this->db->escape($this->fk_pcg_version) . "'");
|
$sql .= ", " . (empty($this->fk_pcg_version) ? 'NULL' : "'" . $this->db->escape($this->fk_pcg_version) . "'");
|
||||||
@ -228,7 +233,18 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param User $user Use making update
|
* @param User $user Use making update
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user) {
|
function update($user)
|
||||||
|
{
|
||||||
|
// Check parameters
|
||||||
|
if (empty($this->pcg_type) || $this->pcg_type == '-1')
|
||||||
|
{
|
||||||
|
$this->pcg_type = 'XXXXXX';
|
||||||
|
}
|
||||||
|
if (empty($this->pcg_subtype) || $this->pcg_subtype == '-1')
|
||||||
|
{
|
||||||
|
$this->pcg_subtype = 'XXXXXX';
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||||
@ -241,7 +257,6 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= " , fk_accounting_category = '" . $this->account_category . "'";
|
$sql .= " , fk_accounting_category = '" . $this->account_category . "'";
|
||||||
$sql .= " , fk_user_modif = " . $user->id;
|
$sql .= " , fk_user_modif = " . $user->id;
|
||||||
$sql .= " , active = '" . $this->active . "'";
|
$sql .= " , active = '" . $this->active . "'";
|
||||||
|
|
||||||
$sql .= " WHERE rowid = " . $this->id;
|
$sql .= " WHERE rowid = " . $this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
||||||
@ -369,7 +384,8 @@ class AccountingAccount extends CommonObject
|
|||||||
if ($withpicto && $withpicto != 2)
|
if ($withpicto && $withpicto != 2)
|
||||||
$result .= ' ';
|
$result .= ' ';
|
||||||
if ($withpicto != 2)
|
if ($withpicto != 2)
|
||||||
$result .= $link . $this->account_number . $linkend;
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
|
$result .= $link . length_accountg($this->account_number) . ' - ' . $this->label . $linkend;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -182,11 +182,15 @@ class FormVentilation extends Form
|
|||||||
$options = array();
|
$options = array();
|
||||||
$out = ajax_combobox($htmlname, $event);
|
$out = ajax_combobox($htmlname, $event);
|
||||||
|
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
if ($obj->pcg_type != '-1')
|
||||||
|
{
|
||||||
$options[$obj->pcg_type] = $obj->pcg_type;
|
$options[$obj->pcg_type] = $obj->pcg_type;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$out .= Form::selectarray($htmlname, $options, $selectid, $showempty);
|
$out .= Form::selectarray($htmlname, $options, $selectid, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth200');
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return $out;
|
return $out;
|
||||||
@ -202,7 +206,8 @@ class FormVentilation extends Form
|
|||||||
*
|
*
|
||||||
* @return string String with HTML select
|
* @return string String with HTML select
|
||||||
*/
|
*/
|
||||||
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array()) {
|
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT DISTINCT pcg_subtype ";
|
$sql = "SELECT DISTINCT pcg_subtype ";
|
||||||
@ -223,11 +228,15 @@ class FormVentilation extends Form
|
|||||||
$options = array();
|
$options = array();
|
||||||
$out = ajax_combobox($htmlname, $event);
|
$out = ajax_combobox($htmlname, $event);
|
||||||
|
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
if ($obj->pcg_type != '-1')
|
||||||
|
{
|
||||||
$options[$obj->pcg_subtype] = $obj->pcg_subtype;
|
$options[$obj->pcg_subtype] = $obj->pcg_subtype;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$out .= Form::selectarray($htmlname, $options, $selectid, $showempty);
|
$out .= Form::selectarray($htmlname, $options, $selectid, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth200');
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return $out;
|
return $out;
|
||||||
|
|||||||
@ -73,7 +73,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader("", "", "FicheVentilation");
|
llxHeader("", $langs->trans(FicheVentilation));
|
||||||
|
|
||||||
if ($cancel == $langs->trans("Cancel")) {
|
if ($cancel == $langs->trans("Cancel")) {
|
||||||
$action = '';
|
$action = '';
|
||||||
|
|||||||
@ -170,31 +170,31 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
|||||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_invoice))) {
|
if (strlen(trim($search_invoice))) {
|
||||||
$sql .= " AND f.facnumber like '%" . $search_invoice . "%'";
|
$sql .= natural_search("f.facnumber", $search_invoice);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_ref))) {
|
if (strlen(trim($search_ref))) {
|
||||||
$sql .= " AND p.ref like '%" . $search_ref . "%'";
|
$sql .= natural_search("p.ref", $search_ref);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) {
|
if (strlen(trim($search_label))) {
|
||||||
$sql .= " AND p.label like '%" . $search_label . "%'";
|
$sql .= natural_search("p.label", $search_label);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_desc))) {
|
if (strlen(trim($search_desc))) {
|
||||||
$sql .= " AND fd.description like '%" . $search_desc . "%'";
|
$sql .= natural_search("fd.description", $search_desc);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_amount))) {
|
if (strlen(trim($search_amount))) {
|
||||||
$sql .= " AND fd.total_ht like '%" . $search_amount . "%'";
|
$sql .= natural_search("fd.total_ht", $search_amount, 1);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_account))) {
|
if (strlen(trim($search_account))) {
|
||||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
$sql .= natural_search("aa.account_number", $search_account);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_vat))) {
|
if (strlen(trim($search_vat))) {
|
||||||
$sql .= " AND (fd.tva_tx like '" . $search_vat . "%')";
|
$sql .= natural_search("fd.tva_tx", $search_vat);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_country))) {
|
if (strlen(trim($search_country))) {
|
||||||
$sql .= " AND (co.label like'" . $search_country . "%')";
|
$sql .= natural_search("co.label", $search_country);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_tvaintra))) {
|
if (strlen(trim($search_tvaintra))) {
|
||||||
$sql .= " AND (s.tva_intra like'" . $search_tvaintra . "%')";
|
$sql .= natural_search("s.tva_intra", $search_tva_intra);
|
||||||
}
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
@ -278,12 +278,12 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="center">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|||||||
@ -293,11 +293,11 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '">%</td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td align="right" class="liste_titre">';
|
print '<td align="center" class="liste_titre">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -400,7 +400,7 @@ if ($result) {
|
|||||||
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="right">';
|
print '<td align="center">';
|
||||||
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -76,7 +76,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
llxHeader("", "FicheVentilation");
|
llxHeader("", $langs->trans(FicheVentilation));
|
||||||
|
|
||||||
if ($cancel == $langs->trans("Cancel")) {
|
if ($cancel == $langs->trans("Cancel")) {
|
||||||
$action = '';
|
$action = '';
|
||||||
@ -89,7 +89,7 @@ $formventilation = new FormVentilation($db);
|
|||||||
|
|
||||||
if (! empty($id)) {
|
if (! empty($id)) {
|
||||||
$sql = "SELECT er.ref, er.rowid as facid, erd.fk_c_type_fees, erd.comments, erd.rowid, erd.fk_code_ventilation,";
|
$sql = "SELECT er.ref, er.rowid as facid, erd.fk_c_type_fees, erd.comments, erd.rowid, erd.fk_code_ventilation,";
|
||||||
$sql .= " f.id as fees_id, f.label as fees_label,";
|
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label,";
|
||||||
$sql .= " aa.account_number, aa.label";
|
$sql .= " aa.account_number, aa.label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
||||||
@ -132,7 +132,7 @@ if (! empty($id)) {
|
|||||||
print '<td>' . stripslashes(nl2br($objp->comments)) . '</td></tr>';
|
print '<td>' . stripslashes(nl2br($objp->comments)) . '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>' . $langs->trans("TypeFees") . '</td>';
|
print '<tr><td>' . $langs->trans("TypeFees") . '</td>';
|
||||||
print '<td>' . dol_trunc($objp->fees_label, 24) . '</td>';
|
print '<td>' . ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))) . '</td>';
|
||||||
|
|
||||||
print '<tr><td>' . $langs->trans("Account") . '</td><td>';
|
print '<tr><td>' . $langs->trans("Account") . '</td><td>';
|
||||||
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -148,7 +148,7 @@ print '<script type="text/javascript">
|
|||||||
$sql = "SELECT er.ref, er.rowid as erid,";
|
$sql = "SELECT er.ref, er.rowid as erid,";
|
||||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.date,";
|
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.date,";
|
||||||
$sql .= " aa.label, aa.account_number,";
|
$sql .= " aa.label, aa.account_number,";
|
||||||
$sql .= " f.id as fees_id, f.label as fees_label";
|
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||||
$sql .= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
|
$sql .= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
$sql .= " , " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
$sql .= " , " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
@ -253,8 +253,8 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_vat" size="1" placeholder="%" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"></td>';
|
print '<td class="liste_titre" align="right"></td>';
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
$searchpicto=$form->showFilterAndCheckAddButtons(1);
|
$searchpicto=$form->showFilterAndCheckAddButtons(1);
|
||||||
@ -282,7 +282,7 @@ if ($result) {
|
|||||||
|
|
||||||
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
|
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
|
||||||
|
|
||||||
print '<td class="tdoverflow">' . $objp->fees_label . '</td>';
|
print '<td class="tdoverflow">' . ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))) . '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments));
|
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments));
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
|
||||||
@ -175,7 +175,7 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation"));
|
|||||||
// Expense report lines
|
// Expense report lines
|
||||||
$sql = "SELECT er.ref, er.rowid as erid, er.date_debut,";
|
$sql = "SELECT er.ref, er.rowid as erid, er.date_debut,";
|
||||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.date,";
|
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.date,";
|
||||||
$sql .= " f.id as fees_id, f.label as fees_label, f.accountancy_code as code_buy,";
|
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,";
|
||||||
$sql .= " aa.rowid as aarowid";
|
$sql .= " aa.rowid as aarowid";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport";
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport";
|
||||||
@ -279,11 +279,11 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td align="right" class="liste_titre">';
|
print '<td align="center" class="liste_titre">';
|
||||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -308,14 +308,14 @@ if ($result) {
|
|||||||
// Line id
|
// Line id
|
||||||
print '<td>' . $objp->rowid . '</td>';
|
print '<td>' . $objp->rowid . '</td>';
|
||||||
|
|
||||||
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
|
|
||||||
|
|
||||||
// Ref Expense report
|
// Ref Expense report
|
||||||
print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
|
print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
|
||||||
|
|
||||||
|
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
|
||||||
|
|
||||||
// Fees label
|
// Fees label
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $objp->fees_label;
|
print ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code)));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Fees description -- Can be null
|
// Fees description -- Can be null
|
||||||
@ -344,7 +344,7 @@ if ($result) {
|
|||||||
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="right">';
|
print '<td align="center">';
|
||||||
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -114,14 +114,14 @@ if (! empty($conf->expensereport->enabled)) // TODO Move this in the default ac
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
if (! empty($conf->loan->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
/*
|
||||||
|
if (! empty($conf->loan->enabled))
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (! empty($conf->don->enabled))
|
if (! empty($conf->don->enabled))
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
|
|||||||
@ -43,6 +43,7 @@ $langs->load("bills");
|
|||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("accountancy");
|
$langs->load("accountancy");
|
||||||
|
$langs->load("trips");
|
||||||
|
|
||||||
$date_startmonth = GETPOST('date_startmonth');
|
$date_startmonth = GETPOST('date_startmonth');
|
||||||
$date_startday = GETPOST('date_startday');
|
$date_startday = GETPOST('date_startday');
|
||||||
|
|||||||
@ -76,7 +76,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
llxHeader("", "", "FicheVentilation");
|
llxHeader("", $langs->trans(FicheVentilation));
|
||||||
|
|
||||||
if ($cancel == $langs->trans("Cancel")) {
|
if ($cancel == $langs->trans("Cancel")) {
|
||||||
$action = '';
|
$action = '';
|
||||||
|
|||||||
@ -157,25 +157,25 @@ $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"
|
|||||||
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||||
$sql.= " AND aa.rowid = l.fk_code_ventilation";
|
$sql.= " AND aa.rowid = l.fk_code_ventilation";
|
||||||
if (strlen(trim($search_invoice))) {
|
if (strlen(trim($search_invoice))) {
|
||||||
$sql .= " AND f.ref like '%" . $search_invoice . "%'";
|
$sql .= natural_search("f.ref", $search_invoice);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_ref))) {
|
if (strlen(trim($search_ref))) {
|
||||||
$sql .= " AND p.ref like '%" . $search_ref . "%'";
|
$sql .= natural_search("p.ref", $search_ref);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) {
|
if (strlen(trim($search_label))) {
|
||||||
$sql .= " AND p.label like '%" . $search_label . "%'";
|
$sql .= natural_search("p.label", $search_label);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_desc))) {
|
if (strlen(trim($search_desc))) {
|
||||||
$sql .= " AND l.description like '%" . $search_desc . "%'";
|
$sql .= natural_search("l.description", $search_desc);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_amount))) {
|
if (strlen(trim($search_amount))) {
|
||||||
$sql .= " AND l.total_ht like '%" . $search_amount . "%'";
|
$sql .= natural_search("l.total_ht", $search_amount, 1);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_account))) {
|
if (strlen(trim($search_account))) {
|
||||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
$sql .= natural_search("aa.account_number", $search_account, 1);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_vat))) {
|
if (strlen(trim($search_vat))) {
|
||||||
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
|
$sql .= natural_search("l.tva_tx", $search_vat, 1);
|
||||||
}
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
@ -255,16 +255,16 @@ if ($result) {
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="center">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -292,11 +292,11 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td align="right" class="liste_titre">';
|
print '<td align="center" class="liste_titre">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -406,7 +406,7 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Colonne choix ligne a ventiler
|
// Colonne choix ligne a ventiler
|
||||||
print '<td align="right">';
|
print '<td align="center">';
|
||||||
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||||
@ -1929,6 +1929,7 @@ class Adherent extends CommonObject
|
|||||||
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
||||||
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
|
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
|
||||||
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||||
|
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // md5 for OpenLdap TODO add type of encryption
|
||||||
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
||||||
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
||||||
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
||||||
|
|||||||
@ -125,6 +125,9 @@ if ($result)
|
|||||||
//print '<tr><td width="30%" class="notopnoleft" valign="top">';
|
//print '<tr><td width="30%" class="notopnoleft" valign="top">';
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||||
|
{
|
||||||
// Search contact/address
|
// Search contact/address
|
||||||
if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire)
|
if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire)
|
||||||
{
|
{
|
||||||
@ -150,7 +153,7 @@ if (count($listofsearchfields))
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -160,7 +163,7 @@ if (count($listofsearchfields))
|
|||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
||||||
print '<tr '.$bc[0].'><td align="center" colspan="2">';
|
print '<tr '.$bc[0].'><td align="center" colspan="2">';
|
||||||
|
|
||||||
$SommeA=0;
|
$SommeA=0;
|
||||||
@ -198,8 +201,70 @@ if ($conf->use_javascript_ajax)
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
// List of subscription by year
|
||||||
|
$Total=array();
|
||||||
|
$Number=array();
|
||||||
|
$tot=0;
|
||||||
|
$numb=0;
|
||||||
|
|
||||||
|
$sql = "SELECT c.subscription, c.dateadh as dateh";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
||||||
|
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||||
|
$sql.= " AND d.rowid = c.fk_adherent";
|
||||||
|
if(isset($date_select) && $date_select != '')
|
||||||
|
{
|
||||||
|
$sql .= " AND c.dateadh LIKE '".$date_select."%'";
|
||||||
|
}
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$objp = $db->fetch_object($result);
|
||||||
|
$year=dol_print_date($db->jdate($objp->dateh),"%Y");
|
||||||
|
$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->subscription;
|
||||||
|
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
|
||||||
|
$tot+=$objp->subscription;
|
||||||
|
$numb+=1;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<th>'.$langs->trans("Subscriptions").'</th>';
|
||||||
|
print '<th align="right">'.$langs->trans("Number").'</th>';
|
||||||
|
print '<th align="right">'.$langs->trans("AmountTotal").'</th>';
|
||||||
|
print '<th align="right">'.$langs->trans("AmountAverage").'</th>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
krsort($Total);
|
||||||
|
foreach ($Total as $key=>$value)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
||||||
|
print "<td align=\"right\">".$Number[$key]."</td>";
|
||||||
|
print "<td align=\"right\">".price($value)."</td>";
|
||||||
|
print "<td align=\"right\">".price(price2num($value/$Number[$key],'MT'))."</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Total
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td>'.$langs->trans("Total").'</td>';
|
||||||
|
print "<td align=\"right\">".$numb."</td>";
|
||||||
|
print '<td align="right">'.price($tot)."</td>";
|
||||||
|
print "<td align=\"right\">".price(price2num($numb>0?($tot/$numb):0,'MT'))."</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
print "</table><br>\n";
|
||||||
|
|
||||||
|
|
||||||
//print '</td><td class="notopnoleftnoright" valign="top">';
|
|
||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
@ -224,7 +289,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4">'.$langs->trans("LastMembersModified",$max).'</td></tr>';
|
print '<th colspan="4">'.$langs->trans("LastMembersModified",$max).'</th></tr>';
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num)
|
if ($num)
|
||||||
@ -287,7 +352,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="5">'.$langs->trans("LastSubscriptionsModified",$max).'</td></tr>';
|
print '<th colspan="5">'.$langs->trans("LastSubscriptionsModified",$max).'</th></tr>';
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num)
|
if ($num)
|
||||||
@ -333,11 +398,11 @@ else
|
|||||||
// Summary of members by type
|
// Summary of members by type
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("MembersTypes").'</td>';
|
print '<th>'.$langs->trans("MembersTypes").'</th>';
|
||||||
print '<td align=right>'.$langs->trans("MembersStatusToValid").'</td>';
|
print '<th align=right>'.$langs->trans("MembersStatusToValid").'</th>';
|
||||||
print '<td align=right>'.$langs->trans("MenuMembersNotUpToDate").'</td>';
|
print '<th align=right>'.$langs->trans("MenuMembersNotUpToDate").'</th>';
|
||||||
print '<td align=right>'.$langs->trans("MenuMembersUpToDate").'</td>';
|
print '<th align=right>'.$langs->trans("MenuMembersUpToDate").'</th>';
|
||||||
print '<td align=right>'.$langs->trans("MembersStatusResiliated").'</td>';
|
print '<th align=right>'.$langs->trans("MembersStatusResiliated").'</th>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
foreach ($AdherentType as $key => $adhtype)
|
foreach ($AdherentType as $key => $adhtype)
|
||||||
@ -360,71 +425,8 @@ print '<td class="liste_total" align="right">'.$SommeD.' '.$staticmember->LibSta
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "<br>\n";
|
|
||||||
|
|
||||||
|
|
||||||
// List of subscription by year
|
|
||||||
$Total=array();
|
|
||||||
$Number=array();
|
|
||||||
$tot=0;
|
|
||||||
$numb=0;
|
|
||||||
|
|
||||||
$sql = "SELECT c.subscription, c.dateadh as dateh";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
|
||||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
|
||||||
$sql.= " AND d.rowid = c.fk_adherent";
|
|
||||||
if(isset($date_select) && $date_select != '')
|
|
||||||
{
|
|
||||||
$sql .= " AND c.dateadh LIKE '".$date_select."%'";
|
|
||||||
}
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$year=dol_print_date($db->jdate($objp->dateh),"%Y");
|
|
||||||
$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->subscription;
|
|
||||||
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
|
|
||||||
$tot+=$objp->subscription;
|
|
||||||
$numb+=1;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td>'.$langs->trans("Subscriptions").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("Number").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
krsort($Total);
|
|
||||||
foreach ($Total as $key=>$value)
|
|
||||||
{
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
|
||||||
print "<td align=\"right\">".$Number[$key]."</td>";
|
|
||||||
print "<td align=\"right\">".price($value)."</td>";
|
|
||||||
print "<td align=\"right\">".price(price2num($value/$Number[$key],'MT'))."</td>";
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Total
|
|
||||||
print '<tr class="liste_total">';
|
|
||||||
print '<td>'.$langs->trans("Total").'</td>';
|
|
||||||
print "<td align=\"right\">".$numb."</td>";
|
|
||||||
print '<td align="right">'.price($tot)."</td>";
|
|
||||||
print "<td align=\"right\">".price(price2num($numb>0?($tot/$numb):0,'MT'))."</td>";
|
|
||||||
print "</tr>\n";
|
|
||||||
print "</table><br>\n";
|
|
||||||
|
|
||||||
//print '</td></tr></table>';
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -375,7 +375,7 @@ if (! empty($moreforfilter))
|
|||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||||
|
|||||||
@ -120,7 +120,7 @@ print '<table class="liste" width="100%">';
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Nature").'</td>';
|
print '<td>'.$langs->trans("Nature").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("NbOfMembers").'</td>';
|
print '<td align="right">'.$langs->trans("NbOfMembers").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
|
print '<td align="center">'.$langs->trans("LatestSubscriptionDate").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
|
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
|
||||||
|
|||||||
@ -199,11 +199,11 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Ref").'</td>';
|
print '<th>'.$langs->trans("Ref").'</th>';
|
||||||
print '<td>'.$langs->trans("Label").'</td>';
|
print '<th>'.$langs->trans("Label").'</th>';
|
||||||
print '<td align="center">'.$langs->trans("SubscriptionRequired").'</td>';
|
print '<th align="center">'.$langs->trans("SubscriptionRequired").'</th>';
|
||||||
print '<td align="center">'.$langs->trans("VoteAllowed").'</td>';
|
print '<th align="center">'.$langs->trans("VoteAllowed").'</th>';
|
||||||
print '<td> </td>';
|
print '<th> </th>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|||||||
@ -94,28 +94,23 @@ print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
$head = expedition_admin_prepare_head();
|
$head = expedition_admin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'general', $langs->trans("Sendings"), 0, 'sending');
|
dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending');
|
||||||
|
|
||||||
/*
|
// Miscellaneous parameters
|
||||||
* Formulaire parametres divers
|
|
||||||
*/
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Feature").'</td>';
|
print '<td>'.$langs->trans("Feature").'</td>';
|
||||||
print '<td align="center" width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '<td align="center" width="100">'.$langs->trans("Status").'</td>';
|
print '<td class="center">'.$langs->trans("Status").'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// expedition activation/desactivation
|
// expedition activation/desactivation
|
||||||
$var=!$var;
|
print "<tr>";
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td>'.$langs->trans("SendingsAbility").'</td>';
|
print '<td>'.$langs->trans("SendingsAbility").'</td>';
|
||||||
print '<td align="center" width="20">';
|
print '<td>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center" width="100">';
|
print '<td class="center">';
|
||||||
print $langs->trans("Required");
|
print $langs->trans("Required");
|
||||||
/*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
/*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||||
{
|
{
|
||||||
@ -129,15 +124,14 @@ print "</td>";
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Bon de livraison activation/desactivation
|
// Bon de livraison activation/desactivation
|
||||||
$var=!$var;
|
print '<tr>';
|
||||||
print '<tr '.$bc[$var].'>';
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans("DeliveriesOrderAbility");
|
print $langs->trans("DeliveriesOrderAbility");
|
||||||
print '<br>'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1);
|
print '<br>'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center" width="20">';
|
print '<td>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center" width="100">';
|
print '<td class="center">';
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
|
if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -86,7 +86,7 @@ $hookmanager->initHooks(array('admin'));
|
|||||||
// Put here declaration of dictionaries properties
|
// Put here declaration of dictionaries properties
|
||||||
|
|
||||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,26,0,32,0);
|
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,26,0);
|
||||||
|
|
||||||
// Name of SQL tables of dictionaries
|
// Name of SQL tables of dictionaries
|
||||||
$tabname=array();
|
$tabname=array();
|
||||||
@ -121,7 +121,7 @@ $tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
|
|||||||
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
|
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
|
||||||
$tabname[30]= MAIN_DB_PREFIX."c_format_cards";
|
$tabname[30]= MAIN_DB_PREFIX."c_format_cards";
|
||||||
//$tabname[31]= MAIN_DB_PREFIX."accounting_system";
|
//$tabname[31]= MAIN_DB_PREFIX."accounting_system";
|
||||||
$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
|
//$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
|
||||||
$tabname[33]= MAIN_DB_PREFIX."c_hrm_department";
|
$tabname[33]= MAIN_DB_PREFIX."c_hrm_department";
|
||||||
$tabname[34]= MAIN_DB_PREFIX."c_hrm_function";
|
$tabname[34]= MAIN_DB_PREFIX."c_hrm_function";
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ $tablib[28]= "DictionaryHolidayTypes";
|
|||||||
$tablib[29]= "DictionaryOpportunityStatus";
|
$tablib[29]= "DictionaryOpportunityStatus";
|
||||||
$tablib[30]= "DictionaryFormatCards";
|
$tablib[30]= "DictionaryFormatCards";
|
||||||
//$tablib[31]= "DictionaryAccountancysystem";
|
//$tablib[31]= "DictionaryAccountancysystem";
|
||||||
$tablib[32]= "DictionaryAccountancyCategory";
|
//$tablib[32]= "DictionaryAccountancyCategory";
|
||||||
$tablib[33]= "DictionaryDepartment";
|
$tablib[33]= "DictionaryDepartment";
|
||||||
$tablib[34]= "DictionaryFunction";
|
$tablib[34]= "DictionaryFunction";
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new
|
|||||||
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||||
$tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
$tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
||||||
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
||||||
$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
//$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
||||||
$tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department";
|
$tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department";
|
||||||
$tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
|
$tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ $tabsqlsort[28]="country ASC, code ASC";
|
|||||||
$tabsqlsort[29]="position ASC";
|
$tabsqlsort[29]="position ASC";
|
||||||
$tabsqlsort[30]="code ASC";
|
$tabsqlsort[30]="code ASC";
|
||||||
//$tabsqlsort[31]="pcg_version ASC";
|
//$tabsqlsort[31]="pcg_version ASC";
|
||||||
$tabsqlsort[32]="position ASC";
|
//$tabsqlsort[32]="position ASC";
|
||||||
$tabsqlsort[33]="code ASC";
|
$tabsqlsort[33]="code ASC";
|
||||||
$tabsqlsort[34]="code ASC";
|
$tabsqlsort[34]="code ASC";
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ $tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
|
|||||||
$tabfield[29]= "code,label,percent,position";
|
$tabfield[29]= "code,label,percent,position";
|
||||||
$tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
$tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||||
//$tabfield[31]= "pcg_version,label";
|
//$tabfield[31]= "pcg_version,label";
|
||||||
$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
|
//$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
|
||||||
$tabfield[33]= "code,label";
|
$tabfield[33]= "code,label";
|
||||||
$tabfield[34]= "code,label";
|
$tabfield[34]= "code,label";
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
|
|||||||
$tabfieldvalue[29]= "code,label,percent,position";
|
$tabfieldvalue[29]= "code,label,percent,position";
|
||||||
$tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
$tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||||
//$tabfieldvalue[31]= "pcg_version,label";
|
//$tabfieldvalue[31]= "pcg_version,label";
|
||||||
$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
|
//$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
|
||||||
$tabfieldvalue[33]= "code,label";
|
$tabfieldvalue[33]= "code,label";
|
||||||
$tabfieldvalue[34]= "code,label";
|
$tabfieldvalue[34]= "code,label";
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ $tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country";
|
|||||||
$tabfieldinsert[29]= "code,label,percent,position";
|
$tabfieldinsert[29]= "code,label,percent,position";
|
||||||
$tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
$tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||||
//$tabfieldinsert[31]= "pcg_version,label";
|
//$tabfieldinsert[31]= "pcg_version,label";
|
||||||
$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
//$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
||||||
$tabfieldinsert[33]= "code,label";
|
$tabfieldinsert[33]= "code,label";
|
||||||
$tabfieldinsert[34]= "code,label";
|
$tabfieldinsert[34]= "code,label";
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ $tabrowid[28]= "";
|
|||||||
$tabrowid[29]= "";
|
$tabrowid[29]= "";
|
||||||
$tabrowid[30]= "";
|
$tabrowid[30]= "";
|
||||||
//$tabrowid[31]= "";
|
//$tabrowid[31]= "";
|
||||||
$tabrowid[32]= "";
|
//$tabrowid[32]= "";
|
||||||
$tabrowid[33]= "rowid";
|
$tabrowid[33]= "rowid";
|
||||||
$tabrowid[34]= "rowid";
|
$tabrowid[34]= "rowid";
|
||||||
|
|
||||||
@ -419,7 +419,7 @@ $tabcond[28]= ! empty($conf->holiday->enabled);
|
|||||||
$tabcond[29]= ! empty($conf->projet->enabled);
|
$tabcond[29]= ! empty($conf->projet->enabled);
|
||||||
$tabcond[30]= ! empty($conf->label->enabled);
|
$tabcond[30]= ! empty($conf->label->enabled);
|
||||||
//$tabcond[31]= ! empty($conf->accounting->enabled);
|
//$tabcond[31]= ! empty($conf->accounting->enabled);
|
||||||
$tabcond[32]= ! empty($conf->accounting->enabled);
|
//$tabcond[32]= ! empty($conf->accounting->enabled);
|
||||||
$tabcond[33]= ! empty($conf->hrm->enabled);
|
$tabcond[33]= ! empty($conf->hrm->enabled);
|
||||||
$tabcond[34]= ! empty($conf->hrm->enabled);
|
$tabcond[34]= ! empty($conf->hrm->enabled);
|
||||||
|
|
||||||
@ -456,7 +456,7 @@ $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$lan
|
|||||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||||
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
||||||
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
|
//$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ $tabfieldcheck[28] = array();
|
|||||||
$tabfieldcheck[29] = array();
|
$tabfieldcheck[29] = array();
|
||||||
$tabfieldcheck[30] = array();
|
$tabfieldcheck[30] = array();
|
||||||
//$tabfieldcheck[31] = array();
|
//$tabfieldcheck[31] = array();
|
||||||
$tabfieldcheck[32] = array();
|
//$tabfieldcheck[32] = array();
|
||||||
$tabfieldcheck[33] = array();
|
$tabfieldcheck[33] = array();
|
||||||
$tabfieldcheck[34] = array();
|
$tabfieldcheck[34] = array();
|
||||||
|
|
||||||
@ -1039,7 +1039,7 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
||||||
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
||||||
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
||||||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("WithCounter"); }
|
||||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||||
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
||||||
|
|
||||||
@ -1211,7 +1211,7 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
||||||
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
||||||
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
||||||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("WithCounter"); }
|
||||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||||
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
||||||
|
|
||||||
@ -1343,6 +1343,10 @@ if ($id)
|
|||||||
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||||
$valuetoshow=price($valuetoshow);
|
$valuetoshow=price($valuetoshow);
|
||||||
}
|
}
|
||||||
|
if ($value == 'private')
|
||||||
|
{
|
||||||
|
$valuetoshow = yn($elementList[$valuetoshow]);
|
||||||
|
}
|
||||||
else if ($fieldlist[$field]=='libelle_facture') {
|
else if ($fieldlist[$field]=='libelle_facture') {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||||
@ -1691,6 +1695,12 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|||||||
print $form->selectarray('source', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
print $form->selectarray('source', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
elseif ($fieldlist[$field] == 'private')
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
print $form->selectyesno("private",(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
|
elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -1762,6 +1772,8 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
$size=''; $class='';
|
$size=''; $class='';
|
||||||
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
||||||
|
if ($fieldlist[$field]=='affect') $class='maxwidth50';
|
||||||
|
if ($fieldlist[$field]=='delay') $class='maxwidth50';
|
||||||
if ($fieldlist[$field]=='position') $class='maxwidth50';
|
if ($fieldlist[$field]=='position') $class='maxwidth50';
|
||||||
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
|
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
|
||||||
if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent';
|
if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent';
|
||||||
|
|||||||
@ -86,7 +86,7 @@ print '<input type="hidden" name="action" value="save">';
|
|||||||
|
|
||||||
$head=security_prepare_head();
|
$head=security_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'audit', $langs->trans("Security"));
|
dol_fiche_head($head, 'audit', $langs->trans("Security"), -1);
|
||||||
|
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|||||||
@ -72,28 +72,30 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_SHIPPING_FREE_TEXT')
|
else if ($action == 'set_param')
|
||||||
{
|
{
|
||||||
$freetext=GETPOST('SHIPPING_FREE_TEXT'); // No alpha here, we want exact string
|
$freetext=GETPOST('SHIPPING_FREE_TEXT'); // No alpha here, we want exact string
|
||||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
|
if ($res <= 0)
|
||||||
if ($res > 0)
|
{
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
$error++;
|
||||||
else
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
|
||||||
{
|
|
||||||
$draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha');
|
$draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha');
|
||||||
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||||
|
if ($res <= 0)
|
||||||
if ($res > 0)
|
{
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
$error++;
|
||||||
else
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen')
|
else if ($action == 'specimen')
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
@ -222,11 +224,9 @@ print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
$head = expedition_admin_prepare_head();
|
$head = expedition_admin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), 0, 'sending');
|
dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending');
|
||||||
|
|
||||||
/*
|
// Shipment numbering model
|
||||||
* Expedition numbering model
|
|
||||||
*/
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("SendingsNumberingModules"));
|
print load_fiche_titre($langs->trans("SendingsNumberingModules"));
|
||||||
|
|
||||||
@ -235,8 +235,8 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||||
print '<td>'.$langs->trans("Description").'</td>';
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td>'.$langs->trans("Example").'</td>';
|
print '<td>'.$langs->trans("Example").'</td>';
|
||||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
|
||||||
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
|
print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
@ -250,8 +250,6 @@ foreach ($dirmodels as $reldir)
|
|||||||
$handle = opendir($dir);
|
$handle = opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
$var=true;
|
|
||||||
|
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (substr($file, 0, 15) == 'mod_expedition_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
if (substr($file, 0, 15) == 'mod_expedition_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||||
@ -268,8 +266,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||||
|
|
||||||
$var=!$var;
|
print '<tr><td>'.$module->nom."</td>\n";
|
||||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td>\n";
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $module->info();
|
print $module->info();
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -374,7 +371,6 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
$var=true;
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
foreach (array('','/doc') as $valdir)
|
foreach (array('','/doc') as $valdir)
|
||||||
@ -412,8 +408,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
|
|
||||||
if ($modulequalified)
|
if ($modulequalified)
|
||||||
{
|
{
|
||||||
$var = !$var;
|
print '<tr><td width="100">';
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
|
||||||
print (empty($module->name)?$name:$module->name);
|
print (empty($module->name)?$name:$module->name);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
if (method_exists($module,'info')) print $module->info($langs);
|
if (method_exists($module,'info')) print $module->info($langs);
|
||||||
@ -498,19 +493,16 @@ print '<br>';
|
|||||||
*/
|
*/
|
||||||
print load_fiche_titre($langs->trans("OtherOptions"));
|
print load_fiche_titre($langs->trans("OtherOptions"));
|
||||||
|
|
||||||
$var=true;
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="set_param">';
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
print "<td>".$langs->trans("Parameter")."</td>\n";
|
print "<td>".$langs->trans("Parameter")."</td>\n";
|
||||||
print '<td width="60" align="center">'.$langs->trans("Value")."</td>\n";
|
|
||||||
print "<td> </td>\n";
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$var=! $var;
|
print '<tr><td>';
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="set_SHIPPING_FREE_TEXT">';
|
|
||||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
|
||||||
print $langs->trans("FreeLegalTextOnShippings").' ('.$langs->trans("AddCRIfTooLong").')<br>';
|
print $langs->trans("FreeLegalTextOnShippings").' ('.$langs->trans("AddCRIfTooLong").')<br>';
|
||||||
$variablename='SHIPPING_FREE_TEXT';
|
$variablename='SHIPPING_FREE_TEXT';
|
||||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||||
@ -523,25 +515,18 @@ else
|
|||||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
|
$doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
|
||||||
print $doleditor->Create();
|
print $doleditor->Create();
|
||||||
}
|
}
|
||||||
print '</td><td align="right">';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
$var=!$var;
|
print '<tr><td>';
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="set_SHIPPING_DRAFT_WATERMARK">';
|
|
||||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
|
||||||
print $langs->trans("WatermarkOnDraft").'<br>';
|
print $langs->trans("WatermarkOnDraft").'<br>';
|
||||||
print '<input size="50" class="flat" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
|
print '<input size="50" class="flat" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
|
||||||
print '</td><td align="right">';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -78,7 +78,7 @@ print "<br>\n";
|
|||||||
|
|
||||||
$head = expedition_admin_prepare_head();
|
$head = expedition_admin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), 0, 'sending');
|
dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'sending');
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ print "<br>\n";
|
|||||||
|
|
||||||
$head = expedition_admin_prepare_head();
|
$head = expedition_admin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), 0, 'sending');
|
dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'sending');
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -189,7 +189,7 @@ else
|
|||||||
show_skin(null,1);
|
show_skin(null,1);
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
$listofmodes=array('dolibarr_mailings','dolibarr_notes','dolibarr_details','Full');
|
$listofmodes=array('dolibarr_mailings','dolibarr_notes','dolibarr_details','dolibarr_readonly','Full');
|
||||||
$linkstomode='';
|
$linkstomode='';
|
||||||
foreach($listofmodes as $newmode)
|
foreach($listofmodes as $newmode)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -157,7 +157,6 @@ if ($action == 'edit') // Edit
|
|||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
$var=true;
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table summary="edit" class="noborder" width="100%">';
|
print '<table summary="edit" class="noborder" width="100%">';
|
||||||
@ -166,16 +165,14 @@ if ($action == 'edit') // Edit
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Default language
|
// Default language
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>';
|
|
||||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'main_lang_default', 1, 0, 0, 0, 0, 'minwidth300');
|
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'main_lang_default', 1, 0, 0, 0, 0, 'minwidth300');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Multilingual GUI
|
// Multilingual GUI
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
|
||||||
print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
|
print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
@ -192,11 +189,9 @@ if ($action == 'edit') // Edit
|
|||||||
{
|
{
|
||||||
print '<table summary="search" class="noborder" width="100%">';
|
print '<table summary="search" class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td colspan="2">'.$langs->trans("Activated").'</td></tr>';
|
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td colspan="2">'.$langs->trans("Activated").'</td></tr>';
|
||||||
$var=True;
|
|
||||||
foreach ($searchform as $key => $value)
|
foreach ($searchform as $key => $value)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$searchformtitle[$key].'</td><td colspan="2">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td colspan="2">';
|
|
||||||
print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
|
print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -210,29 +205,27 @@ if ($action == 'edit') // Edit
|
|||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Show logo
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableShowLogo").'</td><td>';
|
|
||||||
print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Max size of lists
|
// Max size of lists
|
||||||
$var=!$var;
|
print '<tr><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
|
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Max size of short lists on customer card
|
// Max size of short lists on customer card
|
||||||
$var=!$var;
|
print '<tr><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '"></td>';
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '"></td>';
|
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// show input border
|
||||||
|
/*
|
||||||
|
print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
|
||||||
|
print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
// Disable javascript and ajax
|
// Disable javascript and ajax
|
||||||
$var=!$var;
|
print '<tr><td>'.$langs->trans("DisableJavascript").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
|
|
||||||
print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
|
print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
@ -241,8 +234,7 @@ if ($action == 'edit') // Edit
|
|||||||
// Activate preview tab on element card
|
// Activate preview tab on element card
|
||||||
if (class_exists("Imagick"))
|
if (class_exists("Imagick"))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
|
||||||
print $form->selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
|
print $form->selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
@ -250,32 +242,28 @@ if ($action == 'edit') // Edit
|
|||||||
}
|
}
|
||||||
|
|
||||||
// First day for weeks
|
// First day for weeks
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("WeekStartOnDay").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("WeekStartOnDay").'</td><td>';
|
|
||||||
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0);
|
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// DefaultWorkingDays
|
// DefaultWorkingDays
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("DefaultWorkingDays").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultWorkingDays").'</td><td>';
|
|
||||||
print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5').'">';
|
print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// DefaultWorkingHours
|
// DefaultWorkingHours
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("DefaultWorkingHours").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultWorkingHours").'</td><td>';
|
|
||||||
print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18').'">';
|
print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Firstname/Name
|
// Firstname/Name
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("FirstnameNamePosition").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("FirstnameNamePosition").'</td><td>';
|
|
||||||
$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
|
$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
|
||||||
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
|
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -283,40 +271,52 @@ if ($action == 'edit') // Edit
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Hide unauthorized button
|
// Hide unauthorized button
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
|
|
||||||
print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1);
|
print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Hide helpcenter link on login page
|
// Show logo
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("EnableShowLogo").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
|
print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
|
||||||
print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Hide wiki link on login page
|
// Hide version link
|
||||||
$var=!$var;
|
/*
|
||||||
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 '<tr><td width="35%">'.$langs->trans("HideVersionLink").'</td><td>';
|
||||||
|
print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
// Show bugtrack link
|
// Show bugtrack link
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
|
||||||
print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
|
print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Hide wiki link on login page
|
||||||
|
print '<tr><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>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Hide helpcenter link on login page
|
||||||
|
print '<tr><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
|
||||||
|
print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Message on login page
|
// Message on login page
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
|
|
||||||
|
|
||||||
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -324,8 +324,7 @@ if ($action == 'edit') // Edit
|
|||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Message of the day on home page
|
// Message of the day on home page
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
|
|
||||||
|
|
||||||
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -345,14 +344,11 @@ if ($action == 'edit') // Edit
|
|||||||
}
|
}
|
||||||
else // Show
|
else // Show
|
||||||
{
|
{
|
||||||
$var=true;
|
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td><td> </td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td><td> </td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>';
|
|
||||||
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
||||||
print ($s?$s.' ':'');
|
print ($s?$s.' ':'');
|
||||||
print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
||||||
@ -362,8 +358,7 @@ else // Show
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
@ -380,11 +375,10 @@ else // Show
|
|||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td><td> </td></tr>';
|
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td><td> </td></tr>';
|
||||||
$var=true;
|
|
||||||
foreach ($searchform as $key => $value)
|
foreach ($searchform as $key => $value)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td>'.yn($searchformconst[$key]).'</td>';
|
print '<tr><td width="35%">'.$searchformtitle[$key].'</td><td>'.yn($searchformconst[$key]).'</td>';
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
|
if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -394,28 +388,26 @@ else // Show
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
$var=true;
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("Parameters").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("Parameters").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
print '<tr><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$var=!$var;
|
print '<tr><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '</td>';
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$var=!$var;
|
/*
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '</td>';
|
print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
|
||||||
|
print yn($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)."</td>";
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
*/
|
||||||
|
|
||||||
// Disable javascript/ajax
|
// Disable javascript/ajax
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
|
|
||||||
print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)."</td>";
|
print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)."</td>";
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
@ -423,40 +415,36 @@ else // Show
|
|||||||
// Activate preview tab on element card
|
// Activate preview tab on element card
|
||||||
if (class_exists("Imagick"))
|
if (class_exists("Imagick"))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
print '<tr><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
||||||
print yn(isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0)."</td>";
|
print yn(isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0)."</td>";
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// First day for weeks
|
// First day for weeks
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("WeekStartOnDay").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("WeekStartOnDay").'</td><td>';
|
|
||||||
print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'));
|
print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// DefaultWorkingDays
|
// DefaultWorkingDays
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("DefaultWorkingDays").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultWorkingDays").'</td><td>';
|
|
||||||
print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5';
|
print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// DefaultWorkingHours
|
// DefaultWorkingHours
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("DefaultWorkingHours").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultWorkingHours").'</td><td>';
|
|
||||||
print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18';
|
print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Firstname / Name position
|
// Firstname / Name position
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("FirstnameNamePosition").'</td><td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("FirstnameNamePosition").'</td><td>';
|
|
||||||
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); }
|
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); }
|
||||||
else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); }
|
else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); }
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -464,40 +452,48 @@ else // Show
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Hide unauthorized button
|
// Hide unauthorized button
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("ButtonHideUnauthorized").'</td><td colspan="2">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ButtonHideUnauthorized").'</td><td colspan="2">';
|
|
||||||
print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1);
|
print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Link to help center
|
// Show logo
|
||||||
$var=!$var;
|
print '<tr><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td colspan="2">';
|
print '<td width="20"> </td>';
|
||||||
print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1);
|
print "</tr>";
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Link to wiki help
|
// Hide version link
|
||||||
$var=!$var;
|
/*
|
||||||
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 '<tr><td width="35%">'.$langs->trans("HideVersionLink").'</td><td>';
|
||||||
print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
|
print yn($conf->global->MAIN_HIDE_VERSION);
|
||||||
print '</td></tr>';
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
// Show bugtrack link
|
// Show bugtrack link
|
||||||
$var=!$var;
|
print '<tr"><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
||||||
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
|
||||||
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
|
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
|
// Link to wiki help
|
||||||
|
print '<tr><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td colspan="2">';
|
||||||
|
print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Link to help center
|
||||||
|
print '<tr><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td colspan="2">';
|
||||||
|
print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Message login
|
// Message login
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
|
|
||||||
if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
|
if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Message of the day
|
// Message of the day
|
||||||
$var=!$var;
|
print '<tr><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
|
|
||||||
if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
|
if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|||||||
@ -214,12 +214,10 @@ print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
$head = expedition_admin_prepare_head();
|
$head = expedition_admin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), 0, 'sending');
|
dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending');
|
||||||
|
|
||||||
|
|
||||||
/*
|
// Delivery numbering model
|
||||||
* Livraison numbering model
|
|
||||||
*/
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"),'','');
|
print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"),'','');
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ print "<br>\n";
|
|||||||
|
|
||||||
$head = expedition_admin_prepare_head();
|
$head = expedition_admin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), 0, 'sending');
|
dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'sending');
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ print "<br>\n";
|
|||||||
|
|
||||||
$head = expedition_admin_prepare_head();
|
$head = expedition_admin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), 0, 'sending');
|
dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'sending');
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -228,7 +228,7 @@ if ($action == 'edit')
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
dol_fiche_head($head, 'common', '');
|
dol_fiche_head($head, 'common', '', -1);
|
||||||
|
|
||||||
print $langs->trans("EMailsDesc")."<br>\n";
|
print $langs->trans("EMailsDesc")."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -453,7 +453,7 @@ if ($action == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_fiche_head($head, 'common', '');
|
dol_fiche_head($head, 'common', '', -1);
|
||||||
|
|
||||||
print $langs->trans("EMailsDesc")."<br>\n";
|
print $langs->trans("EMailsDesc")."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|||||||
@ -405,7 +405,7 @@ $head[$h][2] = 'templates';
|
|||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
dol_fiche_head($head, 'templates', '');
|
dol_fiche_head($head, 'templates', '', -1);
|
||||||
|
|
||||||
// Confirmation de la suppression de la ligne
|
// Confirmation de la suppression de la ligne
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
|
|||||||
@ -239,7 +239,7 @@ $head[$h][2] = 'desc';
|
|||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=feature';
|
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=feature';
|
||||||
$head[$h][1] = $langs->trans("Features");
|
$head[$h][1] = $langs->trans("TechnicalServicesProvided");
|
||||||
$head[$h][2] = 'feature';
|
$head[$h][2] = 'feature';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
@ -251,45 +251,38 @@ foreach($orders as $tmpkey => $tmpvalue)
|
|||||||
if ($objMod->numero == $id)
|
if ($objMod->numero == $id)
|
||||||
{
|
{
|
||||||
$key = $i;
|
$key = $i;
|
||||||
|
$modName = $filename[$tmpkey];
|
||||||
|
$dirofmodule = $dirmod[$tmpkey];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$value = $orders[$key];
|
$value = $orders[$key];
|
||||||
|
$special = $objMod->special;
|
||||||
|
$tab=explode('_',$value);
|
||||||
|
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
|
||||||
|
|
||||||
|
// Check filters
|
||||||
|
$modulename=$objMod->getName();
|
||||||
|
$moduledesc=$objMod->getDesc();
|
||||||
|
$moduleauthor=$objMod->getPublisher();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<div class="centpercent">';
|
print '<div class="centpercent">';
|
||||||
|
|
||||||
|
print load_fiche_titre(($modulename?$modulename:$moduledesc), $moreinfo, 'object_'.$objMod->picto);
|
||||||
print load_fiche_titre($objMod->getDesc(),$moreinfo,'object_'.$objMod->picto);
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
dol_fiche_head($head, $mode, $title);
|
dol_fiche_head($head, $mode, $title, -1);
|
||||||
|
|
||||||
|
if (! $modulename)
|
||||||
|
|
||||||
$tab=explode('_',$value);
|
|
||||||
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
|
|
||||||
|
|
||||||
$modName = $filename[$key];
|
|
||||||
$objMod = $modules[$key];
|
|
||||||
$dirofmodule = $dirmod[$key];
|
|
||||||
|
|
||||||
$special = $objMod->special;
|
|
||||||
|
|
||||||
if (! $objMod->getName())
|
|
||||||
{
|
{
|
||||||
dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING);
|
dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
||||||
|
|
||||||
// Check filters
|
|
||||||
$modulename=$objMod->getName();
|
|
||||||
$moduledesc=$objMod->getDesc();
|
|
||||||
$moduledesclong=$objMod->getDescLong();
|
|
||||||
$moduleauthor=$objMod->getPublisher();
|
|
||||||
|
|
||||||
// Load all lang files of module
|
// Load all lang files of module
|
||||||
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
||||||
{
|
{
|
||||||
@ -322,6 +315,8 @@ $text='';
|
|||||||
|
|
||||||
if ($mode == 'desc')
|
if ($mode == 'desc')
|
||||||
{
|
{
|
||||||
|
if ($moduledesc) $text.=$moduledesc.'<br><br>';
|
||||||
|
|
||||||
$text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
|
$text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
|
||||||
|
|
||||||
$textexternal='';
|
$textexternal='';
|
||||||
@ -329,7 +324,7 @@ if ($mode == 'desc')
|
|||||||
{
|
{
|
||||||
$textexternal.='<br><strong>'.$langs->trans("Origin").':</strong> '.$langs->trans("ExternalModule",$dirofmodule);
|
$textexternal.='<br><strong>'.$langs->trans("Origin").':</strong> '.$langs->trans("ExternalModule",$dirofmodule);
|
||||||
if ($objMod->editor_name != 'dolibarr') $textexternal.='<br><strong>'.$langs->trans("Publisher").':</strong> '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name);
|
if ($objMod->editor_name != 'dolibarr') $textexternal.='<br><strong>'.$langs->trans("Publisher").':</strong> '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name);
|
||||||
if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='<br><strong>'.$langs->trans("Url").':</strong> '.$objMod->editor_url;
|
if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='<br><strong>'.$langs->trans("Url").':</strong> <a href="'.$objMod->editor_url.'" target="_blank">'.$objMod->editor_url.'</a>';
|
||||||
$text.=$textexternal;
|
$text.=$textexternal;
|
||||||
$text.='<br>';
|
$text.='<br>';
|
||||||
}
|
}
|
||||||
@ -342,7 +337,8 @@ if ($mode == 'desc')
|
|||||||
else $text.=$langs->trans("Disabled");
|
else $text.=$langs->trans("Disabled");
|
||||||
$text.='<br>';
|
$text.='<br>';
|
||||||
|
|
||||||
if ($objMod->getDescLong()) $text.=$objMod->getDesc().'<br>';
|
$moduledesclong=$objMod->getDescLong();
|
||||||
|
if ($moduledesclong) $text.='<br><hr><div class="moduledesclong">'.$moduledesclong.'<div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'feature')
|
if ($mode == 'feature')
|
||||||
@ -360,6 +356,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddDictionaries").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddDictionaries").':</strong> ';
|
||||||
if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib']))
|
if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib']))
|
||||||
{
|
{
|
||||||
@ -372,6 +370,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddBoxes").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddBoxes").':</strong> ';
|
||||||
if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes))
|
if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes))
|
||||||
{
|
{
|
||||||
@ -384,6 +384,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddModels").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddModels").':</strong> ';
|
||||||
if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models'])
|
if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models'])
|
||||||
{
|
{
|
||||||
@ -391,6 +393,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddSubstitutions").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddSubstitutions").':</strong> ';
|
||||||
if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions'])
|
if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions'])
|
||||||
{
|
{
|
||||||
@ -398,6 +402,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddSheduledJobs").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddSheduledJobs").':</strong> ';
|
||||||
if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs))
|
if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs))
|
||||||
{
|
{
|
||||||
@ -410,6 +416,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddTriggers").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddTriggers").':</strong> ';
|
||||||
if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers'])
|
if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers'])
|
||||||
{
|
{
|
||||||
@ -417,6 +425,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddHooks").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddHooks").':</strong> ';
|
||||||
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
|
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
|
||||||
{
|
{
|
||||||
@ -429,6 +439,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddPermissions").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddPermissions").':</strong> ';
|
||||||
if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights))
|
if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights))
|
||||||
{
|
{
|
||||||
@ -441,6 +453,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddMenus").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddMenus").':</strong> ';
|
||||||
if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1
|
if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1
|
||||||
{
|
{
|
||||||
@ -448,6 +462,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddExportProfiles").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddExportProfiles").':</strong> ';
|
||||||
if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label))
|
if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label))
|
||||||
{
|
{
|
||||||
@ -460,6 +476,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddImportProfiles").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddImportProfiles").':</strong> ';
|
||||||
if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label))
|
if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label))
|
||||||
{
|
{
|
||||||
@ -472,6 +490,8 @@ if ($mode == 'feature')
|
|||||||
}
|
}
|
||||||
else $text.=$langs->trans("No");
|
else $text.=$langs->trans("No");
|
||||||
|
|
||||||
|
$text.='<br>';
|
||||||
|
|
||||||
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
||||||
$text.=$langs->trans("DetectionNotPossible");
|
$text.=$langs->trans("DetectionNotPossible");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -235,6 +235,8 @@ $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'
|
|||||||
llxHeader('',$langs->trans("Setup"),$help_url);
|
llxHeader('',$langs->trans("Setup"),$help_url);
|
||||||
|
|
||||||
$arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
|
$arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
|
||||||
|
$arrayofwarnings=array(); // Array of warning each module want to show when activated
|
||||||
|
$arrayofwarningsext=array(); // Array of warning each module want to show when we activate an external module
|
||||||
|
|
||||||
// Search modules dirs
|
// Search modules dirs
|
||||||
$modulesdir = dolGetModulesDirs();
|
$modulesdir = dolGetModulesDirs();
|
||||||
@ -266,7 +268,7 @@ foreach ($modulesdir as $dir)
|
|||||||
|
|
||||||
if ($modName)
|
if ($modName)
|
||||||
{
|
{
|
||||||
if (! empty($modNameLoaded[$modName]))
|
if (! empty($modNameLoaded[$modName])) // In cache of already loaded modules ?
|
||||||
{
|
{
|
||||||
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
|
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
|
||||||
setEventMessages($mesg, null, 'warnings');
|
setEventMessages($mesg, null, 'warnings');
|
||||||
@ -297,7 +299,7 @@ foreach ($modulesdir as $dir)
|
|||||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
|
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
|
||||||
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
|
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
|
||||||
|
|
||||||
// We discard modules according to property disabled
|
// We discard modules according to property ->hidden
|
||||||
if (! empty($objMod->hidden)) $modulequalified=0;
|
if (! empty($objMod->hidden)) $modulequalified=0;
|
||||||
|
|
||||||
if ($modulequalified > 0)
|
if ($modulequalified > 0)
|
||||||
@ -321,8 +323,8 @@ foreach ($modulesdir as $dir)
|
|||||||
// Define array $categ with categ with at least one qualified module
|
// Define array $categ with categ with at least one qualified module
|
||||||
if ($modulequalified > 0)
|
if ($modulequalified > 0)
|
||||||
{
|
{
|
||||||
$modules[$i] = $objMod;
|
|
||||||
$filename[$i]= $modName;
|
$filename[$i]= $modName;
|
||||||
|
$modules[$modName] = $objMod;
|
||||||
|
|
||||||
$special = $objMod->special;
|
$special = $objMod->special;
|
||||||
|
|
||||||
@ -342,6 +344,16 @@ foreach ($modulesdir as $dir)
|
|||||||
|
|
||||||
if ($special == 1) $familykey='interface';
|
if ($special == 1) $familykey='interface';
|
||||||
|
|
||||||
|
// Add list of warnings to show into arrayofwarnings and arrayofwarningsext
|
||||||
|
if (! empty($objMod->warnings_activation))
|
||||||
|
{
|
||||||
|
$arrayofwarnings[$modName]=$objMod->warnings_activation;
|
||||||
|
}
|
||||||
|
if (! empty($objMod->warnings_activation_ext))
|
||||||
|
{
|
||||||
|
$arrayofwarningsext[$modName]=$objMod->warnings_activation_ext;
|
||||||
|
}
|
||||||
|
|
||||||
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
|
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
|
||||||
$dirmod[$i] = $dir;
|
$dirmod[$i] = $dir;
|
||||||
//print $i.'-'.$dirmod[$i].'<br>';
|
//print $i.'-'.$dirmod[$i].'<br>';
|
||||||
@ -428,7 +440,7 @@ if ($mode == 'common')
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
dol_fiche_head($head, $mode, '');
|
dol_fiche_head($head, $mode, '', -1);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
@ -484,7 +496,7 @@ if ($mode == 'common')
|
|||||||
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
|
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
|
||||||
|
|
||||||
$modName = $filename[$key];
|
$modName = $filename[$key];
|
||||||
$objMod = $modules[$key];
|
$objMod = $modules[$modName];
|
||||||
$dirofmodule = $dirmod[$key];
|
$dirofmodule = $dirmod[$key];
|
||||||
|
|
||||||
$special = $objMod->special;
|
$special = $objMod->special;
|
||||||
@ -504,6 +516,7 @@ if ($mode == 'common')
|
|||||||
|
|
||||||
// Check filters
|
// Check filters
|
||||||
$modulename=$objMod->getName();
|
$modulename=$objMod->getName();
|
||||||
|
$moduletechnicalname=$objMod->name;
|
||||||
$moduledesc=$objMod->getDesc();
|
$moduledesc=$objMod->getDesc();
|
||||||
$moduledesclong=$objMod->getDescLong();
|
$moduledesclong=$objMod->getDescLong();
|
||||||
$moduleauthor=$objMod->getPublisher();
|
$moduleauthor=$objMod->getPublisher();
|
||||||
@ -513,6 +526,7 @@ if ($mode == 'common')
|
|||||||
{
|
{
|
||||||
$qualified=0;
|
$qualified=0;
|
||||||
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
||||||
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduletechnicalname)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
||||||
@ -633,7 +647,7 @@ if ($mode == 'common')
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Activate/Disable and Setup (2 columns)
|
// Activate/Disable and Setup (2 columns)
|
||||||
if (! empty($conf->global->$const_name)) // If module is activated
|
if (! empty($conf->global->$const_name)) // If module is already activated
|
||||||
{
|
{
|
||||||
$disableSetup = 0;
|
$disableSetup = 0;
|
||||||
|
|
||||||
@ -699,12 +713,12 @@ if ($mode == 'common')
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else // Module not activated
|
else // Module not yet activated
|
||||||
{
|
{
|
||||||
print '<td align="center" valign="middle">';
|
print '<td align="center" valign="middle">';
|
||||||
if (! empty($objMod->always_enabled))
|
if (! empty($objMod->always_enabled))
|
||||||
{
|
{
|
||||||
// Ne devrait pas arriver.
|
// Should never happened
|
||||||
}
|
}
|
||||||
else if (! empty($objMod->disabled))
|
else if (! empty($objMod->disabled))
|
||||||
{
|
{
|
||||||
@ -712,7 +726,34 @@ if ($mode == 'common')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Module non actif
|
// Module qualified for activation
|
||||||
|
$warningmessage='';
|
||||||
|
if (! empty($arrayofwarnings[$modName]))
|
||||||
|
{
|
||||||
|
print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||||
|
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
|
||||||
|
{
|
||||||
|
$warningmessage .= ($warningmessage?"\n":"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($objMod->isCoreOrExternalModule() == 'external' && ! empty($arrayofwarningsext))
|
||||||
|
{
|
||||||
|
print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||||
|
foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
|
||||||
|
{
|
||||||
|
if (! empty($modules[$keymodule]->const_name)) // If module that request warning is on
|
||||||
|
{
|
||||||
|
foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
|
||||||
|
{
|
||||||
|
if ($keycountry == 'always' || $keycountry == $mysoc->country_code)
|
||||||
|
{
|
||||||
|
$warningmessage .= ($warningmessage?"\n":"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
||||||
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value=' . $modName . '&mode=' . $mode . $param . '">';
|
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value=' . $modName . '&mode=' . $mode . $param . '">';
|
||||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
print "</a>\n";
|
print "</a>\n";
|
||||||
@ -732,7 +773,7 @@ if ($mode == 'common')
|
|||||||
|
|
||||||
if ($mode == 'marketplace')
|
if ($mode == 'marketplace')
|
||||||
{
|
{
|
||||||
dol_fiche_head($head, $mode, '');
|
dol_fiche_head($head, $mode, '', -1);
|
||||||
|
|
||||||
// Marketplace
|
// Marketplace
|
||||||
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
||||||
@ -768,7 +809,7 @@ if ($mode == 'marketplace')
|
|||||||
|
|
||||||
if ($mode == 'deploy')
|
if ($mode == 'deploy')
|
||||||
{
|
{
|
||||||
dol_fiche_head($head, $mode, '');
|
dol_fiche_head($head, $mode, '', -1);
|
||||||
|
|
||||||
|
|
||||||
$allowonlineinstall=true;
|
$allowonlineinstall=true;
|
||||||
|
|||||||
@ -131,7 +131,7 @@ elseif ($action == 'synchronize')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans('multicurrency_syncronize_error', $reponse->error->info), null, 'errors');
|
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,7 @@ $db->commit();
|
|||||||
|
|
||||||
$head=security_prepare_head();
|
$head=security_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'default', $langs->trans("Security"));
|
dol_fiche_head($head, 'default', $langs->trans("Security"), -1);
|
||||||
|
|
||||||
|
|
||||||
// Show warning about external users
|
// Show warning about external users
|
||||||
|
|||||||
@ -96,7 +96,7 @@ print '<input type="hidden" name="action" value="set_proxy">';
|
|||||||
|
|
||||||
$head=security_prepare_head();
|
$head=security_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'proxy', $langs->trans("Security"));
|
dol_fiche_head($head, 'proxy', $langs->trans("Security"), -1);
|
||||||
|
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
|
|||||||
@ -198,7 +198,7 @@ print "<br>\n";
|
|||||||
|
|
||||||
$head=security_prepare_head();
|
$head=security_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'passwords', $langs->trans("Security"));
|
dol_fiche_head($head, 'passwords', $langs->trans("Security"), -1);
|
||||||
|
|
||||||
|
|
||||||
$var=false;
|
$var=false;
|
||||||
|
|||||||
@ -124,7 +124,7 @@ print '<input type="hidden" name="action" value="updateform">';
|
|||||||
|
|
||||||
$head=security_prepare_head();
|
$head=security_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'file', $langs->trans("Security"));
|
dol_fiche_head($head, 'file', $langs->trans("Security"), -1);
|
||||||
|
|
||||||
|
|
||||||
// Upload options
|
// Upload options
|
||||||
|
|||||||
@ -103,7 +103,7 @@ print '<input type="hidden" name="action" value="updateform">';
|
|||||||
|
|
||||||
$head=security_prepare_head();
|
$head=security_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'misc', $langs->trans("Security"));
|
dol_fiche_head($head, 'misc', $langs->trans("Security"), -1);
|
||||||
|
|
||||||
|
|
||||||
// Other Options
|
// Other Options
|
||||||
|
|||||||
@ -40,6 +40,7 @@ $action = GETPOST('action','alpha');
|
|||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scandir','alpha');
|
||||||
|
$type='supplier_payment';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -62,13 +63,114 @@ if ($action == 'updateMask')
|
|||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}else if ($action == 'setmod')
|
||||||
|
|
||||||
if ($action == 'setmod')
|
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// define constants for models generator that need parameters
|
||||||
|
else if ($action == 'setModuleOptions')
|
||||||
|
{
|
||||||
|
$post_size=count($_POST);
|
||||||
|
for($i=0;$i < $post_size;$i++)
|
||||||
|
{
|
||||||
|
if (array_key_exists('param'.$i,$_POST))
|
||||||
|
{
|
||||||
|
$param=GETPOST("param".$i,'alpha');
|
||||||
|
$value=GETPOST("value".$i,'alpha');
|
||||||
|
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activate a model
|
||||||
|
else if ($action == 'set')
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ($action == 'del')
|
||||||
|
{
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'SUPPLIER_PAYMENT_ADDON_PDF',$conf->entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set default model
|
||||||
|
else if ($action == 'setdoc')
|
||||||
|
{
|
||||||
|
if (dolibarr_set_const($db, "SUPPLIER_PAYMENT_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->FACTURE_ADDON_PDF = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On active le modele
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ($action == 'specimen')
|
||||||
|
{
|
||||||
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
|
$paiementFourn = new PaiementFourn($db);
|
||||||
|
$paiementFourn->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/supplier_payment/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($paiementFourn,$langs) > 0)
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_payment&file=SPECIMEN.pdf");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
|
dol_syslog($module->error, LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -96,6 +198,35 @@ if (empty($conf->global->SUPPLIER_PAYMENT_ADDON)) $conf->global->SUPPLIER_PAYMEN
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', '');
|
print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', '');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Document templates generators
|
||||||
|
*/
|
||||||
|
print '<br>';
|
||||||
|
print load_fiche_titre($langs->trans("BillsPDFModules"),'','');
|
||||||
|
|
||||||
|
// Load array def with activated templates
|
||||||
|
$def = array();
|
||||||
|
$sql = "SELECT nom";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql.= " WHERE type = '".$type."'";
|
||||||
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$num_rows=$db->num_rows($resql);
|
||||||
|
while ($i < $num_rows)
|
||||||
|
{
|
||||||
|
$array = $db->fetch_array($resql);
|
||||||
|
array_push($def, $array[0]);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
@ -217,6 +348,119 @@ foreach ($dirmodels as $reldir)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">'."\n";
|
||||||
|
print '<tr class="liste_titre">'."\n";
|
||||||
|
print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>'."\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
|
||||||
|
print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
foreach ($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
$dir = dol_buildpath($reldir."core/modules/supplier_payment/pdf/");
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$var=true;
|
||||||
|
|
||||||
|
$handle=opendir($dir);
|
||||||
|
|
||||||
|
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||||
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
|
|
||||||
|
require_once $dir.'/'.$file;
|
||||||
|
$module = new $classname($db, new PaiementFourn($db));
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">\n";
|
||||||
|
print "<td>";
|
||||||
|
print (empty($module->name)?$name:$module->name);
|
||||||
|
print "</td>\n";
|
||||||
|
print "<td>\n";
|
||||||
|
require_once $dir.$file;
|
||||||
|
$module = new $classname($db,$specimenthirdparty);
|
||||||
|
if (method_exists($module,'info')) print $module->info($langs);
|
||||||
|
else print $module->description;
|
||||||
|
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Active
|
||||||
|
if (in_array($name, $def))
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
//if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF != "$name")
|
||||||
|
//{
|
||||||
|
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">';
|
||||||
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
/*}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
|
}*/
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF == "$name")
|
||||||
|
{
|
||||||
|
//print img_picto($langs->trans("Default"),'on');
|
||||||
|
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||||
|
print '<td align="center">';
|
||||||
|
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table><br>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,13 +26,26 @@
|
|||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("help");
|
$langs->load("help");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
|
$langs->load("other");
|
||||||
|
|
||||||
$youuselaststable = 0;
|
$action=GETPOST('action','alpha');
|
||||||
|
|
||||||
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
$sfurl = '';
|
||||||
|
$version='0.0';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
// None
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -42,7 +55,7 @@ $youuselaststable = 0;
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
|
||||||
print load_fiche_titre("Dolibarr",'','title_setup');
|
print load_fiche_titre($langs->trans("ExternalResources"),'','title_setup');
|
||||||
|
|
||||||
print '<div style="padding-left: 30px;">'.img_picto_common('', 'dolibarr_box.png','height="120"').'</div>';
|
print '<div style="padding-left: 30px;">'.img_picto_common('', 'dolibarr_box.png','height="120"').'</div>';
|
||||||
|
|
||||||
@ -50,51 +63,10 @@ print '<div style="padding-left: 30px;">'.img_picto_common('', 'dolibarr_box.png
|
|||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
|
||||||
print $langs->trans("Version").' / '.$langs->trans("DolibarrLicense").':';
|
print $langs->trans("DolibarrLicense").' : ';
|
||||||
print '<ul>';
|
print '<ul><li>';
|
||||||
print '<li><strong>'.DOL_VERSION.'</strong>';
|
print '<a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
||||||
|
print '</li></ul>';
|
||||||
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
|
|
||||||
//var_dump($result['content']);
|
|
||||||
$sfurl = simplexml_load_string($result['content']);
|
|
||||||
if ($sfurl)
|
|
||||||
{
|
|
||||||
$i=0;
|
|
||||||
$version='0.0';
|
|
||||||
while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
|
||||||
{
|
|
||||||
$title=$sfurl->channel[0]->item[$i]->title;
|
|
||||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
|
||||||
{
|
|
||||||
$newversion=$reg[1];
|
|
||||||
$newversionarray=explode('.',$newversion);
|
|
||||||
$versionarray=explode('.',$version);
|
|
||||||
//var_dump($newversionarray);var_dump($versionarray);
|
|
||||||
if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show version
|
|
||||||
if ($version != '0.0')
|
|
||||||
{
|
|
||||||
print ' ('.$langs->trans("LastStableVersion").': <b>'.$version.'</b>';
|
|
||||||
if (DOL_VERSION == $version)
|
|
||||||
{
|
|
||||||
$youuselaststable=1;
|
|
||||||
print $langs->trans("YouUseLastStableVersion");
|
|
||||||
}
|
|
||||||
print ')';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print ' ('.$langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>)<br>';
|
|
||||||
}
|
|
||||||
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
|
||||||
|
|
||||||
|
|
||||||
print '</ul>';
|
|
||||||
|
|
||||||
//print "<br>\n";
|
//print "<br>\n";
|
||||||
|
|
||||||
@ -182,6 +154,11 @@ $url='https://wiki.dolibarr.org/index.php/Subscribe';
|
|||||||
if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='https://wiki.dolibarr.org/index.php/Adh%C3%A9rer';
|
if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='https://wiki.dolibarr.org/index.php/Adh%C3%A9rer';
|
||||||
if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='https://wiki.dolibarr.org/index.php/Subscribirse';
|
if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='https://wiki.dolibarr.org/index.php/Subscribirse';
|
||||||
print '<li><a href="'.$url.'" target="_blank" rel="external">'.$langs->trans("SubscribeToFoundation").'</a></li>';
|
print '<li><a href="'.$url.'" target="_blank" rel="external">'.$langs->trans("SubscribeToFoundation").'</a></li>';
|
||||||
|
print '</ul>';
|
||||||
|
|
||||||
|
print $langs->trans("SocialNetworks").':';
|
||||||
|
|
||||||
|
print '<ul>';
|
||||||
|
|
||||||
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
|
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
|
||||||
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
|
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
|
||||||
@ -211,12 +188,15 @@ print '</div>';
|
|||||||
print '<div class="clearboth"></div>';
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
|
|
||||||
if ($youuselaststable)
|
$showpromotemessage=1;
|
||||||
|
if ($showpromotemessage)
|
||||||
|
{
|
||||||
|
$tmp=versiondolibarrarray();
|
||||||
|
if (is_numeric($tmp[2])) // Not alpha, beta or rc
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$tmp=versiondolibarrarray();
|
|
||||||
if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0))
|
if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0))
|
||||||
{
|
{
|
||||||
print $langs->trans("TitleExampleForMajorRelease").':<br>';
|
print $langs->trans("TitleExampleForMajorRelease").':<br>';
|
||||||
@ -232,6 +212,7 @@ if ($youuselaststable)
|
|||||||
print '</textarea>';
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -25,14 +25,35 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("install");
|
$langs->load("install");
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
|
$action=GETPOST('action','alpha');
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
$sfurl = '';
|
||||||
|
$version='0.0';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($action == 'getlastversion')
|
||||||
|
{
|
||||||
|
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
|
||||||
|
//var_dump($result['content']);
|
||||||
|
$sfurl = simplexml_load_string($result['content']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -52,11 +73,7 @@ print '<div class="div-table-responsive-no-min">';
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')</td><td>'.DOL_VERSION;
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VersionLastUpgrade").'</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VersionProgram").'</td><td>'.DOL_VERSION;
|
|
||||||
// If current version differs from last upgrade
|
// If current version differs from last upgrade
|
||||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
|
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
|
||||||
{
|
{
|
||||||
@ -68,7 +85,48 @@ else
|
|||||||
// Compare version with last upgrade database version
|
// Compare version with last upgrade database version
|
||||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE));
|
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (function_exists('curl_init'))
|
||||||
|
{
|
||||||
|
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||||
|
print ' - ';
|
||||||
|
if ($action == 'getlastversion')
|
||||||
|
{
|
||||||
|
if ($sfurl)
|
||||||
|
{
|
||||||
|
while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
||||||
|
{
|
||||||
|
$title=$sfurl->channel[0]->item[$i]->title;
|
||||||
|
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
||||||
|
{
|
||||||
|
$newversion=$reg[1];
|
||||||
|
$newversionarray=explode('.',$newversion);
|
||||||
|
$versionarray=explode('.',$version);
|
||||||
|
//var_dump($newversionarray);var_dump($versionarray);
|
||||||
|
if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show version
|
||||||
|
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="button">' .$langs->trans("Check").'</a><br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -265,6 +323,7 @@ $configfileparameters=array(
|
|||||||
'?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
|
'?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
|
||||||
'separator2' => '',
|
'separator2' => '',
|
||||||
'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
|
'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
|
||||||
|
'?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"),
|
||||||
'separator'=> '',
|
'separator'=> '',
|
||||||
'?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
|
'?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
|
||||||
'?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
|
'?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
|
||||||
@ -318,7 +377,11 @@ foreach($configfileparameters as $key => $value)
|
|||||||
{
|
{
|
||||||
$newkey = preg_replace('/^\?/','',$key);
|
$newkey = preg_replace('/^\?/','',$key);
|
||||||
|
|
||||||
if (preg_match('/^\?/',$key) && empty(${$newkey})) continue; // We discard parametes starting with ?
|
if (preg_match('/^\?/',$key) && empty(${$newkey}))
|
||||||
|
{
|
||||||
|
if ($newkey != 'multicompany_transverse_mode' || empty($conf->multicompany->enabled))
|
||||||
|
continue; // We discard parameters starting with ?
|
||||||
|
}
|
||||||
if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue;
|
if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|||||||
@ -95,13 +95,13 @@ print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
|||||||
if (dol_is_file($xmlfile))
|
if (dol_is_file($xmlfile))
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = ';
|
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = ';
|
||||||
print '<input name="xmlshortfile" class="flat minwidth200" value="'.dol_escape_htmltag($xmlshortfile).'">';
|
print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = ';
|
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = ';
|
||||||
print '<input name="xmlshortfile" class="flat minwidth200" value="'.dol_escape_htmltag($xmlshortfile).'">';
|
print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
|
||||||
print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
|
print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
|||||||
if ($enableremotecheck)
|
if ($enableremotecheck)
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = ';
|
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = ';
|
||||||
print '<input name="xmlremote" class="flat quatrevingtpercent" value="'.dol_escape_htmltag($xmlremote).'"><br>';
|
print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -111,8 +111,9 @@ jQuery(document).ready(function() {
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("Backup"),'','title_setup');
|
print load_fiche_titre($langs->trans("Backup"),'','title_setup');
|
||||||
|
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
|
||||||
|
|
||||||
print $langs->trans("BackupDesc",DOL_DATA_ROOT).'<br><br>';
|
print '<div class="center">'.$langs->trans("BackupDesc",DOL_DATA_ROOT).'</div><br><br>';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ print $langs->trans("BackupDesc",DOL_DATA_ROOT).'<br><br>';
|
|||||||
name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input
|
name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input
|
||||||
type="hidden" name="export_type" value="server" />
|
type="hidden" name="export_type" value="server" />
|
||||||
|
|
||||||
<fieldset id="fieldsetexport"><legend style="font-size: 3em">1</legend>
|
<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
print $langs->trans("BackupDesc3",$dolibarr_main_db_name).'<br>';
|
print $langs->trans("BackupDesc3",$dolibarr_main_db_name).'<br>';
|
||||||
@ -468,7 +469,7 @@ print '</td></tr></table>';
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="backupdatabaseright" class="fichehalfright" style="height:400px; overflow: auto;">
|
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">
|
||||||
<div class="ficheaddleft">
|
<div class="ficheaddleft">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -484,7 +485,7 @@ print '<br>';
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<fieldset><legend style="font-size: 3em">2</legend>
|
<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>
|
||||||
<?php
|
<?php
|
||||||
print $langs->trans("BackupDesc2",DOL_DATA_ROOT).'<br>';
|
print $langs->trans("BackupDesc2",DOL_DATA_ROOT).'<br>';
|
||||||
print $langs->trans("BackupDescX").'<br><br>';
|
print $langs->trans("BackupDescX").'<br><br>';
|
||||||
|
|||||||
@ -37,8 +37,8 @@ if (! $user->admin)
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$title=$langs->trans("SystemToolsArea");
|
$title=$langs->trans("AdminTools");
|
||||||
if (GETPOST('leftmenu') == 'admintools') $title=$langs->trans("ModulesSystemTools");
|
//if (GETPOST('leftmenu') == 'admintools') $title=$langs->trans("ModulesSystemTools");
|
||||||
|
|
||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
|
|||||||
@ -69,7 +69,9 @@ llxHeader('',$langs->trans("Upgrade"),$wikihelp);
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("Upgrade"),'','title_setup');
|
print load_fiche_titre($langs->trans("Upgrade"),'','title_setup');
|
||||||
|
|
||||||
print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print $langs->trans("CurrentVersion").' : <strong>'.DOL_VERSION.'</strong><br>';
|
||||||
|
|
||||||
if (function_exists('curl_init'))
|
if (function_exists('curl_init'))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -181,7 +181,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
|
|
||||||
$head=translation_prepare_head();
|
$head=translation_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, $mode, '', 0, '');
|
dol_fiche_head($head, $mode, '', -1, '');
|
||||||
|
|
||||||
if ($mode == 'overwrite')
|
if ($mode == 'overwrite')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,16 +35,83 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
$action = GETPOST('action','alpha');
|
||||||
|
$value = GETPOST('value','alpha');
|
||||||
|
$type='user';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
if (preg_match('/set_(.*)/',$action,$reg))
|
|
||||||
|
// Activate a model
|
||||||
|
|
||||||
|
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||||
|
if ($action == 'setModuleOptions')
|
||||||
|
{
|
||||||
|
$post_size=count($_POST);
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
for($i=0;$i < $post_size;$i++)
|
||||||
|
{
|
||||||
|
if (array_key_exists('param'.$i,$_POST))
|
||||||
|
{
|
||||||
|
$param=GETPOST("param".$i,'alpha');
|
||||||
|
$value=GETPOST("value".$i,'alpha');
|
||||||
|
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($action == 'set_default')
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
$res = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($action == 'del_default')
|
||||||
|
{
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
if ($conf->global->USER_ADDON_PDF_ODT == "$value") dolibarr_del_const($db, 'USER_ADDON_PDF_ODT',$conf->entity);
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set default model
|
||||||
|
elseif ($action == 'setdoc')
|
||||||
|
{
|
||||||
|
if (dolibarr_set_const($db, "USER_ADDON_PDF_ODT",$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->USER_ADDON_PDF_ODT = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On active le modele
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
}
|
||||||
|
elseif (preg_match('/set_(.*)/',$action,$reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||||
@ -58,7 +125,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/del_(.*)/',$action,$reg))
|
elseif (preg_match('/del_(.*)/',$action,$reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||||
@ -72,7 +139,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Set hide closed customer into combox or select
|
//Set hide closed customer into combox or select
|
||||||
if ($action == 'sethideinactiveuser')
|
elseif ($action == 'sethideinactiveuser')
|
||||||
{
|
{
|
||||||
$status = GETPOST('status','alpha');
|
$status = GETPOST('status','alpha');
|
||||||
|
|
||||||
@ -138,6 +205,164 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
|
// Defini tableau def des modeles
|
||||||
|
$def = array();
|
||||||
|
$sql = "SELECT nom";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql.= " WHERE type = '".$type."'";
|
||||||
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$num_rows=$db->num_rows($resql);
|
||||||
|
while ($i < $num_rows)
|
||||||
|
{
|
||||||
|
$array = $db->fetch_array($resql);
|
||||||
|
array_push($def, $array[0]);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||||
|
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
foreach ($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
foreach (array('','/doc') as $valdir)
|
||||||
|
{
|
||||||
|
$dir = dol_buildpath($reldir."core/modules/user".$valdir);
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$handle=opendir($dir);
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
$filelist[]=$file;
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
arsort($filelist);
|
||||||
|
|
||||||
|
foreach($filelist as $file)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||||
|
{
|
||||||
|
|
||||||
|
if (file_exists($dir.'/'.$file))
|
||||||
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
|
|
||||||
|
require_once $dir.'/'.$file;
|
||||||
|
$module = new $classname($db);
|
||||||
|
|
||||||
|
$modulequalified=1;
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||||
|
|
||||||
|
if ($modulequalified)
|
||||||
|
{
|
||||||
|
$var = !$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
|
print (empty($module->name)?$name:$module->name);
|
||||||
|
print "</td><td>\n";
|
||||||
|
if (method_exists($module,'info')) print $module->info($langs);
|
||||||
|
else print $module->description;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Active
|
||||||
|
if (in_array($name, $def))
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del_default&value='.$name.'">';
|
||||||
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set_default&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Defaut
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($conf->global->USER_ADDON_PDF == $name)
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Default"),'on');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
|
if ($module->type == 'pdf')
|
||||||
|
{
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
}
|
||||||
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
||||||
|
|
||||||
|
|
||||||
|
print '<td align="center">';
|
||||||
|
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Preview
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($module->type == 'pdf')
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'contract').'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_object($langs->trans("PreviewNotAvailable"),'generic');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print "<br>";
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
316
htdocs/admin/usergroup.php
Normal file
316
htdocs/admin/usergroup.php
Normal file
@ -0,0 +1,316 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
|
* Copyright (C) 2004-2009 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.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/admin/usergroup.php
|
||||||
|
* \ingroup core
|
||||||
|
* \brief Page to setup usergroup module
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
|
$langs->load("admin");
|
||||||
|
$langs->load("members");
|
||||||
|
$langs->load("users");
|
||||||
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
$action = GETPOST('action','alpha');
|
||||||
|
$value = GETPOST('value','alpha');
|
||||||
|
$type='group';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Action
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Activate a model
|
||||||
|
|
||||||
|
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||||
|
if ($action == 'setModuleOptions')
|
||||||
|
{
|
||||||
|
$post_size=count($_POST);
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
for($i=0;$i < $post_size;$i++)
|
||||||
|
{
|
||||||
|
if (array_key_exists('param'.$i,$_POST))
|
||||||
|
{
|
||||||
|
$param=GETPOST("param".$i,'alpha');
|
||||||
|
$value=GETPOST("value".$i,'alpha');
|
||||||
|
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($action == 'set_default')
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
$res = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($action == 'del_default')
|
||||||
|
{
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
if ($conf->global->USERGROUP_ADDON_PDF_ODT == "$value") dolibarr_del_const($db, 'USERGROUP_ADDON_PDF_ODT',$conf->entity);
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set default model
|
||||||
|
elseif ($action == 'setdoc')
|
||||||
|
{
|
||||||
|
if (dolibarr_set_const($db, "USERGROUP_ADDON_PDF_ODT",$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->USERGROUP_ADDON_PDF_ODT = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On active le modele
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
}
|
||||||
|
elseif (preg_match('/set_(.*)/',$action,$reg))
|
||||||
|
{
|
||||||
|
$code=$reg[1];
|
||||||
|
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif (preg_match('/del_(.*)/',$action,$reg))
|
||||||
|
{
|
||||||
|
$code=$reg[1];
|
||||||
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios';
|
||||||
|
llxHeader('',$langs->trans("UsersSetup"),$help_url);
|
||||||
|
|
||||||
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
|
||||||
|
|
||||||
|
|
||||||
|
$head=user_admin_prepare_head();
|
||||||
|
|
||||||
|
dol_fiche_head($head,'usergroupcard', $langs->trans("MenuUsersAndGroups"), 0, 'user');
|
||||||
|
|
||||||
|
|
||||||
|
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
|
// Defini tableau def des modeles
|
||||||
|
$def = array();
|
||||||
|
$sql = "SELECT nom";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql.= " WHERE type = '".$type."'";
|
||||||
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$num_rows=$db->num_rows($resql);
|
||||||
|
while ($i < $num_rows)
|
||||||
|
{
|
||||||
|
$array = $db->fetch_array($resql);
|
||||||
|
array_push($def, $array[0]);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||||
|
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
foreach ($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
foreach (array('','/doc') as $valdir)
|
||||||
|
{
|
||||||
|
$dir = dol_buildpath($reldir."core/modules/usergroup".$valdir);
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$handle=opendir($dir);
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
$filelist[]=$file;
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
arsort($filelist);
|
||||||
|
|
||||||
|
foreach($filelist as $file)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||||
|
{
|
||||||
|
|
||||||
|
if (file_exists($dir.'/'.$file))
|
||||||
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
|
|
||||||
|
require_once $dir.'/'.$file;
|
||||||
|
$module = new $classname($db);
|
||||||
|
|
||||||
|
$modulequalified=1;
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||||
|
|
||||||
|
if ($modulequalified)
|
||||||
|
{
|
||||||
|
$var = !$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
|
print (empty($module->name)?$name:$module->name);
|
||||||
|
print "</td><td>\n";
|
||||||
|
if (method_exists($module,'info')) print $module->info($langs);
|
||||||
|
else print $module->description;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Active
|
||||||
|
if (in_array($name, $def))
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del_default&value='.$name.'">';
|
||||||
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set_default&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Defaut
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($conf->global->USERGROUP_ADDON_PDF == $name)
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Default"),'on');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
|
if ($module->type == 'pdf')
|
||||||
|
{
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
}
|
||||||
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
||||||
|
|
||||||
|
|
||||||
|
print '<td align="center">';
|
||||||
|
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Preview
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($module->type == 'pdf')
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'contract').'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_object($langs->trans("PreviewNotAvailable"),'generic');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print "<br>";
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -159,7 +159,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat" name="url" size="50" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat" name="url" class="quatrevingtpercent" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||||
$liste=array(0=>$langs->trans("ReplaceWindow"),1=>$langs->trans("OpenANewWindow"));
|
$liste=array(0=>$langs->trans("ReplaceWindow"),1=>$langs->trans("OpenANewWindow"));
|
||||||
@ -221,6 +221,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -297,6 +299,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $langs->load("bills");
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p><a class="lien1" href="<?php echo DOL_URL_ROOT ?>/compta/facture.php?action=builddoc&facid=<?php echo $_GET['facid']; ?>" target="_blank"><?php echo $langs->trans("ShowInvoice"); ?></a></p>
|
<p><a class="lien1" href="<?php echo DOL_URL_ROOT ?>/compta/facture/card.php?action=builddoc&facid=<?php echo $_GET['facid']; ?>" target="_blank"><?php echo $langs->trans("ShowInvoice"); ?></a></p>
|
||||||
<br>
|
<br>
|
||||||
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
|
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
|
||||||
|
|
||||||
|
|||||||
@ -248,6 +248,7 @@ class Categories extends DolibarrApi
|
|||||||
if( ! count($obj_ret)) {
|
if( ! count($obj_ret)) {
|
||||||
throw new RestException(404, 'No category found');
|
throw new RestException(404, 'No category found');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj_ret;
|
return $obj_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,8 +352,46 @@ class Categories extends DolibarrApi
|
|||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
// Remove the subscriptions because they are handled as a subresource.
|
// Remove fields not relevent to categories
|
||||||
//unset($object->subscriptions);
|
unset($object->country);
|
||||||
|
unset($object->country_id);
|
||||||
|
unset($object->country_code);
|
||||||
|
unset($object->total_ht);
|
||||||
|
unset($object->total_ht);
|
||||||
|
unset($object->total_localtax1);
|
||||||
|
unset($object->total_localtax2);
|
||||||
|
unset($object->total_ttc);
|
||||||
|
unset($object->total_tva);
|
||||||
|
unset($object->lines);
|
||||||
|
unset($object->fk_incoterms);
|
||||||
|
unset($object->libelle_incoterms);
|
||||||
|
unset($object->location_incoterms);
|
||||||
|
unset($object->civility_id);
|
||||||
|
unset($object->name);
|
||||||
|
unset($object->lastname);
|
||||||
|
unset($object->firstname);
|
||||||
|
unset($object->shipping_method_id);
|
||||||
|
unset($object->fk_delivery_address);
|
||||||
|
unset($object->cond_reglement);
|
||||||
|
unset($object->cond_reglement_id);
|
||||||
|
unset($object->mode_reglement_id);
|
||||||
|
unset($object->barcode_type_coder);
|
||||||
|
unset($object->barcode_type_label);
|
||||||
|
unset($object->barcode_type_code);
|
||||||
|
unset($object->barcode_type);
|
||||||
|
unset($object->canvas);
|
||||||
|
unset($object->cats);
|
||||||
|
unset($object->motherof);
|
||||||
|
unset($object->context);
|
||||||
|
unset($object->socid);
|
||||||
|
unset($object->thirdparty);
|
||||||
|
unset($object->contact);
|
||||||
|
unset($object->contact_id);
|
||||||
|
unset($object->user);
|
||||||
|
unset($object->fk_account);
|
||||||
|
unset($object->fk_project);
|
||||||
|
unset($object->note);
|
||||||
|
unset($object->statut);
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -291,7 +291,7 @@ class CategoryApi extends DolibarrApi
|
|||||||
* @url GET /customer/{cusid}/categories
|
* @url GET /customer/{cusid}/categories
|
||||||
*/
|
*/
|
||||||
function getListCustomerCategories($cusid, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getListCustomerCategories($cusid, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
return $this->getListForItem('customer', $sortfield, $sortorder, $limit, $page, $cusid);
|
return $this->getListForItem($sortfield, $sortorder, $limit, $page, 'customer', $cusid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -526,9 +526,30 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_project";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact";
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||||
if (!$this->db->query($sql))
|
if (!$this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
|
||||||
|
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||||
|
if (!$this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class";
|
||||||
|
$sql .= " WHERE fk_categ = ".$this->id;
|
||||||
|
if (!$this->db->query($sql))
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
|||||||
@ -146,6 +146,14 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))
|
|||||||
$listUserAssignedUpdated = true;
|
$listUserAssignedUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Link to a project
|
||||||
|
if ($action == 'classin' && ($user->rights->agenda->allactions->create ||
|
||||||
|
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)))
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
$object->setProject(GETPOST('projectid'));
|
||||||
|
}
|
||||||
|
|
||||||
// Action clone object
|
// Action clone object
|
||||||
if ($action == 'confirm_clone' && $confirm == 'yes')
|
if ($action == 'confirm_clone' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
@ -577,6 +585,8 @@ if ($action == 'mupdate')
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$formproject=new FormProjets($db);
|
||||||
|
|
||||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||||
|
|
||||||
@ -744,7 +754,7 @@ if ($action == 'create')
|
|||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Societe, contact
|
// Related company
|
||||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ActionOnCompany").'</td><td>';
|
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ActionOnCompany").'</td><td>';
|
||||||
if (GETPOST('socid','int') > 0)
|
if (GETPOST('socid','int') > 0)
|
||||||
{
|
{
|
||||||
@ -755,7 +765,6 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$events=array();
|
$events=array();
|
||||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||||
//For external user force the company to user company
|
//For external user force the company to user company
|
||||||
@ -768,6 +777,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Related contact
|
||||||
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
|
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
|
||||||
$form->select_contacts(GETPOST('socid','int'), GETPOST('contactid'), 'contactid', 1, '', '', 0, 'minwidth200');
|
$form->select_contacts(GETPOST('socid','int'), GETPOST('contactid'), 'contactid', 1, '', '', 0, 'minwidth200');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -852,7 +862,9 @@ if ($id > 0)
|
|||||||
$result4=$object->fetch_userassigned();
|
$result4=$object->fetch_userassigned();
|
||||||
$result5=$object->fetch_optionals($id,$extralabels);
|
$result5=$object->fetch_optionals($id,$extralabels);
|
||||||
|
|
||||||
if ($listUserAssignedUpdated || $donotclearsession) {
|
if ($listUserAssignedUpdated || $donotclearsession)
|
||||||
|
{
|
||||||
|
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||||
|
|
||||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||||
@ -1090,9 +1102,9 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Thirdparty - Contact
|
|
||||||
if ($conf->societe->enabled)
|
if ($conf->societe->enabled)
|
||||||
{
|
{
|
||||||
|
// Related company
|
||||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ActionOnCompany").'</td>';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("ActionOnCompany").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<div class="maxwidth200onsmartphone">';
|
print '<div class="maxwidth200onsmartphone">';
|
||||||
@ -1104,8 +1116,8 @@ if ($id > 0)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Contact
|
// related contact
|
||||||
print '<tr><td>'.$langs->trans("Contact").'</td><td>';
|
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||||
print '<div class="maxwidth200onsmartphone">';
|
print '<div class="maxwidth200onsmartphone">';
|
||||||
$form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200');
|
$form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -1199,27 +1211,61 @@ if ($id > 0)
|
|||||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||||
$linkback.=$out;
|
$linkback.=$out;
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
|
||||||
|
$morehtmlref='<div class="refidno">';
|
||||||
|
// Thirdparty
|
||||||
|
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||||
|
// Project
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
|
$morehtmlref.=$langs->trans('Project') . ' ';
|
||||||
|
if ($user->rights->agenda->allactions->create ||
|
||||||
|
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
||||||
|
{
|
||||||
|
if ($action != 'classify')
|
||||||
|
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
if ($action == 'classify') {
|
||||||
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
|
$morehtmlref.='</form>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
|
$morehtmlref.=$proj->ref;
|
||||||
|
$morehtmlref.='</a>';
|
||||||
|
if ($proj->title) $morehtmlref.=' - '.$proj->title;
|
||||||
|
} else {
|
||||||
|
$morehtmlref.='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
// Affichage fiche action en mode visu
|
// Affichage fiche action en mode visu
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
|
||||||
/*print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
|
||||||
print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
|
||||||
print '</td></tr>';*/
|
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||||
{
|
{
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Title
|
|
||||||
//print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.dol_htmlentities($object->label).'</td></tr>';
|
|
||||||
|
|
||||||
// Full day event
|
// Full day event
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';
|
||||||
|
|
||||||
@ -1241,11 +1287,6 @@ if ($id > 0)
|
|||||||
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
|
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
|
||||||
/*print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
|
|
||||||
print $object->getLibStatut(4);
|
|
||||||
print '</td></tr>';*/
|
|
||||||
|
|
||||||
// Location
|
// Location
|
||||||
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
|
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
|
||||||
{
|
{
|
||||||
@ -1302,14 +1343,14 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Third party - Contact
|
|
||||||
if ($conf->societe->enabled)
|
if ($conf->societe->enabled)
|
||||||
{
|
{
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None"));
|
// Related company
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td><td colspan="3">'.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):('<span class="opacitymedium">'.$langs->trans("None").'</span>'));
|
||||||
if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL')
|
if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL')
|
||||||
{
|
{
|
||||||
if ($object->thirdparty->fetch($object->thirdparty->id))
|
if ($object->thirdparty->fetch($object->thirdparty->id))
|
||||||
@ -1317,9 +1358,11 @@ if ($id > 0)
|
|||||||
print "<br>".dol_print_phone($object->thirdparty->phone);
|
print "<br>".dol_print_phone($object->thirdparty->phone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td></tr>';
|
||||||
print '<td>'.$langs->trans("Contact").'</td>';
|
|
||||||
print '<td>';
|
// Related contact
|
||||||
|
print '<tr><td>'.$langs->trans("ActionOnContact").'</td>';
|
||||||
|
print '<td colspan="3">';
|
||||||
if ($object->contactid > 0)
|
if ($object->contactid > 0)
|
||||||
{
|
{
|
||||||
print $object->contact->getNomUrl(1);
|
print $object->contact->getNomUrl(1);
|
||||||
@ -1333,12 +1376,13 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("None");
|
print '<span class="opacitymedium">'.$langs->trans("NoneOrSeveral").'</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
|
/*
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Project").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Project").'</td><td colspan="3">';
|
||||||
@ -1350,6 +1394,7 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Priority
|
// Priority
|
||||||
print '<tr><td class="nowrap" class="titlefield">'.$langs->trans("Priority").'</td><td colspan="3">';
|
print '<tr><td class="nowrap" class="titlefield">'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||||
|
|||||||
@ -140,27 +140,41 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
$linkback.=$out;
|
$linkback.=$out;
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
$morehtmlref='<div class="refidno">';
|
||||||
|
// Thirdparty
|
||||||
|
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||||
|
// Project
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
|
$morehtmlref.=$langs->trans('Project') . ': ';
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
|
$morehtmlref.=$proj->ref;
|
||||||
|
$morehtmlref.='</a>';
|
||||||
|
if ($proj->title) $morehtmlref.=' - '.$proj->title;
|
||||||
|
} else {
|
||||||
|
$morehtmlref.='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
// Affichage fiche action en mode visu
|
// Affichage fiche action en mode visu
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
|
||||||
/*print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
|
||||||
print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
|
||||||
print '</td></tr>';*/
|
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||||
{
|
{
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Title
|
|
||||||
//print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>';
|
|
||||||
|
|
||||||
// Full day event
|
// Full day event
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';
|
||||||
|
|
||||||
@ -179,11 +193,6 @@ if ($object->id > 0)
|
|||||||
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
|
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
|
||||||
/*print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
|
|
||||||
print $object->getLibStatut(4);
|
|
||||||
print '</td></tr>';*/
|
|
||||||
|
|
||||||
// Location
|
// Location
|
||||||
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
|
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
|
||||||
{
|
{
|
||||||
@ -227,71 +236,8 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// Third party - Contact
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None"));
|
|
||||||
if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL')
|
|
||||||
{
|
|
||||||
if ($object->thirdparty->fetch($object->thirdparty->id))
|
|
||||||
{
|
|
||||||
print "<br>".dol_print_phone($object->thirdparty->phone);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>'.$langs->trans("Contact").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
if ($object->contact->id > 0)
|
|
||||||
{
|
|
||||||
print $object->contact->getNomUrl(1);
|
|
||||||
if ($object->contact->id && $object->type_code == 'AC_TEL')
|
|
||||||
{
|
|
||||||
if ($object->contact->fetch($object->contact->id))
|
|
||||||
{
|
|
||||||
print "<br>".dol_print_phone($object->contact->phone_pro);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans("None");
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Project
|
|
||||||
if (! empty($conf->projet->enabled))
|
|
||||||
{
|
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Project").'</td><td colspan="3">';
|
|
||||||
if ($object->fk_project)
|
|
||||||
{
|
|
||||||
$project=new Project($db);
|
|
||||||
$project->fetch($object->fk_project);
|
|
||||||
print $project->getNomUrl(1);
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Priority
|
|
||||||
print '<tr><td class="nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
|
|
||||||
print ($object->priority?$object->priority:'');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Other attributes
|
|
||||||
$parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$object->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
|
||||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
|
||||||
{
|
|
||||||
print $object->showOptionals($extrafields,'edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
|||||||
@ -1328,7 +1328,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$cssclass.= " unmovable";
|
$cssclass.= " unmovable";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else $cssclass.= " movable";
|
else{
|
||||||
|
if ($user->rights->agenda->allactions->create ||
|
||||||
|
(($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
||||||
|
{
|
||||||
|
$cssclass.= " movable";
|
||||||
|
}else{
|
||||||
|
$cssclass.= " unmovable";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$h=''; $nowrapontd=1;
|
$h=''; $nowrapontd=1;
|
||||||
if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; }
|
if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; }
|
||||||
@ -1344,7 +1353,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
print '<ul class="cal_event" style="'.$h.'">'; // always 1 li per ul, 1 ul per event
|
print '<ul class="cal_event" style="'.$h.'">'; // always 1 li per ul, 1 ul per event
|
||||||
print '<li class="cal_event" style="'.$h.'">';
|
print '<li class="cal_event" style="'.$h.'">';
|
||||||
print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
|
print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
|
||||||
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -3).'));';
|
||||||
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
||||||
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
|
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
|
||||||
print ' -moz-border-radius:4px;" width="100%"><tr>';
|
print ' -moz-border-radius:4px;" width="100%"><tr>';
|
||||||
@ -1404,7 +1413,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
{
|
{
|
||||||
$savlabel=$event->libelle;
|
$savlabel=$event->libelle;
|
||||||
$event->libelle=$daterange;
|
$event->libelle=$daterange;
|
||||||
|
//print '<strong>';
|
||||||
print $event->getNomUrl(0);
|
print $event->getNomUrl(0);
|
||||||
|
//print '</strong>';
|
||||||
$event->libelle=$savlabel;
|
$event->libelle=$savlabel;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1412,7 +1423,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
print $daterange;
|
print $daterange;
|
||||||
}
|
}
|
||||||
//print '</strong> ';
|
//print '</strong> ';
|
||||||
print "<br>\n";
|
print " ";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1526,14 +1537,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
* Change color with a delta
|
* Change color with a delta
|
||||||
*
|
*
|
||||||
* @param string $color Color
|
* @param string $color Color
|
||||||
* @param int $minus Delta
|
* @param int $minus Delta (1 = 16 unit)
|
||||||
|
* @param int $minusunit Minus unit
|
||||||
* @return string New color
|
* @return string New color
|
||||||
*/
|
*/
|
||||||
function dol_color_minus($color, $minus)
|
function dol_color_minus($color, $minus, $minusunit = 16)
|
||||||
{
|
{
|
||||||
$newcolor=$color;
|
$newcolor=$color;
|
||||||
$newcolor[0]=((hexdec($newcolor[0])-$minus)<0)?0:dechex((hexdec($newcolor[0])-$minus));
|
if ($minusunit == 16)
|
||||||
$newcolor[2]=((hexdec($newcolor[2])-$minus)<0)?0:dechex((hexdec($newcolor[2])-$minus));
|
{
|
||||||
$newcolor[4]=((hexdec($newcolor[4])-$minus)<0)?0:dechex((hexdec($newcolor[4])-$minus));
|
$newcolor[0]=dechex(max(min(hexdec($newcolor[0])-$minus, 15), 0));
|
||||||
|
$newcolor[2]=dechex(max(min(hexdec($newcolor[2])-$minus, 15), 0));
|
||||||
|
$newcolor[4]=dechex(max(min(hexdec($newcolor[4])-$minus, 15), 0));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Not yet implemented
|
||||||
|
}
|
||||||
return $newcolor;
|
return $newcolor;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
@ -74,7 +78,29 @@ $out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.do
|
|||||||
|
|
||||||
$linkback.=$out;
|
$linkback.=$out;
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
$morehtmlref='<div class="refidno">';
|
||||||
|
// Thirdparty
|
||||||
|
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||||
|
// Project
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
|
$morehtmlref.=$langs->trans('Project') . ': ';
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
|
$morehtmlref.=$proj->ref;
|
||||||
|
$morehtmlref.='</a>';
|
||||||
|
if ($proj->title) $morehtmlref.=' - '.$proj->title;
|
||||||
|
} else {
|
||||||
|
$morehtmlref.='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
|||||||
@ -519,7 +519,7 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Lien recap
|
// Lien recap
|
||||||
$boxstat.='<div class="box">';
|
$boxstat.='<div class="box">';
|
||||||
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable" width="100%">';
|
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom" width="100%">';
|
||||||
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
||||||
|
|
||||||
if ($conf->propal->enabled)
|
if ($conf->propal->enabled)
|
||||||
@ -1039,6 +1039,11 @@ if ($id > 0)
|
|||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
|
if ($object->status != 1)
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
|
if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
|
||||||
{
|
{
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
@ -1072,16 +1077,12 @@ if ($id > 0)
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->facture->enabled) && $object->status==1)
|
||||||
{
|
{
|
||||||
if (empty($user->rights->facture->creer))
|
if (empty($user->rights->facture->creer))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
}
|
}
|
||||||
else if ($object->status != 1)
|
|
||||||
{
|
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -1093,7 +1094,7 @@ if ($id > 0)
|
|||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->client != 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a></div>';
|
if ($object->client != 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1101,7 +1102,7 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add action
|
// Add action
|
||||||
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status==1)
|
||||||
{
|
{
|
||||||
if ($user->rights->agenda->myactions->create)
|
if ($user->rights->agenda->myactions->create)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -77,6 +77,8 @@ print load_fiche_titre($langs->trans("CommercialArea"),'','title_commercial.png'
|
|||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||||
|
{
|
||||||
// Search proposal
|
// Search proposal
|
||||||
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||||
{
|
{
|
||||||
@ -127,7 +129,7 @@ if (count($listofsearchfields))
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -156,7 +158,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">'.$langs->trans("ProposalsDraft").($num?' <span class="badge">'.$num.'</span>':'').'</td></tr>';
|
print '<th colspan="3">'.$langs->trans("ProposalsDraft").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
@ -237,7 +239,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">'.$langs->trans("SupplierProposalsDraft").($num?' <span class="badge">'.$num.'</span>':'').'</td></tr>';
|
print '<th colspan="3">'.$langs->trans("SupplierProposalsDraft").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
@ -316,7 +318,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">'.$langs->trans("DraftOrders").($num?' <span class="badge">'.$num.'</span>':'').'</td></tr>';
|
print '<th colspan="3">'.$langs->trans("DraftOrders").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
@ -397,7 +399,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">'.$langs->trans("DraftSuppliersOrders").($num?' <span class="badge">'.$num.'</span>':'').'</td></tr>';
|
print '<th colspan="3">'.$langs->trans("DraftSuppliersOrders").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
@ -483,12 +485,12 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="2">';
|
print '<th colspan="2">';
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
|
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
|
||||||
else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
|
else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
|
||||||
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
|
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
|
||||||
print '</td>';
|
print '</th>';
|
||||||
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
print '<th align="right">'.$langs->trans("DateModificationShort").'</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
@ -547,8 +549,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastModifiedSuppliers",min($max,$num)).'</td>';
|
print '<tr class="liste_titre"><th>'.$langs->trans("BoxTitleLastModifiedSuppliers",min($max,$num)).'</th>';
|
||||||
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
print '<th align="right">'.$langs->trans("DateModificationShort").'</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
@ -626,7 +628,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
|
|||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("LastContracts",5).'</td></tr>';
|
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("LastContracts",5).'</th></tr>';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$staticcontrat=new Contrat($db);
|
$staticcontrat=new Contrat($db);
|
||||||
@ -687,7 +689,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></td></tr>';
|
print '<tr class="liste_titre"><th colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>';
|
||||||
|
|
||||||
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
while ($i < $nbofloop)
|
||||||
@ -786,7 +788,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></td></tr>';
|
print '<tr class="liste_titre"><th class="liste_titre" colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>';
|
||||||
|
|
||||||
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
while ($i < $nbofloop)
|
||||||
|
|||||||
@ -698,13 +698,18 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
$htmltext.='</i>';
|
$htmltext.='</i>';
|
||||||
|
|
||||||
|
|
||||||
|
$availablelink=$form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'availvar');
|
||||||
|
//print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||||
|
|
||||||
|
|
||||||
// Print mail form
|
// Print mail form
|
||||||
print load_fiche_titre($langs->trans("NewMailing"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'title_generic');
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth200" name="titre" value="'.dol_escape_htmltag(GETPOST('titre')).'"></td></tr>';
|
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth300" name="titre" value="'.dol_escape_htmltag(GETPOST('titre')).'"></td></tr>';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO)?$conf->global->MAILING_EMAIL_ERRORSTO:$conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO)?$conf->global->MAILING_EMAIL_ERRORSTO:$conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||||
|
|
||||||
@ -720,7 +725,7 @@ if ($action == 'create')
|
|||||||
print '</br><br>';
|
print '</br><br>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input class="flat minwidth200" name="sujet" value="'.dol_escape_htmltag(GETPOST('sujet')).'"></td></tr>';
|
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input class="flat minwidth200 quatrevingtpercent" name="sujet" value="'.dol_escape_htmltag(GETPOST('sujet')).'"></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||||
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
|
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -841,11 +846,6 @@ else
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
/* print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
|
||||||
print '<td colspan="3">';
|
|
||||||
print $form->showrefnav($object,'id', $linkback);
|
|
||||||
print '</td></tr>';
|
|
||||||
*/
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="titlefield">'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
|
print '<tr><td class="titlefield">'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
|
||||||
print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
||||||
@ -861,13 +861,6 @@ else
|
|||||||
print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
|
||||||
/*
|
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4);
|
|
||||||
if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')';
|
|
||||||
print'</td></tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Nb of distinct emails
|
// Nb of distinct emails
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||||
@ -1057,7 +1050,7 @@ else
|
|||||||
$htmltext.='</i>';
|
$htmltext.='</i>';
|
||||||
|
|
||||||
// Print mail content
|
// Print mail content
|
||||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
|
||||||
|
|
||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
|
|
||||||
@ -1080,7 +1073,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("NoAttachedFiles").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1186,7 +1179,7 @@ else
|
|||||||
$htmltext.='</i>';
|
$htmltext.='</i>';
|
||||||
|
|
||||||
// Print mail content
|
// Print mail content
|
||||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,8 @@ print load_fiche_titre($langs->trans("MailingArea"));
|
|||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
|
//if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||||
|
//{
|
||||||
// Recherche emails
|
// Recherche emails
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">';
|
||||||
@ -62,6 +64,7 @@ print '<tr '.$bc[$var].'><td class="nowrap">';
|
|||||||
print $langs->trans("Other").':</td><td><input type="text" class="flat inputsearch" name="sall"></td>';
|
print $langs->trans("Other").':</td><td><input type="text" class="flat inputsearch" name="sall"></td>';
|
||||||
|
|
||||||
print "</table></form><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
// Affiche stats de tous les modules de destinataires mailings
|
// Affiche stats de tous les modules de destinataires mailings
|
||||||
|
|||||||
@ -1,224 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
|
||||||
* Copyright (C) 2014 Frederic France <frederic.france@free.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
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/comm/propal/apercu.php
|
|
||||||
* \ingroup propal
|
|
||||||
* \brief Preview tab of propal
|
|
||||||
*/
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
|
|
||||||
$langs->load('propal');
|
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load('compta');
|
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid=0;
|
|
||||||
$id = GETPOST('id','int');
|
|
||||||
$ref = GETPOST("ref");
|
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
|
||||||
$result = restrictedArea($user, 'propal', $id);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View Mode
|
|
||||||
*/
|
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
if ($id > 0 || ! empty($ref))
|
|
||||||
{
|
|
||||||
$object = new Propal($db);
|
|
||||||
|
|
||||||
if ($object->fetch($id,$ref) > 0)
|
|
||||||
{
|
|
||||||
$soc = new Societe($db);
|
|
||||||
$soc->fetch($object->socid);
|
|
||||||
|
|
||||||
$head = propal_prepare_head($object);
|
|
||||||
dol_fiche_head($head, 'preview', $langs->trans('Proposal'), 0, 'propal');
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Propal
|
|
||||||
*/
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
|
||||||
|
|
||||||
// Ref
|
|
||||||
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
|
|
||||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Ref client
|
|
||||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
|
||||||
print '<td colspan="5">'.$object->ref_client.'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
|
|
||||||
// Thirdparty
|
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
|
||||||
print '<td colspan="5">'.$soc->getNomUrl(1).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Status
|
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
|
||||||
print '<td colspan="5">'.$object->getLibStatut(4).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Discount
|
|
||||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
|
||||||
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
|
|
||||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
|
||||||
$absolute_discount=$soc->getAvailableDiscounts();
|
|
||||||
print '. ';
|
|
||||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
|
||||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
|
||||||
print '.</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Date
|
|
||||||
print '<tr><td>'.$langs->trans('Date').'</td>';
|
|
||||||
print '<td>'.dol_print_date($object->date,'daytext').'</td>';
|
|
||||||
|
|
||||||
// Right part with $rowspan lines
|
|
||||||
$rowspan=4;
|
|
||||||
print '<td rowspan="'.$rowspan.'" valign="top" width="50%">';
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Documents
|
|
||||||
*/
|
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
|
||||||
$dir_output = $conf->propal->dir_output . "/";
|
|
||||||
$filepath = $dir_output . $objectref . "/";
|
|
||||||
$file = $filepath . $objectref . ".pdf";
|
|
||||||
$filedetail = $filepath . $objectref . "-detail.pdf";
|
|
||||||
$relativepath = $objectref.'/'.$objectref.'.pdf';
|
|
||||||
$relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf';
|
|
||||||
|
|
||||||
// Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
|
|
||||||
$fileimage = $file.'_preview.png'; // If PDF has 1 page
|
|
||||||
$fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page
|
|
||||||
$relativepathimage = $relativepath.'_preview.png';
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
// Si fichier PDF existe
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
|
||||||
$encfile = urlencode($file);
|
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
|
||||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Documents").'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Proposal").' PDF</td>';
|
|
||||||
|
|
||||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
|
|
||||||
|
|
||||||
print '<td align="right">'.dol_print_size(dol_filesize($file)).'</td>';
|
|
||||||
print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
// Conversion du PDF en image png si fichier png non existant
|
|
||||||
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
|
|
||||||
{
|
|
||||||
if (class_exists("Imagick"))
|
|
||||||
{
|
|
||||||
$ret = dol_convert_file($file,'png',$fileimage);
|
|
||||||
if ($ret < 0) $error++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$langs->load("errors");
|
|
||||||
print '<font class="error">'.$langs->trans("ErrorNoImagickReadimage").'</font>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Total HT - left part
|
|
||||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
|
||||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Total VAT - left part
|
|
||||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td>';
|
|
||||||
print '<td align="right" class="nowrap"><b>' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Total TTC - left part
|
|
||||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td>';
|
|
||||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
dol_fiche_end();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Propal non trouvee
|
|
||||||
print $langs->trans("ErrorPropalNotFound",$_GET["id"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<div class="photolist">';
|
|
||||||
// Si fichier png PDF d'1 page trouve
|
|
||||||
if (file_exists($fileimage))
|
|
||||||
{
|
|
||||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">';
|
|
||||||
}
|
|
||||||
// Si fichier png PDF de plus d'1 page trouve
|
|
||||||
elseif (file_exists($fileimagebis))
|
|
||||||
{
|
|
||||||
$multiple = preg_replace('/\.png/','',$relativepath) . "-";
|
|
||||||
|
|
||||||
for ($i = 0; $i < 20; $i++)
|
|
||||||
{
|
|
||||||
$preview = $multiple.$i.'.png';
|
|
||||||
|
|
||||||
if (file_exists($dir_output.$preview))
|
|
||||||
{
|
|
||||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
print '</td></tr>';
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
|
||||||
|
|
||||||
$db->close();
|
|
||||||
@ -751,9 +751,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
// $tva_tx can be 'x.x (XXX)'
|
||||||
|
|
||||||
// Ecrase $pu par celui du produit
|
// Ecrase $pu par celui du produit
|
||||||
// Ecrase $desc par celui du produit
|
// Ecrase $desc par celui du produit
|
||||||
// Ecrase $txtva par celui du produit
|
// Ecrase $tva_tx par celui du produit
|
||||||
// Replaces $fk_unit with the product unit
|
// Replaces $fk_unit with the product unit
|
||||||
if (! empty($idprod)) {
|
if (! empty($idprod)) {
|
||||||
$prod = new Product($db);
|
$prod = new Product($db);
|
||||||
@ -761,7 +763,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : '');
|
$label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : '');
|
||||||
|
|
||||||
// If prices fields are update
|
// Update if prices fields are defined
|
||||||
$tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
|
$tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
|
||||||
$tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
|
$tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
|
||||||
if (empty($tva_tx)) $tva_npr=0;
|
if (empty($tva_tx)) $tva_npr=0;
|
||||||
@ -803,19 +805,21 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||||
|
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||||
|
|
||||||
|
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
||||||
if (! empty($price_ht)) {
|
if (! empty($price_ht)) {
|
||||||
$pu_ht = price2num($price_ht, 'MU');
|
$pu_ht = price2num($price_ht, 'MU');
|
||||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU');
|
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||||
}
|
}
|
||||||
|
|
||||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||||
elseif ($tva_tx != $prod->tva_tx) {
|
elseif ($tmpvat != $tmpprodvat) {
|
||||||
if ($price_base_type != 'HT') {
|
if ($price_base_type != 'HT') {
|
||||||
$pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU');
|
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
|
||||||
} else {
|
} else {
|
||||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU');
|
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1317,8 +1321,18 @@ if ($action == 'create')
|
|||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals($originid);
|
||||||
$object->array_options = $objectsrc->array_options;
|
$object->array_options = $objectsrc->array_options;
|
||||||
|
|
||||||
|
if (!empty($conf->multicurrency->enabled))
|
||||||
|
{
|
||||||
|
if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code;
|
||||||
|
if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
|
||||||
|
}
|
||||||
|
|
||||||
$object = new Propal($db);
|
$object = new Propal($db);
|
||||||
|
|
||||||
@ -1496,7 +1510,6 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>';
|
print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>';
|
||||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||||
$currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency));
|
|
||||||
print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 0);
|
print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -1662,7 +1675,7 @@ if ($action == 'create')
|
|||||||
$soc->fetch($object->socid);
|
$soc->fetch($object->socid);
|
||||||
|
|
||||||
$head = propal_prepare_head($object);
|
$head = propal_prepare_head($object);
|
||||||
dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal');
|
dol_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal');
|
||||||
|
|
||||||
$formconfirm = '';
|
$formconfirm = '';
|
||||||
|
|
||||||
@ -1791,42 +1804,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Link for thirdparty discounts
|
||||||
/*
|
|
||||||
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
|
|
||||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
|
||||||
print '</td></tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Ref customer
|
|
||||||
/*
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
|
||||||
print $langs->trans('RefCustomer') . '</td>';
|
|
||||||
if ($action != 'refclient' && ! empty($object->brouillon))
|
|
||||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=refclient&id=' . $object->id . '">' . img_edit($langs->trans('Modify')) . '</a></td>';
|
|
||||||
print '</td></tr></table>';
|
|
||||||
print '</td><td colspan="5">';
|
|
||||||
if ($user->rights->propal->creer && $action == 'refclient') {
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id=' . $object->id . '" method="post">';
|
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
|
||||||
print '<input type="hidden" name="action" value="set_ref_client">';
|
|
||||||
print '<input type="text" class="flat" size="20" name="ref_client" value="' . $object->ref_client . '">';
|
|
||||||
print ' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
|
||||||
print '</form>';
|
|
||||||
} else {
|
|
||||||
print $object->ref_client;
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Company
|
|
||||||
/*
|
|
||||||
print '<tr><td>' . $langs->trans('Company') . '</td><td colspan="5">' . $soc->getNomUrl(1) . '</td>';
|
|
||||||
print '</tr>';*/
|
|
||||||
|
|
||||||
// Lin for thirdparty discounts
|
|
||||||
print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td>';
|
print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td>';
|
||||||
if ($soc->remise_percent)
|
if ($soc->remise_percent)
|
||||||
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
||||||
@ -2034,7 +2012,7 @@ if ($action == 'create')
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print fieldLabel('CurrencyRate','multicurrency_tx');
|
print fieldLabel('CurrencyRate','multicurrency_tx');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
|
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
@ -2045,7 +2023,7 @@ if ($action == 'create')
|
|||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
||||||
} else {
|
} else {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
|
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
print '<div class="inline-block"> ';
|
print '<div class="inline-block"> ';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -2379,7 +2357,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
|
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddBill") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddBill") . '</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
|
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
|
||||||
@ -2410,7 +2388,6 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
print "<br>\n";
|
|
||||||
|
|
||||||
//Select mail models is same action as presend
|
//Select mail models is same action as presend
|
||||||
if (GETPOST('modelselected')) $action = 'presend';
|
if (GETPOST('modelselected')) $action = 'presend';
|
||||||
|
|||||||
@ -413,7 +413,7 @@ class Propal extends CommonObject
|
|||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu_ht=price2num($pu_ht);
|
$pu_ht=price2num($pu_ht);
|
||||||
$pu_ttc=price2num($pu_ttc);
|
$pu_ttc=price2num($pu_ttc);
|
||||||
$txtva=price2num($txtva);
|
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||||
$txlocaltax1=price2num($txlocaltax1);
|
$txlocaltax1=price2num($txlocaltax1);
|
||||||
$txlocaltax2=price2num($txlocaltax2);
|
$txlocaltax2=price2num($txlocaltax2);
|
||||||
$pa_ht=price2num($pa_ht);
|
$pa_ht=price2num($pa_ht);
|
||||||
@ -1166,14 +1166,9 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$clonedObj->id=0;
|
$clonedObj->id=0;
|
||||||
|
$clonedObj->ref='';
|
||||||
$clonedObj->statut=self::STATUS_DRAFT;
|
$clonedObj->statut=self::STATUS_DRAFT;
|
||||||
|
|
||||||
if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
|
|
||||||
{
|
|
||||||
$this->error='ErrorSetupNotComplete';
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
$clonedObj->user_author = $user->id;
|
$clonedObj->user_author = $user->id;
|
||||||
$clonedObj->user_valid = '';
|
$clonedObj->user_valid = '';
|
||||||
@ -1182,12 +1177,6 @@ class Propal extends CommonObject
|
|||||||
$clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600);
|
$clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600);
|
||||||
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
|
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
|
||||||
|
|
||||||
// Set ref
|
|
||||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php';
|
|
||||||
$obj = $conf->global->PROPALE_ADDON;
|
|
||||||
$modPropale = new $obj;
|
|
||||||
$clonedObj->ref = $modPropale->getNextValue($objsoc,$clonedObj);
|
|
||||||
|
|
||||||
// Create clone
|
// Create clone
|
||||||
|
|
||||||
$result=$clonedObj->create($user);
|
$result=$clonedObj->create($user);
|
||||||
|
|||||||
@ -151,7 +151,7 @@ $formother = new FormOther($db);
|
|||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$head = propal_prepare_head($object);
|
$head = propal_prepare_head($object);
|
||||||
dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal');
|
dol_fiche_head($head, 'contact', $langs->trans("Proposal"), -1, 'propal');
|
||||||
|
|
||||||
|
|
||||||
// Proposal card
|
// Proposal card
|
||||||
|
|||||||
@ -89,7 +89,7 @@ if ($object->id > 0)
|
|||||||
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
$head = propal_prepare_head($object);
|
$head = propal_prepare_head($object);
|
||||||
dol_fiche_head($head, 'document', $langs->trans('Proposal'), 0, 'propal');
|
dol_fiche_head($head, 'document', $langs->trans('Proposal'), -1, 'propal');
|
||||||
|
|
||||||
// Construit liste des fichiers
|
// Construit liste des fichiers
|
||||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||||
|
|||||||
@ -59,9 +59,8 @@ print load_fiche_titre($langs->trans("ProspectionArea"));
|
|||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
/*
|
if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||||
* Search form
|
{
|
||||||
*/
|
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -70,6 +69,7 @@ print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td><
|
|||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Proposal").':</td><td><input type="text" class="flat" name="sall" size=18></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Proposal").':</td><td><input type="text" class="flat" name="sall" size=18></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print "</table></form><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -59,7 +59,7 @@ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_c
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$head = propal_prepare_head($object);
|
$head = propal_prepare_head($object);
|
||||||
dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal');
|
dol_fiche_head($head, 'info', $langs->trans('Proposal'), -1, 'propal');
|
||||||
|
|
||||||
$object->info($object->id);
|
$object->info($object->id);
|
||||||
|
|
||||||
|
|||||||
@ -178,7 +178,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
// Do we click on purge search criteria ?
|
// Do we click on purge search criteria ?
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_categ='';
|
$search_categ='';
|
||||||
$search_user='';
|
$search_user='';
|
||||||
@ -363,7 +363,7 @@ if ($resql)
|
|||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
|
$param='&viewstatut='.$viewstatut;
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
if ($sall) $param.='&sall='.$sall;
|
if ($sall) $param.='&sall='.$sall;
|
||||||
@ -377,6 +377,7 @@ if ($resql)
|
|||||||
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
|
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
|
||||||
if ($search_login) $param.='&search_login='.$search_login;
|
if ($search_login) $param.='&search_login='.$search_login;
|
||||||
if ($search_town) $param.='&search_town='.$search_town;
|
if ($search_town) $param.='&search_town='.$search_town;
|
||||||
|
if ($socid > 0) $param.='&socid='.$socid;
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
@ -436,8 +437,8 @@ if ($resql)
|
|||||||
|
|
||||||
dol_fiche_head(null, '', '');
|
dol_fiche_head(null, '', '');
|
||||||
|
|
||||||
$topicmail="SendProposalRef";
|
$topicmail="SendSupplierProposalRef";
|
||||||
$modelmail="propal_send";
|
$modelmail="supplier_proposal_send";
|
||||||
|
|
||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
@ -559,45 +560,7 @@ if ($resql)
|
|||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
// Fields title
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'],$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.date']['checked'])) print_liste_field_titre($arrayfields['p.date']['label'],$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'],$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'],$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
|
|
||||||
// Extra fields
|
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
|
||||||
{
|
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
|
||||||
{
|
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
|
||||||
{
|
|
||||||
$align=$extrafields->getAlignFlag($key);
|
|
||||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Hook fields
|
|
||||||
$parameters=array('arrayfields'=>$arrayfields);
|
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
|
||||||
print $hookmanager->resPrint;
|
|
||||||
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
|
||||||
print '</tr>'."\n";
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
if (! empty($arrayfields['p.ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
@ -738,9 +701,47 @@ if ($resql)
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Fields title
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'],$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.date']['checked'])) print_liste_field_titre($arrayfields['p.date']['label'],$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'],$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'],$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Hook fields
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$i=0;
|
$i=0;
|
||||||
$var=true;
|
|
||||||
$totalarray=array();
|
$totalarray=array();
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
@ -750,7 +751,7 @@ if ($resql)
|
|||||||
$objectstatic->id=$obj->rowid;
|
$objectstatic->id=$obj->rowid;
|
||||||
$objectstatic->ref=$obj->ref;
|
$objectstatic->ref=$obj->ref;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr>';
|
||||||
|
|
||||||
if (! empty($arrayfields['p.ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
{
|
{
|
||||||
@ -976,7 +977,12 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show total line
|
// Show total line
|
||||||
if (isset($totalarray['totalhtfield']))
|
if (isset($totalarray['totalhtfield'])
|
||||||
|
|| isset($totalarray['totalvatfield'])
|
||||||
|
|| isset($totalarray['totalttcfield'])
|
||||||
|
|| isset($totalarray['totalamfield'])
|
||||||
|
|| isset($totalarray['totalrtpfield'])
|
||||||
|
)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user