Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop

This commit is contained in:
fappels 2015-11-16 16:44:24 +01:00
commit e4b821c266
500 changed files with 22503 additions and 18433 deletions

View File

@ -131,8 +131,9 @@ script:
# - cat upgrade370380.log
- php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log
- php upgrade.php 3.8.0 3.9.0 ignoredbversion > upgrade380390.log
# - cat upgrade380390.log
- php upgrade2.php 3.8.0 3.9.0 ignoredbversion > upgrade380390-2.log
# - cat upgrade370380-2.log
# - cat upgrade380390-2.log
- cd ../..
- date
- phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php

View File

@ -146,6 +146,12 @@ source_file = htdocs/langs/en_US/holiday.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.hrm]
file_filter = htdocs/langs/<lang>/hrm.lang
source_file = htdocs/langs/en_US/hrm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.incoterm]
file_filter = htdocs/langs/<lang>/incoterm.lang
source_file = htdocs/langs/en_US/incoterm.lang
@ -218,6 +224,12 @@ source_file = htdocs/langs/en_US/members.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.oauth]
file_filter = htdocs/langs/<lang>/oauth.lang
source_file = htdocs/langs/en_US/oauth.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.opensurvey]
file_filter = htdocs/langs/<lang>/opensurvey.lang
source_file = htdocs/langs/en_US/opensurvey.lang
@ -278,6 +290,12 @@ source_file = htdocs/langs/en_US/propal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.receiptprinter]
file_filter = htdocs/langs/<lang>/receiptprinter.lang
source_file = htdocs/langs/en_US/receiptprinter.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.resource]
file_filter = htdocs/langs/<lang>/resource.lang
source_file = htdocs/langs/en_US/resource.lang

View File

@ -16,6 +16,7 @@ AdoDb-Date 0.33 Modified BSD License Yes
ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console
CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG
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
FirePHPCore 0.4.0 MIT License Yes Send logs to Firefox Firebug console
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)
@ -25,6 +26,7 @@ PEAR Mail_MIME 1.8.9 BSD Yes
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
PHPExcel 1.8.0 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
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
Raven-php 0.12.1 MIT License Yes Used for server-side error logging with Sentry logger
Restler 3.0 LGPL-3+ Yes Library to develop REST Web services
@ -56,7 +58,7 @@ JsTimezoneDetect 1.0.4 MIT License Yes
Raven.js 1.1.19 MIT License Yes Used for client-side error logging with Sentry logger
For licenses compatibility informations:
http://www.fsf.org/licensing/licenses/index_html
http://www.gnu.org/licenses/licenses.en.html
Copyright

View File

@ -2,7 +2,9 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
WARNING: Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
WARNING:
Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
Upgrading to any other version or any other database system is abolutely required BEFORE trying
@ -11,10 +13,20 @@ make a Dolibarr upgrade.
***** ChangeLog for 3.9 compared to 3.8.* *****
WARNING: Following changes may create regression for some external modules, but were necessary to make
WARNING:
Following changes may create regression for some external modules, but were necessary to make
Dolibarr better:
- Deprecated hidden option MAIN_USE_CUSTOM_TRANSLATION has been removed. Use table llx_overwrite_trans instead.
- Trigger LINECONTRACT_INSERT has been renamed into LINECONTRACT_CREATE to match common denomination.
- A lot hooks used into PDF generation were not correctly implemented. We had to fix this. The result si that
the following hook were set as hook of type "replace". This means if your module implement such hooks, it must
return 0 to execute standard code or 1 to replace standard code (value to output should be set into resPrints instead).
This is list of hooks modified:
'pdf_getlinenum', 'pdf_getlineref', 'pdf_getlineref_supplier', 'pdf_getlinevatrate', 'pdf_getlineupexcltax',
'pdf_getlineupwithtax', 'pdf_getlineqty', 'pdf_getlineqty_asked', 'pdf_getlineqty_shipped', 'pdf_getlineqty_keeptoship',
'pdf_getlineunit', 'pdf_getlineremisepercent', 'pdf_getlineprogress', 'pdf_getlinetotalexcltax', 'pdf_getlinetotalwithtax'
***** ChangeLog for 3.8.1 compared to 3.8.0 *****
@ -348,9 +360,11 @@ FIX send mail, copy sendto don't read the list of contact
FIX Properly escape untrusted data to prevent HTML injection.
FIX send mail, copy sendto don't read the list of contact
Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose
your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to
restore old path.
WARNING:
Path to save photos of products was moved to match path of other attached files. If you had loose your photo
on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to 1 (home - setup - other)
to restore old path and get back working links without having to resubmit images.
WARNING:
@ -523,11 +537,14 @@ You may also experience troubles with Mysql 5.5.41 with error "Lost connection"
Upgrading to any other version or database system is abolutely required BEFORE trying to
make a Dolibarr upgrade.
WARNING: Following changes may create regression for some external modules, but was necessary to make
WARNING:
Following changes may create regression for some external modules, but was necessary to make
Dolibarr better:
- Path to save photos of products was moved to match path of other attached files. If you had loose your photo
on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to restore old path.
on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to 1 (home - setup - other)
to restore old path and get back working links without having to resubmit images.
- If you can't see trips and expenses records, check that you have the new permission "read all
trips and expenses".
- Deprecated module "oscommerce" were removed.

View File

@ -1,5 +1,7 @@
# DOLIBARR ERP & CRM
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dd/dolibarr.svg)
Dolibarr ERP & CRM is a modern software to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
It's an Open Source software (wrote in PHP language) designed for small and medium companies, foundation and freelances.

View File

@ -17,6 +17,7 @@
"ext-curl": "*",
"ccampbell/chromephp": "^4.1",
"ckeditor/ckeditor": "4.3.3",
"mike42/escpos-php": "dev-master",
"mobiledetect/mobiledetectlib": "2.8.3",
"phpoffice/phpexcel": "1.8.0",
"restler/framework": "^3.0",

66
composer.lock generated
View File

@ -4,7 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "f441e6348ae7862942693cab10810418",
"hash": "d88b5c84a9ea1af354d867ba2e2ab251",
"content-hash": "85e60ec7f8ab593387c7bd10d8db860d",
"packages": [
{
"name": "ccampbell/chromephp",
@ -126,6 +127,64 @@
"homepage": "https://github.com/firephp/firephp-core",
"time": "2013-04-23 15:28:20"
},
{
"name": "mike42/escpos-php",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/mike42/escpos-php.git",
"reference": "0564ff94de45564221eca99c4cd5ab24492894c2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mike42/escpos-php/zipball/0564ff94de45564221eca99c4cd5ab24492894c2",
"reference": "0564ff94de45564221eca99c4cd5ab24492894c2",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roni Saha",
"email": "roni.cse@gmail.com"
},
{
"name": "Michael Billington",
"email": "michael.billington@gmail.com"
},
{
"name": "Gergely Radics",
"email": "gerifield@ustream.tv"
},
{
"name": "Warren Doyle",
"email": "w.doyle@fuelled.co"
},
{
"name": "vharo",
"email": "vharo@geepok.com"
}
],
"description": "Thermal receipt printer library, for use with ESC/POS compatible printers",
"homepage": "https://github.com/mike42/escpos-php",
"keywords": [
"ESC-POS",
"driver",
"escpos",
"print",
"receipt"
],
"time": "2015-11-02 10:50:46"
},
{
"name": "mobiledetect/mobiledetectlib",
"version": "2.8.3",
@ -424,13 +483,16 @@
"pdf417",
"qrcode"
],
"abandoned": "tecnickcom/tcpdf",
"time": "2015-01-28 18:51:40"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"mike42/escpos-php": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {

File diff suppressed because one or more lines are too long

View File

@ -450,186 +450,214 @@ else $error++;
//--------------------------------
// Build skeleton_script.php
//--------------------------------
//--------------------------------------------------------------------
// Build skeleton_script.php, skeleton_list.php and skeleton_card.php
//--------------------------------------------------------------------
// Read skeleton_script.php file
$skeletonfile=$path.'skeleton_script.php';
$sourcecontent=file_get_contents($skeletonfile);
if (! $sourcecontent)
$skeletonfiles=array(
$path.'skeleton_script.php' => 'out.'.$classmin.'_script.php',
$path.'skeleton_list.php' => 'out.'.$classmin.'_list.php',
$path.'skeleton_card.php' => 'out.'.$classmin.'_card.php'
);
foreach ($skeletonfiles as $skeletonfile => $outfile)
{
print "\n";
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
print "Try to run script from skeletons directory.\n";
exit;
$sourcecontent=file_get_contents($skeletonfile);
if (! $sourcecontent)
{
print "\n";
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
print "Try to run script from skeletons directory.\n";
exit;
}
// Define output variables
$targetcontent=$sourcecontent;
// Substitute module name
$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent);
$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent);
$targetcontent=preg_replace('/mymodule/', $module, $targetcontent);
// Substitute class name
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
$targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent);
$targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent);
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
// Substitute comments
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
$targetcontent=preg_replace('/\s*\/\/\.\.\./', '', $targetcontent);
$targetcontent=preg_replace('/Put here some comments/','Initialy built by build_class_from_table on '.strftime('%Y-%m-%d %H:%M',mktime()), $targetcontent);
// Substitute table name
$targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent);
// Substitute GETPOST search_fieldx
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
if ($prop['isint']) $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','int');\n";
else $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','alpha');\n";
}
}
$targetcontent=preg_replace('/'.preg_quote('$search_field1=GETPOST("search_field1");','/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote('$search_field2=GETPOST("search_field2");','/').'/', '', $targetcontent);
// Substitute GETPOST fieldx
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
if ($prop['isint']) $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','int');\n";
else $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','alpha');\n";
}
}
$targetcontent=preg_replace('/'.preg_quote('$object->prop1=GETPOST("field1");','/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote('$object->prop2=GETPOST("field2");','/').'/', '', $targetcontent);
// Substitute reset search_field = '';
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.='$search_'.$prop['field']."='';\n";
}
}
$targetcontent=preg_replace('/'.preg_quote('$search_field1=\'\';','/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote('$search_field2=\'\';','/').'/', '', $targetcontent);
// Substitute fetch/select parameters
$targetcontent=preg_replace('/\$sql\s*\.= " t\.field1,";/', $varpropselect, $targetcontent);
$targetcontent=preg_replace('/\$sql\s*\.= " t\.field2";/', '', $targetcontent);
// Substitute where for search
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.='if ($search_'.$prop['field'].') $sql.= natural_search("'.$prop['field'].'",$search_'.$prop['field'].');'."\n";
}
}
$targetcontent=preg_replace('/'.preg_quote('if ($search_field1) $sql.= natural_search("field1",$search_field1);','/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote('if ($search_field2) $sql.= natural_search("field2",$search_field2);','/').'/', '', $targetcontent);
// substitute $params.=
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="if (\$search_".$prop['field']." != '') \$params.= '&amp;search_".$prop['field']."='.urlencode(\$search_".$prop['field'].");\n";
}
}
$targetcontent=preg_replace('/'.preg_quote("if (\$search_field1 != '') \$params.= '&amp;search_field1='.urlencode(\$search_field1);",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("if (\$search_field2 != '') \$params.= '&amp;search_field2='.urlencode(\$search_field2);",'/').'/', '', $targetcontent);
// Substitute arrayfields
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="'t.".$prop['field']."'=>array('label'=>\$langs->trans(\"Field".$prop['field']."\"), 'checked'=>1),\n";
}
}
$targetcontent=preg_replace('/'.preg_quote("'t.field1'=>array('label'=>\$langs->trans(\"Field1\"), 'checked'=>1),",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("'t.field2'=>array('label'=>\$langs->trans(\"Field2\"), 'checked'=>1),",'/').'/', '', $targetcontent);
// Substitute print_liste_field_titre
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print_liste_field_titre(\$arrayfields['t.".$prop['field']."']['label'],\$_SERVER['PHP_SELF'],'t.".$prop['field']."','',\$param,'',\$sortfield,\$sortorder);\n";
}
}
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field1']['checked'])) print_liste_field_titre(\$langs->trans('field1'),\$_SERVER['PHP_SELF'],'t.field1','',\$param,'',\$sortfield,\$sortorder);",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field2']['checked'])) print_liste_field_titre(\$langs->trans('field2'),\$_SERVER['PHP_SELF'],'t.field2','',\$param,'',\$sortfield,\$sortorder);",'/').'/', '', $targetcontent);
// Substitute fields title search
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_".$prop['field']."\" value=\"'.\$search_".$prop['field'].".'\" size=\"10\"></td>';\n";
}
}
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field1']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_field1\" value=\"'.\$search_field1.'\" size=\"10\"></td>';",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field2']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_field2\" value=\"'.\$search_field2.'\" size=\"10\"></td>';",'/').'/', '', $targetcontent);
// Substitute where for <td>.fieldx.</td>
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print '<td>'.\$obj->".$prop['field'].".'</td>';\n";
}
}
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field1']['checked'])) print '<td>'.\$obj->field1.'</td>';",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field2']['checked'])) print '<td>'.\$obj->field2.'</td>';",'/').'/', '', $targetcontent);
// LIST_OF_TD_LABEL_FIELDS_CREATE and EDIT - List of td for card view
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td><input class=\"flat\" type=\"text\" name=\"".$prop['field']."\" value=\"'.\$".$prop['field'].".'\"></td></tr>';\n";
}
}
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_CREATE/', $varprop, $targetcontent);
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_EDIT/', $varprop, $targetcontent);
// LIST_OF_TD_LABEL_FIELDS_VIEW - List of td for card view
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td>\$object->".$prop['field']."</td></tr>';\n";
}
}
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_VIEW/', $varprop, $targetcontent);
// Build file
$fp=fopen($outfile,"w");
if ($fp)
{
fputs($fp, $targetcontent);
fclose($fp);
print "File '".$outfile."' has been built in current directory.\n";
}
else $error++;
}
// Define output variables
$outfile='out.'.$classmin.'_script.php';
$targetcontent=$sourcecontent;
// Substitute module name
$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent);
$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent);
$targetcontent=preg_replace('/mymodule/', $module, $targetcontent);
// Substitute class name
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
$targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent);
$targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent);
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
// Substitute comments
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
$targetcontent=preg_replace('/\s*\/\/\.\.\./', '', $targetcontent);
$targetcontent=preg_replace('/Put here some comments/','Initialy built by build_class_from_table on '.strftime('%Y-%m-%d %H:%M',mktime()), $targetcontent);
// Substitute table name
$targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent);
// Build file
$fp=fopen($outfile,"w");
if ($fp)
{
fputs($fp, $targetcontent);
fclose($fp);
print "File '".$outfile."' has been built in current directory.\n";
}
else $error++;
//--------------------------------
// Build skeleton_page.php
//--------------------------------
// Read skeleton_page.php file
$skeletonfile=$path.'skeleton_page.php';
$sourcecontent=file_get_contents($skeletonfile);
if (! $sourcecontent)
{
print "\n";
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
print "Try to run script from skeletons directory.\n";
exit;
}
// Define output variables
$outfile='out.'.$classmin.'_page.php';
$targetcontent=$sourcecontent;
// Substitute module name
$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent);
$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent);
$targetcontent=preg_replace('/mymodule/', $module, $targetcontent);
// Substitute class name
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
$targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent);
$targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent);
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
// Substitute comments
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
$targetcontent=preg_replace('/\s*\/\/\.\.\./', '', $targetcontent);
$targetcontent=preg_replace('/Put here some comments/','Initialy built by build_class_from_table on '.strftime('%Y-%m-%d %H:%M',mktime()), $targetcontent);
// Substitute table name
$targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent);
// Substitute GETPOST search_fieldx
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
if ($prop['isint']) $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','int');\n";
else $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','alpha');\n";
}
}
$targetcontent=preg_replace('/'.preg_quote('$search_field1=GETPOST("search_field1");','/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote('$search_field2=GETPOST("search_field2");','/').'/', '', $targetcontent);
// Substitute GETPOST fieldx
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
if ($prop['isint']) $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','int');\n";
else $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','alpha');\n";
}
}
$targetcontent=preg_replace('/'.preg_quote('$object->prop1=GETPOST("field1");','/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote('$object->prop2=GETPOST("field2");','/').'/', '', $targetcontent);
// Substitute fetch/select parameters
$targetcontent=preg_replace('/\$sql\s*\.= " t\.field1,";/', $varpropselect, $targetcontent);
$targetcontent=preg_replace('/\$sql\s*\.= " t\.field2";/', '', $targetcontent);
// Substitute where for search
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.='if ($search_'.$prop['field'].') $sql.= natural_search("'.$prop['field'].'",$search_'.$prop['field'].');'."\n";
}
}
$targetcontent=preg_replace('/'.preg_quote('if ($search_field1) $sql.= natural_search("field1",$search_field1);','/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote('if ($search_field2) $sql.= natural_search("field2",$search_field2);','/').'/', '', $targetcontent);
// Substitute print_liste_field_titre
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="print_liste_field_titre(\$langs->trans('".$prop['field']."'),\$_SERVER['PHP_SELF'],'t.".$prop['field']."','',\$param,'',\$sortfield,\$sortorder);\n";
}
}
$targetcontent=preg_replace('/'.preg_quote("print_liste_field_titre(\$langs->trans('field1'),\$_SERVER['PHP_SELF'],'t.field1','',\$param,'',\$sortfield,\$sortorder);",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("print_liste_field_titre(\$langs->trans('field2'),\$_SERVER['PHP_SELF'],'t.field1','',\$param,'',\$sortfield,\$sortorder);",'/').'/', '', $targetcontent);
// Substitute where for <td>.fieldx.</td>
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="print '<td>'.\$obj->".$prop['field'].".'</td>';\n";
}
}
$targetcontent=preg_replace('/'.preg_quote("print '<td>'.\$obj->field1.'</td>';",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("print '<td>'.\$obj->field2.'</td>';",'/').'/', '', $targetcontent);
// Build file
$fp=fopen($outfile,"w");
if ($fp)
{
fputs($fp, $targetcontent);
fclose($fp);
print "File '".$outfile."' has been built in current directory.\n";
}
else $error++;
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
print "You can now rename generated files by removing the 'out.' prefix in their name and store them into directory /yourmodule/class.\n";
print "You can now rename generated files by removing the 'out.' prefix in their name and store them into directory /yourmodule/class (for .class.php file) or /yourmodule.\n";
return $error;

View File

@ -17,7 +17,7 @@
*/
/**
* \file dev/skeletons/skeleton_page.php
* \file dev/skeletons/skeleton_card.php
* \ingroup mymodule othermodule1 othermodule2
* \brief This file is an example of a php page
* Put here some comments
@ -47,7 +47,7 @@ include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
dol_include_once('/mymodule/class/skeleton_class.class.php');
// Load traductions files requiredby by page
$langs->load("companies");
$langs->load("mymodule");
$langs->load("other");
// Get parameters
@ -184,7 +184,7 @@ if (empty($reshook))
{
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');
header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
header("Location: ".dol_buildpath('/mymodule/list.php',1));
exit;
}
else
@ -227,131 +227,10 @@ jQuery(document).ready(function() {
</script>';
// Part to show a list
if ($action == 'list' || (empty($id) && $action != 'create'))
{
// Put here content of your page
print load_fiche_titre('PageTitle');
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.field1,";
$sql.= " t.field2";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
$sql.= " WHERE 1 = 1";
if ($search_field1) $sql.= natural_search("field1",$search_field1);
if ($search_field2) $sql.= natural_search("field2",$search_field2);
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
// Count total nb of records
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
$sql.= $db->order($sortfield, $sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);
dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$params='';
$params.= '&amp;search_field1='.urlencode($search_field1);
$params.= '&amp;search_field2='.urlencode($search_field2);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies');
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
print '<table class="liste">'."\n";
// Fields title
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>'."\n";
// Fields title search
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" name="search_field1" value="'.$search_field1.'" size="10"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10"></td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>'."\n";
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($obj)
{
// You can use here results
print '<tr>';
print '<td>'.$obj->field1.'</td>';
print '<td>'.$obj->field2.'</td>';
$parameters=array('obj' => $obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>';
}
$i++;
}
$db->free($resql);
$parameters=array('sql' => $sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print "</form>\n";
}
else
{
$error++;
dol_print_error($db);
}
}
// Part to create
if ($action == 'create')
{
print load_fiche_titre($langs->trans("NewSkeleton"));
print load_fiche_titre($langs->trans("NewMyModule"));
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="add">';
@ -360,10 +239,8 @@ if ($action == 'create')
dol_fiche_head();
print '<table class="border centpercent">'."\n";
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
print '<input class="flat" type="text" size="36" name="label" value="'.$label.'">';
print '</td></tr>';
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
// LIST_OF_TD_LABEL_FIELDS_CREATE
print '</table>'."\n";
dol_fiche_end();
@ -378,17 +255,25 @@ if ($action == 'create')
// Part to edit record
if (($id || $ref) && $action == 'edit')
{
print load_fiche_titre($langs->trans("MyModule"));
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
dol_fiche_head();
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
dol_fiche_head();
print '<table class="border centpercent">'."\n";
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
// LIST_OF_TD_LABEL_FIELDS_EDIT
print '</table>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"></div>';
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
}
@ -398,10 +283,15 @@ if (($id || $ref) && $action == 'edit')
// Part to show record
if ($id && (empty($action) || $action == 'view'))
{
print load_fiche_titre($langs->trans("MyModule"));
dol_fiche_head();
print '<table class="border centpercent">'."\n";
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
// LIST_OF_TD_LABEL_FIELDS_VIEW
print '</table>';
dol_fiche_end();

View File

@ -426,6 +426,101 @@ class Skeleton_Class extends CommonObject
}
}
/**
* Return a link to the user card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to
* @param integer $notooltip 1=Disable tooltip
* @param int $maxlen Max length of visible user name
* @param string $morecss Add more css on link
* @return string String with URL
*/
function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
{
global $langs, $conf, $db;
global $dolibarr_main_authentication, $dolibarr_main_demo;
global $menumanager;
$result = '';
$companylink = '';
$label = '<u>' . $langs->trans("MyModule") . '</u>';
$label.= '<div width="100%">';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$link = '<a href="'.DOL_URL_ROOT.'/mymodule/card.php?id='.$this->id.'"';
$link.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
$link.= '>';
$linkend='</a>';
if ($withpicto)
{
$result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
$result.= $link . $this->ref . $linkend;
return $result;
}
/**
* Retourne le libelle du status d'un user (actif, inactif)
*
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->status,$mode);
}
/**
* Renvoi le libelle d'un status donne
*
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status
*/
function LibStatut($status,$mode=0)
{
global $langs;
if ($mode == 0)
{
$prefix='';
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
{
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 3)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 4)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 5)
{
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
}
}
/**
* Initialise object with example values
* Id must be 0 if object instance is a specimen

View File

@ -0,0 +1,439 @@
<?php
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
* 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 dev/skeletons/skeleton_list.php
* \ingroup mymodule othermodule1 othermodule2
* \brief This file is an example of a php page
* Put here some comments
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
// Change this following line to use the correct relative path (../, ../../, etc)
$res=0;
if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory
if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only
if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only
if (! $res) die("Include of main fails");
// Change this following line to use the correct relative path from htdocs
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
dol_include_once('/mymodule/class/skeleton_class.class.php');
// Load traductions files requiredby by page
$langs->load("mymodule");
$langs->load("other");
// Get parameters
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$backtopage = GETPOST('backtopage');
$myparam = GETPOST('myparam','alpha');
$search_field1=GETPOST("search_field1");
$search_field2=GETPOST("search_field2");
$optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if ($page == -1) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield="t.rowid"; // Set here default search field
if (! $sortorder) $sortorder="ASC";
// Protection if external user
$socid=0;
if ($user->societe_id > 0)
{
$socid = $user->societe_id;
//accessforbidden();
}
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('skeletonlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('mymodule');
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
// Load object if id or ref is provided as parameter
$object=new Skeleton_Class($db);
if (($id > 0 || ! empty($ref)) && $action != 'add')
{
$result=$object->fetch($id,$ref);
if ($result < 0) dol_print_error($db);
}
/*******************************************************************
* ACTIONS
*
* Put here all code to do according to value of "action" parameter
********************************************************************/
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
{
$search_field1='';
$search_field2='';
$search_date_creation='';
$search_date_update='';
$search_array_options=array();
}
if (empty($reshook))
{
// Action to delete
if ($action == 'confirm_delete')
{
$result=$object->delete($user);
if ($result > 0)
{
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');
header("Location: ".dol_buildpath('/mymodule/list.php',1));
exit;
}
else
{
if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors');
else setEventMessages($object->error,null,'errors');
}
}
}
/***************************************************
* VIEW
*
* Put here all code to build page
****************************************************/
llxHeader('','MyPageName','');
$form=new Form($db);
// Put here content of your page
$title = $langs->trans('MyModuleListTitle');
// Example : Adding jquery code
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
function init_myfunc()
{
jQuery("#myid").removeAttr(\'disabled\');
jQuery("#myid").attr(\'disabled\',\'disabled\');
}
init_myfunc();
jQuery("#mybutton").click(function() {
init_myfunc();
});
});
</script>';
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.field1,";
$sql.= " t.field2";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."mytable_extrafields as ef on (u.rowid = ef.fk_object)";
$sql.= " WHERE 1 = 1";
//$sql.= " WHERE u.entity IN (".getEntity('mytable',1).")";
if ($search_field1) $sql.= natural_search("field1",$search_field1);
if ($search_field2) $sql.= natural_search("field2",$search_field2);
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
// Add where from extra fields
foreach ($search_array_options as $key => $val)
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
if (in_array($typ, array('int'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
}
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.=$db->order($sortfield,$sortorder);
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
// Count total nb of records
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
$sql.= $db->plimit($conf->liste_limit+1, $offset);
dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$params='';
if ($search_field1 != '') $params.= '&amp;search_field1='.urlencode($search_field1);
if ($search_field2 != '') $params.= '&amp;search_field2='.urlencode($search_field2);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies');
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
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="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
}
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
$arrayfields=array(
't.field1'=>array('label'=>$langs->trans("Field1"), 'checked'=>1),
't.field2'=>array('label'=>$langs->trans("Field2"), 'checked'=>1),
//'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
//'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
// Fields title
print '<tr class="liste_titre">';
if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$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['t.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
//if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
print '</tr>'."\n";
// Fields title search
print '<tr class="liste_titre">';
if (! empty($arrayfields['t.field1']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field1" value="'.$search_field1.'" size="10"></td>';
if (! empty($arrayfields['t.field2']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10"></td>';
// 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'])) print '<td class="liste_titre"></td>';
}
}
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['t.datec']['checked']))
{
// Date creation
print '<td class="liste_titre">';
print '</td>';
}
if (! empty($arrayfields['t.tms']['checked']))
{
// Date modification
print '<td class="liste_titre">';
print '</td>';
}
/*if (! empty($arrayfields['u.statut']['checked']))
{
// Status
print '<td class="liste_titre" align="center">';
print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
print '</td>';
}*/
// Action column
print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
print '</tr>'."\n";
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($obj)
{
// You can use here results
print '<tr>';
if (! empty($arrayfields['t.field1']['checked'])) print '<td>'.$obj->field1.'</td>';
if (! empty($arrayfields['t.field2']['checked'])) print '<td>'.$obj->field2.'</td>';
// 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']))
{
print '<td';
$align=$extrafields->getAlignFlag($key);
if ($align) print ' align="'.$align.'"';
print '>';
$tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print '</td>';
}
}
}
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['t.datec']['checked']))
{
print '<td align="center">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
print '</td>';
}
// Date modification
if (! empty($arrayfields['t.tms']['checked']))
{
print '<td align="center">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
print '</td>';
}
// Status
/*
if (! empty($arrayfields['u.statut']['checked']))
{
$userstatic->statut=$obj->statut;
print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
}*/
// Action column
print '<td></td>';
print '</tr>';
}
$i++;
}
$db->free($resql);
$parameters=array('sql' => $sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print "</form>\n";
$db->free($result);
}
else
{
$error++;
dol_print_error($db);
}
// End of page
llxFooter();
$db->close();

View File

@ -76,7 +76,7 @@ if ($action == 'disable') {
$action = 'update';
if ($result < 0) {
setEventMessage($accounting->error, 'errors');
setEventMessages($accounting->error, $accounting->errors, 'errors');
}
} else if ($action == 'enable') {
if ($accounting->fetch($id)) {
@ -84,7 +84,7 @@ if ($action == 'disable') {
}
$action = 'update';
if ($result < 0) {
setEventMessage($accounting->error, 'errors');
setEventMessages($accounting->error, $accounting->errors, 'errors');
}
}

View File

@ -125,7 +125,7 @@ else if ($action == 'delete')
}
if ($result < 0) {
setEventMessage($accounting->error, 'errors');
setEventMessages($accounting->error, $accounting->errors, 'errors');
}
}

View File

@ -100,9 +100,9 @@ if ($action == 'update') {
}
if (! $error) {
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -66,7 +66,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -84,12 +84,12 @@ else if ($action == 'add')
if (empty($object->date_start) && empty($object->date_end))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
$error++;
}
if (empty($object->label))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
$error++;
}
@ -110,7 +110,7 @@ else if ($action == 'add')
{
$db->rollback();
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action='create';
}
}
@ -147,7 +147,7 @@ else if ($action == 'update')
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else

View File

@ -76,14 +76,14 @@ if ($_POST["action"] == 'import') {
$result = $accounting->create($user);
if ($result > 0) {
setEventMessage($langs->trans("AccountingAccountAdd"), 'mesgs');
setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs');
} else {
setEventMessage($accounting->error, 'errors');
setEventMessages($accounting->error, $accounting->errors, 'errors');
}
$cpt ++;
}
} else {
setEventMessage($langs->trans('AccountPlanNotFoundCheckSetting'), 'errors');
setEventMessages($langs->trans('AccountPlanNotFoundCheckSetting'), null, 'errors');
}
} else {
print '<div><font color="red">' . $langs->trans("AnyLineImport") . '</font></div>';

View File

@ -111,11 +111,11 @@ if ($action == 'update')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -126,9 +126,9 @@ if ($action == 'setlistsorttodo') {
$error ++;
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'mesgs');
setEventMessages($langs->trans("Error"), null, 'mesgs');
}
}
@ -138,9 +138,9 @@ if ($action == 'setlistsortdone') {
if (! $res > 0)
$error ++;
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'mesgs');
setEventMessages($langs->trans("Error"), null, 'mesgs');
}
}

View File

@ -68,9 +68,9 @@ if ($action == 'update') {
}
if (! $error) {
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -116,7 +116,7 @@ if ($action == 'update') {
$result=$accounting->fetch($accounting_account_id,null,1);
if ($result<0) {
//setEventMessage(null, $accounting->errors,'errors');
//setEventMessages(null, $accounting->errors, 'errors');
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '<br/> <pre>' . $sql . '</pre></font></div>';
} else {

View File

@ -51,8 +51,8 @@ if ($action == "confirm_update") {
$error = 0;
if ((intval($debit) != 0) && (intval($credit) != 0)) {
setEventMessage($langs->trans('ErrorDebitCredit'), 'errors');
if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) {
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
$error ++;
}
@ -61,7 +61,7 @@ if ($action == "confirm_update") {
$result = $book->fetch($id);
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
} else {
$book->numero_compte = $numero_compte;
$book->code_tiers = $code_tiers;
@ -69,20 +69,20 @@ if ($action == "confirm_update") {
$book->debit = $debit;
$book->credit = $credit;
if (! empty($debit)) {
if (floatval($debit)!=0.0) {
$book->montant = $debit;
$book->sens = 'D';
}
if (! empty($credit)) {
if (floatval($credit)!=0.0) {
$book->montant = $credit;
$book->sens = 'C';
}
$result = $book->update();
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
} else {
setEventMessage($langs->trans('Saved'), 'mesgs');
setEventMessages($langs->trans('Saved'), null, 'mesgs');
$action = '';
}
}
@ -93,7 +93,7 @@ else if ($action == "add") {
$error = 0;
if ((intval($debit) != 0) && (intval($credit) != 0)) {
setEventMessage($langs->trans('ErrorDebitCredit'), 'errors');
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
$error ++;
}
@ -124,9 +124,9 @@ else if ($action == "add") {
$result = $book->create_std($user);
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
} else {
setEventMessage($langs->trans('Saved'), 'mesgs');
setEventMessages($langs->trans('Saved'), null, 'mesgs');
$action = '';
}
}
@ -140,11 +140,11 @@ else if ($action == "confirm_delete") {
$piece_num = $book->piece_num;
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
} else {
$result = $book->delete($user);
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
}
}
$action = '';
@ -168,9 +168,9 @@ else if ($action == "confirm_create") {
$result = $book->create_std($user);
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
} else {
setEventMessage($langs->trans('Saved'), 'mesgs');
setEventMessages($langs->trans('Saved'), null, 'mesgs');
$action = '';
$piece_num = $book->piece_num;
}
@ -246,7 +246,7 @@ if ($action == 'create') {
$book = new BookKeeping($db);
$result = $book->fetch_per_mvt($piece_num);
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
}
if (! empty($book->piece_num)) {
@ -277,7 +277,7 @@ if ($action == 'create') {
$result = $book->fetch_all_per_mvt($piece_num);
if ($result < 0) {
setEventMessage($book->errors, 'errors');
setEventMessages($book->error, $book->errors, 'errors');
} else {
print load_fiche_titre($langs->trans("ListeMvts"));
@ -372,4 +372,4 @@ if ($action == 'create') {
}
llxFooter();
$db->close();
$db->close();

View File

@ -74,7 +74,7 @@ if ($action == 'delbookkeeping') {
$result = $object->delete_by_importkey($import_key);
Header("Location: list.php");
if ($result < 0) {
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
} // Export
@ -86,7 +86,7 @@ else if ($action == 'export_csv') {
$object = new BookKeeping($db);
$result = $object->export_bookkeping('ebp');
if ($result < 0) {
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
foreach ( $object->linesexport as $line ) {

View File

@ -54,7 +54,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql) {
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
} else {
header("Location: ./lines.php");

View File

@ -83,10 +83,10 @@ if ($action == 'validatehistory') {
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Dispatched'), 'mesgs');
setEventMessages($langs->trans('Dispatched'), null, 'mesgs');
}
}
@ -346,4 +346,4 @@ print "</table>\n";
print '</td></tr></table>';
llxFooter();
$db->close();
$db->close();

View File

@ -109,14 +109,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessage($langs->trans('Save'), 'mesgs');
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
}

View File

@ -343,7 +343,7 @@ if ($action == 'writeBookKeeping')
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Third party
@ -420,13 +420,13 @@ if ($action == 'writeBookKeeping')
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
if (empty($error)) {
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
}
}
// Export

View File

@ -185,7 +185,7 @@ if ($action == 'writebookkeeping') {
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -215,7 +215,7 @@ if ($action == 'writebookkeeping') {
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -246,14 +246,14 @@ if ($action == 'writebookkeeping') {
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
}
if (empty($error)) {
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
}
}

View File

@ -220,7 +220,7 @@ if ($action == 'writebookkeeping')
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -250,7 +250,7 @@ if ($action == 'writebookkeeping')
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -282,14 +282,14 @@ if ($action == 'writebookkeeping')
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
}
if (empty($error)) {
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
}
}

View File

@ -55,7 +55,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql);
$resql = $db->query($sql);
if (! $resql) {
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
} else {
header("Location: ./lines.php");

View File

@ -79,10 +79,10 @@ if ($action == 'validatehistory') {
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Dispatched'), 'mesgs');
setEventMessages($langs->trans('Dispatched'), null, 'mesgs');
}
}

View File

@ -115,14 +115,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessage($langs->trans('Save'), 'mesgs');
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
}

View File

@ -7,7 +7,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
@ -69,11 +69,11 @@ if ($action == 'update' || $action == 'add')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -60,11 +60,11 @@ if ($action == 'update')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -133,7 +133,7 @@ if (empty($reshook))
if ($userid != $user->id && $userid != $object->user_id)
{
$error++;
setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors');
setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors');
}
}
@ -169,7 +169,7 @@ if (empty($reshook))
$thirdparty=new Societe($db);
$thirdparty->fetch($socid);
$error++;
setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors');
setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors');
}
}
@ -195,12 +195,12 @@ if (empty($reshook))
if ($result < 0)
{
$langs->load("errors");
setEventMessage($langs->trans($nuser->error), 'errors');
setEventMessages($langs->trans($nuser->error), null, 'errors');
}
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->errors, $object->error, 'errors');
}
}
@ -216,13 +216,13 @@ if (empty($reshook))
if ($result < 0)
{
$langs->load("errors");
setEventMessage($langs->trans($company->error), 'errors');
setEventMessage($company->errors, 'errors');
setEventMessages($langs->trans($company->error), null, 'errors');
setEventMessages($company->error, $company->errors, 'errors');
}
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -236,7 +236,7 @@ if (empty($reshook))
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
$langs->load("mails");
setEventMessage($langs->trans("MailSuccessfulySent", $from, $object->email));
setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs');
}
}
@ -257,12 +257,12 @@ if (empty($reshook))
if ($morphy != 'mor' && empty($lastname)) {
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors');
}
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors');
}
// Create new object
@ -352,7 +352,7 @@ if (empty($reshook))
$newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0)
{
setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors');
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
}
else
{
@ -368,7 +368,7 @@ if (empty($reshook))
}
else
{
setEventMessage("ErrorBadImageFormat", 'errors');
setEventMessages("ErrorBadImageFormat", null, 'errors');
}
}
else
@ -397,9 +397,9 @@ if (empty($reshook))
else
{
if ($object->error) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
$action='';
}
@ -485,14 +485,14 @@ if (empty($reshook))
// Check parameters
if (empty($morphy) || $morphy == "-1") {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Nature")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Nature")), null, 'errors');
}
// Test si le login existe deja
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
if (empty($login)) {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Login")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Login")), null, 'errors');
}
else {
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'";
@ -503,32 +503,32 @@ if (empty($reshook))
if ($num) {
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorLoginAlreadyExists",$login), 'errors');
setEventMessages($langs->trans("ErrorLoginAlreadyExists",$login), null, 'errors');
}
}
if (empty($pass)) {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Password")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Password")), null, 'errors');
}
}
if ($morphy != 'mor' && empty($lastname)) {
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors');
}
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors');
}
if (! ($typeid > 0)) { // Keep () before !
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
}
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) {
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorBadEMail",$email), 'errors');
setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors');
}
$public=0;
if (isset($public)) $public=1;
@ -554,9 +554,9 @@ if (empty($reshook))
$db->rollback();
if ($object->error) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
$action = 'create';
@ -609,7 +609,7 @@ if (empty($reshook))
if ($result < 0)
{
$error++;
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -617,9 +617,9 @@ if (empty($reshook))
{
$error++;
if ($object->error) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -654,7 +654,7 @@ if (empty($reshook))
if ($result < 0)
{
$error++;
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
@ -662,9 +662,9 @@ if (empty($reshook))
$error++;
if ($object->error) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessage($object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
$action='';
}
@ -683,7 +683,7 @@ if (empty($reshook))
{
if (!$mailmanspip->del_to_spip($object))
{
setEventMessage($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, 'errors');
setEventMessages($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, null, 'errors');
}
}
}
@ -694,7 +694,7 @@ if (empty($reshook))
{
if (!$mailmanspip->add_to_spip($object))
{
setEventMessage($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, 'errors');
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
}
}
}

View File

@ -110,7 +110,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
{
$langs->load("errors");
$errmsg=$langs->trans($company->error);
setEventMessage($company->errors, 'errors');
setEventMessages($company->error, $company->errors, 'errors');
}
else
{
@ -131,7 +131,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights
if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id)
{
$error++;
setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors');
setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors');
}
}
@ -167,7 +167,7 @@ if ($action == 'setsocid')
$thirdparty=new Societe($db);
$thirdparty->fetch(GETPOST('socid','int'));
$error++;
setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors');
setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors');
}
}

View File

@ -1575,7 +1575,7 @@ class Adherent extends CommonObject
$picto='user';
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto) $result.=($link.img_object('', $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend;
return $result;

View File

@ -72,12 +72,12 @@ if ($action == 'dolibarr2ldap')
if ($result >= 0)
{
setEventMessage($langs->trans("MemberSynchronized"));
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
$db->commit();
}
else
{
setEventMessage($ldap->error, 'errors');
setEventMessages($ldap->errors, $ldap->error, 'errors');
$db->rollback();
}
}

View File

@ -202,7 +202,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
// Filter on categories

View File

@ -86,12 +86,12 @@ if ($action == "save" && empty($cancel))
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
$db->commit();
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"),null, 'errors');
$db->rollback();
}
}

View File

@ -72,7 +72,7 @@ if ($actionsave)
if (! empty($src) && ! dol_is_url($src))
{
setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors');
setEventMessages($langs->trans("ErrorParamMustBeAnUrl"), null, 'errors');
$error++;
$errorsaved++;
break;
@ -104,12 +104,12 @@ if ($actionsave)
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors');
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -54,12 +54,12 @@ if ($actionsave)
if ($i >= 4)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("SaveFailed"), 'errors');
setEventMessages($langs->trans("SaveFailed"), null, 'errors');
}
}

View File

@ -6,8 +6,8 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
@ -54,11 +54,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -96,13 +96,13 @@ if ($action == 'specimen')
}
else
{
setEventMessage($module->error,'errors');
setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -116,11 +116,11 @@ if ($action == 'set_ASKPRICESUPPLIER_DRAFT_WATERMARK')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -134,11 +134,11 @@ if ($action == 'set_ASKPRICESUPPLIER_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -150,11 +150,11 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -178,12 +178,12 @@ if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -56,11 +56,11 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -97,11 +97,11 @@ if ($action == 'setModuleOptions')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'msgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -111,11 +111,11 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -162,7 +162,7 @@ foreach($dirbarcode as $reldir)
{
$filebis=$reg[1];
// Chargement de la classe de codage
// Loading encoding class
require_once $newdir.$file;
$classname = "mod".ucfirst($filebis);
$module = new $classname($db);

View File

@ -85,7 +85,7 @@ if ($action == 'add') {
}
else
{
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
$error++;
}
}
@ -121,7 +121,7 @@ if ($action == 'add') {
$resql = $db->query($sql);
if (! $resql)
{
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
$error++;
}
}

View File

@ -36,16 +36,19 @@ $action = GETPOST("action");
/*
* Actions
*/
if ($action == 'setvalue' && $user->admin)
{
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity);
if ($result >= 0)
$result=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity);
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity);
if ($result1 >= 0 && $result2 >= 0)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -73,13 +76,22 @@ $var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="120">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=!$var;
print '<tr '.$bc[$var].'><td valign="top">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("ClickToDialUseTelLink").'</td><td>';
print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'<br>';
print '<br>';
print $langs->trans("ClickToDialUseTelLinkDesc");
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("DefaultLink").'</td><td>';
print '<input size="92" type="text" name="url" value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
print '<input size="92" type="text" name="CLICKTODIAL_URL"'.($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
print '<br>';
print $langs->trans("ClickToDialUrlDesc").'<br>';
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';

View File

@ -7,7 +7,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
@ -64,11 +64,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -106,13 +106,13 @@ else if ($action == 'specimen')
}
else
{
setEventMessage($module->error,'errors');
setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -137,12 +137,12 @@ if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -196,11 +196,11 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -214,11 +214,11 @@ else if ($action == 'set_ORDER_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -228,9 +228,9 @@ else if ($action=="setshippableiconinlist") {
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error) {
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -243,11 +243,28 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
// Activate ask for warehouse
else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
{
$res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -630,6 +647,36 @@ else
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
}
// Ask for warehouse during order
if ($conf->stock->enabled)
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp</td><td align="center">';
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
}
else
{
if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
}
print '</td></tr>';
}
else
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
}
print '</table>';
print '<br>';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -125,19 +125,19 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
$error++;
$langs->load("errors");
$tmparray=explode(':',$result);
setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors');
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors');
}
else
{
$error++;
setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors');
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
}
}
else
{
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorBadImageFormat"),'errors');
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
}
}
}
@ -230,7 +230,7 @@ if ($action == 'addthumb')
{
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorBadImageFormat"),'errors');
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING);
}
}
@ -238,7 +238,7 @@ if ($action == 'addthumb')
{
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors');
setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors');
dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
}
}

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -87,11 +87,11 @@ if ($action == 'update')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -55,12 +55,12 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
if (empty($constname))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors');
$error++;
}
if ($constvalue == '')
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Value")), null, 'errors');
$error++;
}
@ -68,7 +68,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
{
if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0)
{
setEventMessage($langs->trans("RecordSaved"));
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$action="";
$constname="";
$constvalue="";
@ -99,7 +99,7 @@ if (! empty($consts) && $action == 'update')
}
}
}
if ($nbmodified > 0) setEventMessage($langs->trans("RecordSaved"));
if ($nbmodified > 0) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$action='';
}
@ -122,7 +122,7 @@ if (! empty($consts) && $action == 'delete')
}
}
}
if ($nbdeleted > 0) setEventMessage($langs->trans("RecordDeleted"));
if ($nbdeleted > 0) setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
$action='';
}
@ -131,7 +131,7 @@ if ($action == 'delete')
{
if (dolibarr_del_const($db, $rowid, $entity) >= 0)
{
setEventMessage($langs->trans("RecordDeleted"));
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
else
{

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -59,11 +59,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -101,13 +101,13 @@ else if ($action == 'specimen') // For contract
}
else
{
setEventMessage($obj->error,'errors');
setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -132,12 +132,12 @@ if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -194,11 +194,11 @@ else if ($action == 'set_other')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
@ -34,6 +34,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->load("errors");
@ -465,6 +466,9 @@ if ($id == 11)
'fichinter' => $langs->trans('InterventionCard')
);
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
complete_elementList_with_modules($elementList);
asort($elementList);
$sourceList = array(
'internal' => $langs->trans('Internal'),
@ -506,7 +510,7 @@ if ($id == 10)
}
// Actions ajout ou modification d'une entree dans un dictionnaire de donnee
// Actions add or modify an entry into a dictionary
if (GETPOST('actionadd') || GETPOST('actionmodify'))
{
$listfield=explode(',',$tabfield[$id]);
@ -518,8 +522,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=1;
foreach ($listfield as $f => $value)
{
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
@ -544,20 +548,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors');
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
}
}
// Other checks
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
$ok=0;
setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors');
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
}
if (isset($_POST["code"]))
{
if ($_POST["code"]=='0')
{
$ok=0;
setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors');
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
}
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{
@ -574,10 +578,15 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
else
{
$ok=0;
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors');
setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors');
}
}
if ($id == 3 && ! is_numeric($_POST["code"]))
{
$ok=0;
setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors');
}
// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
@ -633,13 +642,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$result = $db->query($sql);
if ($result) // Add is ok
{
setEventMessage($langs->transnoentities("RecordSaved"));
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
}
else
{
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors');
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
}
else {
dol_print_error($db);
@ -683,7 +692,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$resql = $db->query($sql);
if (! $resql)
{
setEventMessage($db->error(),'errors');
setEventMessage($db->error(), 'errors');
}
}
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
@ -707,7 +716,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
{
setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors');
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
}
else
{

View File

@ -61,7 +61,7 @@ if ($action == "save")
}
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}

View File

@ -6,7 +6,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -65,9 +65,9 @@ if ($action == 'updateMask')
if (isset($res))
{
if ($res > 0)
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
else
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -77,9 +77,9 @@ else if ($action == 'set_SHIPPING_FREE_TEXT')
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if ($res > 0)
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
else
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
@ -88,9 +88,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if ($res > 0)
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
else
setEventMessage($langs->trans("Error"), 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
else if ($action == 'specimen')
@ -127,13 +127,13 @@ else if ($action == 'specimen')
}
else
{
setEventMessage($module->error, 'errors');
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"), 'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -158,12 +158,12 @@ else if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -60,11 +60,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -102,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter
}
else
{
setEventMessage($obj->error,'errors');
dol_syslog($obj->error, LOG_ERR);
setEventMessages($module->error, $module->errors,'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -133,12 +133,12 @@ if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -196,11 +196,11 @@ else if ($action == 'set_EXPENSEREPORT_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -214,11 +214,11 @@ else if ($action == 'set_EXPENSEREPORT_DRAFT_WATERMARK')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -69,11 +69,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -111,13 +111,13 @@ if ($action == 'specimen')
}
else
{
setEventMessage($module->error,'errors');
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -139,11 +139,11 @@ if ($action == 'setModuleOptions')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -200,11 +200,11 @@ if ($action == 'setribchq')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -218,11 +218,11 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -236,11 +236,11 @@ if ($action == 'set_INVOICE_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -254,11 +254,11 @@ if ($action == 'setforcedate')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -272,11 +272,11 @@ if ($action == 'set_FAC_AUTO_FILLJS')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
$classname = preg_replace('/\-.*$/','',$classname);
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
{
// Chargement de la classe de numerotation
// Charging the numbering class
require_once $dir.$filebis;
$module = new $classname($db);
@ -750,6 +750,20 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" /
print "</td></tr>\n";
print '</form>';
// Add js auto fill amount on paiement form
$var=! $var;
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_FAC_AUTO_FILLJS" />';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("JSOnPaimentBill");
print '</td><td width="60" align="center">';
print $form->selectyesno("FAC_AUTO_FILLJS",$conf->global->FAC_AUTO_FILLJS,1);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n";
print '</form>';
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
@ -784,20 +798,6 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" /
print "</td></tr>\n";
print '</form>';
// Add js auto fill amount on paiement form
$var=! $var;
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_FAC_AUTO_FILLJS" />';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("JSOnPaimentBill");
print '</td><td width="60" align="center">';
print $form->selectyesno("FAC_AUTO_FILLJS",$conf->global->FAC_AUTO_FILLJS,1);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n";
print '</form>';
print '</table>';

View File

@ -121,11 +121,11 @@ if (GETPOST('save','alpha'))
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -143,7 +143,7 @@ $var=true;
if (empty($conf->use_javascript_ajax))
{
setEventMessage(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), 'errors');
setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors');
}
else
{

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -60,11 +60,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -102,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter
}
else
{
setEventMessage($obj->error,'errors');
dol_syslog($obj->error, LOG_ERR);
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -133,12 +133,12 @@ if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -192,11 +192,11 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -209,11 +209,11 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -226,11 +226,11 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -46,7 +46,7 @@ if ($action == 'set')
if (! $gimcdf && ! file_exists($gimcdf))
{
setEventMessage($langs->trans("ErrorFileNotFound",$gimcdf),'errors');
setEventMessages($langs->trans("ErrorFileNotFound",$gimcdf), null, 'errors');
$error++;
}
@ -57,11 +57,11 @@ if ($action == 'set')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
}

View File

@ -37,6 +37,7 @@ $langs->load("companies");
$langs->load("products");
$langs->load("members");
$langs->load("projects");
$langs->load("hrm");
if (! $user->admin) accessforbidden();
@ -46,17 +47,21 @@ $action = GETPOST('action');
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
// List of supported permanent search area
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT");
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT);
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"));
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
$searchform=array();
if (empty($conf->use_javascript_ajax))
{
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE");
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE);
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users"));
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
}
if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
@ -76,13 +81,16 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
/*
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
*/
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
@ -161,19 +169,22 @@ if ($action == 'edit') // Edit
print '<br>';
// Liste des zone de recherche permanantes supportees
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>';
$var=True;
foreach ($searchform as $key => $value)
if (! empty($searchform))
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td colspan="2">';
print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
print '</td></tr>';
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>';
$var=True;
foreach ($searchform as $key => $value)
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td colspan="2">';
print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
print '</td></tr>';
}
print '</table>';
print '<br>';
}
print '</table>';
print '<br>';
// Other
print '<table summary="edit" class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
@ -204,6 +215,12 @@ if ($action == 'edit') // Edit
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Max size of short lists on customer card
$var=!$var;
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_SHORTLISTE_LIMIT . '"></td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Disable javascript and ajax
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
@ -348,20 +365,23 @@ else // Show
print '<br>';
// Liste des zone de recherches permanentes supportees
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td><td>&nbsp;</td></tr>';
$var=true;
foreach ($searchform as $key => $value)
// List of search forms to show
if (! empty($searchform))
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td>'.yn($searchformconst[$key]).'</td>';
print '<td align="left">'.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
print '</td></tr>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td><td>&nbsp;</td></tr>';
$var=true;
foreach ($searchform as $key => $value)
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td>'.yn($searchformconst[$key]).'</td>';
print '<td align="left">';
if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
print '</td></tr>';
}
print '</table>';
print '<br>';
}
print '</table>';
print '<br>';
// Other
$var=true;
@ -385,6 +405,11 @@ else // Show
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
print '<td width="20">&nbsp;</td>';
print "</tr>";
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '</td>';
print '<td width="20">&nbsp;</td>';
print "</tr>";
// Disable javascript/ajax
$var=!$var;

View File

@ -63,7 +63,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
@ -89,10 +89,9 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
}
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
$var=true;
$form=new Form($db);
@ -101,6 +100,8 @@ $form=new Form($db);
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
print '<table class="noborder" width="100%">';
// Liste de synchro actives
@ -135,7 +136,7 @@ if (! empty($conf->societe->enabled))
print '</td><td>'.$langs->trans("LDAPDnContactActiveExample").'</td></tr>';
}
// Synchro adherentt active
// Synchro member active
if (! empty($conf->adherent->enabled))
{
$var=!$var;
@ -143,6 +144,7 @@ if (! empty($conf->adherent->enabled))
$arraylist=array();
$arraylist['0']=$langs->trans("No");
$arraylist['1']=$langs->trans("DolibarrToLDAP");
$arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
print $form->selectarray('activemembers',$arraylist,$conf->global->LDAP_MEMBER_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnMemberActiveExample").'</td></tr>';
}
@ -239,12 +241,12 @@ print '</td><td>secret</td></tr>';
print '</table>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
print '</form>';
print '</div>';
print '<br>';

View File

@ -77,7 +77,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
@ -92,6 +92,8 @@ if ($action == 'setvalue' && $user->admin)
* View
*/
$form=new Form($db);
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:M&oacute;dulo_LDAP');
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
@ -102,7 +104,7 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
}
dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
@ -114,8 +116,6 @@ print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$form=new Form($db);
print '<table class="noborder" width="100%">';
$var=true;
@ -263,16 +263,16 @@ print '</td><td>&nbsp;</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_COUNTRY"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COUNTRY?' checked':'')."></td>";
print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table>';
print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
print '</form>';
print '</div>';
print info_admin($langs->trans("LDAPDescValues"));
/*
* Test de la connexion

View File

@ -68,7 +68,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
@ -93,7 +93,7 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
}
dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
@ -177,16 +177,16 @@ print '</td><td>'.$langs->trans("LDAPFieldGroupMembersExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_GROUPMEMBERS"'.(($conf->global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'')."></td>";
print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table>';
print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
print '</form>';
print '</div>';
print info_admin($langs->trans("LDAPDescValues"));
/*
* Test de la connexion

View File

@ -53,6 +53,7 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN',GETPOST("user"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FILTER',GETPOST("filterconnection"),'chaine',0,'',$conf->entity)) $error++;
// Members
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN',GETPOST("fieldlogin"),'chaine',0,'',$conf->entity)) $error++;
@ -92,7 +93,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
@ -107,6 +108,8 @@ if ($action == 'setvalue' && $user->admin)
* View
*/
$form=new Form($db);
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:M&oacute;dulo_LDAP');
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
@ -117,9 +120,12 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
}
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
@ -127,11 +133,6 @@ print $langs->trans("LDAPDescMembers").'<br>';
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$form=new Form($db);
print '<table class="noborder" width="100%">';
$var=true;
@ -156,6 +157,14 @@ print '</td><td>'.$langs->trans("LDAPMemberObjectClassListExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Filter, used to filter search
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
print '<input size="48" type="text" name="filterconnection" value="'.$conf->global->LDAP_MEMBER_FILTER.'">';
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td>';
print '<td></td>';
print '</tr>';
print '</table>';
print '<br>';
print '<table class="noborder" width="100%">';
@ -377,15 +386,16 @@ print '</td><td>&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table>';
print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
print '</form>';
print '</div>';
print info_admin($langs->trans("LDAPDescValues"));
/*
@ -454,6 +464,7 @@ if (function_exists("ldap_connect"))
}
$db->close();
llxFooter();
$db->close();

View File

@ -63,7 +63,7 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++;
@ -78,7 +78,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
@ -93,6 +93,8 @@ if ($action == 'setvalue' && $user->admin)
* Visu
*/
$form=new Form($db);
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:M&oacute;dulo_LDAP');
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
@ -103,21 +105,22 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
}
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
print $langs->trans("LDAPDescUsers").'<br>';
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$form=new Form($db);
print '<table class="noborder" width="100%">';
$var=true;
@ -141,8 +144,7 @@ print '</td><td>'.$langs->trans("LDAPUserObjectClassListExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Filtre
//Utilise pour filtrer la recherche
// Filter, used to filter search
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
print '<input size="48" type="text" name="filterconnection" value="'.$conf->global->LDAP_FILTER_CONNECTION.'">';
@ -281,16 +283,16 @@ print '</td><td>'.$langs->trans("LDAPFieldSidExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_SID"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'')."></td>";
print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table>';
print '</form>';
print '</div>';
print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
print '</form>';
/*
* Test de la connexion
@ -392,7 +394,7 @@ if (function_exists("ldap_connect"))
$conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
$conf->global->LDAP_FIELD_PHONE,
$conf->global->LDAP_FIELD_FAX,
$conf->global->LDAP_FIELD_SKYPE,
$conf->global->LDAP_FIELD_SKYPE,
$conf->global->LDAP_FIELD_MOBILE,
$conf->global->LDAP_FIELD_MAIL,
$conf->global->LDAP_FIELD_TITLE,
@ -427,7 +429,7 @@ if (function_exists("ldap_connect"))
}
else
{
setEventMessage($ldap->error, 'errors');
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
print "<br>\n";

View File

@ -43,7 +43,7 @@ if ($action == 'update')
|| $_POST["MAIN_MAX_DECIMALS_SHOWN"] > $MAXDEC)
{
$error++;
setEventMessage($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), 'errors');
setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), null, 'errors');
}
if ($_POST["MAIN_MAX_DECIMALS_UNIT"] < 0
@ -52,7 +52,7 @@ if ($action == 'update')
{
$langs->load("errors");
$error++;
setEventMessage($langs->trans("ErrorNegativeValueNotAllowed"), 'errors');
setEventMessages($langs->trans("ErrorNegativeValueNotAllowed"), null, 'errors');
}
if ($_POST["MAIN_ROUNDING_RULE_TOT"])
@ -61,7 +61,7 @@ if ($action == 'update')
{
$langs->load("errors");
$error++;
setEventMessage($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), 'errors');
setEventMessages($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), null, 'errors');
}
}

View File

@ -6,7 +6,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -58,11 +58,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -75,11 +75,11 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -117,13 +117,13 @@ if ($action == 'specimen')
}
else
{
setEventMessage($module->error,'errors');
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -148,12 +148,12 @@ if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -61,11 +61,11 @@ if ($action == 'update')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -64,12 +64,12 @@ if ($action == 'setvalue')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -65,11 +65,11 @@ if ($action == 'update' || $action == 'add')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -99,7 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con
if (! isValidEmail($email))
{
$langs->load("errors");
setEventMessage($langs->trans("ErrorBadEMail",$email),'errors');
setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors');
}
else
{
@ -118,11 +118,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con
if ($result < 0)
{
$error++;
setEventMessage($mailmanspip->error,'errors');
setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors');
}
else
{
setEventMessage($langs->trans("MailmanCreationSuccess"));
setEventMessages($langs->trans("MailmanCreationSuccess"), null);
}
}
if ($action == 'testunsubscribe')
@ -131,11 +131,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con
if ($result < 0)
{
$error++;
setEventMessage($mailmanspip->error,'errors');
setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors');
}
else
{
setEventMessage($langs->trans("MailmanDeletionSuccess"));
setEventMessages($langs->trans("MailmanDeletionSuccess"), null);
}
}
}
@ -156,12 +156,15 @@ print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup'
$head = mailmanspip_admin_prepare_head();
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
$var=true;
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
//$link=img_picto($langs->trans("Active"),'tick').' ';
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">';
//$link.=$langs->trans("Disable");
@ -200,21 +203,30 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
});
</script>';
form_constantes($constantes,1);
form_constantes($constantes,2);
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
print '</form>';
}
else
{
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_MAILMAN">';
//$link.=img_$langs->trans("Activate")
$link.=img_picto($langs->trans("Disabled"),'switch_off');
$link.='</a>';
print load_fiche_titre($langs->trans('MailmanTitle'), $link,'');
dol_fiche_end();
}
dol_fiche_end();
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{

View File

@ -123,7 +123,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml']))
$result = dol_delete_file($pathtodelete,1);
if ($result)
{
setEventMessage($langs->trans("FileWasRemoved"), $filetodelete);
setEventMessages(array($langs->trans("FileWasRemoved"), $filetodelete), null, 'mesgs');
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
@ -169,19 +169,19 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
if (empty($_POST["frommail"]))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")), null, 'errors');
$action='test';
$error++;
}
if (empty($sendto))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTo")), null, 'errors');
$action='test';
$error++;
}
if (! $error)
{
// Le message est-il en html
// Is the message in HTML?
$msgishtml=0; // Message is not HTML
if ($action == 'sendhtml') $msgishtml=1; // Force message to HTML
@ -209,11 +209,11 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
if ($result)
{
setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)));
setEventMessages($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result,'errors');
setEventMessages($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, null, 'errors');
}
$action='';
@ -677,7 +677,7 @@ else
$errormsg .= ' - '.$mail->error;
}
setEventMessage($errormsg, 'errors');
setEventMessages($errormsg, null, 'errors');
}
print '<br>';
}

View File

@ -102,8 +102,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
else
{
$error++;
//TODO: Translate
setEventMessage('Failed to initialize menu '.$key.'.', 'errors');
setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors');
$db->rollback();
}
}

View File

@ -78,16 +78,16 @@ if ($action == 'update')
$result=$menu->update($user);
if ($result > 0)
{
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
}
else
{
setEventMessage($menu->error, 'errors');
setEventMessages($menu->error, $menu->errors, 'errors');
}
}
else
{
setEventMessage($menu->error, 'errors');
setEventMessages($menu->error, $menu->errors, 'errors');
}
$_GET["menuId"] = $_POST['menuId'];
$action = "edit";
@ -135,37 +135,37 @@ if ($action == 'add')
$error=0;
if (! $error && ! $_POST['menu_handler'])
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MenuHandler")), null, 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['type'])
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['url'])
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Url")), null, 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['titre'])
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Title")), 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Title")), null, 'errors');
$action = 'create';
$error++;
}
if (! $error && $_POST['menuId'] && $_POST['type'] == 'top')
{
setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors');
setEventMessages($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), null, 'errors');
$action = 'create';
$error++;
}
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
{
setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors');
setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors');
$action = 'create';
$error++;
}
@ -204,7 +204,7 @@ if ($action == 'add')
else
{
$action = 'create';
setEventMessage($menu->error, 'errors');
setEventMessages($menu->error, $menu->errors, 'errors');
}
}
}
@ -222,7 +222,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
$this->db->commit();
llxHeader();
setEventMessage($langs->trans("MenuDeleted"));
setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs');
llxFooter();
exit ;
}

View File

@ -186,7 +186,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
{
$db->commit();
setEventMessage($langs->trans("MenuDeleted"));
setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs');
header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler);
exit ;
@ -359,7 +359,7 @@ if ($conf->use_javascript_ajax)
else
{
$langs->load("errors");
setEventMessage($langs->trans("ErrorFeatureNeedJavascript"), 'errors');
setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors');
}
print '<br>';

View File

@ -66,7 +66,7 @@ $familyinfo=array(
if ($action == 'set' && $user->admin)
{
$result=activateModule($value);
if ($result) setEventMessage($result, 'errors');
if ($result) setEventMessages($result, null, 'errors');
header("Location: modules.php?mode=".$mode);
exit;
}
@ -74,7 +74,7 @@ if ($action == 'set' && $user->admin)
if ($action == 'reset' && $user->admin)
{
$result=unActivateModule($value);
if ($result) setEventMessage($result, 'errors');
if ($result) setEventMessages($result, null, 'errors');
header("Location: modules.php?mode=".$mode);
exit;
}
@ -125,7 +125,7 @@ foreach ($modulesdir as $dir)
if (! empty($modNameLoaded[$modName]))
{
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
setEventMessage($mesg, 'warnings');
setEventMessages($mesg, null, 'warnings');
dol_syslog($mesg, LOG_ERR);
continue;
}
@ -141,7 +141,7 @@ foreach ($modulesdir as $dir)
if (! $objMod->numero > 0)
{
dol_syslog('a module descriptor must have a numero property', LOG_ERR);
dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR);
}
$j = $objMod->numero;

View File

@ -93,13 +93,13 @@ if ($action == 'setvalue' && $user->admin)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

370
htdocs/admin/oauth.php Normal file
View File

@ -0,0 +1,370 @@
<?php
/* Copyright (C) 2015 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/admin/oauth.php
* \ingroup oauth
* \brief Setup page to configure oauth access api
*/
require '../main.inc.php';
// required Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$langs->load("admin");
$langs->load("oauth");
// Security check
if (!$user->admin)
accessforbidden();
$action = GETPOST('action', 'alpha');
// Supported OAUTH
$supportedoauth2array=array('OAUTH_GOOGLE_NAME');
// API access parameters OAUTH
$list = array (
array(
'OAUTH_AMAZON_NAME',
'OAUTH_AMAZON_ID',
'OAUTH_AMAZON_SECRET',
),
array(
'OAUTH_BITBUCKET_NAME',
'OAUTH_BITBUCKET_ID',
'OAUTH_BITBUCKET_SECRET',
),
array(
'OAUTH_BITLY_NAME',
'OAUTH_BITLY_ID',
'OAUTH_BITLY_SECRET',
),
array(
'OAUTH_BITRIX24_NAME',
'OAUTH_BITRIX24_ID',
'OAUTH_BITRIX24_SECRET',
),
array(
'OAUTH_BOX_NAME',
'OAUTH_BOX_ID',
'OAUTH_BOX_SECRET',
),
array(
'OAUTH_BUFFER_NAME',
'OAUTH_BUFFER_ID',
'OAUTH_BUFFER_SECRET',
),
array(
'OAUTH_DAILYMOTION_NAME',
'OAUTH_DAILYMOTION_ID',
'OAUTH_DAILYMOTION_SECRET',
),
array(
'OAUTH_DEVIANTART_NAME',
'OAUTH_DEVIANTART_ID',
'OAUTH_DEVIANTART_SECRET',
),
array(
'OAUTH_DROPBOX_NAME',
'OAUTH_DROPBOX_ID',
'OAUTH_DROPBOX_SECRET',
),
array(
'OAUTH_ETSY_NAME',
'OAUTH_ETSY_ID',
'OAUTH_ETSY_SECRET',
),
array(
'OAUTH_EVEONLINE_NAME',
'OAUTH_EVEONLINE_ID',
'OAUTH_EVEONLINE_SECRET',
),
array(
'OAUTH_FACEBOOK_NAME',
'OAUTH_FACEBOOK_ID',
'OAUTH_FACEBOOK_SECRET',
),
array(
'OAUTH_FITBIT_NAME',
'OAUTH_FITBIT_ID',
'OAUTH_FITBIT_SECRET',
),
array(
'OAUTH_FIVEHUNDREDPX_NAME',
'OAUTH_FIVEHUNDREDPX_ID',
'OAUTH_FIVEHUNDREDPX_SECRET',
),
array(
'OAUTH_FLICKR_NAME',
'OAUTH_FLICKR_ID',
'OAUTH_FLICKR_SECRET',
),
array(
'OAUTH_FOURSQUARE_NAME',
'OAUTH_FOURSQUARE_ID',
'OAUTH_FOURSQUARE_SECRET',
),
array(
'OAUTH_GITHUB_NAME',
'OAUTH_GITHUB_ID',
'OAUTH_GITHUB_SECRET',
),
array(
'OAUTH_GOOGLE_NAME',
'OAUTH_GOOGLE_ID',
'OAUTH_GOOGLE_SECRET',
),
array(
'OAUTH_HUBIC_NAME',
'OAUTH_HUBIC_ID',
'OAUTH_HUBIC_SECRET',
),
array(
'OAUTH_INSTAGRAM_NAME',
'OAUTH_INSTAGRAM_ID',
'OAUTH_INSTAGRAM_SECRET',
),
array(
'OAUTH_LINKEDIN_NAME',
'OAUTH_LINKEDIN_ID',
'OAUTH_LINKEDIN_SECRET',
),
array(
'OAUTH_MAILCHIMP_NAME',
'OAUTH_MAILCHIMP_ID',
'OAUTH_MAILCHIMP_SECRET',
),
array(
'OAUTH_MICROSOFT_NAME',
'OAUTH_MICROSOFT_ID',
'OAUTH_MICROSOFT_SECRET',
),
array(
'OAUTH_NEST_NAME',
'OAUTH_NEST_ID',
'OAUTH_NEST_SECRET',
),
array(
'OAUTH_NETATMO_NAME',
'OAUTH_NETATMO_ID',
'OAUTH_NETATMO_SECRET',
),
array(
'OAUTH_PARROTFLOWERPOWER_NAME',
'OAUTH_PARROTFLOWERPOWER_ID',
'OAUTH_PARROTFLOWERPOWER_SECRET',
),
array(
'OAUTH_PAYPAL_NAME',
'OAUTH_PAYPAL_ID',
'OAUTH_PAYPAL_SECRET',
),
array(
'OAUTH_POCKET_NAME',
'OAUTH_POCKET_ID',
'OAUTH_POCKET_SECRET',
),
array(
'OAUTH_QUICKBOOKS_NAME',
'OAUTH_QUICKBOOKS_ID',
'OAUTH_QUICKBOOKS_SECRET',
),
array(
'OAUTH_REDDIT_NAME',
'OAUTH_REDDIT_ID',
'OAUTH_REDDIT_SECRET',
),
array(
'OAUTH_REDMINE_NAME',
'OAUTH_REDMINE_ID',
'OAUTH_REDMINE_SECRET',
),
array(
'OAUTH_RUNKEEPER_NAME',
'OAUTH_RUNKEEPER_ID',
'OAUTH_RUNKEEPER_SECRET',
),
array(
'OAUTH_SCOOPIT_NAME',
'OAUTH_SCOOPIT_ID',
'OAUTH_SCOOPIT_SECRET',
),
array(
'OAUTH_SOUNDCLOUD_NAME',
'OAUTH_SOUNDCLOUD_ID',
'OAUTH_SOUNDCLOUD_SECRET',
),
array(
'OAUTH_SPOTIFY_NAME',
'OAUTH_SPOTIFY_ID',
'OAUTH_SPOTIFY_SECRET',
),
array(
'OAUTH_STRAVA_NAME',
'OAUTH_STRAVA_ID',
'OAUTH_STRAVA_SECRET',
),
array(
'OAUTH_TUMBLR_NAME',
'OAUTH_TUMBLR_ID',
'OAUTH_TUMBLR_SECRET',
),
array(
'OAUTH_TWITTER_NAME',
'OAUTH_TWITTER_ID',
'OAUTH_TWITTER_SECRET',
),
array(
'OAUTH_USTREAM_NAME',
'OAUTH_USTREAM_ID',
'OAUTH_USTREAM_SECRET',
),
array(
'OAUTH_VIMEO_NAME',
'OAUTH_VIMEO_ID',
'OAUTH_VIMEO_SECRET',
),
array(
'OAUTH_YAHOO_NAME',
'OAUTH_YAHOO_ID',
'OAUTH_YAHOO_SECRET',
),
array(
'OAUTH_YAMMER_NAME',
'OAUTH_YAMMER_ID',
'OAUTH_YAMMER_SECRET',
),
);
/*
* Actions
*/
if ($action == 'update')
{
$error = 0;
foreach ($list as $constname) {
$constvalue = GETPOST($constname[1], 'alpha');
if (!dolibarr_set_const($db, $constname[1], $constvalue, 'chaine', 0, '', $conf->entity))
$error++;
$constvalue = GETPOST($constname[2], 'alpha');
if (!dolibarr_set_const($db, $constname[2], $constvalue, 'chaine', 0, '', $conf->entity))
$error++;
}
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null);
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
/*
* View
*/
llxHeader();
$form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans('ConfigOAuth'),$linkback,'title_setup');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
/*
* Parameters
*/
dol_fiche_head(array(), '', '', 0, 'technic');
print $langs->trans("ListOfSupportedOauthProviders").'<br><br>';
print '<table class="noborder" width="100%">';
$var = true;
foreach ($list as $key)
{
$supported=0;
if (in_array($key[0], $supportedoauth2array)) $supported=1;
if (! $supported) continue; // show only supported
print '<tr class="liste_titre">';
// Api Name
$label = $langs->trans($key[0]);
print '<td colspan="2">'.$label.'</td></tr>';
if ($supported)
{
$redirect_uri=$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php';
$var = !$var;
print '<tr '.$bc[$var].' class="value">';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
print '<td><input style="width: 80%" type"text" name="uri'.$key[0].'" value="'.$redirect_uri.'">';
print '</td></tr>';
}
else
{
$var = !$var;
print '<tr '.$bc[$var].' class="value">';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
print '</td></tr>';
}
// Api Id
$var = !$var;
print '<tr '.$bc[$var].' class="value">';
print '<td><label for="'.$key[1].'">'.$langs->trans($key[1]).'</label></td>';
print '<td><input type="text" size="100" id="'.$key[1].'" name="'.$key[1].'" value="'.$conf->global->$key[1].'">';
print '</td></tr>';
// Api Secret
$var = !$var;
print '<tr '.$bc[$var].' class="value">';
print '<td><label for="'.$key[2].'">'.$langs->trans($key[2]).'</label></td>';
print '<td><input type="password" size="100" id="'.$key[2].'" name="'.$key[2].'" value="'.$conf->global->$key[2].'">';
print '</td></tr>';
}
print '</table>'."\n";
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
print '</form>';
llxFooter();
$db->close();

View File

@ -66,7 +66,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
$textobject=$langs->transnoentitiesnoconv("OrderLines");
$textobject=$langs->transnoentitiesnoconv("Orders");
llxHeader('',$langs->trans("OrdersSetup"));

View File

@ -54,11 +54,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -130,7 +130,7 @@ foreach ($dirmodels as $reldir)
$classname = preg_replace('/\-.*$/','',$classname);
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
{
// Chargement de la classe de numerotation
// Charging the numbering class
require_once $dir.$filebis;
$module = new $classname($db);

View File

@ -62,7 +62,8 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
}
@ -135,6 +136,12 @@ if ($action == 'edit') // Edit
print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
// Hide VAT Intra on address
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
print '</td></tr>';
// Show prof id 1 in address into pdf
$var=!$var;
if (! $noCountryCode)
@ -223,12 +230,6 @@ if ($action == 'edit') // Edit
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
print '</td></tr>';
// Hide Tva Intra on adress
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
print '</td></tr>';
//Desc
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
@ -247,6 +248,12 @@ if ($action == 'edit') // Edit
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print '</td></tr>';
// Place customer adress to the ISO location
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td>';
print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1);
print '</td></tr>';
print '</table>';
@ -303,6 +310,12 @@ else // Show
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
// Hide Intra VAT on address
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
print '</td></tr>';
// Show prof id 1 in address into pdf
$var=!$var;
if (! $noCountryCode)
@ -386,13 +399,6 @@ else // Show
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>';
// Hide any PDF informations
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1);
print '</td></tr>';
// Encrypt and protect PDF
$var=!$var;
print "<tr ".$bc[$var].">";
@ -421,11 +427,11 @@ else // Show
print "</td>";
print '</tr>';
// Hide Tva Intra on adress
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
print '</td></tr>';
// Hide any PDF informations
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1);
print '</td></tr>';
//Desc
$var=!$var;
@ -445,6 +451,10 @@ else // Show
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td colspan="2">';
print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1);
print '</td></tr>';
print '</table>';

View File

@ -81,12 +81,12 @@ if ($action == "set")
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -59,11 +59,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -101,13 +101,13 @@ if ($action == 'specimen')
}
else
{
setEventMessage($module->error,'errors');
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -121,11 +121,11 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -139,11 +139,11 @@ if ($action == 'set_PROPOSAL_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -155,11 +155,11 @@ if ($action == 'setdefaultduration')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -171,11 +171,11 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -199,12 +199,12 @@ if ($action == 'setModuleOptions')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -44,12 +44,12 @@ if (GETPOST("action") == 'set_proxy')
{
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
{
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
$error++;
}
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
{
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
$error++;
}
@ -68,7 +68,7 @@ if (GETPOST("action") == 'set_proxy')
if (! $error)
{
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
}
}

View File

@ -0,0 +1,442 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 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/admin/receiptprinter.php
* \ingroup printing
* \brief Page to setup receipt printer
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/receiptprinter.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
$langs->load("admin");
$langs->load("receiptprinter");
if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha');
$printername = GETPOST('printername', 'alpha');
$printerid = GETPOST('printerid', 'int');
$parameter = GETPOST('parameter', 'alpha');
$template = GETPOST('template', 'alpha');
$templatename = GETPOST('templatename', 'alpha');
$templateid = GETPOST('templateid', 'int');
$printer = new dolReceiptPrinter($db);
if (!$mode) $mode='config';
// used in library escpos maybe useful if php doesn't support gzdecode
if (!function_exists('gzdecode')) {
function gzdecode($data)
{
return gzinflate(substr($data,10,-8));
}
}
/*
* Action
*/
if ($action == 'addprinter' && $user->admin)
{
$error=0;
$db->begin();
if (empty($printername)) {
$error++;
setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors');
}
if (empty($parameter)) {
setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings');
}
if (! $error)
{
$result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), $parameter);
if ($result > 0) $error++;
if (! $error)
{
$db->commit();
setEventMessages($langs->trans("PrinterAdded",$printername), null);
}
else
{
$db->rollback();
dol_print_error($db);
}
}
$action = '';
}
if ($action == 'deleteprinter' && $user->admin)
{
$error=0;
$db->begin();
if (empty($printerid)) {
$error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
}
if (! $error)
{
$result= $printer->DeletePrinter($printerid);
if ($result > 0) $error++;
if (! $error)
{
$db->commit();
setEventMessages($langs->trans("PrinterDeleted",$printername), null);
}
else
{
$db->rollback();
dol_print_error($db);
}
}
$action = '';
}
if ($action == 'updateprinter' && $user->admin)
{
$error=0;
$db->begin();
if (empty($printerid)) {
$error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
}
if (! $error)
{
$result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), $parameter, $printerid);
if ($result > 0) $error++;
if (! $error)
{
$db->commit();
setEventMessages($langs->trans("PrinterUpdated",$printername), null);
}
else
{
$db->rollback();
dol_print_error($db);
}
}
$action = '';
}
if ($action == 'testprinter' && $user->admin)
{
$error=0;
if (empty($printerid)) {
$error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
}
if (! $error)
{
// test
$ret = $printer->SendTestToPrinter($printerid);
if ($ret == 0)
{
setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
}
else
{
setEventMessages($printer->error, $printer->errors, 'errors');
}
}
$action = '';
}
if ($action == 'updatetemplate' && $user->admin)
{
$error=0;
$db->begin();
if (empty($templateid)) {
$error++;
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
}
if (! $error)
{
$result= $printer->UpdateTemplate($templatename, $template, $templateid);
if ($result > 0) $error++;
if (! $error)
{
$db->commit();
setEventMessages($langs->trans("TemplateUpdated",$templatename), null);
}
else
{
$db->rollback();
dol_print_error($db);
}
}
$action = '';
}
/*
* View
*/
$form = new Form($db);
llxHeader('',$langs->trans("ReceiptPrinterSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("ReceiptPrinterSetup"),$linkback,'title_setup');
$head = receiptprinteradmin_prepare_head($mode);
if ($mode == 'config' && $user->admin)
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='editprinter') {
print '<input type="hidden" name="action" value="addprinter">';
} else {
print '<input type="hidden" name="action" value="updateprinter">';
}
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
print $langs->trans("ReceiptPrinterDesc")."<br><br>\n";
print '<table class="noborder" width="100%">'."\n";
$var=true;
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Type").'</th>';
print '<th>'.$langs->trans("Parameters").'</th>';
print '<th></th>';
print '<th></th>';
print '<th></th>';
print "</tr>\n";
$ret = $printer->listprinters();
if ($ret > 0) {
setEventMessages($printer->error, $printer->errors, 'errors');
} else {
for ($line=0; $line < count($printer->listprinters); $line++) {
$var = !$var;
print '<tr '.$bc[$var].'>';
if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) {
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
print '<td>'.$printer->resprint.'</td>';
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
} else {
print '<td>'.$printer->listprinters[$line]['name'].'</td>';
switch ($printer->listprinters[$line]['fk_type']) {
case 1:
$connector = 'CONNECTOR_DUMMY';
break;
case 2:
$connector = 'CONNECTOR_FILE_PRINT';
break;
case 3:
$connector = 'CONNECTOR_NETWORK_PRINT';
break;
case 4:
$connector = 'CONNECTOR_WINDOWS_PRINT';
break;
case 5:
$connector = 'CONNECTOR_JAVA';
break;
default:
$connector = 'CONNECTOR_UNKNOWN';
break;
}
print '<td>'.$langs->trans($connector).'</td>';
print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
// edit icon
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=editprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'">';
print img_picto($langs->trans("Edit"),'edit');
print '</a></td>';
// delete icon
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=deleteprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'&amp;printername='.$printer->listprinters[$line]['name'].'">';
print img_picto($langs->trans("Delete"),'delete');
print '</a></td>';
// test icon
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=testprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'&amp;printername='.$printer->listprinters[$line]['name'].'">';
print img_picto($langs->trans("TestPrinter"),'printer');
print '</a></td>';
print '</tr>';
}
}
}
if ($action!='editprinter') {
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Type").'</th>';
print '<th>'.$langs->trans("Parameters").'</th>';
print '<th></th>';
print '<th></th>';
print '<th></th>';
print "</tr>\n";
print '<tr>';
print '<td><input size="50" type="text" name="printername"></td>';
$ret = $printer->selectTypePrinter();
print '<td>'.$printer->resprint.'</td>';
print '<td><input size="60" type="text" name="parameter"></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
}
print '</table>';
dol_fiche_end();
if ($action!='editprinter') {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
} else {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
}
print '</form>';
print '<div><p></div>';
dol_fiche_head();
print '<table class="noborder" width="100%">'."\n";
$var=true;
print '<tr><td>'.$langs->trans("CONNECTOR_DUMMY").':</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
print '<td>'.$langs->trans("CONNECTOR_NETWORK_PRINT").':</td><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'</td></tr>';
print '<td>'.$langs->trans("CONNECTOR_FILE_PRINT").':</td><td>'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'</td></tr>';
print '<td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT").':</td><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT_HELP").'</td></tr>';
//print '<td>'.$langs->trans("CONNECTOR_JAVA").':</td><td>'.$langs->trans("CONNECTOR_JAVA_HELP").'</td></tr>';
print '</table>';
dol_fiche_end();
}
if ($mode == 'template' && $user->admin)
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='edittemplate') {
print '<input type="hidden" name="action" value="addtemplate">';
} else {
print '<input type="hidden" name="action" value="updatetemplate">';
}
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
print $langs->trans("ReceiptPrinterTemplateDesc")."<br><br>\n";
print '<table class="noborder" width="100%">'."\n";
$var=true;
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Template").'</th>';
print '<th></th>';
print '<th></th>';
print '<th></th>';
print "</tr>\n";
$ret = $printer->listPrintersTemplates();
//print '<pre>'.print_r($printer->listprinterstemplates, true).'</pre>';
if ($ret > 0) {
setEventMessages($printer->error, $printer->errors, 'errors');
} else {
for ($line=0; $line < count($printer->listprinterstemplates); $line++) {
$var = !$var;
print '<tr '.$bc[$var].'>';
if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) {
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
print '<td><textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
print '</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
} else {
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
print '<td>'.nl2br(htmlentities($printer->listprinterstemplates[$line]['template'])).'</td>';
// edit icon
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=edittemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
print img_picto($langs->trans("Edit"),'edit');
print '</a></td>';
// delete icon
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=deletetemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'&amp;templatename='.$printer->listprinterstemplates[$line]['name'].'">';
print img_picto($langs->trans("Delete"),'delete');
print '</a></td>';
// test icon
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=testtemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'&amp;templatename='.$printer->listprinterstemplates[$line]['name'].'">';
print img_picto($langs->trans("TestPrinterTemplate"),'printer');
print '</a></td>';
}
print '</tr>';
}
}
print '</table>';
if ($action!='edittemplate') {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
} else {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
}
print '</form>';
print '<div><p></div>';
print '<table class="noborder" width="100%">'."\n";
$var=true;
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Tag").'</th>';
print '<th>'.$langs->trans("Description").'</th>';
print "</tr>\n";
for ($tag=0; $tag < count($printer->tags); $tag++) {
$var = !$var;
print '<tr '.$bc[$var].'>';
print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>';
print '</tr>';
}
print '</table>';
dol_fiche_end();
}
// to remove after test
$object->date_time = '2015-11-02 22:30:25';
$object->id = 1234;
$object->customer_firstname = 'John';
$object->customer_lastname = 'Deuf';
$object->vendor_firstname = 'Jim';
$object->vendor_lastname = 'Big';
$object->barcode = '3700123862396';
//$printer->sendToPrinter($object, 1, 16);
//setEventMessages($printer->error, $printer->errors, 'errors');
llxFooter();
$db->close();

View File

@ -60,11 +60,11 @@ if ($action == 'update')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -135,7 +135,7 @@ if ($action == 'activate_encryptdbpassconf')
}
else
{
setEventMessage($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)),'warnings');
setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings');
}
}
else if ($action == 'disable_encryptdbpassconf')
@ -152,7 +152,7 @@ else if ($action == 'disable_encryptdbpassconf')
}
else
{
setEventMessage($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass),'warnings');
setEventMessages($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass), null, 'warnings');
}
}
@ -221,7 +221,7 @@ if (is_resource($handle))
{
if (preg_match('/(modGeneratePass[a-z]+)\.class\.php/i',$file,$reg))
{
// Chargement de la classe de numerotation
// Charging the numbering class
$classname = $reg[1];
require_once $dir.'/'.$file;
@ -292,6 +292,7 @@ $var=!$var;
$this->NbRepeat = $tabConf[4];
$this->WithoutAmbi = $tabConf[5];
*/
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3"> '.$langs->trans("PasswordPatternDesc").'</td>';
@ -332,13 +333,17 @@ $var=!$var;
print '<td>' . $langs->trans("NoAmbiCaracAutoGeneration")."</td>";
print '<td colspan="2"><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>';
print '</tr>';
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td colspan="2"></td><td width="103" align="center"><a id="linkChangePattern">'.$langs->trans("Save").'</a></td>';
print '</tr>';
print '</table>';
print '<br>';
print '<table align="right">';
print '<tr><td>';
print '<a class="button" id="linkChangePattern">'.$langs->trans("Save").'</a>';
print '</td></tr>';
print '</table>';
print '<br><br>';
print '<script type="text/javascript">';
print ' function getStringArg(){';
print ' var pattern = "";';
@ -389,7 +394,7 @@ $var=!$var;
// Cryptage mot de passe
print '<br>';
$var=true;
print "<form method=\"post\" action=\"security.php\">";
print "<form method=\"post\" action=\"" . $_SERVER["PHP_SELF"] . "\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"encrypt\">";

View File

@ -86,7 +86,7 @@ else if ($action == 'updateform')
$res4=dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity);
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity);
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity);
if ($res3 && $res4 && $res5 && $res6) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
}
@ -97,8 +97,8 @@ else if ($action == 'delete')
$langs->load("other");
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
Header('Location: '.$_SERVER["PHP_SELF"]);
exit;
}

View File

@ -76,7 +76,7 @@ else if ($action == 'updateform')
{
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
if ($res1 && $res2) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
if ($res1 && $res2) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
}

View File

@ -88,25 +88,25 @@ if ($action == 'send' && ! $_POST['cancel'])
if (! empty($formsms->error))
{
setEventMessage($formsms->error,'errors');
setEventMessages($formsms->error, $formsms->errors, 'errors');
$action='test';
$error++;
}
if (empty($body))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Message")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors');
$action='test';
$error++;
}
if (empty($smsfrom) || ! str_replace('+','',$smsfrom))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsFrom")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsFrom")), null, 'errors');
$action='test';
$error++;
}
if (empty($sendto) || ! str_replace('+','',$sendto))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsTo")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsTo")), null, 'errors');
$action='test';
$error++;
}
@ -123,11 +123,11 @@ if ($action == 'send' && ! $_POST['cancel'])
if ($result)
{
setEventMessage($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto));
setEventMessages($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("ResultKo"),'errors');
setEventMessages($langs->trans("ResultKo"), null, 'errors');
}
$action='';

View File

@ -54,28 +54,30 @@ if ($action == 'update' || $action == 'add')
$constname=GETPOST("constname");
$constvalue=GETPOST("constvalue");
if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue='';
if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
{
if ($constvalue) $constvalue=0;
else $constvalue=1;
}
// Action mise a jour ou ajout d'une constante
if ($action == 'update' || $action == 'add')
{
foreach($_POST['constname'] as $key => $val)
{
$constname=$_POST["constname"][$key];
$constvalue=$_POST["constvalue"][$key];
$consttype=$_POST["consttype"][$key];
$constnote=$_POST["constnote"][$key];
if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname];
$consttype=$_POST["consttype"];
$constnote=GETPOST("constnote");
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
if (! $res > 0) $error++;
}
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
}
// Action activation d'un sous module du module adherent
@ -115,7 +117,6 @@ print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup'
$head = mailmanspip_admin_prepare_head();
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
$var=true;
@ -124,6 +125,10 @@ $var=true;
*/
if (! empty($conf->global->ADHERENT_USE_SPIP))
{
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
//$link=img_picto($langs->trans("Active"),'tick').' ';
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">';
//$link.=$langs->trans("Disable");
@ -139,21 +144,28 @@ if (! empty($conf->global->ADHERENT_USE_SPIP))
print load_fiche_titre($langs->trans('SPIPTitle'), $link, '');
print '<br>';
form_constantes($constantes);
print '<br>';
form_constantes($constantes,2);
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
print '</form>';
}
else
{
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_SPIP">';
//$link.=$langs->trans("Activate");
$link.=img_picto($langs->trans("Disabled"),'switch_off');
$link.='</a>';
print load_fiche_titre($langs->trans('SPIPTitle'), $link, '');
dol_fiche_end();
}
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -96,12 +96,12 @@ if($action)
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -141,58 +141,75 @@ $var=true;
$found=0;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("DeStockOnBill").'</td>';
print '<td width="160" align="right">';
if (! empty($conf->facture->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("DeStockOnBill").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_BILL\">";
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
print "</form>\n</td>\n</tr>\n";
$found++;
print "</form>\n";
}
else
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name"));
}
print "</td>\n</tr>\n";
$found++;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
if (! empty($conf->commande->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_VALIDATE_ORDER\">";
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
print "</form>\n</td>\n</tr>\n";
$found++;
print "</form>\n";
}
else
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name"));
}
print "</td>\n</tr>\n";
$found++;
//if (! empty($conf->expedition->enabled))
//{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("DeStockOnShipment").'</td>';
print '<td width="160" align="right">';
if (! empty($conf->expedition->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("DeStockOnShipment").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT\">";
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
print "</form>\n</td>\n</tr>\n";
$found++;
print "</form>\n";
}
else
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
}
print "</td>\n</tr>\n";
$found++;
if (! $found)
/*if (! $found)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td colspan="2">'.$langs->trans("NoModueToManageStockDecrease").'</td>';
print '<td colspan="2">'.$langs->trans("NoModuleToManageStockDecrease").'</td>';
print "</tr>\n";
}
}*/
print '</table>';
@ -208,57 +225,74 @@ $var=true;
$found=0;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("ReStockOnBill").'</td>';
print '<td width="160" align="right">';
if (! empty($conf->fournisseur->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("ReStockOnBill").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_BILL\">";
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
print "</form>\n</td>\n</tr>\n";
$found++;
print "</form>\n";
}
else
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
}
print "</td>\n</tr>\n";
$found++;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
if (! empty($conf->fournisseur->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER\">";
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
print "</form>\n</td>\n</tr>\n";
$found++;
print "</form>\n";
}
else
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
}
print "</td>\n</tr>\n";
$found++;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td width="160" align="right">';
if (! empty($conf->fournisseur->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER\">";
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
print "</form>\n</td>\n</tr>\n";
$found++;
print "</form>\n";
}
else
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
}
print "</td>\n</tr>\n";
$found++;
if (! $found)
/*if (! $found)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td colspan="2">'.$langs->trans("NoModueToManageStockIncrease").'</td>';
print "</tr>\n";
}
}*/
print '</table>';

View File

@ -5,7 +5,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -63,11 +63,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -106,13 +106,13 @@ if ($action == 'specimen') // For invoices
}
else
{
setEventMessage($module->error,'errors');
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -174,11 +174,11 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -5,7 +5,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -64,11 +64,11 @@ if ($action == 'updateMask')
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -107,13 +107,13 @@ else if ($action == 'specimen') // For orders
}
else
{
setEventMessage($module->error,'errors');
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}

View File

@ -119,12 +119,12 @@ if ($action == 'set')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($error, 'errors');
setEventMessages($error, $errors, 'errors');
}
@ -140,11 +140,11 @@ if ($action == 'setlevel')
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -25,11 +25,15 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
$langs->load("admin");
$langs->load("help");
$langs->load("members");
$youuselaststable = 0;
/*
* View
@ -42,9 +46,54 @@ print load_fiche_titre("Dolibarr",'','title_setup');
print '<div style="padding-left: 30px;">'.img_picto_common('', 'dolibarr_box.png','height="120"').'</div>';
print '<div class="fichecenter"><div class="fichehalfleft">';
print $langs->trans("Version").' / '.$langs->trans("DolibarrLicense").':';
print '<ul>';
print '<li>'.DOL_VERSION.' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
print '<li><strong>'.DOL_VERSION.'</strong>';
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
//var_dump($result['content']);
$sfurl = simplexml_load_string($result['content']);
if ($sfurl)
{
$title=$sfurl->channel[0]->item[0]->title;
function word_limiter($text, $limit = 30, $chars = '0123456789.')
{
if (strlen( $text ) > $limit)
{
$words = str_word_count($text, 2, $chars);
$words = array_reverse($words, TRUE);
foreach($words as $length => $word) {
if ($length + strlen( $word ) >= $limit)
{
array_shift($words);
} else {
break;
}
}
$words = array_reverse($words);
$text = implode(" ", $words) . '';
}
return $text;
}
$str = word_limiter($title);
$str = preg_replace('/[^0-9\.]/', '', $str);
print ' ('.$langs->trans("LastStableVersion").': <b>'.$str.'</b>';
if (DOL_VERSION == $str)
{
$youuselaststable=1;
print $langs->trans("YouUseLastStableVersion");
}
print ')';
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
}
print '</ul>';
//print "<br>\n";
@ -114,6 +163,9 @@ print '</li>';
print '</ul>';
print '</div><div class="fichehalfright">';
print $langs->trans("HelpCenter").':';
print '<ul>';
print '<li>';
@ -122,6 +174,7 @@ print '<a target="_blank" href="'.DOL_URL_ROOT.'/support/index.php" data-ajax="f
print '</li>';
print '</ul>';
print $langs->trans("Foundation").':';
print '<ul>';
@ -153,6 +206,33 @@ print '</li>';
print '</ul>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div>';
if ($youuselaststable)
{
print '<br>';
print '<br>';
$tmp=versiondolibarrarray();
if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0))
{
print $langs->trans("TitleExampleForMajorRelease").':<br>';
print '<textarea style="width:80%; min-height: 60px">';
print $langs->trans("ExampleOfNewsMessageForMajorRelease", DOL_VERSION, DOL_VERSION);
print '</textarea>';
}
else
{
print $langs->trans("TitleExampleForMaintenanceRelease").':<br>';
print '<textarea style="width:80%; min-height: 60px">';
print $langs->trans("ExampleOfNewsMessageForMaintenanceRelease", DOL_VERSION, DOL_VERSION);
print '</textarea>';
}
}
llxFooter();

View File

@ -98,10 +98,10 @@ if ($action == 'update') {
if (! $error) {
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@ -52,8 +52,8 @@ if ($action == 'delete')
{
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
$ret=dol_delete_file($file, 1);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$action='';
}

View File

@ -60,8 +60,8 @@ if ($action == 'delete')
{
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
$ret=dol_delete_file($file, 1);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$action='';
}
@ -357,7 +357,7 @@ if ($what == 'postgresql')
//{
if ($errormsg)
{
setEventMessage($langs->trans("Error")." : ".$errormsg, 'errors');
setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
$resultstring='';
$resultstring.='<div class="error">'.$langs->trans("Error")." : ".$errormsg.'</div>';
@ -368,7 +368,7 @@ if ($what == 'postgresql')
{
if ($what)
{
setEventMessage($langs->trans("BackupFileSuccessfullyCreated").'.<br>'.$langs->trans("YouCanDownloadBackupFile"));
setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.<br>'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs');
$resultstring='<div class="ok">';
$resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.<br>';
@ -379,7 +379,7 @@ if ($what == 'postgresql')
}
else
{
setEventMessage($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user));
setEventMessages($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user), null, 'mesgs');
}
}
//}

View File

@ -34,7 +34,7 @@ $action=GETPOST('action','alpha');
if (! $user->admin) accessforbidden();
if (GETPOST('msg','alpha')) {
setEventMessage(GETPOST('msg','alpha'), 'errors');
setEventMessages(GETPOST('msg','alpha'), null, 'errors');
}
@ -63,7 +63,7 @@ if ($action=='install')
if (! $original_file)
{
$langs->load("Error");
setEventMessage($langs->trans("ErrorFileRequired"), 'warnings');
setEventMessages($langs->trans("ErrorFileRequired"), null, 'warnings');
$error++;
}
else
@ -71,7 +71,7 @@ if ($action=='install')
if (! preg_match('/\.zip/i',$original_file))
{
$langs->load("errors");
setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors');
setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors');
$error++;
}
}
@ -99,7 +99,7 @@ if ($action=='install')
if (! empty($result['error']))
{
$langs->load("errors");
setEventMessage($langs->trans($result['error'],$original_file), 'errors');
setEventMessages($langs->trans($result['error'],$original_file), null, 'errors');
$error++;
}
else
@ -116,7 +116,7 @@ if ($action=='install')
//var_dump($modulenamedir);
if (! dol_is_dir($modulenamedir))
{
setEventMessage($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), 'errors');
setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors');
$error++;
}
}
@ -128,7 +128,7 @@ if ($action=='install')
$result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1);
if ($result <= 0)
{
setEventMessage($langs->trans("ErrorFailedToCopy"), 'errors');
setEventMessages($langs->trans("ErrorFailedToCopy"), null, 'errors');
$error++;
}
}
@ -142,7 +142,7 @@ if ($action=='install')
if (! $error)
{
setEventMessage($langs->trans("SetupIsReadyForUse"));
setEventMessages($langs->trans("SetupIsReadyForUse"), null, 'mesgs');
}
}

View File

@ -0,0 +1 @@

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