Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop_unlock_title_button_feature
@ -17,7 +17,7 @@ CKEditor 4.12.1 LGPL-2.1+ Yes
|
|||||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||||
Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||||
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
||||||
Mobiledetect 2.8.83 MIT License Yes Detect mobile devices browsers
|
Mobiledetect 2.8.33 MIT License Yes Detect mobile devices browsers
|
||||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
ParseDown 1.6 MIT License Yes Markdown parser
|
ParseDown 1.6 MIT License Yes Markdown parser
|
||||||
@ -33,7 +33,7 @@ Restler 3.0.0RC6 LGPL-3+ Yes
|
|||||||
Sabre 3.2.2 BSD Yes DAV support
|
Sabre 3.2.2 BSD Yes DAV support
|
||||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
||||||
Stripe 6.41 MIT licence Yes Library for Stripe module
|
Stripe 6.41 MIT licence Yes Library for Stripe module
|
||||||
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
|
||||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
|
|||||||
@ -23,6 +23,7 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...)
|
* If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...)
|
||||||
* Removed function dol_micro_time. Use native PHP microtime instead.
|
* Removed function dol_micro_time. Use native PHP microtime instead.
|
||||||
* The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE.
|
* The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE.
|
||||||
|
* The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 10.0.2 compared to 10.0.1 *****
|
***** ChangeLog for 10.0.2 compared to 10.0.1 *****
|
||||||
|
|||||||
@ -26,15 +26,13 @@
|
|||||||
"require" : {
|
"require" : {
|
||||||
"php" : ">=5.3.0",
|
"php" : ">=5.3.0",
|
||||||
"ext-curl" : "*",
|
"ext-curl" : "*",
|
||||||
"ccampbell/chromephp" : "4.1.0",
|
"ckeditor/ckeditor" : "4.12.1",
|
||||||
"ckeditor/ckeditor" : "4.6.2",
|
|
||||||
"mike42/escpos-php" : "1.2.1",
|
"mike42/escpos-php" : "1.2.1",
|
||||||
"mobiledetect/mobiledetectlib" : "2.8.17",
|
"mobiledetect/mobiledetectlib" : "2.8.33",
|
||||||
"phpoffice/phpexcel" : "1.8.1",
|
"phpoffice/phpexcel" : "1.8.1",
|
||||||
"restler/framework" : "3.0.0-RC6",
|
"restler/framework" : "3.0.0-RC6",
|
||||||
"tecnickcom/tcpdf" : "^6.2",
|
"tecnickcom/tcpdf" : "^6.2",
|
||||||
"atgp/factur-x" : "^1.0",
|
"luracast/restler" : "^3.0"
|
||||||
"luracast/restler": "^3.0"
|
|
||||||
},
|
},
|
||||||
"require-dev" : {
|
"require-dev" : {
|
||||||
"jakub-onderka/php-parallel-lint" : "^0",
|
"jakub-onderka/php-parallel-lint" : "^0",
|
||||||
@ -59,4 +57,4 @@
|
|||||||
"ext-xml" : "Excel support",
|
"ext-xml" : "Excel support",
|
||||||
"firephp/firephp-core" : "Logging to Firebug console support"
|
"firephp/firephp-core" : "Logging to Firebug console support"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
665
composer.lock
generated
@ -67,7 +67,7 @@ define('QR_FIND_FROM_RANDOM', false);
|
|||||||
zapfdingbats.php (for special chars like form checkboxes)
|
zapfdingbats.php (for special chars like form checkboxes)
|
||||||
|
|
||||||
* Optionnaly, made freemono the default monotype font if we removed courier
|
* Optionnaly, made freemono the default monotype font if we removed courier
|
||||||
In htdocs/includes/tcpdf/tcpdf.php
|
In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
||||||
- protected $default_monospaced_font = 'courier';
|
- protected $default_monospaced_font = 'courier';
|
||||||
+ protected $default_monospaced_font = 'freemono';
|
+ protected $default_monospaced_font = 'freemono';
|
||||||
|
|
||||||
@ -137,20 +137,7 @@ with:
|
|||||||
|
|
||||||
RESTLER:
|
RESTLER:
|
||||||
--------
|
--------
|
||||||
|
Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
|
||||||
* Add 2 lines into file AutoLoader.php to complete function
|
|
||||||
private function alias($className, $currentClass)
|
|
||||||
{
|
|
||||||
...
|
|
||||||
to get
|
|
||||||
|
|
||||||
private function alias($className, $currentClass)
|
|
||||||
{
|
|
||||||
if ($className == 'Luracast\Restler\string') return;
|
|
||||||
if ($className == 'Luracast\Restler\mixed') return;
|
|
||||||
...
|
|
||||||
|
|
||||||
Change also content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
|
|
||||||
|
|
||||||
+With swagger 2:
|
+With swagger 2:
|
||||||
|
|
||||||
|
|||||||
BIN
dev/initdemo/documents_demo/adherent/1/photos/person5.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
BIN
dev/initdemo/documents_demo/adherent/2/photos/pierrecurie.jpg
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
BIN
dev/initdemo/documents_demo/adherent/3/photos/person9.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
BIN
dev/initdemo/documents_demo/adherent/4/photos/person2.jpeg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
@ -2,10 +2,14 @@
|
|||||||
|
|
||||||
namespace Dolibarr;
|
namespace Dolibarr;
|
||||||
|
|
||||||
|
|
||||||
global $globalaaa;
|
global $globalaaa;
|
||||||
$globalaaa = 'globalaaa';
|
$globalaaa = 'globalaaa';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* faaa
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function faaa()
|
function faaa()
|
||||||
{
|
{
|
||||||
return 'faaa';
|
return 'faaa';
|
||||||
@ -15,9 +19,12 @@ class Aaa
|
|||||||
{
|
{
|
||||||
const AAA='aaa';
|
const AAA='aaa';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* do
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function do()
|
public function do()
|
||||||
{
|
{
|
||||||
echo 'doaaa'."\n";
|
echo 'doaaa'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
global $globalbbb;
|
global $globalbbb;
|
||||||
$globalbbb = 'globalbbb';
|
$globalbbb = 'globalbbb';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fbbb
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function fbbb()
|
function fbbb()
|
||||||
{
|
{
|
||||||
return 'fbbb';
|
return 'fbbb';
|
||||||
@ -14,6 +15,11 @@ function fbbb()
|
|||||||
class Bbb
|
class Bbb
|
||||||
{
|
{
|
||||||
const BBB='bbb';
|
const BBB='bbb';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* do
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function do()
|
public function do()
|
||||||
{
|
{
|
||||||
global $globalaaa, $globalbbb;
|
global $globalaaa, $globalbbb;
|
||||||
@ -22,4 +28,3 @@ class Bbb
|
|||||||
$globalbbb.='+bbb';
|
$globalbbb.='+bbb';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,4 +4,4 @@
|
|||||||
var_dump('class='.$class_name);
|
var_dump('class='.$class_name);
|
||||||
require $class_name;
|
require $class_name;
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -68,7 +68,9 @@
|
|||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
|
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod">
|
||||||
|
<severity>0</severity>
|
||||||
|
</rule>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<rule ref="Generic.Commenting.Todo" />
|
<rule ref="Generic.Commenting.Todo" />
|
||||||
|
|||||||
@ -17,14 +17,14 @@ fi
|
|||||||
# To detec
|
# To detec
|
||||||
if [ "x$1" = "xlist" ]
|
if [ "x$1" = "xlist" ]
|
||||||
then
|
then
|
||||||
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep CRLF
|
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep CRLF
|
||||||
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'htdocs\/includes' | grep CRLF
|
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep -v 'htdocs\/includes' | grep CRLF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# To convert
|
# To convert
|
||||||
if [ "x$1" = "xfix" ]
|
if [ "x$1" = "xfix" ]
|
||||||
then
|
then
|
||||||
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep CRLF | awk -F':' '{ print $1 }' `
|
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep CRLF | awk -F':' '{ print $1 }' `
|
||||||
do
|
do
|
||||||
echo "Fix file $fic"
|
echo "Fix file $fic"
|
||||||
dos2unix "$fic"
|
dos2unix "$fic"
|
||||||
|
|||||||
@ -36,6 +36,7 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
|
$massaction = GETPOST('massaction', 'aZ09');
|
||||||
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'accountingaccountlist'; // To manage different context of search
|
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'accountingaccountlist'; // To manage different context of search
|
||||||
|
|
||||||
$search_account = GETPOST('search_account', 'alpha');
|
$search_account = GETPOST('search_account', 'alpha');
|
||||||
@ -100,7 +101,7 @@ if (empty($reshook))
|
|||||||
$search_array_options=array();
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('change_chart', 'alpha'))
|
if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax)))
|
||||||
{
|
{
|
||||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||||
|
|
||||||
@ -236,6 +237,24 @@ if ($resql)
|
|||||||
if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
|
||||||
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print '<!-- Add javascript to update a flag when we select "Change plan" -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function () {
|
||||||
|
$("#searchFormList").on("submit", function (e) {
|
||||||
|
console.log("chartofaccounts focus = "+$("#chartofaccounts").is(":focus"));
|
||||||
|
console.log("change_chart focus = "+$("#change_chart").is(":focus"));
|
||||||
|
if ($("#change_chart").is(":focus"))
|
||||||
|
{
|
||||||
|
console.log("We set valid_change_chart to 1");
|
||||||
|
$("#valid_change_chart").val(1);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
@ -278,7 +297,8 @@ if ($resql)
|
|||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
print "</select>";
|
print "</select>";
|
||||||
print ajax_combobox("chartofaccounts");
|
print ajax_combobox("chartofaccounts");
|
||||||
print '<input type="submit" class="button" name="change_chart" tabindex="-1" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
print '<input type="submit" class="button" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||||
|
print '<input type="hidden" name="valid_change_chart" id="valid_change_chart" value="0">';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -286,6 +306,9 @@ if ($resql)
|
|||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
|
$moreforfilter = '';
|
||||||
|
$massactionbutton = '';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -132,12 +132,15 @@ if ($action == 'update') {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title = $langs->trans('ConfigAccountingExpert');
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
|
|
||||||
|
$linkback='';
|
||||||
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy');
|
||||||
|
|
||||||
|
|
||||||
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
||||||
|
|||||||
@ -82,7 +82,6 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TO DO Mutualize code for yes/no constants
|
|
||||||
if ($action == 'setlistsorttodo') {
|
if ($action == 'setlistsorttodo') {
|
||||||
$setlistsorttodo = GETPOST('value', 'int');
|
$setlistsorttodo = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
||||||
@ -160,12 +159,12 @@ if ($action == 'setenablesubsidiarylist') {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
$title= $langs->trans('ConfigAccountingExpert');
|
||||||
|
llxHeader('', $title);
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
|
$linkback='';
|
||||||
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy');
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
@ -212,7 +211,7 @@ if (! empty($user->admin))
|
|||||||
{
|
{
|
||||||
// TO DO Mutualize code for yes/no constants
|
// TO DO Mutualize code for yes/no constants
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
|
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
@ -224,7 +223,7 @@ if (! empty($user->admin))
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
|
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
|
||||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
|
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
|
||||||
@ -237,7 +236,7 @@ if (! empty($user->admin))
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . '</td>';
|
print '<td>' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . '</td>';
|
||||||
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
|
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
|
||||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
|
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
|
||||||
@ -250,7 +249,7 @@ if (! empty($user->admin))
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||||
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
||||||
@ -263,7 +262,7 @@ if (! empty($user->admin))
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . '</td>';
|
print '<td>' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . '</td>';
|
||||||
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=0">';
|
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=0">';
|
||||||
@ -276,7 +275,7 @@ if (! empty($user->admin))
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
||||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
|
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
|
||||||
|
|||||||
@ -265,7 +265,7 @@ if ($action != 'export_csv')
|
|||||||
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
||||||
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
||||||
if (empty($description)) {
|
if (empty($description)) {
|
||||||
$link = '<a href="../admin/card.php?action=create&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -279,8 +279,8 @@ if ($action != 'export_csv')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche le compte comptable en debut de ligne
|
// Show first line of a break
|
||||||
print "<tr>";
|
print '<tr class="trforbreak">';
|
||||||
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '</td>';
|
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -439,7 +439,7 @@ if ($action == 'create')
|
|||||||
print $langs->trans('Docdate');
|
print $langs->trans('Docdate');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editdate')
|
if ($action != 'editdate')
|
||||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate&piece_num='. $object->piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&piece_num='. $object->piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'editdate') {
|
if ($action == 'editdate') {
|
||||||
@ -463,7 +463,7 @@ if ($action == 'create')
|
|||||||
print $langs->trans('Codejournal');
|
print $langs->trans('Codejournal');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editjournal')
|
if ($action != 'editjournal')
|
||||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editjournal&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editjournal') {
|
if ($action == 'editjournal') {
|
||||||
@ -487,7 +487,7 @@ if ($action == 'create')
|
|||||||
print $langs->trans('Piece');
|
print $langs->trans('Piece');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editdocref')
|
if ($action != 'editdocref')
|
||||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdocref&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editdocref') {
|
if ($action == 'editdocref') {
|
||||||
|
|||||||
@ -235,7 +235,7 @@ class AccountingJournal extends CommonObject
|
|||||||
{
|
{
|
||||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
{
|
{
|
||||||
$label=$langs->trans("ShowAccoutingJournal");
|
$label=$langs->trans("ShowAccountingJournal");
|
||||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
}
|
}
|
||||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
|||||||
@ -406,7 +406,7 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a link to the object card (with optionaly the picto)
|
* Return a link to the object card (with optionally the picto)
|
||||||
*
|
*
|
||||||
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
|
* @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 ('nolink', ...)
|
* @param string $option On what the link point to ('nolink', ...)
|
||||||
@ -1309,7 +1309,7 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete bookkepping by importkey
|
* Delete bookkeeping by importkey
|
||||||
*
|
*
|
||||||
* @param string $importkey Import key
|
* @param string $importkey Import key
|
||||||
* @return int Result
|
* @return int Result
|
||||||
@ -1337,7 +1337,7 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete bookkepping by year
|
* Delete bookkeeping by year
|
||||||
*
|
*
|
||||||
* @param string $delyear Year to delete
|
* @param string $delyear Year to delete
|
||||||
* @param string $journal Journal to delete
|
* @param string $journal Journal to delete
|
||||||
@ -1379,7 +1379,7 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete bookkepping by piece number
|
* Delete bookkeeping by piece number
|
||||||
*
|
*
|
||||||
* @param int $piecenum Piecenum to delete
|
* @param int $piecenum Piecenum to delete
|
||||||
* @return int Result
|
* @return int Result
|
||||||
@ -1624,12 +1624,12 @@ class BookKeeping extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Export bookkeping
|
* Export bookkeeping
|
||||||
*
|
*
|
||||||
* @param string $model Model
|
* @param string $model Model
|
||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
public function export_bookkeping($model = 'ebp')
|
public function export_bookkeeping($model = 'ebp')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -1641,7 +1641,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE entity IN (" . getEntity('accountancy') . ")";
|
$sql .= " WHERE entity IN (" . getEntity('accountancy') . ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
|
dol_syslog(get_class($this) . "::export_bookkeeping", LOG_DEBUG);
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
@ -1679,7 +1679,7 @@ class BookKeeping extends CommonObject
|
|||||||
return $num;
|
return $num;
|
||||||
} else {
|
} else {
|
||||||
$this->error = "Error " . $this->db->lasterror();
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
dol_syslog(get_class($this) . "::export_bookkeping " . $this->error, LOG_ERR);
|
dol_syslog(get_class($this) . "::export_bookkeeping " . $this->error, LOG_ERR);
|
||||||
return - 1;
|
return - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -413,7 +413,6 @@ if ($result) {
|
|||||||
|
|
||||||
$objp->code_sell_l = '';
|
$objp->code_sell_l = '';
|
||||||
$objp->code_sell_p = '';
|
$objp->code_sell_p = '';
|
||||||
$objp->aarowid_suggest = '';
|
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
@ -425,7 +424,7 @@ if ($result) {
|
|||||||
$facture_static->type = $objp->ftype;
|
$facture_static->type = $objp->ftype;
|
||||||
|
|
||||||
$code_sell_p_notset = '';
|
$code_sell_p_notset = '';
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
$objp->aarowid_suggest = ''; // Will be set later
|
||||||
|
|
||||||
$isBuyerInEEC = isInEEC($objp);
|
$isBuyerInEEC = isInEEC($objp);
|
||||||
|
|
||||||
@ -459,8 +458,9 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
if ($objp->code_sell_l == -1) $objp->code_sell_l='';
|
if ($objp->code_sell_l == -1) $objp->code_sell_l='';
|
||||||
|
|
||||||
|
// Search suggested account for product/service
|
||||||
$suggestedaccountingaccountfor = '';
|
$suggestedaccountingaccountfor = '';
|
||||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
$objp->code_sell_p = $objp->code_sell;
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
$objp->aarowid_suggest = $objp->aarowid;
|
||||||
$suggestedaccountingaccountfor = '';
|
$suggestedaccountingaccountfor = '';
|
||||||
@ -549,12 +549,19 @@ if ($result) {
|
|||||||
|
|
||||||
// Suggested accounting account
|
// Suggested accounting account
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
$suggestedid = $objp->aarowid_suggest;
|
||||||
|
if (empty($suggestedid) && empty($objp->code_sell_p) && ! empty($objp->code_sell_l) && ! empty($conf->global->ACCOUNTANCY_AUTOFILL_ACCOUNT_WITH_GENERIC))
|
||||||
|
{
|
||||||
|
//$suggestedid = // id of $objp->code_sell_l
|
||||||
|
}
|
||||||
|
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Column with checkbox
|
// Column with checkbox
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
//var_dump($objp->aarowid);var_dump($objp->aarowid_intra);var_dump($objp->aarowid_export);var_dump($objp->aarowid_suggest);
|
||||||
|
$ischecked = $objp->aarowid_suggest;
|
||||||
|
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($ischecked ? "checked" : "") . '/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -26,6 +26,7 @@
|
|||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
|
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
|
||||||
@ -41,8 +42,17 @@ $hookmanager->initHooks(array('accountancyindex'));
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// None
|
if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax disabled)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||||
|
$zone=GETPOST('areacode', 'aZ09');
|
||||||
|
$userid=GETPOST('userid', 'int');
|
||||||
|
$boxorder=GETPOST('boxorder', 'aZ09');
|
||||||
|
$boxorder.=GETPOST('boxcombo', 'aZ09');
|
||||||
|
|
||||||
|
$result=InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
|
||||||
|
if ($result > 0) setEventMessages($langs->trans("BoxAdded"), null);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -50,14 +60,39 @@ $hookmanager->initHooks(array('accountancyindex'));
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("AccountancyArea"));
|
llxHeader('', $langs->trans("AccountancyArea"));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
|
|
||||||
//dol_fiche_head();
|
|
||||||
|
|
||||||
$step = 0;
|
|
||||||
|
|
||||||
if ($conf->accounting->enabled)
|
if ($conf->accounting->enabled)
|
||||||
{
|
{
|
||||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
$step = 0;
|
||||||
|
|
||||||
|
$resultboxes=FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
||||||
|
|
||||||
|
$helpisexpanded = empty($resultboxes['boxactivated']); // If there is no widget, the tooltip help is expanded by default.
|
||||||
|
$showtutorial = '';
|
||||||
|
|
||||||
|
if (! $helpisexpanded)
|
||||||
|
{
|
||||||
|
$showtutorial = '<div align="right"><a href="#" id="show_hide">';
|
||||||
|
$showtutorial .= img_picto('', 'chevron-down');
|
||||||
|
$showtutorial .= ' ' . $langs->trans("ShowTutorial");
|
||||||
|
$showtutorial .= '</a></div>';
|
||||||
|
|
||||||
|
$showtutorial .= '<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery("#show_hide").click(function () {
|
||||||
|
jQuery( "#idfaq" ).toggle({
|
||||||
|
duration: 400,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("AccountancyArea"), $showtutorial . $resultboxes['selectboxlist'], 'accountancy');
|
||||||
|
|
||||||
|
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||||
|
print "<br>\n";
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||||
print "<br>\n";print "<br>\n";
|
print "<br>\n";print "<br>\n";
|
||||||
|
|
||||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||||
@ -172,12 +207,51 @@ if ($conf->accounting->enabled)
|
|||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
|
print '<div class="fichecenter fichecenterbis">';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Show boxes
|
||||||
|
*/
|
||||||
|
$boxlist.='<div class="twocolumns">';
|
||||||
|
|
||||||
|
$boxlist.='<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
||||||
|
if(!empty($nbworkboardcount))
|
||||||
|
{
|
||||||
|
$boxlist.=$boxwork;
|
||||||
|
}
|
||||||
|
|
||||||
|
$boxlist.=$resultboxes['boxlista'];
|
||||||
|
|
||||||
|
$boxlist.= '</div>';
|
||||||
|
|
||||||
|
$boxlist.= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
|
||||||
|
|
||||||
|
$boxlist.=$boxstat;
|
||||||
|
$boxlist.=$resultboxes['boxlistb'];
|
||||||
|
|
||||||
|
$boxlist.= '</div>';
|
||||||
|
$boxlist.= "\n";
|
||||||
|
|
||||||
|
$boxlist.='</div>';
|
||||||
|
|
||||||
|
|
||||||
|
print $boxlist;
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
|
||||||
|
|
||||||
print $langs->trans("Module10Desc")."<br>\n";
|
print $langs->trans("Module10Desc")."<br>\n";
|
||||||
}
|
}
|
||||||
//dol_fiche_end();
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -192,12 +192,12 @@ if ($search_lineid) {
|
|||||||
if (strlen(trim($search_invoice))) {
|
if (strlen(trim($search_invoice))) {
|
||||||
$sql .= natural_search("f.ref", $search_invoice);
|
$sql .= natural_search("f.ref", $search_invoice);
|
||||||
}
|
}
|
||||||
|
if (strlen(trim($search_label))) {
|
||||||
|
$sql .= natural_search("f.libelle", $search_label);
|
||||||
|
}
|
||||||
if (strlen(trim($search_ref))) {
|
if (strlen(trim($search_ref))) {
|
||||||
$sql .= natural_search("p.ref", $search_ref);
|
$sql .= natural_search("p.ref", $search_ref);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) {
|
|
||||||
$sql .= natural_search("p.label", $search_label);
|
|
||||||
}
|
|
||||||
if (strlen(trim($search_desc))) {
|
if (strlen(trim($search_desc))) {
|
||||||
$sql .= natural_search("l.description", $search_desc);
|
$sql .= natural_search("l.description", $search_desc);
|
||||||
}
|
}
|
||||||
@ -300,14 +300,13 @@ if ($result) {
|
|||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre center nowraponall">';
|
print '<td class="liste_titre center nowraponall">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||||
$formother->select_year($search_year, 'search_year', 1, 20, 5);
|
$formother->select_year($search_year, 'search_year', 1, 20, 5);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
|
|||||||
@ -234,12 +234,12 @@ if ($search_lineid) {
|
|||||||
if (strlen(trim($search_invoice))) {
|
if (strlen(trim($search_invoice))) {
|
||||||
$sql .= natural_search("f.ref", $search_invoice);
|
$sql .= natural_search("f.ref", $search_invoice);
|
||||||
}
|
}
|
||||||
|
if (strlen(trim($search_label))) {
|
||||||
|
$sql .= natural_search("f.libelle", $search_label);
|
||||||
|
}
|
||||||
if (strlen(trim($search_ref))) {
|
if (strlen(trim($search_ref))) {
|
||||||
$sql .= natural_search("p.ref", $search_ref);
|
$sql .= natural_search("p.ref", $search_ref);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) {
|
|
||||||
$sql .= natural_search("p.label", $search_label);
|
|
||||||
}
|
|
||||||
if (strlen(trim($search_desc))) {
|
if (strlen(trim($search_desc))) {
|
||||||
$sql .= natural_search("l.description", $search_desc);
|
$sql .= natural_search("l.description", $search_desc);
|
||||||
}
|
}
|
||||||
@ -317,6 +317,7 @@ if ($result) {
|
|||||||
if ($search_year) $param.='&search_year='.urlencode($search_year);
|
if ($search_year) $param.='&search_year='.urlencode($search_year);
|
||||||
if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice);
|
if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice);
|
||||||
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
|
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
|
||||||
|
if ($search_label) $param.='&search_label='.urlencode($search_label);
|
||||||
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
|
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
|
||||||
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
|
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
|
||||||
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
|
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
|
||||||
@ -362,14 +363,13 @@ if ($result) {
|
|||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||||
print '<td class="liste_titre center nowraponall">';
|
print '<td class="liste_titre center nowraponall">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||||
$formother->select_year($search_year, 'search_year', 1, 20, 5);
|
$formother->select_year($search_year, 'search_year', 1, 20, 5);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||||
@ -521,12 +521,14 @@ if ($result) {
|
|||||||
|
|
||||||
// Suggested accounting account
|
// Suggested accounting account
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
$suggestedid = $objp->aarowid_suggest;
|
||||||
|
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Column with checkbox
|
// Column with checkbox
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
$ischecked = $objp->aarowid_suggest;
|
||||||
|
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($ischecked ? "checked" : "") . '/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -225,7 +225,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
|
|||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
||||||
print img_picto('', 'object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
|
print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').':<br>';
|
||||||
if ($conf->multicompany->enabled) {
|
if ($conf->multicompany->enabled) {
|
||||||
$entity_qr='?entity='.$conf->entity;
|
$entity_qr='?entity='.$conf->entity;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $object = new Adherent($db);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$object->getCanvas($id);
|
$object->getCanvas($id);
|
||||||
@ -320,7 +320,7 @@ if (empty($reshook))
|
|||||||
$object->public = GETPOST("public", 'alpha');
|
$object->public = GETPOST("public", 'alpha');
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
// Check if we need to also synchronize user information
|
// Check if we need to also synchronize user information
|
||||||
@ -497,7 +497,7 @@ if (empty($reshook))
|
|||||||
$object->public = $public;
|
$object->public = $public;
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
@ -866,10 +866,22 @@ else
|
|||||||
$object->country_code=$tmparray['code'];
|
$object->country_code=$tmparray['code'];
|
||||||
$object->country=$tmparray['label'];
|
$object->country=$tmparray['label'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($socid)) {
|
||||||
|
$object = new Societe($db);
|
||||||
|
if ($socid > 0) $object->fetch($socid);
|
||||||
|
|
||||||
|
if (! ($object->id > 0))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print($langs->trans('ErrorRecordNotFound'));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$adht = new AdherentType($db);
|
$adht = new AdherentType($db);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewMember"));
|
print load_fiche_titre($langs->trans("NewMember"), '', 'members');
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -905,6 +917,7 @@ else
|
|||||||
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
|
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
|
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
|
||||||
|
|
||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
@ -1362,15 +1375,8 @@ else
|
|||||||
else print $langs->trans("NoDolibarrAccess");
|
else print $langs->trans("NoDolibarrAccess");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||||
//Hooks here
|
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
||||||
print $hookmanager->resPrint;
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -1672,11 +1678,15 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! $adht->subscription)
|
if ($object->need_subscription == 0)
|
||||||
|
{
|
||||||
|
print $langs->trans("SubscriptionNotNeeded");
|
||||||
|
}
|
||||||
|
elseif (! $adht->subscription)
|
||||||
{
|
{
|
||||||
print $langs->trans("SubscriptionNotRecorded");
|
print $langs->trans("SubscriptionNotRecorded");
|
||||||
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
|
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("SubscriptionNotReceived");
|
print $langs->trans("SubscriptionNotReceived");
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $object=new Adherent($db);
|
|||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -248,7 +248,7 @@ $form=new Form($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("MembersCards"));
|
llxHeader('', $langs->trans("MembersCards"));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("LinkToGeneratedPages"));
|
print load_fiche_titre($langs->trans("LinkToGeneratedPages"), '', 'members');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("LinkToGeneratedPagesDesc").'</span><br>';
|
print '<span class="opacitymedium">'.$langs->trans("LinkToGeneratedPagesDesc").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -581,6 +581,7 @@ class Adherent extends CommonObject
|
|||||||
$sql.= ", fk_adherent_type = ".$this->db->escape($this->typeid);
|
$sql.= ", fk_adherent_type = ".$this->db->escape($this->typeid);
|
||||||
$sql.= ", morphy = '".$this->db->escape($this->morphy)."'";
|
$sql.= ", morphy = '".$this->db->escape($this->morphy)."'";
|
||||||
$sql.= ", birth = ".($this->birth?"'".$this->db->idate($this->birth)."'":"null");
|
$sql.= ", birth = ".($this->birth?"'".$this->db->idate($this->birth)."'":"null");
|
||||||
|
if ($this->socid) $sql.= ", fk_soc = '".$this->db->escape($this->socid)."'"; // Must be modified only when creating from a third-party
|
||||||
if ($this->datefin) $sql.= ", datefin = '".$this->db->idate($this->datefin)."'"; // Must be modified only when deleting a subscription
|
if ($this->datefin) $sql.= ", datefin = '".$this->db->idate($this->datefin)."'"; // Must be modified only when deleting a subscription
|
||||||
if ($this->datevalid) $sql.= ", datevalid = '".$this->db->idate($this->datevalid)."'"; // Must be modified only when validating a member
|
if ($this->datevalid) $sql.= ", datevalid = '".$this->db->idate($this->datevalid)."'"; // Must be modified only when validating a member
|
||||||
$sql.= ", fk_user_mod = ".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest
|
$sql.= ", fk_user_mod = ".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest
|
||||||
@ -2178,7 +2179,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
||||||
|
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
||||||
else return $langs->trans("MemberStatusPaid");
|
else return $langs->trans("MemberStatusPaid");
|
||||||
}
|
}
|
||||||
@ -2188,7 +2190,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
||||||
|
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
||||||
else return $langs->trans("MemberStatusPaidShort");
|
else return $langs->trans("MemberStatusPaidShort");
|
||||||
}
|
}
|
||||||
@ -2198,7 +2201,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscriptionShort");
|
||||||
|
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaidShort");
|
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaidShort");
|
||||||
}
|
}
|
||||||
@ -2208,7 +2212,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
||||||
|
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
||||||
}
|
}
|
||||||
@ -2218,7 +2223,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraft");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActive");
|
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscription");
|
||||||
|
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActive");
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaid");
|
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaid");
|
||||||
}
|
}
|
||||||
@ -2228,7 +2234,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusDraftShort").'</span> '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
if ($statut == -1) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusDraftShort").'</span> '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
if ($need_subscription == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusNoSubscriptionShort").' </span>'.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
||||||
|
elseif (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
||||||
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
||||||
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
||||||
}
|
}
|
||||||
@ -2238,7 +2245,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
||||||
if ($statut >= 1) {
|
if ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription").' '.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
||||||
|
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
||||||
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
||||||
}
|
}
|
||||||
@ -2301,9 +2309,11 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT a.rowid, a.datefin, a.statut";
|
$sql = "SELECT a.rowid, a.datefin, a.statut";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||||
$sql.= " WHERE a.statut = 1";
|
$sql.= ", ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
|
$sql.= " WHERE a.fk_adherent_type = t.rowid";
|
||||||
|
$sql.= " AND a.statut = 1";
|
||||||
$sql.= " AND a.entity IN (".getEntity('adherent').")";
|
$sql.= " AND a.entity IN (".getEntity('adherent').")";
|
||||||
$sql.= " AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')";
|
$sql.= " AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND t.subscription = 1)";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -88,6 +88,8 @@ class AdherentType extends CommonObject
|
|||||||
|
|
||||||
/** @var array Array of members */
|
/** @var array Array of members */
|
||||||
public $members=array();
|
public $members=array();
|
||||||
|
|
||||||
|
public $multilangs=array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,6 +103,185 @@ class AdherentType extends CommonObject
|
|||||||
$this->statut = 1;
|
$this->statut = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load array this->multilangs
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function getMultiLangs()
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$current_lang = $langs->getDefaultLang();
|
||||||
|
|
||||||
|
$sql = "SELECT lang, label, description, email";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
|
$sql.= " WHERE fk_type=".$this->id;
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
while ($obj = $this->db->fetch_object($result))
|
||||||
|
{
|
||||||
|
//print 'lang='.$obj->lang.' current='.$current_lang.'<br>';
|
||||||
|
if ($obj->lang == $current_lang) // si on a les traduct. dans la langue courante on les charge en infos principales.
|
||||||
|
{
|
||||||
|
$this->label = $obj->label;
|
||||||
|
$this->description = $obj->description;
|
||||||
|
$this->email = $obj->email;
|
||||||
|
}
|
||||||
|
$this->multilangs["$obj->lang"]["label"] = $obj->label;
|
||||||
|
$this->multilangs["$obj->lang"]["description"] = $obj->description;
|
||||||
|
$this->multilangs["$obj->lang"]["email"] = $obj->email;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error="Error: ".$this->db->lasterror()." - ".$sql;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update or add a translation for a product
|
||||||
|
*
|
||||||
|
* @param User $user Object user making update
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function setMultiLangs($user)
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 0, 2);
|
||||||
|
$current_lang = $langs->getDefaultLang();
|
||||||
|
|
||||||
|
foreach ($langs_available as $key => $value)
|
||||||
|
{
|
||||||
|
if ($key == $current_lang) {
|
||||||
|
$sql = "SELECT rowid";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
|
$sql.= " WHERE fk_type=".$this->id;
|
||||||
|
$sql.= " AND lang='".$key."'";
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
|
if ($this->db->num_rows($result)) // if there is already a description line for this language
|
||||||
|
{
|
||||||
|
$sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
|
$sql2.= " SET ";
|
||||||
|
$sql2.= " label='".$this->db->escape($this->label)."',";
|
||||||
|
$sql2.= " description='".$this->db->escape($this->description)."'";
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", email='".$this->db->escape($this->other)."'";
|
||||||
|
}
|
||||||
|
$sql2.= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.=", email";
|
||||||
|
}
|
||||||
|
$sql2.= ")";
|
||||||
|
$sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->label)."',";
|
||||||
|
$sql2.= " '".$this->db->escape($this->description)."'";
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", '".$this->db->escape($this->other)."'";
|
||||||
|
}
|
||||||
|
$sql2.= ")";
|
||||||
|
}
|
||||||
|
dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key);
|
||||||
|
if (! $this->db->query($sql2)) {
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($this->multilangs[$key])) {
|
||||||
|
$sql = "SELECT rowid";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
|
$sql.= " WHERE fk_type=".$this->id;
|
||||||
|
$sql.= " AND lang='".$key."'";
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
|
if ($this->db->num_rows($result)) // if there is already a description line for this language
|
||||||
|
{
|
||||||
|
$sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
|
$sql2.= " SET ";
|
||||||
|
$sql2.= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||||
|
$sql2.= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", email='".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
||||||
|
}
|
||||||
|
$sql2.= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.=", email";
|
||||||
|
}
|
||||||
|
$sql2.= ")";
|
||||||
|
$sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||||
|
$sql2.= " '".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
||||||
|
}
|
||||||
|
$sql2.= ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
// We do not save if main fields are empty
|
||||||
|
if ($this->multilangs["$key"]["label"] || $this->multilangs["$key"]["description"]) {
|
||||||
|
if (! $this->db->query($sql2)) {
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// language is not current language and we didn't provide a multilang description for this language
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call trigger
|
||||||
|
$result = $this->call_trigger('MEMBER_TYPE_SET_MULTILANGS', $user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a language for this product
|
||||||
|
*
|
||||||
|
* @param string $langtodelete Language code to delete
|
||||||
|
* @param User $user Object user making delete
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function delMultiLangs($langtodelete, $user)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
|
$sql.= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($langtodelete)."'";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this).'::delMultiLangs', LOG_DEBUG);
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
// Call trigger
|
||||||
|
$result = $this->call_trigger('ADHERENT_TYPE_DEL_MULTILANGS', $user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction qui permet de creer le status de l'adherent
|
* Fonction qui permet de creer le status de l'adherent
|
||||||
@ -111,7 +292,7 @@ class AdherentType extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@ -180,7 +361,7 @@ class AdherentType extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function update($user, $notrigger = 0)
|
public function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $hookmanager;
|
global $langs, $conf, $hookmanager;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@ -202,6 +383,17 @@ class AdherentType extends CommonObject
|
|||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$this->description = $this->db->escape($this->note);
|
||||||
|
|
||||||
|
// Multilangs
|
||||||
|
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||||
|
if ($this->setMultiLangs($user) < 0) {
|
||||||
|
$this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql;
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
@ -283,6 +475,8 @@ class AdherentType extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function fetch($rowid)
|
public function fetch($rowid)
|
||||||
{
|
{
|
||||||
|
global $langs, $conf;
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||||
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
||||||
@ -299,12 +493,17 @@ class AdherentType extends CommonObject
|
|||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->ref = $obj->rowid;
|
$this->ref = $obj->rowid;
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
$this->morphy = $obj->morphy;
|
$this->morphy = $obj->morphy;
|
||||||
$this->statut = $obj->statut;
|
$this->statut = $obj->statut;
|
||||||
$this->subscription = $obj->subscription;
|
$this->subscription = $obj->subscription;
|
||||||
$this->mail_valid = $obj->mail_valid;
|
$this->mail_valid = $obj->mail_valid;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note;
|
||||||
$this->vote = $obj->vote;
|
$this->vote = $obj->vote;
|
||||||
|
|
||||||
|
// multilangs
|
||||||
|
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||||
|
$this->getMultiLangs();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -104,8 +104,7 @@ $now=dol_now();
|
|||||||
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||||
//$sql.= " AND d.statut = 1 AND ((t.subscription = 0 AND d.datefin IS NULL) OR d.datefin >= '".$db->idate($now)."')";
|
$sql.= " AND d.statut = 1 AND (d.datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
||||||
$sql.= " AND d.statut = 1 AND d.datefin >= '".$db->idate($now)."'";
|
|
||||||
$sql.= " AND t.rowid = d.fk_adherent_type";
|
$sql.= " AND t.rowid = d.fk_adherent_type";
|
||||||
$sql.= " GROUP BY d.fk_adherent_type";
|
$sql.= " GROUP BY d.fk_adherent_type";
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ $massaction=GETPOST('massaction', 'alpha');
|
|||||||
$show_files=GETPOST('show_files', 'int');
|
$show_files=GETPOST('show_files', 'int');
|
||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'memberslist'; // To manage different context of search
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result=restrictedArea($user, 'adherent');
|
$result=restrictedArea($user, 'adherent');
|
||||||
@ -88,7 +89,7 @@ $hookmanager->initHooks(array('memberlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -293,8 +294,8 @@ if ($search_town) $sql.= natural_search("d.town", $search_town);
|
|||||||
if ($search_zip) $sql.= natural_search("d.zip", $search_zip);
|
if ($search_zip) $sql.= natural_search("d.zip", $search_zip);
|
||||||
if ($search_state) $sql.= natural_search("state.nom", $search_state);
|
if ($search_state) $sql.= natural_search("state.nom", $search_state);
|
||||||
if ($search_country) $sql .= " AND d.country IN (".$search_country.')';
|
if ($search_country) $sql .= " AND d.country IN (".$search_country.')';
|
||||||
if ($filter == 'uptodate') $sql.=" AND datefin >= '".$db->idate($now)."'";
|
if ($filter == 'uptodate') $sql.=" AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
||||||
if ($filter == 'outofdate') $sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
|
if ($filter == 'outofdate') $sql.=" AND ((datefin IS NULL OR datefin < '".$db->idate($now)."') AND t.subscription = 1)";
|
||||||
|
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
@ -419,7 +420,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="member";
|
$modelmail="member";
|
||||||
|
|||||||
@ -56,9 +56,10 @@ $langs->loadLangs(array("companies","members"));
|
|||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
llxHeader();
|
$title = $langs->trans("SubscriptionsStatistics");
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("SubscriptionsStatistics"), $mesg);
|
print load_fiche_titre($title, '', 'members');
|
||||||
|
|
||||||
$dir=$conf->adherent->dir_temp;
|
$dir=$conf->adherent->dir_temp;
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
$adht = new AdherentType($db);
|
$adht = new AdherentType($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$errmsg='';
|
$errmsg='';
|
||||||
$errmsgs=array();
|
$errmsgs=array();
|
||||||
@ -571,7 +571,7 @@ if ($rowid > 0)
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="2" class="valeur">';
|
print '</td><td colspan="2" class="valeur">';
|
||||||
if ($action == 'editthirdparty')
|
if ($action == 'editthirdparty')
|
||||||
@ -614,7 +614,7 @@ if ($rowid > 0)
|
|||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($user->rights->user->user->creer)
|
if ($user->rights->user->user->creer)
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $hookmanager->initHooks(array('subscriptionlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="subscription";
|
$modelmail="subscription";
|
||||||
|
|||||||
@ -73,7 +73,7 @@ $object = new AdherentType($db);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
|
|||||||
$object->vote = (int) $vote;
|
$object->vote = (int) $vote;
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (empty($object->label)) {
|
if (empty($object->label)) {
|
||||||
@ -168,7 +168,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
|||||||
$object->vote = (boolean) trim($vote);
|
$object->vote = (boolean) trim($vote);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
$ret=$object->update($user);
|
$ret=$object->update($user);
|
||||||
@ -248,7 +248,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewMemberType"));
|
print load_fiche_titre($langs->trans("NewMemberType"), '', 'members');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -524,14 +524,14 @@ if ($rowid > 0)
|
|||||||
{
|
{
|
||||||
$sql.= natural_search("d.email", $search_email);
|
$sql.= natural_search("d.email", $search_email);
|
||||||
}
|
}
|
||||||
if ($filter == 'uptodate')
|
if ($filter == 'uptodate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin >= '".$db->idate($now)."'";
|
$sql.=" AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)";
|
||||||
}
|
}
|
||||||
if ($filter == 'outofdate')
|
if ($filter == 'outofdate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
$sql.=" AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql.= " ".$db->order($sortfield, $sortorder);
|
$sql.= " ".$db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
@ -713,7 +713,7 @@ if ($rowid > 0)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($user->rights->adherent->creer)
|
if ($user->rights->adherent->creer)
|
||||||
{
|
{
|
||||||
print '<a href="card.php?rowid='.$objp->rowid.'&action=edit&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
print '<a class="editfielda" href="card.php?rowid='.$objp->rowid.'&action=edit&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||||
}
|
}
|
||||||
print ' ';
|
print ' ';
|
||||||
if ($user->rights->adherent->supprimer)
|
if ($user->rights->adherent->supprimer)
|
||||||
|
|||||||
323
htdocs/adherents/type_translation.php
Normal file
@ -0,0 +1,323 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
|
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2014 Henry Florian <florian.henry@open-concept.pro>
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/adherents/type_translation.php
|
||||||
|
* \ingroup product
|
||||||
|
* \brief Page de traduction des produits
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array('members', 'languages'));
|
||||||
|
|
||||||
|
$id = GETPOST('rowid', 'int');
|
||||||
|
$action=GETPOST('action', 'alpha');
|
||||||
|
$cancel=GETPOST('cancel', 'alpha');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||||
|
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
// Security check
|
||||||
|
$result=restrictedArea($user, 'adherent', $id, 'adherent_type');
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
// retour a l'affichage des traduction si annulation
|
||||||
|
if ($cancel == $langs->trans("Cancel"))
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'delete' && GETPOST('langtodelete', 'alpha'))
|
||||||
|
{
|
||||||
|
$object = new AdherentType($db);
|
||||||
|
$object->fetch($id);
|
||||||
|
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add translation
|
||||||
|
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->adherent->configurer)
|
||||||
|
{
|
||||||
|
$object = new AdherentType($db);
|
||||||
|
$object->fetch($id);
|
||||||
|
$current_lang = $langs->getDefaultLang();
|
||||||
|
|
||||||
|
// update de l'objet
|
||||||
|
if ( $_POST["forcelangprod"] == $current_lang )
|
||||||
|
{
|
||||||
|
$object->label = $_POST["libelle"];
|
||||||
|
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
||||||
|
$object->other = dol_htmlcleanlastbr($_POST["other"]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
|
||||||
|
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
||||||
|
$object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// sauvegarde en base
|
||||||
|
if ( $object->setMultiLangs($user) > 0 )
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$action = 'add';
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit translation
|
||||||
|
if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->adherent->configurer)
|
||||||
|
{
|
||||||
|
$object = new AdherentType($db);
|
||||||
|
$object->fetch($id);
|
||||||
|
$current_lang = $langs->getDefaultLang();
|
||||||
|
|
||||||
|
foreach ($object->multilangs as $key => $value) // enregistrement des nouvelles valeurs dans l'objet
|
||||||
|
{
|
||||||
|
if ( $key == $current_lang )
|
||||||
|
{
|
||||||
|
$object->label = $_POST["libelle-".$key];
|
||||||
|
$object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||||
|
$object->other = dol_htmlcleanlastbr($_POST["other-".$key]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->multilangs[$key]["label"] = $_POST["libelle-".$key];
|
||||||
|
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||||
|
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $object->setMultiLangs($user) > 0 )
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$action = 'edit';
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete translation
|
||||||
|
if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && $user->rights->adherent->configurer)
|
||||||
|
{
|
||||||
|
$object = new AdherentType($db);
|
||||||
|
$object->fetch($id);
|
||||||
|
$langtodelete=GETPOST('langdel', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
|
if ( $object->delMultiLangs($langtodelete, $user) > 0 )
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$action = 'edit';
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$object = new AdherentType($db);
|
||||||
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$title = $langs->trans('MemberTypeCard');
|
||||||
|
$helpurl = '';
|
||||||
|
$shortlabel = dol_trunc($object->label, 16);
|
||||||
|
|
||||||
|
$title = $langs->trans('MemberType')." ". $shortlabel ." - ".$langs->trans('Translation');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
|
||||||
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
$formadmin=new FormAdmin($db);
|
||||||
|
|
||||||
|
$head = member_type_prepare_head($object);
|
||||||
|
$titre=$langs->trans("MemberType".$object->type);
|
||||||
|
|
||||||
|
// Calculate $cnt_trans
|
||||||
|
$cnt_trans = 0;
|
||||||
|
if (! empty($object->multilangs))
|
||||||
|
{
|
||||||
|
foreach ($object->multilangs as $key => $value)
|
||||||
|
{
|
||||||
|
$cnt_trans++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'translation', $titre, 0, 'group');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.dol_buildpath('/adherents/type.php', 1).'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'rowid', $linkback);
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Barre d'action */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
|
if ($action == '')
|
||||||
|
{
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=add&rowid='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||||
|
if ($cnt_trans > 0) print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=edit&rowid='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print "\n</div>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
//WYSIWYG Editor
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="vedit">';
|
||||||
|
print '<input type="hidden" name="rowid" value="'.$object->id.'">';
|
||||||
|
|
||||||
|
if (! empty($object->multilangs))
|
||||||
|
{
|
||||||
|
foreach ($object->multilangs as $key => $value)
|
||||||
|
{
|
||||||
|
$s=picto_from_langcode($key);
|
||||||
|
print "<br>".($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"')."</a><br>";
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
|
||||||
|
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||||
|
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||||
|
$doleditor->Create();
|
||||||
|
print '</td></tr>';
|
||||||
|
print '</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
elseif ($action != 'add')
|
||||||
|
{
|
||||||
|
if (! empty($object->multilangs))
|
||||||
|
{
|
||||||
|
foreach ($object->multilangs as $key => $value)
|
||||||
|
{
|
||||||
|
$s=picto_from_langcode($key);
|
||||||
|
print ($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"').'</a>';
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
print '<tr><td class="titlefieldcreate">'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>';
|
||||||
|
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $cnt_trans && $action != 'add') print '<div class="opacitymedium">'. $langs->trans('NoTranslation').'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Form to add a new translation
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($action == 'add' && $user->rights->adherent->configurer)
|
||||||
|
{
|
||||||
|
//WYSIWYG Editor
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="vadd">';
|
||||||
|
print '<input type="hidden" name="rowid" value="'.GETPOST("rowid", 'int').'">';
|
||||||
|
|
||||||
|
dol_fiche_head();
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Language').'</td><td>';
|
||||||
|
print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
||||||
|
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||||
|
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||||
|
$doleditor->Create();
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -161,13 +161,13 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
|
|||||||
// Show message
|
// Show message
|
||||||
$message='';
|
$message='';
|
||||||
$urlvcal='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
$urlvcal='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal);
|
$message.=img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
$urlical='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
$urlical='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical);
|
$message.=img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
$urlrss='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
$urlrss='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss);
|
$message.=img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
print $message;
|
print $message;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'boxes'));
|
$langs->loadLangs(array('admin', 'boxes', 'accountancy'));
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -195,6 +195,8 @@ $param = '';
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" id="action" name="action" value="">';
|
print '<input type="hidden" id="action" name="action" value="">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|||||||
@ -123,7 +123,9 @@ else
|
|||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
$label = $langs->trans($key);
|
||||||
|
if ($key == 'DAV_RESTICT_ON_IP') $label = $langs->trans("RESTRICT_ON_IP");
|
||||||
|
print $form->textwithpicto($label, $tooltiphelp);
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($key == 'DAV_ALLOW_PRIVATE_DIR')
|
if ($key == 'DAV_ALLOW_PRIVATE_DIR')
|
||||||
{
|
{
|
||||||
@ -172,13 +174,13 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
|
|||||||
// Show message
|
// Show message
|
||||||
$message='';
|
$message='';
|
||||||
$url='<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">'.$urlwithroot.'/dav/fileserver.php</a>';
|
$url='<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">'.$urlwithroot.'/dav/fileserver.php</a>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV', $url);
|
$message.=img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV', $url);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
if (! empty($conf->global->DAV_ALLOW_PUBLIC_DIR))
|
if (! empty($conf->global->DAV_ALLOW_PUBLIC_DIR))
|
||||||
{
|
{
|
||||||
$urlEntity = (! empty($conf->multicompany->enabled)?'?entity='.$conf->entity:'');
|
$urlEntity = (! empty($conf->multicompany->enabled)?'?entity='.$conf->entity:'');
|
||||||
$url='<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
|
$url='<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV public', $url);
|
$message.=img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV public', $url);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
}
|
}
|
||||||
print $message;
|
print $message;
|
||||||
|
|||||||
@ -938,34 +938,35 @@ if ($action == 'disable_favorite')
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formadmin=new FormAdmin($db);
|
$formadmin=new FormAdmin($db);
|
||||||
|
|
||||||
llxHeader();
|
$title=$langs->trans("DictionarySetup");
|
||||||
|
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
$titre=$langs->trans("DictionarySetup");
|
|
||||||
$linkback='';
|
$linkback='';
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
$titre.=' - '.$langs->trans($tablib[$id]);
|
$title.=' - '.$langs->trans($tablib[$id]);
|
||||||
$linkback='<a href="'.$_SERVER['PHP_SELF'].'">'.$langs->trans("BackToDictionaryList").'</a>';
|
$linkback='<a href="'.$_SERVER['PHP_SELF'].'">'.$langs->trans("BackToDictionaryList").'</a>';
|
||||||
}
|
}
|
||||||
$titlepicto='title_setup';
|
$titlepicto='title_setup';
|
||||||
if ($id == 10 && GETPOST('from') == 'accountancy')
|
if ($id == 10 && GETPOST('from') == 'accountancy')
|
||||||
{
|
{
|
||||||
$titre=$langs->trans("MenuVatAccounts");
|
$title=$langs->trans("MenuVatAccounts");
|
||||||
$titlepicto='title_accountancy';
|
$titlepicto='accountancy';
|
||||||
}
|
}
|
||||||
if ($id == 7 && GETPOST('from') == 'accountancy')
|
if ($id == 7 && GETPOST('from') == 'accountancy')
|
||||||
{
|
{
|
||||||
$titre=$langs->trans("MenuTaxAccounts");
|
$title=$langs->trans("MenuTaxAccounts");
|
||||||
$titlepicto='title_accountancy';
|
$titlepicto='accountancy';
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($titre, $linkback, $titlepicto);
|
print load_fiche_titre($title, $linkback, $titlepicto);
|
||||||
|
|
||||||
if (empty($id))
|
if (empty($id))
|
||||||
{
|
{
|
||||||
print $langs->trans("DictionaryDesc");
|
print '<span class="opacitymedium">'.$langs->trans("DictionaryDesc");
|
||||||
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
|
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
|
||||||
print '<br>';
|
print '</span><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1509,6 +1510,10 @@ if ($id)
|
|||||||
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
|
elseif ($fieldlist[$field]=='type' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
|
||||||
|
$payment_type_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth'));
|
||||||
|
$valuetoshow = $payment_type_list[$valuetoshow];
|
||||||
|
}
|
||||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
|
||||||
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
@ -1697,7 +1702,6 @@ if ($id)
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1711,7 +1715,6 @@ else
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
//print '<td>'.$langs->trans("Module").'</td>';
|
|
||||||
print '<td colspan="2">'.$langs->trans("Dictionary").'</td>';
|
print '<td colspan="2">'.$langs->trans("Dictionary").'</td>';
|
||||||
print '<td>'.$langs->trans("Table").'</td>';
|
print '<td>'.$langs->trans("Table").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -1726,7 +1729,7 @@ else
|
|||||||
if ($showemptyline)
|
if ($showemptyline)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven"><td width="30%"> </td><td> </td><td> </td></tr>';
|
print '<tr class="oddeven"><td width="50%"> </td><td> </td><td> </td></tr>';
|
||||||
$showemptyline=0;
|
$showemptyline=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1877,6 +1880,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
print $type.'<input type="hidden" name="type" value="'.$type.'">';
|
print $type.'<input type="hidden" name="type" value="'.$type.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX.'c_paiement')
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$select_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth'));
|
||||||
|
print $form->selectarray($fieldlist[$field], $select_list, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'2'));
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||||
if ($fieldlist[$field] == 'type_cdr') print '<td class="center">';
|
if ($fieldlist[$field] == 'type_cdr') print '<td class="center">';
|
||||||
else print '<td>';
|
else print '<td>';
|
||||||
|
|||||||
@ -57,7 +57,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration
|
|||||||
$hookmanager->initHooks(array('emailcollectorcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('emailcollectorcard')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
{
|
{
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration
|
|||||||
$hookmanager->initHooks(array('emailcollectorlist')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('emailcollectorlist')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012-20113 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2019 Christophe Battarel <christophe@altairis.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -49,7 +50,8 @@ $modules = array(
|
|||||||
'DETAILS' => 'FCKeditorForProductDetails',
|
'DETAILS' => 'FCKeditorForProductDetails',
|
||||||
'USERSIGN' => 'FCKeditorForUserSignature',
|
'USERSIGN' => 'FCKeditorForUserSignature',
|
||||||
'MAILING' => 'FCKeditorForMailing',
|
'MAILING' => 'FCKeditorForMailing',
|
||||||
'MAIL' => 'FCKeditorForMail'
|
'MAIL' => 'FCKeditorForMail',
|
||||||
|
'TICKET' => 'FCKeditorForTicket'
|
||||||
);
|
);
|
||||||
// Conditions pour que l'option soit proposee
|
// Conditions pour que l'option soit proposee
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
@ -58,7 +60,8 @@ $conditions = array(
|
|||||||
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAILING' => ! empty($conf->mailing->enabled),
|
'MAILING' => ! empty($conf->mailing->enabled),
|
||||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)),
|
||||||
|
'TICKET' => ! empty($conf->ticket->enabled)
|
||||||
);
|
);
|
||||||
// Picto
|
// Picto
|
||||||
$picto = array(
|
$picto = array(
|
||||||
@ -67,7 +70,8 @@ $picto = array(
|
|||||||
'DETAILS' => 'product',
|
'DETAILS' => 'product',
|
||||||
'USERSIGN' => 'user',
|
'USERSIGN' => 'user',
|
||||||
'MAILING' => 'email',
|
'MAILING' => 'email',
|
||||||
'MAIL' => 'email'
|
'MAIL' => 'email',
|
||||||
|
'TICKET' => 'ticket'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->i
|
|||||||
$hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -189,14 +189,15 @@ foreach($object->fields as $key => $val)
|
|||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
if (! empty($extrafields->attributes[$object->table_element]['label']))
|
||||||
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql=preg_replace('/, $/', '', $sql);
|
$sql=preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||||
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('emailsenderprofile').")";
|
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('emailsenderprofile').")";
|
||||||
else $sql.=" WHERE 1 = 1";
|
else $sql.=" WHERE 1 = 1";
|
||||||
foreach($search as $key => $val)
|
foreach($search as $key => $val)
|
||||||
@ -219,7 +220,8 @@ foreach($object->fields as $key => $val)
|
|||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
@ -460,6 +460,7 @@ asort($orders);
|
|||||||
$nbofactivatedmodules=count($conf->modules);
|
$nbofactivatedmodules=count($conf->modules);
|
||||||
$moreinfo=$langs->trans("TotalNumberOfActivatedModules", ($nbofactivatedmodules-1), count($modules));
|
$moreinfo=$langs->trans("TotalNumberOfActivatedModules", ($nbofactivatedmodules-1), count($modules));
|
||||||
if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
|
if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ModulesSetup"), $moreinfo, 'title_setup');
|
print load_fiche_titre($langs->trans("ModulesSetup"), $moreinfo, 'title_setup');
|
||||||
|
|
||||||
// Start to show page
|
// Start to show page
|
||||||
@ -870,21 +871,23 @@ if ($mode == 'marketplace')
|
|||||||
dol_fiche_head($head, $mode, '', -1);
|
dol_fiche_head($head, $mode, '', -1);
|
||||||
|
|
||||||
// Marketplace
|
// Marketplace
|
||||||
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print "<tr class=\"liste_titre\">\n";
|
print '<table summary="list_of_modules" class="noborder centpercent">'."\n";
|
||||||
//print '<td>'.$langs->trans("Logo").'</td>';
|
print '<tr class="liste_titre">'."\n";
|
||||||
print '<td colspan="2">'.$langs->trans("WebSiteDesc").'</td>';
|
print '<td class="hideonsmartphone">'.$form->textwithpicto($langs->trans("Provider"), $langs->trans("WebSiteDesc")).'</td>';
|
||||||
|
print '<td></td>';
|
||||||
print '<td>'.$langs->trans("URL").'</td>';
|
print '<td>'.$langs->trans("URL").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">'."\n";
|
print '<tr class="oddeven">'."\n";
|
||||||
$url='https://www.dolistore.com';
|
$url='https://www.dolistore.com';
|
||||||
print '<td class="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
|
print '<td class="hideonsmartphone"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
|
||||||
print '<td>'.$langs->trans("DoliStoreDesc").'</td>';
|
print '<td>'.$langs->trans("DoliStoreDesc").'</td>';
|
||||||
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|||||||
@ -170,9 +170,23 @@ elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
|||||||
|
|
||||||
if ($action == 'maj_pattern')
|
if ($action == 'maj_pattern')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "USER_PASSWORD_PATTERN", GETPOST("pattern"), 'chaine', 0, '', $conf->entity);
|
$pattern = GETPOST("pattern");
|
||||||
header("Location: security.php");
|
$explodePattern = explode(';', $pattern);
|
||||||
exit;
|
|
||||||
|
$patternInError = false;
|
||||||
|
if ($explodePattern[0] < 1 || $explodePattern[4] < 0) {
|
||||||
|
$patternInError = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($explodePattern[0] < $explodePattern[1] + $explodePattern[2] + $explodePattern[3]) {
|
||||||
|
$patternInError = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$patternInError) {
|
||||||
|
dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity);
|
||||||
|
header("Location: security.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -278,13 +292,6 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){
|
|||||||
|
|
||||||
|
|
||||||
$tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN);
|
$tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN);
|
||||||
/*$this->length2 = $tabConf[0];
|
|
||||||
$this->NbMaj = $tabConf[1];
|
|
||||||
$this->NbNum = $tabConf[2];
|
|
||||||
$this->NbSpe = $tabConf[3];
|
|
||||||
$this->NbRepeat = $tabConf[4];
|
|
||||||
$this->WithoutAmbi = $tabConf[5];
|
|
||||||
*/
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -350,6 +357,13 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){
|
|||||||
print ' }';
|
print ' }';
|
||||||
|
|
||||||
print ' function valuePossible(){';
|
print ' function valuePossible(){';
|
||||||
|
print ' var fields = ["#minlenght", "#NbMajMin", "#NbNumMin", "#NbSpeMin", "#NbIteConsecutive"];';
|
||||||
|
print ' for(var i = 0 ; i < fields.length ; i++){';
|
||||||
|
print ' if($(fields[i]).val() < $(fields[i]).attr("min")){';
|
||||||
|
print ' return false;';
|
||||||
|
print ' }';
|
||||||
|
print ' }';
|
||||||
|
print ' ';
|
||||||
print ' var length = parseInt($("#minlenght").val());';
|
print ' var length = parseInt($("#minlenght").val());';
|
||||||
print ' var length_mini = parseInt($("#NbMajMin").val()) + parseInt($("#NbNumMin").val()) + parseInt($("#NbSpeMin").val());';
|
print ' var length_mini = parseInt($("#NbMajMin").val()) + parseInt($("#NbNumMin").val()) + parseInt($("#NbSpeMin").val());';
|
||||||
print ' return length >= length_mini;';
|
print ' return length >= length_mini;';
|
||||||
|
|||||||
@ -160,7 +160,6 @@ print '<ul>';
|
|||||||
|
|
||||||
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
|
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
|
||||||
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
|
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
|
||||||
print '<li><a href="https://plus.google.com/+DolibarrOrg" target="_blank" rel="external">Google Plus page</a></li>';
|
|
||||||
|
|
||||||
print '</ul>';
|
print '</ul>';
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
|
|||||||
$scandir = GETPOST('scandir', 'alpha');
|
$scandir = GETPOST('scandir', 'alpha');
|
||||||
$type = 'ticket';
|
$type = 'ticket';
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if ($action == 'updateMask') {
|
if ($action == 'updateMask') {
|
||||||
$maskconstticket = GETPOST('maskconstticket', 'alpha');
|
$maskconstticket = GETPOST('maskconstticket', 'alpha');
|
||||||
$maskticket = GETPOST('maskticket', 'alpha');
|
$maskticket = GETPOST('maskticket', 'alpha');
|
||||||
@ -91,7 +97,7 @@ if ($action == 'updateMask') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
|
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'restricthtml');
|
||||||
if (!empty($mail_intro)) {
|
if (!empty($mail_intro)) {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
|
||||||
} else {
|
} else {
|
||||||
@ -101,7 +107,7 @@ if ($action == 'updateMask') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
|
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'restricthtml');
|
||||||
if (!empty($mail_signature)) {
|
if (!empty($mail_signature)) {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
|
||||||
} else {
|
} else {
|
||||||
@ -110,16 +116,6 @@ if ($action == 'updateMask') {
|
|||||||
if (!$res > 0) {
|
if (!$res > 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
|
|
||||||
if (!empty($text_help)) {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
|
||||||
} else {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
|
||||||
}
|
|
||||||
if (!$res > 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setvarother') {
|
if ($action == 'setvarother') {
|
||||||
|
|||||||
@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
|
|||||||
$scandir = GETPOST('scandir', 'alpha');
|
$scandir = GETPOST('scandir', 'alpha');
|
||||||
$type = 'ticket';
|
$type = 'ticket';
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
|
if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
|
||||||
{
|
{
|
||||||
if (GETPOST('value')) dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
|
if (GETPOST('value')) dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
|
||||||
@ -51,95 +57,54 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
|
|||||||
if ($action == 'setvar') {
|
if ($action == 'setvar') {
|
||||||
include_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
|
include_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
|
||||||
|
|
||||||
$notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha');
|
$topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'nohtml');
|
||||||
if (!empty($notification_email)) {
|
if (!empty($topic_interface)) {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
|
||||||
} else {
|
} else {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
if (!$res > 0) {
|
if (!$res > 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// altairis : differentiate notification email FROM and TO
|
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
|
||||||
$notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha');
|
if (!empty($text_home)) {
|
||||||
if (!empty($notification_email_to)) {
|
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity);
|
|
||||||
} else {
|
} else {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
if (!$res > 0) {
|
if (!$res > 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'alpha');
|
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
|
||||||
|
if (!empty($text_help)) {
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
||||||
|
} else {
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
if (!$res > 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
|
||||||
if (!empty($mail_new_ticket)) {
|
if (!empty($mail_new_ticket)) {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
|
||||||
} else {
|
} else {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
if (!$res > 0) {
|
if (!$res > 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
|
||||||
|
|
||||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
|
|
||||||
if (!empty($mail_intro)) {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
|
|
||||||
} else {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText'), 'chaine', 0, '', $conf->entity);
|
|
||||||
}
|
|
||||||
if (!$res > 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
|
|
||||||
if (!empty($mail_signature)) {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
|
|
||||||
} else {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $langs->trans('TicketMessageMailSignatureText'), 'chaine', 0, '', $conf->entity);
|
|
||||||
}
|
|
||||||
if (!$res > 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
|
$url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
|
||||||
if (!empty($url_interface)) {
|
if (!empty($url_interface)) {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
|
||||||
} else {
|
} else {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
if (!$res > 0) {
|
if (!$res > 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
|
||||||
|
|
||||||
$topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alpha');
|
|
||||||
if (!empty($topic_interface)) {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
|
|
||||||
} else {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
|
|
||||||
}
|
|
||||||
if (!$res > 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'alpha');
|
|
||||||
if (!empty($text_home)) {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
|
|
||||||
} else {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
|
|
||||||
}
|
|
||||||
if (!$res > 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
|
|
||||||
if (!empty($text_help)) {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
|
||||||
} else {
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
|
||||||
}
|
|
||||||
if (!$res > 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,14 +127,11 @@ if ($action == 'setvarother') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
$param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
|
||||||
{
|
$res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||||
$param_show_module_logo = GETPOST('TICKET_SHOW_MODULE_LOGO', 'alpha');
|
if (!$res > 0) {
|
||||||
$res = dolibarr_set_const($db, 'TICKET_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
$error++;
|
||||||
if (!$res > 0) {
|
}
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||||
{
|
{
|
||||||
@ -179,12 +141,6 @@ if ($action == 'setvarother') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!$res > 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -238,8 +194,7 @@ print '<br><br>';
|
|||||||
|
|
||||||
if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||||
{
|
{
|
||||||
|
if (empty($conf->use_javascript_ajax)) {
|
||||||
if (!$conf->use_javascript_ajax) {
|
|
||||||
print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data" >';
|
print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data" >';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="setvarother">';
|
print '<input type="hidden" name="action" value="setvarother">';
|
||||||
@ -349,16 +304,6 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Url public interface
|
|
||||||
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
|
||||||
print '<tr><td>' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . '</label>';
|
|
||||||
print '</td><td>';
|
|
||||||
print '<input type="text" name="TICKET_URL_PUBLIC_INTERFACE" value="' . $conf->global->TICKET_URL_PUBLIC_INTERFACE . '" size="40" ></td>';
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Interface topic
|
// Interface topic
|
||||||
$url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC;
|
$url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC;
|
||||||
print '<tr><td>' . $langs->trans("TicketPublicInterfaceTopicLabelAdmin") . '</label>';
|
print '<tr><td>' . $langs->trans("TicketPublicInterfaceTopicLabelAdmin") . '</label>';
|
||||||
@ -420,6 +365,16 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
|||||||
print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
|
print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Url public interface
|
||||||
|
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
||||||
|
print '<tr><td>' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . '</label>';
|
||||||
|
print '</td><td>';
|
||||||
|
print '<input type="text" name="TICKET_URL_PUBLIC_INTERFACE" value="' . $conf->global->TICKET_URL_PUBLIC_INTERFACE . '" size="40" ></td>';
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '"></div>';
|
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '"></div>';
|
||||||
|
|||||||
@ -553,7 +553,7 @@ if ($mode == 'searchkey')
|
|||||||
//$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key;
|
//$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key;
|
||||||
$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key;
|
$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key;
|
||||||
|
|
||||||
print ' <a href="'.$transifexurl.'" target="transifex">'.img_picto('FixOnTransifex', 'object_globe').'</a>';
|
print ' <a href="'.$transifexurl.'" target="transifex">'.img_picto('FixOnTransifex', 'globe').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -179,7 +179,7 @@ print '<br>';
|
|||||||
$message='';
|
$message='';
|
||||||
$url='<a href="'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword" target="_blank">'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword[&reset=1]</a>';
|
$url='<a href="'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword" target="_blank">'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword[&reset=1]</a>';
|
||||||
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
|
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$url;
|
$message.=img_picto('', 'globe').' '.$url;
|
||||||
print $message;
|
print $message;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -208,7 +208,7 @@ foreach($listofapis['v1'] as $key => $val)
|
|||||||
//print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx<br>\n";
|
//print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx<br>\n";
|
||||||
$url=$urlwithroot.'/api/index.php/'.$key;
|
$url=$urlwithroot.'/api/index.php/'.$key;
|
||||||
$url.='?api_key=token';
|
$url.='?api_key=token';
|
||||||
print img_picto('', 'object_globe.png').' '.$method.' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('', 'globe').' '.$method.' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,7 +152,7 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
|
|||||||
$message='';
|
$message='';
|
||||||
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
|
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
|
||||||
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
|
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$url;
|
$message.=img_picto('', 'globe').' '.$url;
|
||||||
print $message;
|
print $message;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -162,7 +162,7 @@ print '<u>'.$langs->trans("ApiExporerIs").':</u><br>';
|
|||||||
if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer'))
|
if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer'))
|
||||||
{
|
{
|
||||||
$url=DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
|
$url=DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
|
||||||
print img_picto('', 'object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,7 +45,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
|||||||
$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -64,9 +64,6 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
|
|||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||||
//$result = restrictedArea($user, 'asset', $id);
|
//$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
@ -142,7 +139,7 @@ jQuery(document).ready(function() {
|
|||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("NewAsset"));
|
print load_fiche_titre($langs->trans("NewAsset"), '', 'accountancy');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -207,7 +204,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||||
{
|
{
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals($object->id);
|
||||||
|
|
||||||
$head = asset_prepare_head($object);
|
$head = asset_prepare_head($object);
|
||||||
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
||||||
|
|||||||
@ -62,7 +62,7 @@ $diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->
|
|||||||
$hookmanager->initHooks(array('assetdocument')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('assetdocument')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|||||||
@ -62,7 +62,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
|||||||
$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -183,14 +183,15 @@ foreach($object->fields as $key => $val)
|
|||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
if (! empty($extrafields->attributes[$object->table_element]['label']))
|
||||||
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql=preg_replace('/, $/', '', $sql);
|
$sql=preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."assets_extrafields as ef on (t.rowid = ef.fk_object)";
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||||
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('assets').")";
|
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('assets').")";
|
||||||
else $sql.=" WHERE 1 = 1";
|
else $sql.=" WHERE 1 = 1";
|
||||||
foreach($search as $key => $val)
|
foreach($search as $key => $val)
|
||||||
@ -213,7 +214,8 @@ foreach($object->fields as $key => $val)
|
|||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -316,7 +318,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
// Add code for pre mass action (confirmation or email presend form)
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
$topicmail="SendAssetsRef";
|
$topicmail="SendAssetsRef";
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
|||||||
$hookmanager->initHooks(array('assetnote')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('assetnote')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->societe_id > 0) access_forbidden();
|
||||||
@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($user->rights->asset->creer)
|
if ($user->rights->asset->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||
@ -65,7 +65,7 @@ $object = new AssetType($db);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
@ -102,7 +102,7 @@ if ($action == 'add' && $user->rights->asset->write)
|
|||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (empty($object->label)) {
|
if (empty($object->label)) {
|
||||||
@ -155,7 +155,7 @@ if ($action == 'update' && $user->rights->asset->write)
|
|||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
$ret=$object->update($user);
|
$ret=$object->update($user);
|
||||||
@ -197,6 +197,7 @@ if ($action == 'confirm_delete' && $user->rights->asset->write)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
$helpurl='';
|
$helpurl='';
|
||||||
llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl);
|
llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl);
|
||||||
|
|
||||||
@ -237,7 +238,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
|
|||||||
@ -252,7 +252,7 @@ if ($conf->product->enabled || $conf->product->service)
|
|||||||
|
|
||||||
$nbno=$nbtotal=0;
|
$nbno=$nbtotal=0;
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'title_products');
|
print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'products');
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
|
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
|
||||||
|
|||||||
@ -74,7 +74,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('bomagenda','globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomagenda','globalcard')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('bom');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
@ -149,7 +149,7 @@ if ($object->id > 0)
|
|||||||
if ($user->rights->bom->creer)
|
if ($user->rights->bom->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
@ -204,7 +204,7 @@ jQuery(document).ready(function() {
|
|||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("NewBOM"));
|
print load_fiche_titre($langs->trans("NewBOM"), '', 'cubes');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -237,7 +237,7 @@ if ($action == 'create')
|
|||||||
// Part to edit record
|
// Part to edit record
|
||||||
if (($id || $ref) && $action == 'edit')
|
if (($id || $ref) && $action == 'edit')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("BillOfMaterials"));
|
print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -339,7 +339,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if ($user->rights->bom->write)
|
if ($user->rights->bom->write)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
|||||||
@ -63,7 +63,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('bomdocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomdocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|||||||
@ -62,7 +62,7 @@ $diroutputmassaction = $conf->bom->dir_output . '/temp/massgeneration/'.$user->i
|
|||||||
$hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); // Load $extrafields->attributes['bom']
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ $newcardbutton='';
|
|||||||
// $newcardbutton.= '</a>';
|
// $newcardbutton.= '</a>';
|
||||||
//}
|
//}
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
// Add code for pre mass action (confirmation or email presend form)
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
$topicmail="SendBillOfMaterialsRef";
|
$topicmail="SendBillOfMaterialsRef";
|
||||||
|
|||||||
@ -44,7 +44,7 @@ $diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
|||||||
$hookmanager->initHooks(array('bomnote','globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomnote','globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->societe_id > 0) access_forbidden();
|
||||||
@ -104,7 +104,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($user->rights->bom->creer)
|
if ($user->rights->bom->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||
@ -140,7 +140,7 @@ if ($nolinesbefore) {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (is_object($objectline)) {
|
if (is_object($objectline)) {
|
||||||
print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@ $coldisplay=0;
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (is_object($objectline)) {
|
if (is_object($objectline)) {
|
||||||
print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -149,9 +149,9 @@ $objectline = new BOMLine($object->db);
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
//Line extrafield
|
//Line extrafield
|
||||||
if (!empty($extrafieldsline))
|
if (!empty($extrafields))
|
||||||
{
|
{
|
||||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -150,3 +150,140 @@ function printBookmarksList($aDb, $aLangs)
|
|||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add area with bookmarks in top menu
|
||||||
|
*
|
||||||
|
* @param DoliDb $aDb Database handler
|
||||||
|
* @param Translate $aLangs Object lang
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function printDropdownBookmarksList($aDb, $aLangs)
|
||||||
|
{
|
||||||
|
global $conf, $user;
|
||||||
|
|
||||||
|
$db = $aDb;
|
||||||
|
$langs = $aLangs;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||||
|
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
||||||
|
|
||||||
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
|
$url= $_SERVER["PHP_SELF"];
|
||||||
|
|
||||||
|
if (! empty($_SERVER["QUERY_STRING"]))
|
||||||
|
{
|
||||||
|
$url.=(dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):'');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
global $sortfield,$sortorder;
|
||||||
|
$tmpurl='';
|
||||||
|
// No urlencode, all param $url will be urlencoded later
|
||||||
|
if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield;
|
||||||
|
if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder;
|
||||||
|
if (is_array($_POST))
|
||||||
|
{
|
||||||
|
foreach($_POST as $key => $val)
|
||||||
|
{
|
||||||
|
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$url.=($tmpurl?'?'.$tmpurl:'');
|
||||||
|
}
|
||||||
|
|
||||||
|
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||||
|
$searchForm.= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="" onsubmit="return false" >';
|
||||||
|
$searchForm.= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||||
|
$searchForm.= '</form>';
|
||||||
|
|
||||||
|
// Url to list bookmark
|
||||||
|
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
||||||
|
$listbtn.= '<span class="fa fa-list"></span> '.$langs->trans('Bookmarks').'</a>';
|
||||||
|
|
||||||
|
// Url to go on create new bookmark page
|
||||||
|
$newbtn = '';
|
||||||
|
if (! empty($user->rights->bookmark->creer))
|
||||||
|
{
|
||||||
|
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||||
|
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||||
|
$newbtn.= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
|
||||||
|
$newbtn.= '<span class="fa fa-star-o"></span> '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$bookmarkList='<div id="dropdown-bookmarks-list" >';
|
||||||
|
// Menu with all bookmarks
|
||||||
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
||||||
|
{
|
||||||
|
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||||
|
$sql.= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
|
||||||
|
$sql.= " AND entity IN (".getEntity('bookmarks').")";
|
||||||
|
$sql.= " ORDER BY position";
|
||||||
|
if ($resql = $db->query($sql) )
|
||||||
|
{
|
||||||
|
$i=0;
|
||||||
|
while ($i < $conf->global->BOOKMARKS_SHOW_IN_MENU && $obj = $db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
$bookmarkList.='<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1?' target="_blank"':'').' href="'.dol_escape_htmltag($obj->url).'" >';
|
||||||
|
$bookmarkList.= dol_escape_htmltag($obj->title);
|
||||||
|
$bookmarkList.='</a>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$bookmarkList.='</div>';
|
||||||
|
|
||||||
|
$html= '';
|
||||||
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
|
||||||
|
$html.= '
|
||||||
|
<!-- search input -->
|
||||||
|
<div class="dropdown-header bookmark-header">
|
||||||
|
' . $searchForm . '
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
}
|
||||||
|
|
||||||
|
$html.= '
|
||||||
|
<!-- Menu Body -->
|
||||||
|
<div class="bookmark-body dropdown-body">
|
||||||
|
'.$bookmarkList.'
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$html.= '
|
||||||
|
<!-- Menu Footer-->
|
||||||
|
<div class="bookmark-footer">
|
||||||
|
'.$newbtn.$listbtn.'
|
||||||
|
<div style="clear:both;"></div>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
|
||||||
|
$html .= '<script>
|
||||||
|
$( document ).on("keyup", "#top-bookmark-search-input", function () {
|
||||||
|
|
||||||
|
var filter = $(this).val(), count = 0;
|
||||||
|
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
||||||
|
|
||||||
|
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
||||||
|
$(this).addClass("hidden-search-result");
|
||||||
|
} else {
|
||||||
|
$(this).removeClass("hidden-search-result");
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#top-bookmark-search-filter-count").text(count);
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|||||||
@ -181,7 +181,7 @@ if ($resql)
|
|||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
if ($user->rights->bookmark->creer)
|
if ($user->rights->bookmark->creer)
|
||||||
{
|
{
|
||||||
print "<a href=\"".DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> ";
|
print '<a href="'.DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
|
||||||
}
|
}
|
||||||
if ($user->rights->bookmark->supprimer)
|
if ($user->rights->bookmark->supprimer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -68,7 +68,7 @@ if ($catorigin && $type == Categorie::TYPE_PRODUCT) $idCatOrigin = $catorigin;
|
|||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('categorycard'));
|
$hookmanager->initHooks(array('categorycard'));
|
||||||
@ -137,7 +137,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
|||||||
|
|
||||||
if ($parent != "-1") $object->fk_parent = $parent;
|
if ($parent != "-1") $object->fk_parent = $parent;
|
||||||
|
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $object->label)
|
if (! $object->label)
|
||||||
|
|||||||
@ -864,11 +864,14 @@ class Categorie extends CommonObject
|
|||||||
if ($type=="contact") {
|
if ($type=="contact") {
|
||||||
$subcol_name="fk_socpeople";
|
$subcol_name="fk_socpeople";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$idoftype = array_search($type, self::$MAP_ID_TO_CODE);
|
||||||
|
|
||||||
$sql = "SELECT s.rowid";
|
$sql = "SELECT s.rowid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as s";
|
||||||
$sql.= " , ".MAIN_DB_PREFIX."categorie_".$sub_type." as sub ";
|
$sql.= " , ".MAIN_DB_PREFIX."categorie_".$sub_type." as sub ";
|
||||||
$sql.= ' WHERE s.entity IN ('.getEntity('category').')';
|
$sql.= ' WHERE s.entity IN ('.getEntity('category').')';
|
||||||
$sql.= ' AND s.type='.array_search($type, self::$MAP_ID_TO_CODE);
|
$sql.= ' AND s.type='.$idoftype;
|
||||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||||
$sql.= ' AND sub.'.$subcol_name.' = '.$id;
|
$sql.= ' AND sub.'.$subcol_name.' = '.$id;
|
||||||
|
|
||||||
@ -887,7 +890,15 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql.= $this->db->plimit($limit + 1, $offset);
|
if ($limit) {
|
||||||
|
if ($page < 0)
|
||||||
|
{
|
||||||
|
$page = 0;
|
||||||
|
}
|
||||||
|
$offset = $limit * $page;
|
||||||
|
|
||||||
|
$sql.= $this->db->plimit($limit + 1, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -62,7 +62,7 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('categorycard'));
|
$hookmanager->initHooks(array('categorycard'));
|
||||||
@ -102,7 +102,7 @@ if ($action == 'update' && $user->rights->categorie->creer)
|
|||||||
}
|
}
|
||||||
if (! $error && empty($object->error))
|
if (! $error && empty($object->error))
|
||||||
{
|
{
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error && $object->update($user) > 0)
|
if (! $error && $object->update($user) > 0)
|
||||||
|
|||||||
@ -84,7 +84,7 @@ $type=$object->type;
|
|||||||
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('categorycard','globalcard'));
|
$hookmanager->initHooks(array('categorycard','globalcard'));
|
||||||
|
|||||||
@ -99,7 +99,7 @@ if ($id > 0 && $action!='add') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
//var_dump($_POST);
|
//var_dump($_POST);
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ if (empty($reshook) && $action == 'add')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -526,7 +526,7 @@ if (empty($reshook) && $action == 'update')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@ -1582,7 +1582,7 @@ if ($id > 0)
|
|||||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
@ -1622,7 +1622,7 @@ if ($id > 0)
|
|||||||
// Type
|
// Type
|
||||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||||
{
|
{
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$langs->trans($object->type).'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Full day event
|
// Full day event
|
||||||
|
|||||||
@ -1562,7 +1562,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$savlabel=$event->label?$event->label:$event->libelle;
|
$savlabel=$event->label?$event->label:$event->libelle;
|
||||||
$event->label=$titletoshow;
|
$event->label=$titletoshow;
|
||||||
$event->libelle=$titletoshow;
|
$event->libelle=$titletoshow;
|
||||||
print $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 1);
|
print $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0);
|
||||||
$event->label=$savlabel;
|
$event->label=$savlabel;
|
||||||
$event->libelle=$savlabel;
|
$event->libelle=$savlabel;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,7 @@ $hookmanager->initHooks(array('agendalist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
// If not choice done on calendar owner, we filter on user.
|
// If not choice done on calendar owner, we filter on user.
|
||||||
@ -504,8 +504,8 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $param, '', 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $param, '', 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $param, "", "", $sortfield, $sortorder);
|
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $param, "", "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "a.fk_contact", $param, "", "", $sortfield, $sortorder);
|
if (! empty($arrayfields['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['a.fk_element']['checked'])) print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "a.fk_element", $param, "", "", $sortfield, $sortorder);
|
if (! empty($arrayfields['a.fk_element']['checked'])) print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
@ -562,7 +562,7 @@ if ($resql)
|
|||||||
// User owner
|
// User owner
|
||||||
if (! empty($arrayfields['owner']['checked']))
|
if (! empty($arrayfields['owner']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="'.($conf->browser->name != 'chrome'?'':'tdoverflowmax100').'">'; // With edge and chrom the td overflow is not supported correctly when content is not full text.
|
print '<td class="tdoverflowmax150">'; // With edge and chrome the td overflow is not supported correctly when content is not full text.
|
||||||
if ($obj->fk_user_action > 0)
|
if ($obj->fk_user_action > 0)
|
||||||
{
|
{
|
||||||
$userstatic->fetch($obj->fk_user_action);
|
$userstatic->fetch($obj->fk_user_action);
|
||||||
@ -632,7 +632,7 @@ if ($resql)
|
|||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) {
|
if (! empty($arrayfields['s.nom']['checked'])) {
|
||||||
print '<td class="tdoverflowmax100">';
|
print '<td class="tdoverflowmax150">';
|
||||||
if ($obj->socid > 0)
|
if ($obj->socid > 0)
|
||||||
{
|
{
|
||||||
$societestatic->id=$obj->socid;
|
$societestatic->id=$obj->socid;
|
||||||
@ -650,12 +650,11 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
|
|
||||||
$actionstatic->fetchResources();
|
$actionstatic->fetchResources();
|
||||||
if(!empty($actionstatic->socpeopleassigned))
|
if(!empty($actionstatic->socpeopleassigned))
|
||||||
{
|
{
|
||||||
$contactList = array();
|
$contactList = array();
|
||||||
foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned)
|
foreach ($actionstatic->socpeopleassigned as $socpeopleassigned)
|
||||||
{
|
{
|
||||||
if(!isset($contactListCache[$socpeopleassigned['id']]))
|
if(!isset($contactListCache[$socpeopleassigned['id']]))
|
||||||
{
|
{
|
||||||
@ -663,8 +662,8 @@ if ($resql)
|
|||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
if($contact->fetch($socpeopleassigned['id'])>0)
|
if($contact->fetch($socpeopleassigned['id'])>0)
|
||||||
{
|
{
|
||||||
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 28);
|
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 0);
|
||||||
$contactList[] = $contact->getNomUrl(1, '', 28);
|
$contactList[] = $contact->getNomUrl(1, '', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -686,7 +685,7 @@ if ($resql)
|
|||||||
$contactstatic->phone_mobile=$obj->phone_mobile;
|
$contactstatic->phone_mobile=$obj->phone_mobile;
|
||||||
$contactstatic->phone_perso=$obj->phone_perso;
|
$contactstatic->phone_perso=$obj->phone_perso;
|
||||||
$contactstatic->country_id=$obj->country_id;
|
$contactstatic->country_id=$obj->country_id;
|
||||||
print $contactstatic->getNomUrl(1, '', 28);
|
print $contactstatic->getNomUrl(1, '', 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -80,7 +80,7 @@ $object = new Client($db);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('thirdpartycomm','globalcard'));
|
$hookmanager->initHooks(array('thirdpartycomm','globalcard'));
|
||||||
@ -194,8 +194,7 @@ if (empty($reshook))
|
|||||||
$object->oldcopy = dol_clone($object);
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -324,7 +323,7 @@ if ($object->id > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
print $langs->trans('PaymentConditions');
|
print $langs->trans('PaymentConditions');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editconditions')
|
if ($action == 'editconditions')
|
||||||
@ -343,7 +342,7 @@ if ($object->id > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('PaymentMode');
|
print $langs->trans('PaymentMode');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
if (($action != 'editmode') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editmode')
|
if ($action == 'editmode')
|
||||||
@ -364,7 +363,7 @@ if ($object->id > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('PaymentBankAccount');
|
print $langs->trans('PaymentBankAccount');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
if (($action != 'editbankaccount') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editbankaccount')
|
if ($action == 'editbankaccount')
|
||||||
@ -390,7 +389,7 @@ if ($object->id > 0)
|
|||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
|
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
|
||||||
@ -404,7 +403,7 @@ if ($object->id > 0)
|
|||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -426,8 +425,6 @@ if ($object->id > 0)
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
||||||
print $form->editfieldval("OutstandingBill", 'outstanding_limit', $object->outstanding_limit, $object, $user->rights->societe->creer, $limit_field_type, ($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
print $form->editfieldval("OutstandingBill", 'outstanding_limit', $object->outstanding_limit, $object, $user->rights->societe->creer, $limit_field_type, ($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||||
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -457,7 +454,7 @@ if ($object->id > 0)
|
|||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($user->rights->societe->creer)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
@ -474,7 +471,7 @@ if ($object->id > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('SendingMethod');
|
print $langs->trans('SendingMethod');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($action != 'editshipping') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshipping&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
if (($action != 'editshipping') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshipping&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editshipping')
|
if ($action == 'editshipping')
|
||||||
@ -542,7 +539,7 @@ if ($object->id > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('ProspectLevel');
|
print $langs->trans('ProspectLevel');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editlevel')
|
if ($action == 'editlevel')
|
||||||
|
|||||||
@ -51,7 +51,7 @@ $result=$object->fetch($id);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('mailingcard','globalcard'));
|
$hookmanager->initHooks(array('mailingcard','globalcard'));
|
||||||
@ -73,7 +73,6 @@ $object->substitutionarrayfortest = $substitutionarray;
|
|||||||
// List of sending methods
|
// List of sending methods
|
||||||
$listofmethods=array();
|
$listofmethods=array();
|
||||||
$listofmethods['mail']='PHP mail function';
|
$listofmethods['mail']='PHP mail function';
|
||||||
//$listofmethods['simplemail']='Simplemail class';
|
|
||||||
$listofmethods['smtps']='SMTP/SMTPS socket library';
|
$listofmethods['smtps']='SMTP/SMTPS socket library';
|
||||||
|
|
||||||
|
|
||||||
@ -896,17 +895,23 @@ else
|
|||||||
print '<table class="border centpercent tableforfield">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="titlefield">'.$form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').'</td><td colspan="3">';
|
print '<tr><td class="titlefield">';
|
||||||
|
print $form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
|
print '</td><td>';
|
||||||
print $form->editfieldval("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
print $form->editfieldval("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// From
|
// From
|
||||||
print '<tr><td>'.$form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').'</td><td colspan="3">';
|
print '<tr><td>';
|
||||||
|
print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
|
print '</td><td>';
|
||||||
print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Errors to
|
// Errors to
|
||||||
print '<tr><td>'.$form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').'</td><td colspan="3">';
|
print '<tr><td>';
|
||||||
|
print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
|
print '</td><td>';
|
||||||
print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1117,7 +1122,7 @@ else
|
|||||||
$htmltext.='</i>';
|
$htmltext.='</i>';
|
||||||
|
|
||||||
// Print mail content
|
// Print mail content
|
||||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto('<span class="hideonsmartphone">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'generic');
|
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto('<span class="opacitymedium hideonsmartphone">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'helpclickable', '', 0, 2, 'emailsubstitionhelp'), 'generic');
|
||||||
|
|
||||||
dol_fiche_head('', '', '', -1);
|
dol_fiche_head('', '', '', -1);
|
||||||
|
|
||||||
|
|||||||
@ -544,7 +544,7 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
public function query_thirdparty($arrayquery)
|
public function query_thirdparty($arrayquery)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf,$extrafields;
|
||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " t.rowid";
|
$sql.= " t.rowid";
|
||||||
@ -617,29 +617,29 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
|
|
||||||
//Standard Extrafield feature
|
//Standard Extrafield feature
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||||
// fetch optionals attributes and labels
|
|
||||||
dol_include_once('/core/class/extrafields.class.php');
|
|
||||||
$extrafields = new ExtraFields($this->db);
|
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('societe');
|
|
||||||
|
|
||||||
foreach($extralabels as $key=>$val) {
|
$elementtype = Societe::$table_element;
|
||||||
|
|
||||||
if (($extrafields->attribute_type[$key] == 'varchar') ||
|
$extrafields->fetch_name_optionals_label($elementtype);
|
||||||
($extrafields->attribute_type[$key] == 'text')) {
|
|
||||||
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
|
||||||
|
|
||||||
|
if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
|
||||||
|
($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
|
||||||
if (!empty($arrayquery['options_'.$key])) {
|
if (!empty($arrayquery['options_'.$key])) {
|
||||||
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key]."')";
|
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key]."')";
|
||||||
}
|
}
|
||||||
} elseif (($extrafields->attribute_type[$key] == 'int') ||
|
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
|
||||||
($extrafields->attribute_type[$key] == 'double')) {
|
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
|
||||||
if (!empty($arrayquery['options_'.$key.'_max'])) {
|
if (!empty($arrayquery['options_'.$key.'_max'])) {
|
||||||
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
|
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
|
||||||
}
|
}
|
||||||
} elseif (($extrafields->attribute_type[$key] == 'date') ||
|
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
|
||||||
($extrafields->attribute_type[$key] == 'datetime')) {
|
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
|
||||||
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
|
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
|
||||||
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
|
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
|
||||||
}
|
}
|
||||||
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
|
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||||
if ($arrayquery['options_'.$key]!=''){
|
if ($arrayquery['options_'.$key]!=''){
|
||||||
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key].")";
|
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key].")";
|
||||||
}
|
}
|
||||||
@ -757,29 +757,33 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
|
|
||||||
//Standard Extrafield feature
|
//Standard Extrafield feature
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||||
|
$elementtype = Contact::$table_element;
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
dol_include_once('/core/class/extrafields.class.php');
|
dol_include_once('/core/class/extrafields.class.php');
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('socpeople');
|
$extrafields->fetch_name_optionals_label($elementtype);
|
||||||
|
|
||||||
foreach($extralabels as $key=>$val) {
|
$extrafields->fetch_name_optionals_label($elementtype);
|
||||||
|
|
||||||
if (($extrafields->attribute_type[$key] == 'varchar') ||
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
|
||||||
($extrafields->attribute_type[$key] == 'text')) {
|
|
||||||
|
if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
|
||||||
|
($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
|
||||||
if (!empty($arrayquery['options_'.$key.'_cnct'])) {
|
if (!empty($arrayquery['options_'.$key.'_cnct'])) {
|
||||||
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key.'_cnct']."')";
|
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key.'_cnct']."')";
|
||||||
}
|
}
|
||||||
} elseif (($extrafields->attribute_type[$key] == 'int') ||
|
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
|
||||||
($extrafields->attribute_type[$key] == 'double')) {
|
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
|
||||||
if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) {
|
if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) {
|
||||||
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")";
|
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")";
|
||||||
}
|
}
|
||||||
} elseif (($extrafields->attribute_type[$key] == 'date') ||
|
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
|
||||||
($extrafields->attribute_type[$key] == 'datetime')) {
|
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
|
||||||
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){
|
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){
|
||||||
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
|
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
|
||||||
}
|
}
|
||||||
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
|
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||||
if ($arrayquery['options_'.$key.'_cnct']!=''){
|
if ($arrayquery['options_'.$key.'_cnct']!=''){
|
||||||
if ($arrayquery['options_'.$key.'_cnct']==0) {
|
if ($arrayquery['options_'.$key.'_cnct']==0) {
|
||||||
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))";
|
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))";
|
||||||
@ -857,29 +861,32 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
|
|
||||||
//Standard Extrafield feature
|
//Standard Extrafield feature
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||||
|
$elementtype = Societe::$table_element;
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
dol_include_once('/core/class/extrafields.class.php');
|
dol_include_once('/core/class/extrafields.class.php');
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('societe');
|
|
||||||
|
|
||||||
foreach($extralabels as $key=>$val) {
|
$extrafields->fetch_name_optionals_label($elementtype);
|
||||||
|
|
||||||
if (($extrafields->attribute_type[$key] == 'varchar') ||
|
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
|
||||||
($extrafields->attribute_type[$key] == 'text')) {
|
|
||||||
|
if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
|
||||||
|
($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
|
||||||
if (!empty($arrayquery['options_'.$key])) {
|
if (!empty($arrayquery['options_'.$key])) {
|
||||||
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
|
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
|
||||||
}
|
}
|
||||||
} elseif (($extrafields->attribute_type[$key] == 'int') ||
|
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
|
||||||
($extrafields->attribute_type[$key] == 'double')) {
|
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
|
||||||
if (!empty($arrayquery['options_'.$key.'_max'])) {
|
if (!empty($arrayquery['options_'.$key.'_max'])) {
|
||||||
$sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
|
$sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
|
||||||
}
|
}
|
||||||
} elseif (($extrafields->attribute_type[$key] == 'date') ||
|
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
|
||||||
($extrafields->attribute_type[$key] == 'datetime')) {
|
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
|
||||||
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
|
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
|
||||||
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
|
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
|
||||||
}
|
}
|
||||||
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
|
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||||
if ($arrayquery['options_'.$key]!=''){
|
if ($arrayquery['options_'.$key]!=''){
|
||||||
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
|
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ $hookmanager->initHooks(array('mailinglist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -93,7 +93,7 @@ $object = new Propal($db);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
if ($id > 0 || ! empty($ref)) {
|
if ($id > 0 || ! empty($ref)) {
|
||||||
@ -410,7 +410,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
@ -841,9 +841,8 @@ if (empty($reshook))
|
|||||||
if (empty($remise_percent)) $remise_percent=0;
|
if (empty($remise_percent)) $remise_percent=0;
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
$extrafieldsline = new ExtraFields($db);
|
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
|
||||||
// Unset extrafield
|
// Unset extrafield
|
||||||
if (is_array($extralabelsline)) {
|
if (is_array($extralabelsline)) {
|
||||||
// Get extra fields
|
// Get extra fields
|
||||||
@ -1210,9 +1209,8 @@ if (empty($reshook))
|
|||||||
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
$extrafieldsline = new ExtraFields($db);
|
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
|
||||||
// Unset extrafield
|
// Unset extrafield
|
||||||
if (is_array($extralabelsline)) {
|
if (is_array($extralabelsline)) {
|
||||||
// Get extra fields
|
// Get extra fields
|
||||||
@ -1379,8 +1377,7 @@ if (empty($reshook))
|
|||||||
$object->oldcopy = dol_clone($object);
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -1598,7 +1595,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
// Contacts (ask contact only if thirdparty already defined). TODO do this also into order and invoice.
|
// Contacts (ask contact only if thirdparty already defined).
|
||||||
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td>';
|
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td>';
|
||||||
$form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist);
|
$form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1903,7 +1900,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||||
$notify = new Notify($db);
|
$notify = new Notify($db);
|
||||||
$formquestion = array_merge($formquestion, array(
|
$formquestion = array_merge($formquestion, array(
|
||||||
array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
|
array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -1983,7 +1980,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
if ($usercancreate)
|
if ($usercancreate)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
@ -2049,7 +2046,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $langs->trans('Date');
|
print $langs->trans('Date');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdate&id=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdate&id=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
|
||||||
@ -2075,7 +2072,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $langs->trans('DateEndPropal');
|
print $langs->trans('DateEndPropal');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
|
||||||
@ -2103,7 +2100,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $langs->trans('PaymentConditionsShort');
|
print $langs->trans('PaymentConditionsShort');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editconditions' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editconditions' && $usercancreate) {
|
||||||
@ -2131,7 +2128,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print ' (' . $langs->trans('AfterOrder') . ')';
|
print ' (' . $langs->trans('AfterOrder') . ')';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editavailability' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editavailability' && $usercancreate) {
|
||||||
@ -2150,7 +2147,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $langs->trans('SendingMethod');
|
print $langs->trans('SendingMethod');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editshippingmethod' && $usercancreate)
|
if ($action != 'editshippingmethod' && $usercancreate)
|
||||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editshippingmethod' && $usercancreate) {
|
if ($action == 'editshippingmethod' && $usercancreate) {
|
||||||
@ -2168,7 +2165,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $langs->trans('Source');
|
print $langs->trans('Source');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdemandreason' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdemandreason' && $usercancreate) {
|
||||||
@ -2186,7 +2183,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $langs->trans('PaymentMode');
|
print $langs->trans('PaymentMode');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) {
|
||||||
@ -2206,7 +2203,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmulticurrencycode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editmulticurrencycode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmulticurrencycode' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmulticurrencycode' && $usercancreate) {
|
||||||
@ -2223,7 +2220,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmulticurrencyrate' && $object->statut == Propal::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate)
|
if ($action != 'editmulticurrencyrate' && $object->statut == Propal::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate)
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') && $usercancreate) {
|
||||||
@ -2263,7 +2260,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print $langs->trans('BankAccount');
|
print $langs->trans('BankAccount');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editbankaccount' && $usercancreate)
|
if ($action != 'editbankaccount' && $usercancreate)
|
||||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editbankaccount') {
|
if ($action == 'editbankaccount') {
|
||||||
@ -2298,7 +2295,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
print $langs->trans('IncotermLabel');
|
print $langs->trans('IncotermLabel');
|
||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($usercancreate) print '<a href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
if ($usercancreate) print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -2496,7 +2493,7 @@ $formquestion = array_merge($formquestion, array(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED) {
|
if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||||
if ($usercansend) {
|
if ($usercansend) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a></div>';
|
||||||
} else
|
} else
|
||||||
|
|||||||
@ -171,7 +171,7 @@ if ($object->id > 0)
|
|||||||
if ($user->rights->propal->creer)
|
if ($user->rights->propal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||
@ -122,7 +122,7 @@ if ($object->id > 0)
|
|||||||
if ($user->rights->propal->creer)
|
if ($user->rights->propal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||
@ -58,7 +58,7 @@ $help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES
|
|||||||
|
|
||||||
llxHeader("", $langs->trans("ProspectionArea"), $help_url);
|
llxHeader("", $langs->trans("ProspectionArea"), $help_url);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ProspectionArea"));
|
print load_fiche_titre($langs->trans("ProspectionArea"), '', 'commercial');
|
||||||
|
|
||||||
//print '<table width="100%" class="notopnoleftnoright">';
|
//print '<table width="100%" class="notopnoleftnoright">';
|
||||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||||
|
|||||||
@ -87,7 +87,7 @@ if (! empty($conf->projet->enabled))
|
|||||||
if ($user->rights->propal->creer)
|
if ($user->rights->propal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||
@ -129,7 +129,7 @@ $hookmanager->initHooks(array('propallist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -1013,9 +1013,8 @@ if ($resql)
|
|||||||
// Author
|
// Author
|
||||||
if (! empty($arrayfields['u.login']['checked']))
|
if (! empty($arrayfields['u.login']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td class="center nowraponall">';
|
||||||
if ($userstatic->id) print $userstatic->getLoginUrl(1);
|
if ($userstatic->id) print $userstatic->getLoginUrl(1);
|
||||||
else print ' ';
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1088,7 +1087,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Date cloture
|
// Date cloture
|
||||||
if (! empty($arrayfields['p.date_cloture']['checked']))
|
if (! empty($arrayfields['p.date_cloture']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
|
|||||||
@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($user->rights->propal->creer)
|
if ($user->rights->propal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||
@ -63,7 +63,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
<td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||||
<td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td>
|
<td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td>
|
||||||
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||||
<td class="linkedcol-amount right"><?php
|
<td class="linkedcol-amount right"><?php
|
||||||
|
|||||||
@ -70,6 +70,7 @@ $action = GETPOST('action', 'alpha');
|
|||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
|
$contactid = GETPOST('contactid', 'int');
|
||||||
$projectid = GETPOST('projectid', 'int');
|
$projectid = GETPOST('projectid', 'int');
|
||||||
$origin = GETPOST('origin', 'alpha');
|
$origin = GETPOST('origin', 'alpha');
|
||||||
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
|
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
|
||||||
@ -88,7 +89,7 @@ $object = new Commande($db);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||||
@ -284,7 +285,7 @@ if (empty($reshook))
|
|||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -673,9 +674,8 @@ if (empty($reshook))
|
|||||||
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
|
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
$extrafieldsline = new ExtraFields($db);
|
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
|
||||||
// Unset extrafield
|
// Unset extrafield
|
||||||
if (is_array($extralabelsline)) {
|
if (is_array($extralabelsline)) {
|
||||||
// Get extra fields
|
// Get extra fields
|
||||||
@ -1037,9 +1037,8 @@ if (empty($reshook))
|
|||||||
$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value
|
$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value
|
||||||
|
|
||||||
// Extrafields Lines
|
// Extrafields Lines
|
||||||
$extrafieldsline = new ExtraFields($db);
|
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
|
||||||
// Unset extrafield POST Data
|
// Unset extrafield POST Data
|
||||||
if (is_array($extralabelsline)) {
|
if (is_array($extralabelsline)) {
|
||||||
foreach ($extralabelsline as $key => $value) {
|
foreach ($extralabelsline as $key => $value) {
|
||||||
@ -1297,8 +1296,7 @@ if (empty($reshook))
|
|||||||
$object->oldcopy = dol_clone($object);
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -1649,8 +1647,9 @@ if ($action == 'create' && $usercancreate)
|
|||||||
|
|
||||||
// Contact of order
|
// Contact of order
|
||||||
if ($socid > 0) {
|
if ($socid > 0) {
|
||||||
|
// Contacts (ask contact only if thirdparty already defined).
|
||||||
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td>';
|
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td>';
|
||||||
$form->select_contacts($soc->id, $setcontact, 'contactid', 1, $srccontactslist, '', 1);
|
$form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Ligne info remises tiers
|
// Ligne info remises tiers
|
||||||
@ -2096,7 +2095,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
if ($usercancreate)
|
if ($usercancreate)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
@ -2542,7 +2541,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
// Send
|
// Send
|
||||||
if ($object->statut > Commande::STATUS_DRAFT) {
|
if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||||
if ($usercansend) {
|
if ($usercansend) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a></div>';
|
||||||
} else
|
} else
|
||||||
|
|||||||
@ -165,7 +165,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($user->rights->commande->creer)
|
if ($user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
|||||||