Merge branch 'Dolibarr:develop' into develop
This commit is contained in:
commit
a231b44aae
44
ChangeLog
44
ChangeLog
@ -2,6 +2,50 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
|
||||
|
||||
FIX: #18353 Invoice list translation issue
|
||||
FIX: #18375 SQL Error on tasks statistics
|
||||
FIX: #18465
|
||||
FIX: #18484
|
||||
FIX: #18531
|
||||
FIX: #18542 REST API: set global $user variable to DolibarrApiAccess::user.
|
||||
FIX: #18544 Shipment REST API: load thirdparty object into the shipment before validating.
|
||||
FIX: #18544 Shipment rest api: load thirdparty object when validating
|
||||
FIX: #18565
|
||||
FIX: #18589 #18617
|
||||
FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility
|
||||
FIX: #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary.
|
||||
FIX: Accountancy - Some problems of length with general & subledger account
|
||||
FIX: add DISTINCT
|
||||
FIX: Add option $noescapecommand in executeCLI for better compatibility
|
||||
FIX: Add token to remove error when removing widget
|
||||
FIX: Add token when remove the last widget on home page
|
||||
FIX: an approved holiday can be canceled by an admin.
|
||||
FIX: better sql request
|
||||
FIX: change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done)
|
||||
FIX: Collapsing of extrafields has disappeared.
|
||||
FIX: Date of payment of subscription must not be set to 1970-01-01.
|
||||
FIX: Export of website generates a package that contains a sql error
|
||||
FIX: Field already present in SQL request
|
||||
FIX: increase maxlength of password input
|
||||
FIX: invoice fetch not found syslog debug level instead of error
|
||||
FIX: Invoice list - Wrong name for column total_tva
|
||||
FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts
|
||||
FIX: Manage credit note on situation invoice for calculate margin
|
||||
FIX: Menu List of project was not visible.
|
||||
FIX: migration script
|
||||
FIX: multicompany transverse mode compatibility
|
||||
FIX: option "Default value for field 'Refuse bulk emailings'"
|
||||
FIX: Recommended session.cookie_samesite must be 'Lax' not 'Strict'.
|
||||
FIX: Relative discount with high nb of decimals
|
||||
FIX: salary extrafields don't work and table is not well named
|
||||
FIX: Supplier invoice list - Wrong language key used
|
||||
FIX: wrong table_element_line
|
||||
FIX: wrong users count in multicompany transverse mode
|
||||
FIX: #yogosha6944 Protection against traversal path.
|
||||
|
||||
|
||||
***** ChangeLog for 14.0.1 compared to 14.0.0 *****
|
||||
|
||||
FIX: $conf->task used but it does not exist, use $conf->projet instead
|
||||
|
||||
@ -4,10 +4,10 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
||||
|
||||
## Supported Versions for security reports
|
||||
|
||||
| Version | Supported |
|
||||
| --------- | ------------------ |
|
||||
| <= 12.* | :x: |
|
||||
| >= 13.* | :white_check_mark: |
|
||||
| Version | Supported |
|
||||
| ---------- | ------------------ |
|
||||
| <= 14.0.1 | :x: |
|
||||
| >= 14.0.2+ | :white_check_mark: |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
@ -239,10 +239,18 @@ fclose($fp);
|
||||
if (empty($buildzip)) {
|
||||
print "File ".$outputfile." generated\n";
|
||||
} else {
|
||||
$result = dol_compress_file($outputfile, $outputfile.'.zip');
|
||||
if ($result > 0) {
|
||||
dol_delete_file($outputfile);
|
||||
print "File ".$outputfile.".zip generated\n";
|
||||
if ($buildzip == '1' || $buildzip == 'zip') {
|
||||
$result = dol_compress_file($outputfile, $outputfile.'.zip', 'zip');
|
||||
if ($result > 0) {
|
||||
dol_delete_file($outputfile);
|
||||
print "File ".$outputfile.".zip generated\n";
|
||||
}
|
||||
} elseif ($buildzip == '2' || $buildzip == 'gz') {
|
||||
$result = dol_compress_file($outputfile, $outputfile.'.gz', 'gz');
|
||||
if ($result > 0) {
|
||||
dol_delete_file($outputfile);
|
||||
print "File ".$outputfile.".gz generated\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,11 +3,26 @@
|
||||
#
|
||||
# Use this sample to search into a ldap
|
||||
#
|
||||
# ldapsearch -h hostname -x
|
||||
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
|
||||
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||
|
||||
# Anonymous access
|
||||
# ldapsearch -h hostname -p 389
|
||||
#
|
||||
# Login access (using a Bind DN)
|
||||
# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
#
|
||||
# Login access in SSL (using a Bind DN)
|
||||
# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local
|
||||
# If it fails, you may try to use "hostname" that is real name of certificate.
|
||||
# You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
# What to search
|
||||
# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local"
|
||||
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra"
|
||||
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)"
|
||||
#
|
||||
# Example to test a ldap search:
|
||||
# ldapsearch -h hostname -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password
|
||||
# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password
|
||||
|
||||
|
||||
@ -479,7 +479,7 @@ class AccountancyExport
|
||||
/**
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
* Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://sage50c.online-help.sage.fr/aide-technique/
|
||||
* In sage software | Use menu : "Exchange" > "Importing entries..."
|
||||
@ -507,7 +507,7 @@ class AccountancyExport
|
||||
|
||||
$Tab = array();
|
||||
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
|
||||
$Tab['code_journal'] = str_pad($data->code_journal, 2);
|
||||
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
|
||||
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
|
||||
@ -515,9 +515,9 @@ class AccountancyExport
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
|
||||
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['type_montant'] = str_pad($data->sens, 1);
|
||||
$Tab['vide'] = str_repeat(' ', 18);
|
||||
$Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr
|
||||
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
$Tab['end'] = 'O2003';
|
||||
$Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel
|
||||
|
||||
$Tab['end_line'] = $end_line;
|
||||
|
||||
|
||||
@ -260,13 +260,13 @@ $y = $year_current;
|
||||
|
||||
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@ -314,12 +314,12 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
@ -344,13 +344,13 @@ print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@ -404,7 +404,7 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
@ -436,7 +436,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("TotalVente").'</td>';
|
||||
print '<tr class="liste_titre"><td lass="left">'.$langs->trans("TotalVente").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@ -497,7 +497,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
print "<br>\n";
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400">'.$langs->trans("TotalMarge").'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("TotalMarge").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
|
||||
@ -149,13 +149,13 @@ $y = $year_current;
|
||||
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@ -197,12 +197,12 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
@ -227,14 +227,14 @@ print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@ -276,13 +276,13 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
@ -314,7 +314,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
|
||||
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
|
||||
@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') {
|
||||
$userstatic->id = $tabuser[$key]['id'];
|
||||
$userstatic->name = $tabuser[$key]['name'];
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -260,13 +260,13 @@ $y = $year_current;
|
||||
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@ -309,12 +309,12 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
@ -339,13 +339,13 @@ print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@ -393,7 +393,7 @@ if ($resql) {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
@ -425,7 +425,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
|
||||
@ -620,10 +620,12 @@ if ($result) {
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($objp->code_buy_p)) {
|
||||
@ -724,11 +726,13 @@ if ($result) {
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '<br>';
|
||||
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
||||
$shelp = '';
|
||||
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
||||
$shelp = '';
|
||||
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Suggested accounting account
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/adherents/admin/adherent.php
|
||||
* \file htdocs/adherents/admin/member.php
|
||||
* \ingroup member
|
||||
* \brief Page to setup the module Foundation
|
||||
*/
|
||||
|
||||
@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') {
|
||||
|
||||
if ($action == 'update') {
|
||||
$public = GETPOST('MEMBER_ENABLE_PUBLIC');
|
||||
$amount = GETPOST('MEMBER_NEWFORM_AMOUNT');
|
||||
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
|
||||
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
|
||||
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
||||
@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td class="right">';
|
||||
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
|
||||
print '<input type="text" class="right width75" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Can edit
|
||||
|
||||
@ -660,7 +660,7 @@ if (empty($reshook)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
|
||||
@ -731,7 +731,7 @@ if (empty($reshook)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
|
||||
@ -802,7 +802,7 @@ if (empty($reshook)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
|
||||
@ -1509,7 +1509,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
|
||||
|
||||
@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -696,7 +696,7 @@ $tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') {
|
||||
$tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
|
||||
}
|
||||
print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
|
||||
print '<label for="use_vat">'.$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
@ -706,7 +706,7 @@ $tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') {
|
||||
$tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
|
||||
}
|
||||
print "<label for=\"no_vat\">".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
|
||||
print '<label for="no_vat">'.$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "</table>";
|
||||
@ -721,12 +721,12 @@ print "</tr>\n";
|
||||
|
||||
if ($mysoc->useLocalTax(1)) {
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> <label for="lt1">'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print '<div class="nobordernopadding">';
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
print '<label for="lt1">'.$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||
print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
|
||||
if (!isOnlyOneLocalTax(1)) {
|
||||
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
||||
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
|
||||
@ -739,11 +739,11 @@ if ($mysoc->useLocalTax(1)) {
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> <label for="nolt1">'.$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
print "<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||
print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
|
||||
print "</td></tr>\n";
|
||||
} else {
|
||||
if (empty($mysoc->country_code)) {
|
||||
@ -765,7 +765,7 @@ print "</tr>\n";
|
||||
|
||||
if ($mysoc->useLocalTax(2)) {
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> <label for="lt2">'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print '<div class="nobordernopadding">';
|
||||
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
|
||||
@ -780,7 +780,7 @@ if ($mysoc->useLocalTax(2)) {
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> <label for="nolt2">'.$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<div>";
|
||||
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
|
||||
@ -803,7 +803,7 @@ print "</table>";
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
if ($mysoc->useRevenueStamp()) {
|
||||
|
||||
@ -220,7 +220,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -217,15 +217,15 @@ class Dolistore
|
||||
for ($i = 0; $i < $nbofcateg; $i++) {
|
||||
$cat = $this->categories[$i];
|
||||
if ($cat->is_root_category == 1 && $parent == 0) {
|
||||
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ';
|
||||
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
|
||||
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.((int) $cat->id).'" ';
|
||||
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a></h3>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
|
||||
$select = ($cat->id == $this->categorie) ? ' selected' : '';
|
||||
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"';
|
||||
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.((int) $cat->id).'"';
|
||||
$html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ';
|
||||
$html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
|
||||
$html .= '>'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
}
|
||||
@ -267,9 +267,9 @@ class Dolistore
|
||||
|
||||
// add image or default ?
|
||||
if ($product->id_default_image != '') {
|
||||
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
|
||||
$images = '<a href="'.$image_url.'" class="documentpreview" target="_blank" mime="image/png" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
|
||||
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
|
||||
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.((int) $product->id).'&id_image='.((int) $product->id_default_image);
|
||||
$images = '<a href="'.urlencode($image_url).'" class="documentpreview" target="_blank" mime="image/png" title="'.dol_escape_htmltag($product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version).'">';
|
||||
$images .= '<img src="'.urlencode($image_url).'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
|
||||
} else {
|
||||
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
|
||||
}
|
||||
@ -277,11 +277,11 @@ class Dolistore
|
||||
// free or pay ?
|
||||
if ($product->price > 0) {
|
||||
$price = '<h3>'.price(price2num($product->price, 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'</h3>';
|
||||
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
} else {
|
||||
$price = '<h3>'.$langs->trans('Free').'</h3>';
|
||||
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
|
||||
$download_link .= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
|
||||
$download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
}
|
||||
|
||||
//checking versions
|
||||
@ -319,14 +319,14 @@ class Dolistore
|
||||
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
|
||||
|
||||
//output template
|
||||
$html .= '<tr class="app oddeven '.$compatible.'">
|
||||
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
|
||||
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
|
||||
.'<br><small>'.$version.'</small></h2>
|
||||
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
|
||||
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">
|
||||
<td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td>
|
||||
<td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1])
|
||||
.'<br><small>'.dol_escape_htmltag($version).'</small></h2>
|
||||
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
|
||||
// do not load if display none
|
||||
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
|
||||
$html .= '<td class="margeCote center">'.$price.'</td>';
|
||||
$html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>';
|
||||
$html .= '<td class="margeCote">'.$download_link.'</td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
@ -343,7 +343,7 @@ class Dolistore
|
||||
public function get_previous_link($text = '<<')
|
||||
{
|
||||
// phpcs:enable
|
||||
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
|
||||
return '<a href="'.$this->get_previous_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@ -356,7 +356,7 @@ class Dolistore
|
||||
public function get_next_link($text = '>>')
|
||||
{
|
||||
// phpcs:enable
|
||||
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
|
||||
return '<a href="'.$this->get_next_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/setup.php
|
||||
* \file htdocs/admin/eventorganization.php
|
||||
* \ingroup eventorganization
|
||||
* \brief EventOrganization setup page.
|
||||
*/
|
||||
@ -48,8 +48,8 @@ $arrayofparameters = array(
|
||||
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
@ -213,7 +213,7 @@ if ($action == 'edit') {
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
@ -264,7 +264,7 @@ if ($action == 'edit') {
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
$formcompany = new FormCompany($db);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1);
|
||||
} elseif ($val['type'] == 'securekey') {
|
||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
@ -305,7 +305,7 @@ if ($action == 'edit') {
|
||||
} else {
|
||||
if (!empty($arrayofparameters)) {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
@ -362,7 +362,7 @@ if ($action == 'edit') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
print $product->getNomUrl(1);
|
||||
} elseif ($resprod < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
@ -445,7 +445,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -252,9 +252,8 @@ if ($resql) {
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>".$langs->trans("RSS")." ".($i + 1)."</td>";
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button buttongen" name="modify" value="'.$langs->trans("Modify").'">';
|
||||
print " ";
|
||||
print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">';
|
||||
print '<input type="submit" class="button buttongen button-save" name="modify" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="delete" value="'.$langs->trans("Delete").'">';
|
||||
print '<input type="hidden" name="norss" value="'.$idrss.'">';
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -47,6 +47,8 @@ if (!$user->admin) {
|
||||
|
||||
// Constant and translation of the module description
|
||||
$modules = array(
|
||||
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
|
||||
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
|
||||
'SOCIETE' => 'FCKeditorForCompany',
|
||||
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||
'DETAILS' => 'FCKeditorForProductDetails',
|
||||
@ -54,11 +56,11 @@ $modules = array(
|
||||
'MAILING' => 'FCKeditorForMailing',
|
||||
'MAIL' => 'FCKeditorForMail',
|
||||
'TICKET' => 'FCKeditorForTicket',
|
||||
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
|
||||
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
|
||||
);
|
||||
// Conditions for the option to be offered
|
||||
$conditions = array(
|
||||
'NOTE_PUBLIC' => 1,
|
||||
'NOTE_PRIVATE' => 1,
|
||||
'SOCIETE' => 1,
|
||||
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
||||
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||
@ -66,11 +68,11 @@ $conditions = array(
|
||||
'MAILING' => !empty($conf->mailing->enabled),
|
||||
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
||||
'TICKET' => !empty($conf->ticket->enabled),
|
||||
'NOTE_PUBLIC' => 1,
|
||||
'NOTE_PRIVATE' => 1,
|
||||
);
|
||||
// Picto
|
||||
$picto = array(
|
||||
'NOTE_PUBLIC' => 'generic',
|
||||
'NOTE_PRIVATE' => 'generic',
|
||||
'SOCIETE' => 'generic',
|
||||
'PRODUCTDESC' => 'product',
|
||||
'DETAILS' => 'product',
|
||||
@ -78,8 +80,6 @@ $picto = array(
|
||||
'MAILING' => 'email',
|
||||
'MAIL' => 'email',
|
||||
'TICKET' => 'ticket',
|
||||
'NOTE_PUBLIC' => 'generic',
|
||||
'NOTE_PRIVATE' => 'generic',
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -43,7 +44,7 @@ if (!$user->admin) {
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search
|
||||
|
||||
$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'language'; // 'language', 'template', 'login', 'other'
|
||||
$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'other'; // 'template', 'dashboard', 'login', 'other'
|
||||
|
||||
if (!defined("MAIN_MOTD")) {
|
||||
define("MAIN_MOTD", "");
|
||||
@ -96,12 +97,6 @@ if ($action == 'removebackgroundlogin' && !empty($conf->global->MAIN_LOGIN_BACKG
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
if ($mode == 'language') {
|
||||
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
||||
//dolibarr_set_const($db, "MAIN_MULTILANGS", GETPOST("MAIN_MULTILANGS"), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if ($mode == 'template') {
|
||||
dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@ -206,7 +201,14 @@ if ($action == 'update') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode == 'dashboard') {
|
||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if ($mode == 'other') {
|
||||
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@ -221,8 +223,6 @@ if ($action == 'update') {
|
||||
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST("MAIN_BUGTRACK_ENABLELINK", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if ($mode == 'login') {
|
||||
@ -301,10 +301,139 @@ print dol_get_fiche_head($head, $mode, '', -1, '');
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if ($mode == 'language') {
|
||||
if ($mode == 'template') {
|
||||
// Themes and themes options
|
||||
showSkins(null, 1);
|
||||
}
|
||||
|
||||
if ($mode == 'dashboard') {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="blockdashboard" class="noborder centpercent editmode tableforfield">';
|
||||
|
||||
// Message of the day on home page
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
print '<tr class="oddeven width25p"><td>';
|
||||
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
|
||||
foreach ($substitutionarray as $key => $val) {
|
||||
$texthelp .= $key . '<br>';
|
||||
}
|
||||
print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
|
||||
|
||||
print '</td><td>';
|
||||
|
||||
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print '</td></tr>' . "\n";
|
||||
|
||||
/* no more need for this option. It is now a widget already controlled by end user
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('BoxstatsDisableGlobal') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_GLOBAL_BOXSTATS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="blockdashboard" class="noborder centpercent editmode tableforfield">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("DashboardDisableBlocks");
|
||||
print '</td><td class="titlefieldmiddle">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableGlobal') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_GLOBAL_WORKBOARD", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
||||
// Block meteo
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('MAIN_DISABLE_METEO') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block agenda
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockAgenda') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block agenda
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockProject') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block customer
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockCustomer') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block supplier
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockSupplier') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block contract
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockContract') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block ticket
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockTicket') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block bank
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockBank') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block adherent
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockAdherent') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block expense report
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockExpenseReport') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Block holiday
|
||||
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockHoliday') . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>' . "\n";
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($mode == 'other') {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Language");
|
||||
print '</td><td class="titlefieldmiddle">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Default language
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print img_picto('', 'language', 'class="pictofixedwidth"');
|
||||
@ -315,32 +444,28 @@ if ($mode == 'language') {
|
||||
|
||||
// Multilingual GUI
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("EnableMultilangInterface") . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'language');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>' . "\n";
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($mode == 'template') {
|
||||
// Themes and themes options
|
||||
showSkins(null, 1);
|
||||
}
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
if ($mode == 'other') {
|
||||
// Other
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="otherparameters" class="noborder centpercent editmode tableforfield">';
|
||||
|
||||
// Disable javascript and ajax
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("DisableJavascript") . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print ' <span class="opacitymedium"> ' . $langs->trans("DisableJavascriptNote") . '</span>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Miscelaneous");
|
||||
print '</td><td class="titlefieldmiddle">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Max size of lists
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
|
||||
@ -393,7 +518,7 @@ if ($mode == 'other') {
|
||||
// Hide unauthorized menus
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("HideUnauthorizedMenu") . '</td><td>';
|
||||
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
|
||||
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
@ -401,7 +526,7 @@ if ($mode == 'other') {
|
||||
// Hide unauthorized button
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("ButtonHideUnauthorized") . '</td><td>';
|
||||
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
|
||||
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
@ -417,7 +542,9 @@ if ($mode == 'other') {
|
||||
*/
|
||||
|
||||
// Show bugtrack link
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")) . '</td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="' . (empty($conf->global->MAIN_BUGTRACK_ENABLELINK) ? '' : $conf->global->MAIN_BUGTRACK_ENABLELINK) . '">';
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
@ -426,29 +553,20 @@ if ($mode == 'other') {
|
||||
// Hide wiki link on login page
|
||||
$pictohelp = '<span class="fa fa-question-circle"></span>';
|
||||
print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
|
||||
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Message of the day on home page
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
|
||||
foreach ($substitutionarray as $key => $val) {
|
||||
$texthelp .= $key . '<br>';
|
||||
}
|
||||
print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
|
||||
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print '</td></tr>' . "\n";
|
||||
// Disable javascript and ajax
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("DisableJavascript") . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
|
||||
print ' <span class="opacitymedium paddingleft marginleft">' . $langs->trans("DisableJavascriptNote") . '</span>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>' . "\n";
|
||||
print '</div>';
|
||||
@ -459,11 +577,16 @@ if ($mode == 'login') {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Parameter");
|
||||
print '</td><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Value");
|
||||
print '</td></tr>';
|
||||
|
||||
// Hide helpcenter link on login page
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>';
|
||||
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
|
||||
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0, 0, 0, '', 'login');
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Message on login page
|
||||
@ -475,13 +598,13 @@ if ($mode == 'login') {
|
||||
$texthelp .= $key . '<br>';
|
||||
}
|
||||
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
|
||||
print '</td><td colspan="2">';
|
||||
print '</td><td>';
|
||||
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>' . "\n";
|
||||
|
||||
// Background
|
||||
print '<tr class="oddeven"><td><label for="imagebackground">' . $langs->trans("BackgroundImageLogin") . ' (png,jpg)</label></td><td colspan="2">';
|
||||
print '<tr class="oddeven"><td><label for="imagebackground">' . $langs->trans("BackgroundImageLogin") . ' (png,jpg)</label></td><td>';
|
||||
print '<div class="centpercent inline-block">';
|
||||
$disabled = '';
|
||||
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||
|
||||
@ -396,7 +396,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -43,6 +43,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('adminldap', 'globaladmin'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -150,7 +151,7 @@ $arraylist['0'] = $langs->trans("No");
|
||||
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr");
|
||||
$arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
|
||||
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnSynchroActiveExample");
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
|
||||
print '<br><font class="error">'.$langs->trans("LDAPSetupNotComplete").'</font>';
|
||||
}
|
||||
@ -163,7 +164,7 @@ if (!empty($conf->societe->enabled)) {
|
||||
$arraylist['0'] = $langs->trans("No");
|
||||
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
|
||||
print $form->selectarray('activecontact', $arraylist, $conf->global->LDAP_CONTACT_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnContactActiveExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>';
|
||||
}
|
||||
|
||||
// Synchro member active
|
||||
@ -174,7 +175,7 @@ if (!empty($conf->adherent->enabled)) {
|
||||
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
|
||||
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
|
||||
print $form->selectarray('activemembers', $arraylist, $conf->global->LDAP_MEMBER_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnMemberActiveExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>';
|
||||
}
|
||||
|
||||
// Synchro member type active
|
||||
@ -185,7 +186,7 @@ if (!empty($conf->adherent->enabled)) {
|
||||
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
|
||||
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
|
||||
print $form->selectarray('activememberstypes', $arraylist, $conf->global->LDAP_MEMBER_TYPE_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnMemberTypeActiveExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>';
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
@ -214,33 +215,33 @@ $arraylist = array();
|
||||
$arraylist['3'] = 'Version 3';
|
||||
$arraylist['2'] = 'Version 2';
|
||||
print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION', $arraylist, $conf->global->LDAP_SERVER_PROTOCOLVERSION);
|
||||
print '</td><td>'.$langs->trans("LDAPServerProtocolVersion").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerProtocolVersion").'</span></td></tr>';
|
||||
|
||||
// Serveur primaire
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("LDAPPrimaryServer").'</td><td>';
|
||||
print '<input size="25" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
|
||||
print '<input class="minwidth200" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
|
||||
|
||||
// Serveur secondaire
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("LDAPSecondaryServer").'</td><td>';
|
||||
print '<input size="25" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
|
||||
print '<input class="minwidth200" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
|
||||
|
||||
// Port
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerPort").'</td><td>';
|
||||
if (!empty($conf->global->LDAP_SERVER_PORT)) {
|
||||
print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
|
||||
print '<input class="width75" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
|
||||
} else {
|
||||
print '<input size="25" type="text" name="port" value="389">';
|
||||
print '<input class="width75" type="text" name="port" value="389">';
|
||||
}
|
||||
print '</td><td>'.$langs->trans("LDAPServerPortExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerPortExample").'</span></td></tr>';
|
||||
|
||||
// DNserver
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerDn").'</td><td>';
|
||||
print '<input size="25" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPServerDnExample").'</td></tr>';
|
||||
print '<input class="minwidth300" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerDnExample").'</span></td></tr>';
|
||||
|
||||
// Utiliser TLS
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerUseTLS").'</td><td>';
|
||||
@ -248,7 +249,7 @@ $arraylist = array();
|
||||
$arraylist['0'] = $langs->trans("No");
|
||||
$arraylist['1'] = $langs->trans("Yes");
|
||||
print $form->selectarray('usetls', $arraylist, $conf->global->LDAP_SERVER_USE_TLS);
|
||||
print '</td><td>'.$langs->trans("LDAPServerUseTLSExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerUseTLSExample").'</span></td></tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("ForANonAnonymousAccess").'</td>';
|
||||
@ -257,18 +258,18 @@ print "</tr>\n";
|
||||
// DNAdmin
|
||||
print '<!-- LDAP_ADMIN_DN -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPAdminDn").'</td><td>';
|
||||
print '<input size="25" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
|
||||
print '<input class="minwidth300" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
|
||||
print '</td><td class="maxwidthhalf"><span class="opacitymedium">'.$langs->trans("LDAPAdminDnExample").'</span></td></tr>';
|
||||
|
||||
// Pass
|
||||
print '<!-- LDAP_ADMIN_PASS -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPPassword").'</td><td>';
|
||||
if (!empty($conf->global->LDAP_ADMIN_PASS)) {
|
||||
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
|
||||
print '<input class="minwidth150" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
|
||||
} else {
|
||||
print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
|
||||
print '<input class="minwidth150" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
|
||||
}
|
||||
print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans('Password').' (ex: secret)</span></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -228,7 +228,7 @@ if (!empty($conf->agenda->enabled)) {
|
||||
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
|
||||
}
|
||||
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) {
|
||||
$elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
|
||||
$elementList['conferenceorbooth'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
|
||||
}
|
||||
if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) {
|
||||
$elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership'));
|
||||
@ -935,7 +935,7 @@ if ($resql) {
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="submit" class="button buttongen" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button buttongen button-save" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
@ -1071,8 +1071,8 @@ if ($resql) {
|
||||
if ($showfield) {
|
||||
print '<!-- '.$fieldlist[$field].' -->';
|
||||
print '<td class="'.$class.'"';
|
||||
if ($value == 'topic') {
|
||||
print ' title="'.$valuetoshow.'"';
|
||||
if (in_array($value, array('code', 'label', 'topic'))) {
|
||||
print ' title="'.dol_escape_htmltag($valuetoshow).'"';
|
||||
}
|
||||
print '>';
|
||||
print $valuetoshow;
|
||||
|
||||
@ -1025,16 +1025,16 @@ if ($mode == 'marketplace') {
|
||||
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">';
|
||||
|
||||
print '<form method="POST" class="centpercent" id="searchFormList" action="'.$dolistore->url.'">';
|
||||
print '<form method="POST" class="centpercent" id="searchFormList" action="'.urlencode($dolistore->url).'">';
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
|
||||
<input type="hidden" name="mode" value="marketplace">
|
||||
<div class="divsearchfield">
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo $options['search'] ?>"><br>
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>"><br>
|
||||
</div>
|
||||
<div class="divsearchfield">
|
||||
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
|
||||
<a class="buttonreset" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
|
||||
<a class="buttonreset" href="<?php echo urlencode($dolistore->url) ?>"><?php echo $langs->trans('Reset') ?></a>
|
||||
|
||||
|
||||
</div>
|
||||
@ -1051,7 +1051,7 @@ if ($mode == 'marketplace') {
|
||||
|
||||
<div id="category-tree-left">
|
||||
<ul class="tree">
|
||||
<?php echo $dolistore->get_categories(); ?>
|
||||
<?php echo dol_escape_htmltag($dolistore->get_categories()); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="listing-content">
|
||||
|
||||
@ -69,7 +69,7 @@ if ($action == 'updateMask') {
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
|
||||
$mo = new MO($db);
|
||||
$mrp->initAsSpecimen();
|
||||
$mo->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file = ''; $classname = ''; $filefound = 0;
|
||||
@ -88,7 +88,7 @@ if ($action == 'updateMask') {
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($mrp, $langs) > 0) {
|
||||
if ($module->write_file($mo, $langs) > 0) {
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ foreach ($arrayhandler as $key => $module) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$tmp.'</span>';
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@ if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="tdoverflowmax300">'.$obj->name.'</td>'."\n";
|
||||
print '<td class="tdoverflowmax600" title="'.dol_escape_htmltag($obj->name).'">'.dol_escape_htmltag($obj->name).'</td>'."\n";
|
||||
print '<td class="tdoverflowmax300">';
|
||||
if (isASecretKey($obj->name)) {
|
||||
if (empty($dolibarr_main_prod)) {
|
||||
|
||||
@ -266,7 +266,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -101,6 +101,10 @@ if ($action == 'setMAIN_ENABLE_OVERWRITE_TRANSLATION') {
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
if ($transkey == '') {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Key")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($transvalue == '') {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors');
|
||||
$error++;
|
||||
@ -108,7 +112,7 @@ if ($action == 'update') {
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".GETPOST('rowid', 'int');
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".((int) GETPOST('rowid', 'int'));
|
||||
$result = $db->query($sql);
|
||||
if ($result > 0) {
|
||||
$db->commit();
|
||||
@ -324,7 +328,13 @@ if ($mode == 'overwrite') {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>'.$obj->lang.'</td>'."\n";
|
||||
print '<td>'.$obj->transkey.'</td>'."\n";
|
||||
print '<td>';
|
||||
if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) {
|
||||
print '<input type="text" class="quatrevingtpercent" name="transkey" value="'.dol_escape_htmltag($obj->transkey).'">';
|
||||
} else {
|
||||
print $obj->transkey;
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
// Value
|
||||
print '<td class="small">';
|
||||
@ -541,7 +551,7 @@ if ($mode == 'searchkey') {
|
||||
print $form->textwithpicto('', $htmltext, 1, 'info');
|
||||
} elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
|
||||
//print $key.'-'.$val;
|
||||
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
|
||||
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("TranslationOverwriteKey")).'</a>';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
||||
|
||||
@ -286,7 +286,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
|
||||
@ -44,8 +44,9 @@ class Login
|
||||
* Login
|
||||
*
|
||||
* Request the API token for a couple username / password.
|
||||
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: The API token (DOLAPIKEY) can be found/set on the user page.
|
||||
* WARNING: You should NEVER use this API, like you should never use the similare API that uses the POST method. This will expose your password.
|
||||
* To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call.
|
||||
* From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs.
|
||||
*
|
||||
* @param string $login User login
|
||||
* @param string $password User password
|
||||
@ -67,8 +68,9 @@ class Login
|
||||
* Login
|
||||
*
|
||||
* Request the API token for a couple username / password.
|
||||
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: The API token (DOLAPIKEY) can be found/set on the user page.
|
||||
* WARNING: You should NEVER use this API, like you should never use the similare API that uses the POST method. This will expose your password.
|
||||
* To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call.
|
||||
* From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs.
|
||||
*
|
||||
* @param string $login User login
|
||||
* @param string $password User password
|
||||
|
||||
@ -946,7 +946,7 @@ class BOM extends CommonObject
|
||||
$this->lines = array();
|
||||
|
||||
$objectline = new BOMLine($this->db);
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.((int) $this->id)));
|
||||
|
||||
if (is_numeric($result)) {
|
||||
$this->error = $this->error;
|
||||
|
||||
@ -58,6 +58,7 @@ class Categorie extends CommonObject
|
||||
const TYPE_ACTIONCOMM = 'actioncomm';
|
||||
const TYPE_WEBSITE_PAGE = 'website_page';
|
||||
const TYPE_TICKET = 'ticket';
|
||||
const TYPE_KNOWLEDGEMANAGEMENT = 'knowledgemanagement';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
@ -81,7 +82,8 @@ class Categorie extends CommonObject
|
||||
'warehouse' => 9,
|
||||
'actioncomm' => 10,
|
||||
'website_page' => 11,
|
||||
'ticket' => 12
|
||||
'ticket' => 12,
|
||||
'knowledgemanagement' => 13
|
||||
);
|
||||
|
||||
/**
|
||||
@ -102,7 +104,8 @@ class Categorie extends CommonObject
|
||||
9 => 'warehouse',
|
||||
10 => 'actioncomm',
|
||||
11 => 'website_page',
|
||||
12 => 'ticket'
|
||||
12 => 'ticket',
|
||||
13 => 'knowledgemanagement'
|
||||
);
|
||||
|
||||
/**
|
||||
@ -146,7 +149,8 @@ class Categorie extends CommonObject
|
||||
'warehouse'=> 'Entrepot',
|
||||
'actioncomm' => 'ActionComm',
|
||||
'website_page' => 'WebsitePage',
|
||||
'ticket' => 'Ticket'
|
||||
'ticket' => 'Ticket',
|
||||
'knowledgemanagement' => 'KnowledgeRecord'
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@ -205,10 +205,14 @@ foreach ($fulltree as $key => $val) {
|
||||
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_view().'</a>';
|
||||
$entry .= '</td>';
|
||||
$entry .= '<td class="right" width="20px;">';
|
||||
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_edit().'</a>';
|
||||
if ($user->rights->categorie->creer) {
|
||||
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type) . '">' . img_edit() . '</a>';
|
||||
}
|
||||
$entry .= '</td>';
|
||||
$entry .= '<td class="right" width="20px;">';
|
||||
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_delete().'</a>';
|
||||
if ($user->rights->categorie->supprimer) {
|
||||
$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '">' . img_delete() . '</a>';
|
||||
}
|
||||
$entry .= '</td>';
|
||||
|
||||
$entry .= '</tr>';
|
||||
|
||||
@ -898,15 +898,23 @@ while ($currentdaytoshow < $lastdaytoshow) {
|
||||
}
|
||||
} else {
|
||||
/* Use this list to have for all users */
|
||||
$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
|
||||
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql .= " WHERE ug.entity IN (".getEntity('usergroup').")";
|
||||
$sql .= " AND ug.fk_user = u.rowid ";
|
||||
} else {
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
||||
}
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
}
|
||||
$sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")";
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " AND u.statut = 1";
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
|
||||
}
|
||||
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@ -399,8 +399,8 @@ if (empty($reshook)) {
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
|
||||
$object->socid = GETPOST('socid', 'int');
|
||||
$object->contact_id = GETPOST('contactid', 'int');
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
@ -841,8 +841,8 @@ if (empty($reshook)) {
|
||||
$tva_tx = '';
|
||||
}
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
|
||||
if (empty($remise_percent)) {
|
||||
$remise_percent = 0;
|
||||
}
|
||||
@ -1229,6 +1229,8 @@ if (empty($reshook)) {
|
||||
$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
|
||||
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
@ -1241,7 +1243,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Define special_code for special lines
|
||||
$special_code = GETPOST('special_code');
|
||||
$special_code = GETPOST('special_code', 'int');
|
||||
if (!GETPOST('qty')) {
|
||||
$special_code = 3;
|
||||
}
|
||||
@ -1260,7 +1262,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -1290,7 +1292,7 @@ if (empty($reshook)) {
|
||||
|
||||
$qty = price2num(GETPOST('qty', 'alpha'), 'MS');
|
||||
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
|
||||
|
||||
if ($result >= 0) {
|
||||
$db->commit();
|
||||
@ -1358,9 +1360,9 @@ if (empty($reshook)) {
|
||||
// Terms of payment
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
} elseif ($action == 'setremisepercent' && $usercancreate) {
|
||||
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent')));
|
||||
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
|
||||
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue')));
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
|
||||
} elseif ($action == 'setmode' && $usercancreate) {
|
||||
// Payment choice
|
||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
||||
|
||||
@ -613,9 +613,9 @@ if (empty($reshook)) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'setremisepercent' && $usercancreate) {
|
||||
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
|
||||
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
|
||||
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU'));
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
|
||||
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') {
|
||||
// Define vat_rate
|
||||
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
|
||||
@ -645,7 +645,7 @@ if (empty($reshook)) {
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
|
||||
|
||||
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
|
||||
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
|
||||
if (empty($remise_percent)) {
|
||||
$remise_percent = 0;
|
||||
}
|
||||
@ -1035,6 +1035,8 @@ if (empty($reshook)) {
|
||||
$special_code = 3;
|
||||
}
|
||||
|
||||
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
|
||||
// Check minimum price
|
||||
$productid = GETPOST('productid', 'int');
|
||||
if (!empty($productid)) {
|
||||
@ -1050,7 +1052,7 @@ if (empty($reshook)) {
|
||||
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -1075,7 +1077,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
|
||||
|
||||
if ($result >= 0) {
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
* \brief Page to list orders
|
||||
*/
|
||||
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
@ -430,7 +429,7 @@ $sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,';
|
||||
$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method,';
|
||||
$sql .= ' c.fk_input_reason';
|
||||
if ($search_categ_cus) {
|
||||
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
|
||||
$sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
@ -447,7 +446,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
||||
if (!empty($search_categ_cus)) {
|
||||
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
|
||||
}
|
||||
$sql .= ', '.MAIN_DB_PREFIX.'commande as c';
|
||||
@ -501,16 +500,13 @@ if ($search_billed != '' && $search_billed >= 0) {
|
||||
$sql .= ' AND c.facture = '.((int) $search_billed);
|
||||
}
|
||||
if ($search_status <> '') {
|
||||
if ($search_status < 4 && $search_status > -4) {
|
||||
if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination)
|
||||
if ($search_status == 1 && empty($conf->expedition->enabled)) {
|
||||
$sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated'
|
||||
} else {
|
||||
$sql .= ' AND c.fk_statut = '.((int) $search_status); // brouillon, validee, en cours, annulee
|
||||
}
|
||||
}
|
||||
if ($search_status == 4) {
|
||||
$sql .= ' AND c.facture = 1'; // invoice created
|
||||
}
|
||||
if ($search_status == -2) { // To process
|
||||
//$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
|
||||
$sql .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
|
||||
@ -520,8 +516,6 @@ if ($search_status <> '') {
|
||||
//$sql.= ' AND c.facture = 0'; // invoice not created
|
||||
$sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed
|
||||
}
|
||||
|
||||
|
||||
if ($search_status == -4) { // "validate and in progress"
|
||||
$sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process
|
||||
}
|
||||
@ -675,9 +669,6 @@ if ($resql) {
|
||||
if ($search_status == 3) {
|
||||
$title .= ' - '.$langs->trans('StatusOrderToBillShort');
|
||||
}
|
||||
if ($search_status == 4) {
|
||||
$title .= ' - '.$langs->trans('StatusOrderProcessedShort');
|
||||
}
|
||||
if ($search_status == -1) {
|
||||
$title .= ' - '.$langs->trans('StatusOrderCanceledShort');
|
||||
}
|
||||
@ -808,7 +799,7 @@ if ($resql) {
|
||||
if ($search_product_category != '') {
|
||||
$param .= '&search_product_category='.urlencode($search_product_category);
|
||||
}
|
||||
if ($search_categ_cus > 0) {
|
||||
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
|
||||
$param .= '&search_categ_cus='.urlencode($search_categ_cus);
|
||||
}
|
||||
if ($show_files) {
|
||||
@ -1254,10 +1245,10 @@ if ($resql) {
|
||||
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
|
||||
-4=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"),
|
||||
-2=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||
);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -5, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
|
||||
@ -889,7 +889,7 @@ if ($resql) {
|
||||
print '</td>';
|
||||
}*/
|
||||
print '<td class="center">';
|
||||
print '<input type="submit" name="save" class="button buttongen marginbottomonly" value="'.$langs->trans("Add").'"><br>';
|
||||
print '<input type="submit" name="save" class="button buttongen marginbottomonly button-add" value="'.$langs->trans("Add").'"><br>';
|
||||
print '<input type="submit" name="cancel" class="button buttongen marginbottomonly button-cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -433,8 +433,8 @@ if (empty($reshook)) {
|
||||
$tva_tx = '';
|
||||
}
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
@ -781,6 +781,8 @@ if (empty($reshook)) {
|
||||
$result = -1;
|
||||
}*/
|
||||
|
||||
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
|
||||
// Check minimum price
|
||||
$productid = GETPOST('productid', 'int');
|
||||
if (!empty($productid)) {
|
||||
@ -797,7 +799,7 @@ if (empty($reshook)) {
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent', 2)) / 100) < price2num($price_min)))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -830,8 +832,8 @@ if (empty($reshook)) {
|
||||
$vat_rate,
|
||||
$localtax1_rate,
|
||||
$localtax1_rate,
|
||||
GETPOST('productid'),
|
||||
price2num(GETPOST('remise_percent'), 2),
|
||||
GETPOST('productid', 'int'),
|
||||
$remise_percent,
|
||||
'HT',
|
||||
$info_bits,
|
||||
0,
|
||||
@ -1226,6 +1228,8 @@ if ($action == 'create') {
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$morehtmlright = '';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
@ -521,7 +521,7 @@ if (empty($reshook)) {
|
||||
$result = $object->setBankAccount(GETPOST('fk_account', 'int'));
|
||||
} elseif ($action == 'setremisepercent' && $usercancreate) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
|
||||
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
|
||||
} elseif ($action == "setabsolutediscount" && $usercancreate) {
|
||||
// POST[remise_id] or POST[remise_id_for_payment]
|
||||
|
||||
@ -1037,8 +1037,8 @@ if (empty($reshook)) {
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||
@ -1094,7 +1094,7 @@ if (empty($reshook)) {
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||
@ -1309,7 +1309,7 @@ if (empty($reshook)) {
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->amount = price2num(GETPOST('amount'));
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||
@ -1390,7 +1390,7 @@ if (empty($reshook)) {
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->amount = price2num(GETPOST('amount'));
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||
@ -1813,7 +1813,7 @@ if (empty($reshook)) {
|
||||
$product->fetch(GETPOST('idprod'.$i, 'int'));
|
||||
$startday = dol_mktime(12, 0, 0, GETPOST('date_start'.$i.'month'), GETPOST('date_start'.$i.'day'), GETPOST('date_start'.$i.'year'));
|
||||
$endday = dol_mktime(12, 0, 0, GETPOST('date_end'.$i.'month'), GETPOST('date_end'.$i.'day'), GETPOST('date_end'.$i.'year'));
|
||||
$result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i)), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit);
|
||||
$result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i), '', 2), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1914,8 +1914,8 @@ if (empty($reshook)) {
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
|
||||
$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
|
||||
// Proprietes particulieres a facture de remplacement
|
||||
|
||||
@ -2001,8 +2001,8 @@ if (empty($reshook)) {
|
||||
$tva_tx = '';
|
||||
}
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef), 'MS');
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
|
||||
$qty = price2num(GETPOST('qty'.$predef), 'MS', 2);
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
@ -2404,6 +2404,8 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
|
||||
// Check minimum price
|
||||
$productid = GETPOST('productid', 'int');
|
||||
if (!empty($productid)) {
|
||||
@ -2420,7 +2422,7 @@ if (empty($reshook)) {
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
|
||||
if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
|
||||
if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -2473,7 +2475,7 @@ if (empty($reshook)) {
|
||||
$description,
|
||||
$pu_ht,
|
||||
$qty,
|
||||
price2num(GETPOST('remise_percent'), 2),
|
||||
$remise_percent,
|
||||
$date_start,
|
||||
$date_end,
|
||||
$vat_rate,
|
||||
@ -4671,7 +4673,7 @@ if ($action == 'create') {
|
||||
print '<input type="hidden" name="revenuestamp" id="revenuestamp_val" value="'.price2num($object->revenuestamp).'">';
|
||||
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
|
||||
print ' → <span id="revenuestamp_span"></span>';
|
||||
print ' <input type="submit" class="button buttongen" value="'.$langs->trans('Modify').'">';
|
||||
print ' <input type="submit" class="button buttongen button-save" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
print " <script>
|
||||
$(document).ready(function(){
|
||||
|
||||
@ -74,12 +74,22 @@ $search_montant_vat = GETPOST('search_montant_vat');
|
||||
$search_montant_ttc = GETPOST('search_montant_ttc');
|
||||
$search_payment_mode = GETPOST('search_payment_mode');
|
||||
$search_payment_term = GETPOST('search_payment_term');
|
||||
$search_day = GETPOST('search_day', 'int');
|
||||
$search_year = GETPOST('search_year', 'int');
|
||||
$search_month = GETPOST('search_month', 'int');
|
||||
$search_day_date_when = GETPOST('search_day_date_when', 'int');
|
||||
$search_year_date_when = GETPOST('search_year_date_when', 'int');
|
||||
$search_month_date_when = GETPOST('search_month_date_when', 'int');
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_when_startday = GETPOST('search_date_when_startday', 'int');
|
||||
$search_date_when_startmonth = GETPOST('search_date_when_startmonth', 'int');
|
||||
$search_date_when_startyear = GETPOST('search_date_when_startyear', 'int');
|
||||
$search_date_when_endday = GETPOST('search_date_when_endday', 'int');
|
||||
$search_date_when_endmonth = GETPOST('search_date_when_endmonth', 'int');
|
||||
$search_date_when_endyear = GETPOST('search_date_when_endyear', 'int');
|
||||
$search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver
|
||||
$search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear);
|
||||
$search_recurring = GETPOST('search_recurring', 'int');
|
||||
$search_frequency = GETPOST('search_frequency', 'alpha');
|
||||
$search_unit_frequency = GETPOST('search_unit_frequency', 'alpha');
|
||||
@ -206,12 +216,22 @@ if (empty($reshook)) {
|
||||
$search_montant_ttc = '';
|
||||
$search_payment_mode = '';
|
||||
$search_payment_term = '';
|
||||
$search_day = '';
|
||||
$search_year = '';
|
||||
$search_month = '';
|
||||
$search_day_date_when = '';
|
||||
$search_year_date_when = '';
|
||||
$search_month_date_when = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startyear = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_when_startday = '';
|
||||
$search_date_when_startmonth = '';
|
||||
$search_date_when_startyear = '';
|
||||
$search_date_when_endday = '';
|
||||
$search_date_when_endmonth = '';
|
||||
$search_date_when_endyear = '';
|
||||
$search_date_when_start = '';
|
||||
$search_date_when_end = '';
|
||||
$search_recurring = '';
|
||||
$search_frequency = '';
|
||||
$search_unit_frequency = '';
|
||||
@ -326,8 +346,18 @@ if ($search_status != '' && $search_status >= -1) {
|
||||
$sql .= ' AND suspended = 1';
|
||||
}
|
||||
}
|
||||
$sql .= dolSqlDateFilter('f.date_last_gen', $search_day, $search_month, $search_year);
|
||||
$sql .= dolSqlDateFilter('f.date_when', $search_day_date_when, $search_month_date_when, $search_year_date_when);
|
||||
if ($search_date_start) {
|
||||
$sql .= " AND f.date_last_gen >= '".$db->idate($search_date_start)."'";
|
||||
}
|
||||
if ($search_date_end) {
|
||||
$sql .= " AND f.date_last_gen <= '".$db->idate($search_date_end)."'";
|
||||
}
|
||||
if ($search_date_when_start) {
|
||||
$sql .= " AND f.date_when >= '".$db->idate($search_date_when_start)."'";
|
||||
}
|
||||
if ($search_date_when_end) {
|
||||
$sql .= " AND f.date_when <= '".$db->idate($search_date_when_end)."'";
|
||||
}
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@ -357,23 +387,41 @@ if ($resql) {
|
||||
if ($socid > 0) {
|
||||
$param .= '&socid='.urlencode($socid);
|
||||
}
|
||||
if ($search_day) {
|
||||
$param .= '&search_day='.urlencode($search_day);
|
||||
if ($search_date_startday) {
|
||||
$param .= '&search_date_startday='.urlencode($search_date_startday);
|
||||
}
|
||||
if ($search_month) {
|
||||
$param .= '&search_month='.urlencode($search_month);
|
||||
if ($search_date_startmonth) {
|
||||
$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
|
||||
}
|
||||
if ($search_year) {
|
||||
$param .= '&search_year='.urlencode($search_year);
|
||||
if ($search_date_startyear) {
|
||||
$param .= '&search_date_startyear='.urlencode($search_date_startyear);
|
||||
}
|
||||
if ($search_day_date_when) {
|
||||
$param .= '&search_day_date_when='.urlencode($search_day_date_when);
|
||||
if ($search_date_endday) {
|
||||
$param .= '&search_date_endday='.urlencode($search_date_endday);
|
||||
}
|
||||
if ($search_month_date_when) {
|
||||
$param .= '&search_month_date_when='.urlencode($search_month_date_when);
|
||||
if ($search_date_endmonth) {
|
||||
$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
|
||||
}
|
||||
if ($search_year_date_when) {
|
||||
$param .= '&search_year_date_when='.urlencode($search_year_date_when);
|
||||
if ($search_date_endyear) {
|
||||
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
|
||||
}
|
||||
if ($search_date_when_startday) {
|
||||
$param .= '&search_date_when_startday='.urlencode($search_date_when_startday);
|
||||
}
|
||||
if ($search_date_when_startmonth) {
|
||||
$param .= '&search_date_when_startmonth='.urlencode($search_date_when_startmonth);
|
||||
}
|
||||
if ($search_date_when_startyear) {
|
||||
$param .= '&search_date_when_startyear='.urlencode($search_date_when_startyear);
|
||||
}
|
||||
if ($search_date_when_endday) {
|
||||
$param .= '&search_date_when_endday='.urlencode($search_date_when_endday);
|
||||
}
|
||||
if ($search_date_when_endmonth) {
|
||||
$param .= '&search_date_when_endmonth='.urlencode($search_date_when_endmonth);
|
||||
}
|
||||
if ($search_date_when_endyear) {
|
||||
$param .= '&search_date_when_endyear='.urlencode($search_date_when_endyear);
|
||||
}
|
||||
if ($search_ref) {
|
||||
$param .= '&search_ref='.urlencode($search_ref);
|
||||
@ -453,7 +501,7 @@ if ($resql) {
|
||||
print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Thirpdarty
|
||||
// Thirdparty
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="liste_titre left"><input class="flat" type="text" size="8" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
}
|
||||
@ -489,19 +537,19 @@ if ($resql) {
|
||||
}
|
||||
if (!empty($arrayfields['recurring']['checked'])) {
|
||||
// Recurring or not
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectyesno('search_recurring', $search_recurring, 1, false, 1);
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['f.frequency']['checked'])) {
|
||||
// Recurring or not
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input class="flat" type="text" size="1" name="search_frequency" value="'.dol_escape_htmltag($search_frequency).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['f.unit_frequency']['checked'])) {
|
||||
// Frequency unit
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input class="flat" type="text" size="1" name="search_unit_frequency" value="'.dol_escape_htmltag($search_unit_frequency).'">';
|
||||
print '</td>';
|
||||
}
|
||||
@ -512,22 +560,24 @@ if ($resql) {
|
||||
}
|
||||
// Date invoice
|
||||
if (!empty($arrayfields['f.date_last_gen']['checked'])) {
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
}
|
||||
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
$formother->select_year($search_year ? $search_year : -1, 'search_year', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle');
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date next generation
|
||||
if (!empty($arrayfields['f.date_when']['checked'])) {
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_date_when" value="'.$search_day_date_when.'">';
|
||||
}
|
||||
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month_date_when" value="'.$search_month_date_when.'">';
|
||||
$formother->select_year($search_year_date_when ? $search_year_date_when : -1, 'search_year_date_when', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle');
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_when_start ? $search_date_when_start : -1, 'search_date_when_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_when_end ? $search_date_when_end : -1, 'search_date_when_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Extra fields
|
||||
@ -559,7 +609,7 @@ if ($resql) {
|
||||
}
|
||||
// Status
|
||||
if (!empty($arrayfields['status']['checked'])) {
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
$liststatus = array(
|
||||
0=>$langs->trans("Draft"),
|
||||
1=>$langs->trans("Active"),
|
||||
|
||||
@ -253,7 +253,7 @@ $arrayfields = array(
|
||||
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
|
||||
if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
|
||||
if (getDolGlobalString("INVOICE_USE_SITUATION") && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
|
||||
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
|
||||
}
|
||||
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
||||
|
||||
@ -321,6 +321,12 @@ if ($search_company) {
|
||||
if ($search_amount != '') {
|
||||
$param .= '&search_amount='.urlencode($search_amount);
|
||||
}
|
||||
if ($search_paymenttype) {
|
||||
$param .= '&search_paymenttype='.urlencode($search_paymenttype);
|
||||
}
|
||||
if ($search_account) {
|
||||
$param .= '&search_account='.urlencode($search_account);
|
||||
}
|
||||
if ($search_payment_num) {
|
||||
$param .= '&search_payment_num='.urlencode($search_payment_num);
|
||||
}
|
||||
|
||||
@ -95,7 +95,9 @@ if (empty($reshook)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
$bank = new Account($db);
|
||||
$bank->fetch($conf->global->{$default_account});
|
||||
if (empty($bank->ics) || empty($bank->ics_transfer)) {
|
||||
if ((empty($bank->ics) && $type !== 'bank-transfer')
|
||||
|| (empty($bank->ics_transfer) && $type === 'bank-transfer')
|
||||
) {
|
||||
$errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}'));
|
||||
setEventMessages($errormessage, null, 'errors');
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php');
|
||||
|
||||
@ -4,8 +4,9 @@
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -50,9 +51,22 @@ $search_ref = GETPOST('search_ref', 'int');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
$search_amount = GETPOST('search_amount', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'int');
|
||||
$search_day_lim = GETPOST('search_day_lim', 'int');
|
||||
$search_month_lim = GETPOST('search_month_lim', 'int');
|
||||
$search_year_lim = GETPOST('search_year_lim', 'int');
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_limit_startday = GETPOST('search_date_limit_startday', 'int');
|
||||
$search_date_limit_startmonth = GETPOST('search_date_limit_startmonth', 'int');
|
||||
$search_date_limit_startyear = GETPOST('search_date_limit_startyear', 'int');
|
||||
$search_date_limit_endday = GETPOST('search_date_limit_endday', 'int');
|
||||
$search_date_limit_endmonth = GETPOST('search_date_limit_endmonth', 'int');
|
||||
$search_date_limit_endyear = GETPOST('search_date_limit_endyear', 'int');
|
||||
$search_date_limit_start = dol_mktime(0, 0, 0, $search_date_limit_startmonth, $search_date_limit_startday, $search_date_limit_startyear);
|
||||
$search_date_limit_end = dol_mktime(23, 59, 59, $search_date_limit_endmonth, $search_date_limit_endday, $search_date_limit_endyear);
|
||||
$search_project_ref = GETPOST('search_project_ref', 'alpha');
|
||||
$search_project = GETPOST('search_project', 'alpha');
|
||||
$search_users = GETPOST('search_users');
|
||||
@ -78,7 +92,6 @@ if (!$sortorder) {
|
||||
$sortorder = "DESC";
|
||||
}
|
||||
|
||||
$year = GETPOST("year", 'int');
|
||||
$filtre = GETPOST("filtre", 'int');
|
||||
|
||||
if (!GETPOSTISSET('search_typeid')) {
|
||||
@ -146,10 +159,22 @@ if (empty($reshook)) {
|
||||
$search_amount = '';
|
||||
$search_status = '';
|
||||
$search_typeid = '';
|
||||
$year = '';
|
||||
$search_day_lim = '';
|
||||
$search_year_lim = '';
|
||||
$search_month_lim = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startyear = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_limit_startday = '';
|
||||
$search_date_limit_startmonth = '';
|
||||
$search_date_limit_startyear = '';
|
||||
$search_date_limit_endday = '';
|
||||
$search_date_limit_endmonth = '';
|
||||
$search_date_limit_endyear = '';
|
||||
$search_date_limit_start = '';
|
||||
$search_date_limit_end = '';
|
||||
$search_project_ref = '';
|
||||
$search_project = '';
|
||||
$search_users = '';
|
||||
@ -192,7 +217,7 @@ if (!empty($conf->projet->enabled)) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON (cs.fk_user = u.rowid)";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .= " AND cs.entity = ".$conf->entity;
|
||||
$sql .= " AND cs.entity = ".((int) $conf->entity);
|
||||
// Search criteria
|
||||
if ($search_ref) {
|
||||
$sql .= " AND cs.ref = '".$db->escape($search_ref)."'";
|
||||
@ -220,15 +245,17 @@ if ($search_amount) {
|
||||
if ($search_status != '' && $search_status >= 0) {
|
||||
$sql .= " AND cs.paye = ".((int) $search_status);
|
||||
}
|
||||
$sql .= dolSqlDateFilter("cs.periode", $search_day_lim, $search_month_lim, $search_year_lim);
|
||||
//$sql.= dolSqlDateFilter("cs.periode", 0, 0, $year);
|
||||
if ($year > 0) {
|
||||
$sql .= " AND (";
|
||||
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
|
||||
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
|
||||
$sql .= " (cs.periode IS NOT NULL AND date_format(cs.periode, '%Y') = '".$db->escape($year)."') ";
|
||||
$sql .= "OR (cs.periode IS NULL AND date_format(cs.date_ech, '%Y') = '".$db->escape($year)."')";
|
||||
$sql .= ")";
|
||||
if ($search_date_start) {
|
||||
$sql .= " AND cs.date_ech >= '".$db->idate($search_date_start)."'";
|
||||
}
|
||||
if ($search_date_end) {
|
||||
$sql .= " AND cs.date_ech <= '".$db->idate($search_date_end)."'";
|
||||
}
|
||||
if ($search_date_limit_start) {
|
||||
$sql .= " AND cs.periode >= '".$db->idate($search_date_limit_start)."'";
|
||||
}
|
||||
if ($search_date_limit_end) {
|
||||
$sql .= " AND cs.periode <= '".$db->idate($search_date_limit_end)."'";
|
||||
}
|
||||
if ($search_typeid > 0) {
|
||||
$sql .= " AND cs.fk_type = ".((int) $search_typeid);
|
||||
@ -293,8 +320,41 @@ if ($search_account) {
|
||||
if ($search_status != '' && $search_status != '-1') {
|
||||
$param .= '&search_status='.urlencode($search_status);
|
||||
}
|
||||
if ($year) {
|
||||
$param .= '&year='.urlencode($year);
|
||||
if ($search_date_startday) {
|
||||
$param .= '&search_date_startday='.urlencode($search_date_startday);
|
||||
}
|
||||
if ($search_date_startmonth) {
|
||||
$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
|
||||
}
|
||||
if ($search_date_startyear) {
|
||||
$param .= '&search_date_startyear='.urlencode($search_date_startyear);
|
||||
}
|
||||
if ($search_date_endday) {
|
||||
$param .= '&search_date_endday='.urlencode($search_date_endday);
|
||||
}
|
||||
if ($search_date_endmonth) {
|
||||
$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
|
||||
}
|
||||
if ($search_date_endyear) {
|
||||
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
|
||||
}
|
||||
if ($search_date_limit_startday) {
|
||||
$param .= '&search_date_limit_startday='.urlencode($search_date_limit_startday);
|
||||
}
|
||||
if ($search_date_limit_startmonth) {
|
||||
$param .= '&search_date_limit_startmonth='.urlencode($search_date_limit_startmonth);
|
||||
}
|
||||
if ($search_date_limit_startyear) {
|
||||
$param .= '&search_date_limit_startyear='.urlencode($search_date_limit_startyear);
|
||||
}
|
||||
if ($search_date_limit_endday) {
|
||||
$param .= '&search_date_limit_endday='.urlencode($search_date_limit_endday);
|
||||
}
|
||||
if ($search_date_limit_endmonth) {
|
||||
$param .= '&search_date_limit_endmonth='.urlencode($search_date_limit_endmonth);
|
||||
}
|
||||
if ($search_date_limit_endyear) {
|
||||
$param .= '&search_date_limit_endyear='.urlencode($search_date_limit_endyear);
|
||||
}
|
||||
|
||||
$newcardbutton = '';
|
||||
@ -315,11 +375,6 @@ print '<input type="hidden" name="search_status" value="'.$search_status.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$center = '';
|
||||
if ($year) {
|
||||
$center = '<a href="list.php?year='.($year - 1).'">'.img_previous().'</a>';
|
||||
$center .= ' '.$langs->trans("Year").' '.$year;
|
||||
$center .= ' <a href="list.php?year='.($year + 1).'">'.img_next().'</a>';
|
||||
}
|
||||
|
||||
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
@ -375,18 +430,25 @@ if (!empty($arrayfields['cs.fk_type']['checked'])) {
|
||||
|
||||
// Filter: Date (placeholder)
|
||||
if (!empty($arrayfields['cs.date_ech']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Filter: Period end date
|
||||
if (!empty($arrayfields['cs.periode']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_lim" value="'.dol_escape_htmltag($search_day_lim).'">';
|
||||
}
|
||||
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month_lim" value="'.dol_escape_htmltag($search_month_lim).'">';
|
||||
$formother->select_year($search_year_lim ? $search_year_lim : -1, 'search_year_lim', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle');
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_limit_start ? $search_date_limit_start : -1, 'search_date_limit_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_limit_end ? $search_date_limit_end : -1, 'search_date_limit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -452,13 +514,13 @@ if (!empty($arrayfields['cs.rowid']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.rowid']['label'], $_SERVER["PHP_SELF"], "cs.rowid", '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.libelle']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.libelle']['label'], $_SERVER["PHP_SELF"], "cs.libelle", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['cs.libelle']['label'], $_SERVER["PHP_SELF"], "cs.libelle,cs.periode", '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.fk_type']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.fk_type']['label'], $_SERVER["PHP_SELF"], "cs.fk_type", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['cs.fk_type']['label'], $_SERVER["PHP_SELF"], "cs.fk_type,cs.periode", '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.date_ech']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.date_ech']['label'], $_SERVER["PHP_SELF"], "cs.date_ech", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($arrayfields['cs.date_ech']['label'], $_SERVER["PHP_SELF"], "cs.date_ech,cs.periode", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['cs.periode']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.periode']['label'], $_SERVER["PHP_SELF"], "cs.periode", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
@ -467,19 +529,19 @@ if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.fk_user']['checked'])) {
|
||||
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'class="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname,cs.periode", "", $param, 'class="left"', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.fk_mode_reglement']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "cs.fk_mode_reglement", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['cs.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "cs.fk_mode_reglement,cs.periode", '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.fk_account']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.fk_account']['label'], $_SERVER["PHP_SELF"], "cs.fk_account", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['cs.fk_account']['label'], $_SERVER["PHP_SELF"], "cs.fk_account,cs.periode", '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.amount']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.amount']['label'], $_SERVER["PHP_SELF"], "cs.amount", '', $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['cs.amount']['label'], $_SERVER["PHP_SELF"], "cs.amount,cs.periode", '', $param, 'class="right"', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['cs.paye']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cs.paye']['label'], $_SERVER["PHP_SELF"], "cs.paye", '', $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['cs.paye']['label'], $_SERVER["PHP_SELF"], "cs.paye,cs.periode", '', $param, 'class="right"', $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
// Hook fields
|
||||
@ -549,13 +611,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Date end period
|
||||
if (!empty($arrayfields['cs.periode']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if ($obj->periode) {
|
||||
print '<a href="list.php?search_year_lim='.dol_print_date($db->jdate($obj->periode), "%Y").'">';
|
||||
print dol_print_date($db->jdate($obj->periode), 'day');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->periode), 'day').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -437,7 +437,7 @@ if ($action == 'create') {
|
||||
print '<tr><td colspan="2"><hr></td></tr>';
|
||||
|
||||
// Auto create payment
|
||||
print '<tr><td>'.$langs->trans('AutomaticCreationPayment').'</td>';
|
||||
print '<tr><td><label for="auto_create_paiement">'.$langs->trans('AutomaticCreationPayment').'</label></td>';
|
||||
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_payment) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="hide_if_no_auto_create_payment">';
|
||||
|
||||
@ -1172,25 +1172,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
if (!empty($conf->commande->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
|
||||
print $object->ref_commande ? $object->ref_commande : $langs->trans("NoContactForAnyOrder");
|
||||
print $object->ref_commande ? $object->ref_commande : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyOrder").'</span>');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (!empty($conf->propal->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
||||
print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal");
|
||||
print $object->ref_propal ? $object->ref_propal : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyProposal").'</span>');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
|
||||
print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract");
|
||||
print $object->ref_contrat ? $object->ref_contrat : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyContract").'</span>');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (!empty($conf->facture->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
||||
print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice");
|
||||
print $object->ref_facturation ? $object->ref_facturation : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyInvoice").'</span>');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -1201,7 +1201,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$result = $dolibarr_user->fetch($object->user_id);
|
||||
print $dolibarr_user->getLoginUrl(1);
|
||||
} else {
|
||||
print $langs->trans("NoDolibarrAccess");
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -90,21 +90,19 @@ class Contact extends CommonObject
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>15),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
|
||||
'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>25, 'searchall'=>1),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>30, 'index'=>1),
|
||||
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>3, 'position'=>35),
|
||||
'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>3, 'position'=>40),
|
||||
'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'showoncombobox'=>1, 'searchall'=>1),
|
||||
'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1),
|
||||
'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>52),
|
||||
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
||||
'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>1, 'position'=>60),
|
||||
'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
||||
'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>3, 'position'=>70),
|
||||
'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>3, 'position'=>75),
|
||||
'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>77, 'searchall'=>1),
|
||||
'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>3, 'position'=>80),
|
||||
'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
|
||||
'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>1, 'position'=>90, 'searchall'=>1),
|
||||
'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'searchall'=>1),
|
||||
'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'searchall'=>1),
|
||||
@ -113,15 +111,17 @@ class Contact extends CommonObject
|
||||
'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>3, 'position'=>115),
|
||||
'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>3, 'position'=>170),
|
||||
'priv' =>array('type'=>'smallint(6)', 'label'=>'ContactVisibility', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>175),
|
||||
'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'Fk stcommcontact', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220),
|
||||
'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'ProspectStatus', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220),
|
||||
'fk_prospectlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255),
|
||||
'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>185),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'position'=>190),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>195, 'searchall'=>1),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>200, 'searchall'=>1),
|
||||
'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>3, 'position'=>205),
|
||||
'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>3, 'position'=>210),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>300),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>305),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>310),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'position'=>315),
|
||||
'statut' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>1000),
|
||||
);
|
||||
|
||||
@ -227,7 +227,7 @@ if (empty($reshook)) {
|
||||
$object->note_private = GETPOST('note_private', 'alpha');
|
||||
$object->note_public = GETPOST('note_public', 'alpha');
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
$object->ref = GETPOST('ref', 'alpha');
|
||||
$object->ref_customer = GETPOST('ref_customer', 'alpha');
|
||||
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
|
||||
@ -1202,12 +1202,8 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
print "</form>\n";
|
||||
} else /* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode vue et edition */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
{
|
||||
} else {
|
||||
// View and edit mode
|
||||
$now = dol_now();
|
||||
|
||||
if ($object->id > 0) {
|
||||
|
||||
@ -131,6 +131,10 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
$result = $object->create($user);
|
||||
if ($result > 0) {
|
||||
// Creation OK
|
||||
if ($conf->categorie->enabled) {
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
}
|
||||
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
|
||||
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
|
||||
header("Location: ".$urltogo);
|
||||
@ -229,6 +233,11 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->categorie->enabled) {
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
}
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
|
||||
@ -1287,6 +1287,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
|
||||
$objecttmp = new $objectclass($db);
|
||||
$nbok = 0;
|
||||
$TMsg = array();
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
@ -1314,7 +1315,9 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
$result = $objecttmp->delete($user);
|
||||
}
|
||||
|
||||
if ($result <= 0) {
|
||||
if (empty($result)) { // if delete returns 0, there is at least one object linked
|
||||
$TMsg = array_merge($objecttmp->errors, $TMsg);
|
||||
} elseif ($result < 0) { // if delete returns is < 0, there is an error, we break and rollback later
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
@ -1328,16 +1331,25 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (empty($error)) {
|
||||
// Message for elements well deleted
|
||||
if ($nbok > 1) {
|
||||
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
||||
} else {
|
||||
} elseif ($nbok == 1) {
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
|
||||
// Message for elements which can't be deleted
|
||||
if (!empty($TMsg)) {
|
||||
sort($TMsg);
|
||||
setEventMessages('', array_unique($TMsg), 'warnings');
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
//var_dump($listofobjectthirdparties);exit;
|
||||
}
|
||||
|
||||
|
||||
120
htdocs/core/ajax/fetchKnowledgeRecord.php
Normal file
120
htdocs/core/ajax/fetchKnowledgeRecord.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file /htdocs/core/ajax/fetchKnowledgeRecord.php
|
||||
* \brief File to make Ajax action on Knowledge Management
|
||||
*/
|
||||
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
||||
}
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
}
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define('NOCSRFCHECK', '1');
|
||||
}
|
||||
// Do not check anti CSRF attack test
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
define('NOREQUIREMENU', '1');
|
||||
}
|
||||
// If there is no need to load and show top and left menu
|
||||
if (!defined("NOLOGIN")) {
|
||||
define("NOLOGIN", '1');
|
||||
}
|
||||
if (!defined('NOIPCHECK')) {
|
||||
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
}
|
||||
if (!defined('NOBROWSERNOTIF')) {
|
||||
define('NOBROWSERNOTIF', '1');
|
||||
}
|
||||
include '../../main.inc.php';
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$idticketgroup = GETPOST('idticketgroup', 'aZ09');
|
||||
$idticketgroup = GETPOST('idticketgroup', 'aZ09');
|
||||
$lang = GETPOST('lang', 'aZ09');
|
||||
$popupurl = GETPOST('popupurl', 'bool');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
if ($action == "getKnowledgeRecord") {
|
||||
$response = '';
|
||||
$sql = "SELECT kr.rowid, kr.ref, kr.question, kr.answer,l.url,ctc.code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."links as l";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as kr ON kr.rowid = l.objectid";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_ticket_category as ctc ON ctc.rowid = kr.fk_c_ticket_category";
|
||||
$sql .= " WHERE ctc.code = '".$db->escape($idticketgroup)."'";
|
||||
$sql .= " AND ctc.active = 1 AND ctc.public = 1 AND (kr.lang = '".$db->escape($lang)."' OR kr.lang = 0)";
|
||||
$sql .= " AND kr.status = 1";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$response = array();
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($popupurl == "false") {
|
||||
$url = "<a href=\"".$obj->url. "\" target=\"_blank\">".$obj->url."</a></li>";
|
||||
$response[] = array('title'=>$obj->question,'ref'=>$obj->url,'answer'=>$obj->answer,'url'=>$url);
|
||||
} else {
|
||||
$name = $obj->ref;
|
||||
$buttonstring = $obj->url;
|
||||
$url = $obj->url;
|
||||
$urltoprint = '<a class="button_'.$name.'" style="cursor:pointer">'.$buttonstring.'</a>';
|
||||
$urltoprint .= '<!-- Add js code to open dialog popup on dialog -->';
|
||||
$urltoprint .= '<script language="javascript">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(".button_'.$name.'").click(function () {
|
||||
console.log("Open popup with jQuery(...).dialog() on URL '.dol_escape_js($url).'")
|
||||
var $dialog = $(\'<div></div>\').html(\'<iframe class="iframedialog" style="border: 0px;" src="'.$url.'" width="100%" height="98%"></iframe>\')
|
||||
.dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
height: (window.innerHeight - 150),
|
||||
width: \'80%\',
|
||||
title: "'.dol_escape_js($label).'"
|
||||
});
|
||||
$dialog.dialog(\'open\');
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$response[] = array('title'=>$obj->question,'ref'=>$obj->url,'answer'=>$obj->answer,'url'=>$urltoprint);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$response =json_encode($response);
|
||||
echo $response;
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2015 Regis Houssin <regis.houssin@inodbox.com>
|
||||
/* Copyright (C) 2010-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -79,7 +79,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'facturedet' && $user->rights->facture->creer) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'facturerecdet' && $user->rights->facture->creer) {
|
||||
} elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) {
|
||||
$perm = 1;
|
||||
@ -89,7 +89,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'mrp_production' && $user->rights->mrp->write) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->write) {
|
||||
} elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->creer) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'commande_fournisseurdet' && $user->rights->fournisseur->commande->creer) {
|
||||
$perm = 1;
|
||||
|
||||
@ -53,7 +53,7 @@ top_httphead();
|
||||
|
||||
// Registering the location of boxes
|
||||
if (isset($_GET['action']) && !empty($_GET['action'])) {
|
||||
if ($_GET['action'] == 'getrandompassword' && $user->admin) {
|
||||
if ($_GET['action'] == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
$generic = $_GET['generic'] ? true : false;
|
||||
echo getRandomPassword($generic);
|
||||
|
||||
@ -133,7 +133,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
$thirdpartystatic->outstanding_limit = $objp->outstanding_limit;
|
||||
|
||||
$outstandingtotal = $thirdpartystatic->getOutstandingBills()['opened'];
|
||||
$tmp = $thirdpartystatic->getOutstandingBills();
|
||||
$outstandingtotal = $tmp['opened'];
|
||||
$outstandinglimit = $thirdpartystatic->outstanding_limit;
|
||||
|
||||
if ($outstandingtotal >= $outstandinglimit) {
|
||||
|
||||
@ -122,7 +122,7 @@ class box_task extends ModeleBoxes
|
||||
$boxcontent .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
|
||||
$selectArray = array('all' => $langs->trans("NoFilter"), 'im_task_contact' => $langs->trans("WhichIamLinkedTo"), 'im_project_contact' => $langs->trans("WhichIamLinkedToProject"));
|
||||
$boxcontent .= $form->selectArray($cookie_name, $selectArray, $filterValue);
|
||||
$boxcontent .= '<button type="submit" class="button buttongen">'.$langs->trans("Refresh").'</button>';
|
||||
$boxcontent .= '<button type="submit" class="button buttongen button-save">'.$langs->trans("Refresh").'</button>';
|
||||
$boxcontent .= '</form>'."\n";
|
||||
$boxcontent .= '</div>'."\n";
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
|
||||
@ -447,6 +447,9 @@ abstract class CommonDocGenerator
|
||||
|
||||
$array_key.'_bank_iban'=>$bank_account->iban,
|
||||
$array_key.'_bank_bic'=>$bank_account->bic,
|
||||
$array_key.'_bank_label'=>$bank_account->label,
|
||||
$array_key.'_bank_number'=>$bank_account->number,
|
||||
$array_key.'_bank_proprio'=>$bank_account->proprio,
|
||||
|
||||
$array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
|
||||
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
|
||||
|
||||
@ -2010,6 +2010,11 @@ abstract class CommonObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
// For backward compatibility
|
||||
if ($this->table_element == 'facture_rec' && $fieldid == 'title') {
|
||||
$fieldid = 'titre';
|
||||
}
|
||||
|
||||
// Security on socid
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) {
|
||||
@ -3840,8 +3845,14 @@ abstract class CommonObject
|
||||
$classfile = 'conferenceorbooth';
|
||||
$classname = 'ConferenceOrBooth';
|
||||
$module = 'eventorganization';
|
||||
} elseif ($objecttype == 'mo') {
|
||||
$classpath = 'mrp/class';
|
||||
$classfile = 'mo';
|
||||
$classname = 'Mo';
|
||||
$module = 'mrp';
|
||||
}
|
||||
|
||||
|
||||
// Here $module, $classfile and $classname are set
|
||||
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype)) {
|
||||
if ($loadalsoobjects) {
|
||||
@ -4292,10 +4303,10 @@ abstract class CommonObject
|
||||
//print 'Found into table '.$table.', type '.$langs->transnoentitiesnoconv($elementname).', haschild='.$haschild;
|
||||
$haschild += $obj->nb;
|
||||
if (is_numeric($elementname)) { // old usage
|
||||
$this->errors[] = $langs->trans("ErrorRecordHasAtLeastOneChildOfType", $table);
|
||||
$this->errors[] = $langs->transnoentities("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $table);
|
||||
} else // new usage: $elementname=Translation key
|
||||
{
|
||||
$this->errors[] = $langs->trans("ErrorRecordHasAtLeastOneChildOfType", $langs->transnoentitiesnoconv($elementname));
|
||||
$this->errors[] = $langs->transnoentities("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $langs->transnoentitiesnoconv($elementname));
|
||||
}
|
||||
break; // We found at least one, we stop here
|
||||
}
|
||||
@ -6721,9 +6732,9 @@ abstract class CommonObject
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if ($translabel != $obj->$field_toshow) {
|
||||
$labeltoshow = dol_trunc($translabel, 18).' ';
|
||||
$labeltoshow = dol_trunc($translabel).' ';
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
|
||||
$labeltoshow = dol_trunc($obj->$field_toshow).' ';
|
||||
}
|
||||
}
|
||||
$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
|
||||
@ -6733,7 +6744,7 @@ abstract class CommonObject
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$labeltoshow = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18);
|
||||
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
}
|
||||
if (empty($labeltoshow)) {
|
||||
@ -6916,7 +6927,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
} elseif ($type == 'link') {
|
||||
$param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter]]'
|
||||
$param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'
|
||||
$param_list_array = explode(':', $param_list[0]);
|
||||
$showempty = (($required && $default != '') ? 0 : 1);
|
||||
|
||||
@ -8961,7 +8972,7 @@ abstract class CommonObject
|
||||
* @param User $user User that deletes
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @param int $forcechilddeletion 0=no, 1=Force deletion of children
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @return int <=0 if KO, 0=Nothing done because object has child, >0 if OK
|
||||
*/
|
||||
public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0)
|
||||
{
|
||||
|
||||
@ -388,9 +388,9 @@ class dolReceiptPrinter extends Printer
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
$sql .= ' (name, fk_type, fk_profile, parameter, entity)';
|
||||
$sql .= ' VALUES ("'.$this->db->escape($name).'", '.((int) $type).', '.((int) $profile).', "'.$this->db->escape($parameter).'", '.$conf->entity.')';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt";
|
||||
$sql .= " (name, fk_type, fk_profile, parameter, entity)";
|
||||
$sql .= " VALUES ('".$this->db->escape($name)."', ".((int) $type).", ".((int) $profile).", '".$this->db->escape($parameter)."', ".((int) $conf->entity).")";
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
@ -413,12 +413,14 @@ class dolReceiptPrinter extends Printer
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
$sql .= ' SET name="'.$this->db->escape($name).'"';
|
||||
$sql .= ', fk_type='.((int) $type);
|
||||
$sql .= ', fk_profile='.((int) $profile);
|
||||
$sql .= ', parameter="'.$this->db->escape($parameter).'"';
|
||||
$sql .= ' WHERE rowid='.((int) $printerid);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt";
|
||||
$sql .= " SET name='".$this->db->escape($name)."'";
|
||||
$sql .= ", fk_type=".((int) $type);
|
||||
$sql .= ", fk_profile=".((int) $profile);
|
||||
$sql .= ", parameter='".$this->db->escape($parameter)."'";
|
||||
$sql .= " WHERE rowid=".((int) $printerid);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
@ -458,9 +460,9 @@ class dolReceiptPrinter extends Printer
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt_template';
|
||||
$sql .= ' (name, template, entity) VALUES ("'.$this->db->escape($name).'"';
|
||||
$sql .= ', "'.$this->db->escape($template).'", '.$conf->entity.')';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt_template";
|
||||
$sql .= " (name, template, entity) VALUES ('".$this->db->escape($name)."'";
|
||||
$sql .= ", '".$this->db->escape($template)."', ".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
@ -502,10 +504,11 @@ class dolReceiptPrinter extends Printer
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template';
|
||||
$sql .= ' SET name="'.$this->db->escape($name).'"';
|
||||
$sql .= ', template="'.$this->db->escape($template).'"';
|
||||
$sql .= ' WHERE rowid='.((int) $templateid);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt_template";
|
||||
$sql .= " SET name='".$this->db->escape($name)."'";
|
||||
$sql .= ", template='".$this->db->escape($template)."'";
|
||||
$sql .= " WHERE rowid=".((int) $templateid);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
|
||||
@ -1976,7 +1976,7 @@ class ExtraFields
|
||||
*/
|
||||
public function showSeparator($key, $object, $colspan = 2, $display_type = 'card')
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
if ($display_type=='card') {
|
||||
$tagtype='tr';
|
||||
@ -1989,6 +1989,7 @@ class ExtraFields
|
||||
|
||||
$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">';
|
||||
$out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>';
|
||||
// Some js code will be injected here to manage the collapsing of extrafields
|
||||
$out .='<strong>';
|
||||
$out .= $langs->trans($this->attributes[$object->table_element]['label'][$key]);
|
||||
$out .= '</strong>';
|
||||
@ -2011,15 +2012,17 @@ class ExtraFields
|
||||
$out .= '<script type="text/javascript">'."\n";
|
||||
$out .= 'jQuery(document).ready(function(){'."\n";
|
||||
if ($collapse_display === false) {
|
||||
$out .= ' console.log("Inject js for the collapsing of extrafield '.$key.' - hide");';
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.'").prepend("<span class=\"cursorpointer far fa-plus-square\"></span> ");'."\n";
|
||||
$out .= ' jQuery(".trextrafields_collapse'.$extrafields_collapse_num.'").hide();'."\n";
|
||||
} else {
|
||||
$out .= ' console.log("Inject js for collapsing of extrafield '.$key.' - keep visible and set cookie");';
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.'").prepend("<span class=\"cursorpointer far fa-minus-square\"></span> ");'."\n";
|
||||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
}
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n";
|
||||
$out .= ' console.log("We click on collapse/uncollapse .trextrafields_collapse'.$extrafields_collapse_num.'");'."\n";
|
||||
$out .= ' jQuery(".trextrafields_collapse'.$extrafields_collapse_num.'").toggle(300, function(){'."\n";
|
||||
$out .= ' jQuery(".trextrafields_collapse'.$extrafields_collapse_num.'").toggle(100, function(){'."\n";
|
||||
$out .= ' if (jQuery(".trextrafields_collapse'.$extrafields_collapse_num.'").is(":hidden")) {'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
|
||||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
|
||||
@ -1363,7 +1363,7 @@ class Form
|
||||
$sql .= " AND s.status <> 0";
|
||||
}
|
||||
if (!empty($excludeids)) {
|
||||
$sql .= " AND rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
|
||||
$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
|
||||
}
|
||||
// Add criteria
|
||||
if ($filterkey && $filterkey != '') {
|
||||
@ -3383,9 +3383,9 @@ class Form
|
||||
$opt .= ' disabled';
|
||||
}
|
||||
if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
|
||||
$opt .= ' data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'"';
|
||||
$opt .= ' data-product-id="'.$objp->rowid.'" data-price-id="'.$objp->idprodfournprice.'" data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'"';
|
||||
}
|
||||
$opt .= ' data-description="'.dol_escape_htmltag($objp->description).'"';
|
||||
$opt .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
|
||||
$opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"';
|
||||
$opt .= '>';
|
||||
|
||||
@ -4727,7 +4727,7 @@ class Form
|
||||
foreach ($formquestion as $key => $input) {
|
||||
if (is_array($input) && !empty($input)) {
|
||||
if ($input['type'] == 'hidden') {
|
||||
$more .= '<input type="hidden" id="'.$input['name'].'" name="'.$input['name'].'" value="'.dol_escape_htmltag($input['value']).'">'."\n";
|
||||
$more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'">'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4742,9 +4742,21 @@ class Form
|
||||
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
|
||||
|
||||
if ($input['type'] == 'text') {
|
||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
||||
} elseif ($input['type'] == 'password') {
|
||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
||||
} elseif ($input['type'] == 'textarea') {
|
||||
/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
|
||||
$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
|
||||
$more .= $input['value'];
|
||||
$more .= '</textarea>';
|
||||
$more .= '</div></div>'."\n";*/
|
||||
$moreonecolumn .= '<div class="margintoponly">';
|
||||
$moreonecolumn .= $input['label'].'<br>';
|
||||
$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
|
||||
$moreonecolumn .= $input['value'];
|
||||
$moreonecolumn .= '</textarea>';
|
||||
$moreonecolumn .= '</div>';
|
||||
} elseif ($input['type'] == 'select') {
|
||||
if (empty($morecss)) {
|
||||
$morecss = 'minwidth100';
|
||||
@ -4767,7 +4779,7 @@ class Form
|
||||
} elseif ($input['type'] == 'checkbox') {
|
||||
$more .= '<div class="tagtr">';
|
||||
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
|
||||
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$moreattr;
|
||||
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
|
||||
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0') {
|
||||
$more .= ' checked';
|
||||
}
|
||||
@ -4788,7 +4800,7 @@ class Form
|
||||
} else {
|
||||
$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>';
|
||||
}
|
||||
$more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.$input['name'].$selkey.'" name="'.$input['name'].'" value="'.$selkey.'"'.$moreattr;
|
||||
$more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr;
|
||||
if ($input['disabled']) {
|
||||
$more .= ' disabled';
|
||||
}
|
||||
@ -4796,7 +4808,7 @@ class Form
|
||||
$more .= ' checked="checked"';
|
||||
}
|
||||
$more .= ' /> ';
|
||||
$more .= '<label for="'.$input['name'].$selkey.'">'.$selval.'</label>';
|
||||
$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'">'.$selval.'</label>';
|
||||
$more .= '</div></div>'."\n";
|
||||
$i++;
|
||||
}
|
||||
@ -4921,7 +4933,7 @@ class Form
|
||||
inputvalue = $("#" + inputname + more).val();
|
||||
}
|
||||
if (typeof inputvalue == "undefined") { inputvalue=""; }
|
||||
console.log("check inputname="+inputname+" inputvalue="+inputvalue);
|
||||
console.log("formconfirm check inputname="+inputname+" inputvalue="+inputvalue);
|
||||
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
|
||||
});
|
||||
}
|
||||
@ -6813,7 +6825,7 @@ class Form
|
||||
* Can use autocomplete with ajax after x key pressed or a full combo, depending on setup.
|
||||
* This is the generic method that will replace all specific existing methods.
|
||||
*
|
||||
* @param string $objectdesc ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]
|
||||
* @param string $objectdesc ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]
|
||||
* @param string $htmlname Name of HTML select component
|
||||
* @param int $preselectedvalue Preselected value (ID of element)
|
||||
* @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
|
||||
@ -6838,6 +6850,7 @@ class Form
|
||||
$classpath = $InfoFieldList[1];
|
||||
$addcreatebuttonornot = empty($InfoFieldList[2]) ? 0 : $InfoFieldList[2];
|
||||
$filter = empty($InfoFieldList[3]) ? '' : $InfoFieldList[3];
|
||||
$sortfield = empty($InfoFieldList[4]) ? '' : $InfoFieldList[4];
|
||||
|
||||
if (!empty($classpath)) {
|
||||
dol_include_once($classpath);
|
||||
@ -6883,14 +6896,14 @@ class Form
|
||||
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
|
||||
|
||||
// No immediate load of all database
|
||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
|
||||
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdesc).'&filter='.urlencode($objecttmp->filter).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
|
||||
// Activate the auto complete using ajax call.
|
||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '') .' />';
|
||||
} else {
|
||||
// Immediate load of table record. Note: filter is inside $objecttmp->filter
|
||||
$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled);
|
||||
$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield);
|
||||
}
|
||||
|
||||
return $out;
|
||||
@ -6940,10 +6953,11 @@ class Form
|
||||
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
|
||||
* @param int $outputmode 0=HTML select string, 1=Array
|
||||
* @param int $disabled 1=Html component is disabled
|
||||
* @param string $sortfield Sort field
|
||||
* @return string|array Return HTML string
|
||||
* @see selectForForms()
|
||||
*/
|
||||
public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0)
|
||||
public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0, $sortfield = '')
|
||||
{
|
||||
global $conf, $langs, $user, $hookmanager;
|
||||
|
||||
@ -6995,7 +7009,7 @@ class Form
|
||||
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
@ -7023,7 +7037,7 @@ class Form
|
||||
$sql .= " AND t.fk_soc = ".((int) $user->socid);
|
||||
}
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
@ -7041,7 +7055,7 @@ class Form
|
||||
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'Form::forgeCriteriaCallback', $objecttmp->filter).")";
|
||||
}
|
||||
}
|
||||
$sql .= $this->db->order($fieldstoshow, "ASC");
|
||||
$sql .= $this->db->order($sortfield ? $sortfield : $fieldstoshow, "ASC");
|
||||
//$sql.=$this->db->plimit($limit, 0);
|
||||
//print $sql;
|
||||
|
||||
@ -7877,12 +7891,16 @@ class Form
|
||||
$tplpath = 'eventorganization';
|
||||
} elseif ($objecttype == 'conferenceorboothattendee') {
|
||||
$tplpath = 'eventorganization';
|
||||
} elseif ($objecttype == 'mo') {
|
||||
$tplpath = 'mrp';
|
||||
if (empty($conf->mrp->enabled)) {
|
||||
continue; // Do not show if module disabled
|
||||
}
|
||||
}
|
||||
|
||||
global $linkedObjectBlock;
|
||||
$linkedObjectBlock = $objects;
|
||||
|
||||
|
||||
// Output template part (modules that overwrite templates must declare this into descriptor)
|
||||
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
|
||||
foreach ($dirtpls as $reldir) {
|
||||
@ -7968,7 +7986,8 @@ class Form
|
||||
'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'),
|
||||
'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'),
|
||||
'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled, 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'),
|
||||
'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')')
|
||||
'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'),
|
||||
'mo'=>array('enabled'=>$conf->mrp->enabled, 'perms'=>1, 'label'=>'LinkToMO', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s INNER JOIN ".MAIN_DB_PREFIX."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -717,6 +717,8 @@ class FormCompany extends Form
|
||||
print ' onChange="'.$javaScript.'"';
|
||||
}
|
||||
print '>';
|
||||
print '<option value="-1"> </option>';
|
||||
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
@ -779,7 +781,7 @@ class FormCompany extends Form
|
||||
|
||||
$out .= '<select class="flat valignmiddle'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
if ($showempty) {
|
||||
$out .= '<option value="0"></option>';
|
||||
$out .= '<option value="0"> </option>';
|
||||
}
|
||||
foreach ($lesTypes as $key => $value) {
|
||||
$out .= '<option value="'.$key.'"';
|
||||
@ -996,16 +998,16 @@ class FormCompany extends Form
|
||||
/**
|
||||
* Return a HTML select for thirdparty type
|
||||
*
|
||||
* @param int $selected selected value
|
||||
* @param string $htmlname HTML select name
|
||||
* @param string $htmlidname HTML select id
|
||||
* @param string $typeinput HTML output
|
||||
* @param string $morecss More css
|
||||
* @return string HTML string
|
||||
* @param int $selected Selected value
|
||||
* @param string $htmlname HTML select name
|
||||
* @param string $htmlidname HTML select id
|
||||
* @param string $typeinput HTML output
|
||||
* @param string $morecss More css
|
||||
* @param string $allowempty Allow empty value or not
|
||||
* @return string HTML string
|
||||
*/
|
||||
public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '')
|
||||
public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '', $allowempty = '')
|
||||
{
|
||||
|
||||
global $conf, $langs;
|
||||
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->fournisseur->enabled)) {
|
||||
return '' ;
|
||||
@ -1013,8 +1015,14 @@ class FormCompany extends Form
|
||||
|
||||
$out = '<select class="flat '.$morecss.'" name="'.$htmlname.'" id="'.$htmlidname.'">';
|
||||
if ($typeinput == 'form') {
|
||||
if ($selected == '' || $selected == '-1') {
|
||||
$out .= '<option value="-1"> </option>';
|
||||
if ($allowempty || ($selected == '' || $selected == '-1')) {
|
||||
$out .= '<option value="-1">';
|
||||
if (is_numeric($allowempty)) {
|
||||
$out .= ' ';
|
||||
} else {
|
||||
$out .= $langs->trans($allowempty);
|
||||
}
|
||||
$out .= '</option>';
|
||||
}
|
||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
|
||||
$out .= '<option value="2"'.($selected == 2 ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>';
|
||||
|
||||
@ -1209,7 +1209,7 @@ class FormOther
|
||||
async: false
|
||||
});
|
||||
// We force reload to be sure to get all boxes into list
|
||||
window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'&action=delbox\';
|
||||
window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'&action=delbox&token='.newToken().'\';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -243,6 +243,65 @@ class FormTicket
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->knowledgemanagement->enabled) {
|
||||
// KM Articles
|
||||
print '<tr id="KWwithajax"></tr>';
|
||||
print '<!-- Script to manage change of ticket group -->
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
function groupticketchange(){
|
||||
console.log("We called groupticketchange, so we try to load list KM linked to event");
|
||||
$("#KWwithajax").html("");
|
||||
idgroupticket = $("#selectcategory_code").val();
|
||||
|
||||
console.log("We have selected id="+idgroupticket);
|
||||
|
||||
if (idgroupticket != "") {
|
||||
$.ajax({ url: \''.DOL_URL_ROOT.'/core/ajax/fetchKnowledgeRecord.php\',
|
||||
data: { action: \'getKnowledgeRecord\', idticketgroup: idgroupticket, token: \''.newToken().'\', lang:\''.$langs->defaultlang.'\', popupurl:false},
|
||||
type: \'GET\',
|
||||
success: function(response) {
|
||||
var urllist = \'\';
|
||||
console.log("We received response "+response);
|
||||
response = JSON.parse(response)
|
||||
for (key in response) {
|
||||
console.log(response[key])
|
||||
urllist += "<li>" + response[key].title + ": " +response[key].url+"</li>";
|
||||
}
|
||||
if (urllist != "") {
|
||||
console.log(urllist)
|
||||
$("#KWwithajax").html(\'<td>'.$langs->trans("KMFoundForTicketGroup").'</td><td><ul style="list-style:none;padding-left: 0;">\'+urllist+\'</ul></td>\');
|
||||
$("#KWwithajax").show();
|
||||
}
|
||||
},
|
||||
error : function(output) {
|
||||
console.log("error");
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
$("#selectcategory_code").bind("change",function() { groupticketchange(); });
|
||||
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
||||
var trackChange = function(element) {
|
||||
var observer = new MutationObserver(function(mutations, observer) {
|
||||
if (mutations[0].attributeName == "value") {
|
||||
$(element).trigger("change");
|
||||
}
|
||||
});
|
||||
observer.observe(element, {
|
||||
attributes: true
|
||||
});
|
||||
}
|
||||
|
||||
trackChange($("#selectcategory_code")[0]);
|
||||
|
||||
if ($("#selectcategory_code").val() != "") {
|
||||
groupticketchange();
|
||||
}
|
||||
});
|
||||
</script>'."\n";
|
||||
}
|
||||
|
||||
// MESSAGE
|
||||
$msg = GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : '';
|
||||
print '<tr><td><label for="message"><span class="fieldrequired">'.$langs->trans("Message").'</span></label></td><td>';
|
||||
@ -589,23 +648,29 @@ class FormTicket
|
||||
/**
|
||||
* Return html list of ticket anaytic codes
|
||||
*
|
||||
* @param string $selected Id categorie pre-selectionnée
|
||||
* @param string $htmlname Name of select component
|
||||
* @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users.
|
||||
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
|
||||
* @param int $empty 1=peut etre vide, 0 sinon
|
||||
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
|
||||
* @param int $maxlength Max length of label
|
||||
* @param string $morecss More CSS
|
||||
* @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes.
|
||||
* @param string $selected Id categorie pre-selectionnée
|
||||
* @param string $htmlname Name of select component
|
||||
* @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users.
|
||||
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
|
||||
* @param int $empty 1=peut etre vide, 0 sinon
|
||||
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
|
||||
* @param int $maxlength Max length of label
|
||||
* @param string $morecss More CSS
|
||||
* @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes.
|
||||
* @param Translate $outputlangs Output lnaguage
|
||||
* @return void
|
||||
*/
|
||||
public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0)
|
||||
public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null)
|
||||
{
|
||||
global $langs, $user;
|
||||
global $conf, $langs, $user;
|
||||
|
||||
dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
|
||||
|
||||
if (empty($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
}
|
||||
$outputlangs->load("ticket");
|
||||
|
||||
$ticketstat = new Ticket($this->db);
|
||||
$ticketstat->loadCacheCategoriesTickets();
|
||||
|
||||
@ -629,6 +694,13 @@ class FormTicket
|
||||
continue;
|
||||
}
|
||||
|
||||
$label = ($arraycategories['label'] != '-' ? $arraycategories['label'] : '');
|
||||
if ($outputlangs->trans("TicketCategoryShort".$arraycategories['code']) != ("TicketCategoryShort".$arraycategories['code'])) {
|
||||
$label = $outputlangs->trans("TicketCategoryShort".$arraycategories['code']);
|
||||
} elseif ($outputlangs->trans($arraycategories['code']) != $arraycategories['code']) {
|
||||
$label = $outputlangs->trans($arraycategories['code']);
|
||||
}
|
||||
|
||||
if ($format == 0) {
|
||||
print '<option value="'.$id.'"';
|
||||
}
|
||||
@ -657,7 +729,7 @@ class FormTicket
|
||||
print '>';
|
||||
|
||||
if ($format == 0) {
|
||||
$value = ($maxlength ? dol_trunc($arraycategories['label'], $maxlength) : $arraycategories['label']);
|
||||
$value = ($maxlength ? dol_trunc($label, $maxlength) : $label);
|
||||
}
|
||||
|
||||
if ($format == 1) {
|
||||
@ -665,7 +737,7 @@ class FormTicket
|
||||
}
|
||||
|
||||
if ($format == 2) {
|
||||
$value = ($maxlength ? dol_trunc($arraycategories['label'], $maxlength) : $arraycategories['label']);
|
||||
$value = ($maxlength ? dol_trunc($label, $maxlength) : $label);
|
||||
}
|
||||
|
||||
if ($format == 3) {
|
||||
@ -685,21 +757,26 @@ class FormTicket
|
||||
} elseif ($htmlname!='') {
|
||||
$groupticket=GETPOST($htmlname, 'aZ09');
|
||||
$child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0;
|
||||
$arraycodenotparent[] = "";
|
||||
|
||||
$arrayidused = array();
|
||||
$arrayidusedconcat = array();
|
||||
$arraycodenotparent = array();
|
||||
$arraycodenotparent[] = "";
|
||||
|
||||
$stringtoprint = '<span class="supportemailfield bold">'.$langs->trans("GroupOfTicket").'</span> ';
|
||||
$stringtoprint .= '<select id ="'.$htmlname.'" class="maxwidth500 minwidth400" child_id="0">';
|
||||
$stringtoprint .= '<option value=""> </option>';
|
||||
|
||||
$sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ";
|
||||
$sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ctc.public, ";
|
||||
$sql .= $this->db->ifsql("ctc.rowid NOT IN (SELECT ctcfather.rowid FROM llx_c_ticket_category as ctcfather JOIN llx_c_ticket_category as ctcjoin ON ctcfather.rowid = ctcjoin.fk_parent)", "'NOTPARENT'", "'PARENT'")." as isparent";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc";
|
||||
$sql .= " WHERE ctc.active > 0";
|
||||
$sql .= " WHERE ctc.active > 0 AND ctc.entity = ".((int) $conf->entity);
|
||||
if ($filtertype == 'public=1') {
|
||||
$sql .= " AND ctc.public = 1";
|
||||
}
|
||||
$sql .= " AND ctc.fk_parent = 0";
|
||||
$sql .= $this->db->order('ctc.pos', 'ASC');
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num_rows_level0 = $this->db->num_rows($resql);
|
||||
@ -707,23 +784,32 @@ class FormTicket
|
||||
while ($i < $num_rows_level0) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$label = ($obj->label != '-' ? $obj->label : '');
|
||||
if ($outputlangs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code)) {
|
||||
$label = $outputlangs->trans("TicketCategoryShort".$obj->code);
|
||||
} elseif ($outputlangs->trans($obj->code) != $obj->code) {
|
||||
$label = $outputlangs->trans($obj->code);
|
||||
}
|
||||
|
||||
$grouprowid = $obj->rowid;
|
||||
$groupvalue = $obj->code;
|
||||
$grouplabel = $obj->label;
|
||||
$grouplabel = $label;
|
||||
|
||||
$isparent = $obj->isparent;
|
||||
$iselected = $groupticket == $obj->code ?'selected':'';
|
||||
$stringtoprint .= '<option '.$iselected.' class="'.$htmlname.dol_escape_htmltag($grouprowid).'" value="'.dol_escape_htmltag($groupvalue).'" data-html="'.dol_escape_htmltag($grouplabel).'">'.dol_escape_htmltag($grouplabel).'</option>';
|
||||
if ($isparent == 'NOTPARENT') {
|
||||
$arraycodenotparent[] = $groupvalue;
|
||||
}
|
||||
$arrayidused[]=$grouprowid;
|
||||
$arrayidused[] = $grouprowid;
|
||||
$arrayidusedconcat[] = $grouprowid;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
if ($num_rows_level0 == 1) {
|
||||
if (count($arrayidused) == 1) {
|
||||
return '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.dol_escape_htmltag($groupvalue).'">';
|
||||
} else {
|
||||
$stringtoprint .= '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'_select" class="maxwidth500 minwidth400">';
|
||||
@ -731,20 +817,22 @@ class FormTicket
|
||||
}
|
||||
$stringtoprint .= '</select> ';
|
||||
|
||||
$levelid = 1;
|
||||
while ($levelid <= $use_multilevel) {
|
||||
$levelid = 1; // The first combobox
|
||||
while ($levelid <= $use_multilevel) { // Loop to take the child of the combo
|
||||
$tabscript = array();
|
||||
$stringtoprint .= '<select id ="'.$htmlname.'_child_'.$levelid.'" class="maxwidth500 minwidth400 groupticketchild" child_id="'.$levelid.'">';
|
||||
$stringtoprint .= '<option value=""> </option>';
|
||||
|
||||
$sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ctcjoin.code as codefather, ";
|
||||
$sql .= $this->db->ifsql("ctc.rowid NOT IN (SELECT ctcfather.rowid FROM llx_c_ticket_category as ctcfather JOIN llx_c_ticket_category as ctcjoin ON ctcfather.rowid = ctcjoin.fk_parent)", "'NOTPARENT'", "'PARENT'")." as isparent";
|
||||
$sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ctc.public, ctcjoin.code as codefather";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."c_ticket_category as ctcjoin ON ctc.fk_parent = ctcjoin.rowid";
|
||||
$sql .= " WHERE ctc.active = 1";
|
||||
$sql .= " WHERE ctc.active > 0 AND ctc.entity = ".((int) $conf->entity);
|
||||
$sql .= " AND ctc.rowid NOT IN (".$this->db->sanitize(join(',', $arrayidusedconcat)).")";
|
||||
|
||||
if ($filtertype == 'public=1') {
|
||||
$sql .= " AND ctc.public = 1";
|
||||
}
|
||||
// Add a test to take only record that are direct child
|
||||
if (!empty($arrayidused)) {
|
||||
$sql .= " AND ctc.fk_parent IN ( ";
|
||||
foreach ($arrayidused as $idused) {
|
||||
@ -755,6 +843,7 @@ class FormTicket
|
||||
} else {
|
||||
}
|
||||
$sql .= $this->db->order('ctc.pos', 'ASC');
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
@ -763,12 +852,20 @@ class FormTicket
|
||||
while ($i < $num_rows) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$label = ($obj->label != '-' ? $obj->label : '');
|
||||
if ($outputlangs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code)) {
|
||||
$label = $outputlangs->trans("TicketCategoryShort".$obj->code);
|
||||
} elseif ($outputlangs->trans($obj->code) != $obj->code) {
|
||||
$label = $outputlangs->trans($obj->code);
|
||||
}
|
||||
|
||||
$grouprowid = $obj->rowid;
|
||||
$groupvalue = $obj->code;
|
||||
$grouplabel = $obj->label;
|
||||
$grouplabel = $label;
|
||||
$isparent = $obj->isparent;
|
||||
$fatherid = $obj->fk_parent;
|
||||
$arrayidused[] = $grouprowid;
|
||||
$arrayidusedconcat[] = $grouprowid;
|
||||
$groupcodefather = $obj->codefather;
|
||||
if ($isparent == 'NOTPARENT') {
|
||||
$arraycodenotparent[] = $groupvalue;
|
||||
@ -793,7 +890,7 @@ class FormTicket
|
||||
$stringtoprint .='</select>';
|
||||
|
||||
$stringtoprint .='<script>';
|
||||
$stringtoprint .='arraynotparents = '.json_encode($arraycodenotparent).';';
|
||||
$stringtoprint .='arraynotparents = '.json_encode($arraycodenotparent).';'; // when the last visible combo list is number x, this is the array of group
|
||||
$stringtoprint .='if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value)){
|
||||
console.log("'.$htmlname.'_child_'.$levelid.'")
|
||||
if($("#'.$htmlname.'_child_'.$levelid.'")[0].value == "" && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")>'.$child_id.')){
|
||||
@ -821,10 +918,17 @@ class FormTicket
|
||||
if (arraynotparents.includes(this.value) || $(this).attr("child_id") == '.$use_multilevel.') {
|
||||
$("#ticketcategory_select")[0].value = this.value;
|
||||
$("#ticketcategory_select_child_id")[0].value = $(this).attr("child_id");
|
||||
console.log("We choose to select "+ $("#ticketcategory_select")[0].value );
|
||||
console.log("We choose to select "+ this.value);
|
||||
}else{
|
||||
$("#ticketcategory_select")[0].value = "";
|
||||
$("#ticketcategory_select_child_id")[0].value = "";
|
||||
if ($("#'.$htmlname.'_child_'.$levelid.' option").length <= 1) {
|
||||
$("#ticketcategory_select")[0].value = this.value;
|
||||
$("#ticketcategory_select_child_id")[0].value = $(this).attr("child_id");
|
||||
console.log("We choose to select "+ this.value + " and next combo has no item, so we keep this selection");
|
||||
} else {
|
||||
console.log("We choose to select "+ this.value + " but next combo has some item, so we clean selected item");
|
||||
$("#ticketcategory_select")[0].value = "";
|
||||
$("#ticketcategory_select_child_id")[0].value = "";
|
||||
}
|
||||
}
|
||||
|
||||
console.log("We select a new value into combo child_id="+child_id);
|
||||
@ -840,7 +944,8 @@ class FormTicket
|
||||
|
||||
/* Now we enable the next combo */
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").val("");
|
||||
if (!arraynotparents.includes(this.value)) {
|
||||
if (!arraynotparents.includes(this.value) && $("#'.$htmlname.'_child_'.$levelid.' option").length > 1) {
|
||||
console.log($("#'.$htmlname.'_child_'.$levelid.' option").length);
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").show()
|
||||
} else {
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").hide()
|
||||
|
||||
@ -205,14 +205,26 @@ class Ldap
|
||||
if ($this->serverPing($host, $this->serverPort) === true) {
|
||||
$this->connection = ldap_connect($host, $this->serverPort);
|
||||
} else {
|
||||
continue;
|
||||
if (preg_match('/^ldaps/i', $host)) {
|
||||
// With host = ldaps://server, the serverPing to ssl://server sometimes fails, even if the ldap_connect succeed, so
|
||||
// we test this case and continue in suche a case even if serverPing fails.
|
||||
$this->connection = ldap_connect($host, $this->serverPort);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_resource($this->connection)) {
|
||||
// Begin TLS if requested by the configuration
|
||||
// Upgrade connexion to TLS, if requested by the configuration
|
||||
if (!empty($conf->global->LDAP_SERVER_USE_TLS)) {
|
||||
if (!ldap_start_tls($this->connection)) {
|
||||
// For test/debug
|
||||
//ldap_set_option($this->connection, LDAP_OPT_DEBUG_LEVEL, 7);
|
||||
//ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
|
||||
$resulttls = ldap_start_tls($this->connection);
|
||||
if (!$resulttls) {
|
||||
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
|
||||
$this->error = 'ldap_start_tls Failed to start TLS '.ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
$connected = 0;
|
||||
$this->close();
|
||||
}
|
||||
@ -474,6 +486,11 @@ class Ldap
|
||||
// For better compatibility with Samba4 AD
|
||||
if ($this->serverType == "activedirectory") {
|
||||
unset($info['cn']); // To avoid error : Operation not allowed on RDN (Code 67)
|
||||
|
||||
// To avoid error : LDAP Error: 53 (Unwilling to perform)
|
||||
if (isset($info['unicodePwd'])) {
|
||||
$info['unicodePwd'] = mb_convert_encoding("\"".$info['unicodePwd']."\"", "UTF-16LE", "UTF-8");
|
||||
}
|
||||
}
|
||||
$result = @ldap_modify($this->connection, $dn, $info);
|
||||
|
||||
@ -689,22 +706,38 @@ class Ldap
|
||||
/**
|
||||
* Ping a server before ldap_connect for avoid waiting
|
||||
*
|
||||
* @param string $host Server host or address
|
||||
* @param string $host Server host or address
|
||||
* @param int $port Server port (default 389)
|
||||
* @param int $timeout Timeout in second (default 1s)
|
||||
* @param int $timeout Timeout in second (default 1s)
|
||||
* @return boolean true or false
|
||||
*/
|
||||
public function serverPing($host, $port = 389, $timeout = 1)
|
||||
{
|
||||
// Replace ldaps:// by ssl://
|
||||
$regs = array();
|
||||
if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/', $host, $regs)) {
|
||||
// Replace ldaps:// by ssl://
|
||||
$host = 'ssl://'.$regs[1];
|
||||
}
|
||||
// Remove ldap://
|
||||
if (preg_match('/^ldap:\/\/([^\/]+)\/?$/', $host, $regs)) {
|
||||
} elseif (preg_match('/^ldap:\/\/([^\/]+)\/?$/', $host, $regs)) {
|
||||
// Remove ldap://
|
||||
$host = $regs[1];
|
||||
}
|
||||
|
||||
//var_dump($newhostforstream); var_dump($host); var_dump($port);
|
||||
//$host = 'ssl://ldap.test.local:636';
|
||||
//$port = 636;
|
||||
|
||||
$errno = $errstr = 0;
|
||||
/*
|
||||
if ($methodtochecktcpconnect == 'socket') {
|
||||
Try to use socket_create() method.
|
||||
Method that use stream_context_create() works only on registered listed in stream stream_get_wrappers(): http, https, ftp, ...
|
||||
}
|
||||
*/
|
||||
|
||||
// Use the method fsockopen to test tcp connect. No way to ignore ssl certificate errors with this method !
|
||||
$op = @fsockopen($host, $port, $errno, $errstr, $timeout);
|
||||
|
||||
//var_dump($op);
|
||||
if (!$op) {
|
||||
return false; //DC is N/A
|
||||
} else {
|
||||
|
||||
@ -349,7 +349,7 @@ foreach ($arrayoftype as $key => $val) {
|
||||
}
|
||||
print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1);
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<input type="submit" class="button buttongen" name="changeobjecttype" value="'.$langs->trans("Refresh").'">';
|
||||
print '<input type="submit" class="button buttongen button-save" name="changeobjecttype" value="'.$langs->trans("Refresh").'">';
|
||||
} else {
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
@ -456,7 +456,7 @@ if ($mode == 'graph') {
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="divadvancedsearchfield">';
|
||||
print '<input type="submit" class="button buttongen" value="'.$langs->trans("Refresh").'">';
|
||||
print '<input type="submit" class="button buttongen button-save" value="'.$langs->trans("Refresh").'">';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
@ -110,14 +110,13 @@ print '
|
||||
}
|
||||
|
||||
a.alilevel0 {
|
||||
background-image: url(\''.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/next.png\') !important;
|
||||
background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/next.png\') !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-position-x: 10px;
|
||||
background-position-y: 16px;
|
||||
padding: 1em 15px 1em 40px;
|
||||
}
|
||||
li.lilevel0 font.vsmenudisabled {
|
||||
/* background-image: url(/dolibarr_dev/htdocs/theme/eldy/img/next.png) !important; */
|
||||
background-repeat: no-repeat !important;
|
||||
background-position-x: 10px;
|
||||
background-position-y: 16px;
|
||||
@ -178,6 +177,9 @@ print '
|
||||
white-space: nowrap;
|
||||
display: block;
|
||||
}
|
||||
.vsmenudisabled .fa, .vsmenudisabled .fas, .vsmenudisabled .far {
|
||||
color: #aaa !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@ -1135,7 +1135,7 @@ function price2numjs(amount) {
|
||||
var res = Math.round10(amount, - rounding);
|
||||
// Other solution is
|
||||
// var res = dolroundjs(amount, rounding)
|
||||
console.log("res="+res)
|
||||
console.log("price2numjs text="+amount+" return="+res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -675,26 +675,26 @@ function ihm_prepare_head()
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=language";
|
||||
$head[$h][1] = $langs->trans("DefaultLanguage");
|
||||
$head[$h][2] = 'language';
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=other";
|
||||
$head[$h][1] = $langs->trans("LanguageAndPresentation");
|
||||
$head[$h][2] = 'other';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=template";
|
||||
$head[$h][1] = $langs->trans("DefaultSkin");
|
||||
$head[$h][1] = $langs->trans("SkinAndColors");
|
||||
$head[$h][2] = 'template';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=dashboard";
|
||||
$head[$h][1] = $langs->trans("Dashboard");
|
||||
$head[$h][2] = 'dashboard';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=login";
|
||||
$head[$h][1] = $langs->trans("LoginPage");
|
||||
$head[$h][2] = 'login';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=other";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'other';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin');
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin', 'remove');
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
* @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list)
|
||||
* @param string $urloption More parameters on URL request
|
||||
* @param int $minLength Minimum number of chars to trigger that Ajax search
|
||||
* @param int $autoselect Automatic selection if just one value (trigger("change") on field is done is search return only 1 result)
|
||||
* @param int $autoselect Automatic selection if just one value (trigger("change") on field is done if search return only 1 result)
|
||||
* @param array $ajaxoptions Multiple options array
|
||||
* - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done
|
||||
* - Ex: array('disabled'=> )
|
||||
@ -67,7 +67,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
$script .= '<!-- Javascript code for autocomplete of field '.$htmlname.' -->'."\n";
|
||||
$script .= '<script>'."\n";
|
||||
$script .= '$(document).ready(function() {
|
||||
var autoselect = '.$autoselect.';
|
||||
var autoselect = '.((int) $autoselect).';
|
||||
var options = '.json_encode($ajaxoptions).'; /* Option of actions to do after keyup, or after select */
|
||||
|
||||
/* Remove selected id as soon as we type or delete a char (it means old selection is wrong). Use keyup/down instead of change to avoid loosing the product id. This is needed only for select of predefined product */
|
||||
@ -543,12 +543,14 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
|
||||
* @param int $revertonoff 1=Revert on/off
|
||||
* @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant
|
||||
* @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input)
|
||||
* @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin. Works for fontawesome picto only.
|
||||
* @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin.
|
||||
* @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code.
|
||||
* @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it
|
||||
* @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red'
|
||||
* @param string $mode Add parameter &mode= to the href link (Used for href link)
|
||||
* @return string
|
||||
*/
|
||||
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0)
|
||||
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '')
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
@ -559,9 +561,9 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
|
||||
if (empty($conf->use_javascript_ajax) || $forcenoajax) {
|
||||
if (empty($conf->global->$code)) {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_'.$code.'&token='.newToken().'&entity='.$entity.'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_'.$code.'&token='.newToken().'&entity='.$entity.($mode ? '&mode='.$mode : '').'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_'.$code.'&token='.newToken().'&entity='.$entity.'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_'.$code.'&token='.newToken().'&entity='.$entity.($mode ? '&mode='.$mode : '').'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
}
|
||||
} else {
|
||||
$out = "\n<!-- Ajax code to switch constant ".$code." -->".'
|
||||
@ -607,7 +609,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
|
||||
$out .= '<div id="confirm_'.$code.'" title="" style="display: none;"></div>';
|
||||
$out .= '<span id="set_'.$code.'" class="valignmiddle linkobject '.(!empty($conf->global->$code) ? 'hideobject' : '').'">'.($revertonoff ?img_picto($langs->trans("Enabled"), 'switch_on', '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', $marginleftonlyshort)).'</span>';
|
||||
$out .= '<span id="del_'.$code.'" class="valignmiddle linkobject '.(!empty($conf->global->$code) ? '' : 'hideobject').'">'.($revertonoff ?img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Enabled"), 'switch_on', '', false, 0, 0, '', '', $marginleftonlyshort)).'</span>';
|
||||
$out .= '<span id="del_'.$code.'" class="valignmiddle linkobject '.(!empty($conf->global->$code) ? '' : 'hideobject').'">'.($revertonoff ?img_picto($langs->trans("Disabled"), 'switch_off'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Enabled"), 'switch_on'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort)).'</span>';
|
||||
$out .= "\n";
|
||||
}
|
||||
|
||||
@ -624,9 +626,10 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
* @param string $text_on Text if on
|
||||
* @param string $text_off Text if off
|
||||
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
|
||||
* @param string $morecss More CSS
|
||||
* @return string html for button on/off
|
||||
*/
|
||||
function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array())
|
||||
function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -697,8 +700,8 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$out .= '<span id="set_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? 'hideobject' : '').'">'.img_picto($langs->trans($text_off), 'switch_off').'</span>';
|
||||
$out .= '<span id="del_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').'">'.img_picto($langs->trans($text_on), 'switch_on').'</span>';
|
||||
$out .= '<span id="set_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? 'hideobject' : '').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_off), 'switch_off').'</span>';
|
||||
$out .= '<span id="del_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_on), 'switch_on').'</span>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -1548,7 +1548,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
||||
$sql .= "OR (";
|
||||
}
|
||||
if (!empty($code)) {
|
||||
addEventTypeSQL($sql, $code, $donetodo, $now, $filters, "");
|
||||
addEventTypeSQL($sql, $code);
|
||||
}
|
||||
if ($key != 0) {
|
||||
$sql .= ")";
|
||||
@ -1556,9 +1556,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
||||
}
|
||||
$sql .= ')';
|
||||
} elseif (!empty($actioncode)) {
|
||||
addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters);
|
||||
addEventTypeSQL($sql, $actioncode);
|
||||
}
|
||||
|
||||
addOtherFilterSQL($sql, $donetodo, $now, $filters);
|
||||
|
||||
if (is_array($actioncode)) {
|
||||
foreach ($actioncode as $code) {
|
||||
$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
|
||||
@ -2021,13 +2023,10 @@ function show_subsidiaries($conf, $langs, $db, $object)
|
||||
*
|
||||
* @param string $sql $sql modified
|
||||
* @param string $actioncode Action code
|
||||
* @param string $donetodo donetodo
|
||||
* @param string $now now
|
||||
* @param string $filters array
|
||||
* @param string $sqlANDOR "AND", "OR" or "" sql condition
|
||||
* @return string sql request
|
||||
*/
|
||||
function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDOR = "AND")
|
||||
function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND")
|
||||
{
|
||||
global $conf, $db;
|
||||
// Condition on actioncode
|
||||
@ -2054,6 +2053,23 @@ function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDO
|
||||
}
|
||||
}
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Event Type SQL
|
||||
*
|
||||
* @param string $sql $sql modified
|
||||
* @param string $donetodo donetodo
|
||||
* @param string $now now
|
||||
* @param string $filters array
|
||||
* @return string sql request
|
||||
*/
|
||||
function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
|
||||
{
|
||||
global $conf, $db;
|
||||
// Condition on actioncode
|
||||
|
||||
if ($donetodo == 'todo') {
|
||||
$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||
} elseif ($donetodo == 'done') {
|
||||
|
||||
@ -2303,9 +2303,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
$sqlprotectagainstexternals = '';
|
||||
$ret = array();
|
||||
|
||||
// Find the subdirectory name as the reference. For exemple original_file='10/myfile.pdf' -> refname='10'
|
||||
// Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10'
|
||||
if (empty($refname)) {
|
||||
$refname = basename(dirname($original_file)."/");
|
||||
if ($refname == 'thumbs') {
|
||||
// If we get the thumbns directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10'
|
||||
$refname = basename(dirname(dirname($original_file))."/");
|
||||
}
|
||||
}
|
||||
|
||||
// Define possible keys to use for permission check
|
||||
|
||||
@ -3615,7 +3615,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
|
||||
'off', 'on', 'order',
|
||||
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip',
|
||||
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
|
||||
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
|
||||
'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
|
||||
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
|
||||
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
|
||||
@ -3659,7 +3659,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
|
||||
'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
|
||||
'sign-out'=>'sign-out-alt',
|
||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
||||
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
||||
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
||||
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
||||
@ -3720,7 +3720,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
// Define $marginleftonlyshort
|
||||
$arrayconvpictotomarginleftonly = array(
|
||||
'bank', 'check', 'delete', 'generic', 'grip', 'grip_title', 'jabber',
|
||||
'grip_title', 'grip', 'listlight', 'note', 'on', 'off', 'playdisabled', 'printer', 'resize', 'sign-out', 'stats', 'switch_on', 'switch_off',
|
||||
'grip_title', 'grip', 'listlight', 'note', 'on', 'off', 'playdisabled', 'printer', 'resize', 'sign-out', 'stats', 'switch_on', 'switch_on_red', 'switch_off',
|
||||
'uparrow', '1uparrow', '1downarrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected'
|
||||
);
|
||||
if (!isset($arrayconvpictotomarginleftonly[$pictowithouttext])) {
|
||||
@ -3742,7 +3742,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'members'=>'infobox-adherent', 'member'=>'infobox-adherent', 'money-bill-alt'=>'infobox-bank_account',
|
||||
'order'=>'infobox-commande',
|
||||
'user'=>'infobox-adherent', 'users'=>'infobox-adherent',
|
||||
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
|
||||
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'switch_on_red'=>'font-status8',
|
||||
'holiday'=>'infobox-holiday', 'info'=>'opacityhigh', 'invoice'=>'infobox-commande',
|
||||
'knowledgemanagement'=>'infobox-contrat rotate90', 'loan'=>'infobox-bank_account',
|
||||
'payment'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'pos'=>'infobox-bank_account', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', 'propal'=>'infobox-propal',
|
||||
|
||||
@ -31,16 +31,17 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
* @param Project $project Object related to tabs
|
||||
* @param string $moreparam More param on url
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
function project_prepare_head(Project $project)
|
||||
function project_prepare_head(Project $project, $moreparam = '')
|
||||
{
|
||||
global $db, $langs, $conf, $user;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/card.php?id='.$project->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/card.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
|
||||
$head[$h][1] = $langs->trans("Project");
|
||||
$head[$h][2] = 'project';
|
||||
$h++;
|
||||
@ -56,7 +57,7 @@ function project_prepare_head(Project $project)
|
||||
$nbContacts = count($project->liste_contact(-1, 'internal')) + count($project->liste_contact(-1, 'external'));
|
||||
dol_setcache($cachekey, $nbContacts, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||
}
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.$project->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
|
||||
$head[$h][1] = $langs->trans("ProjectContact");
|
||||
if ($nbContacts > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContacts.'</span>';
|
||||
@ -80,7 +81,7 @@ function project_prepare_head(Project $project)
|
||||
$nbTasks = count($taskstatic->getTasksArray(0, 0, $project->id, 0, 0));
|
||||
dol_setcache($cachekey, $nbTasks, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||
}
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$project->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
|
||||
$head[$h][1] = $langs->trans("Tasks");
|
||||
if ($nbTasks > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbTasks).'</span>';
|
||||
@ -113,7 +114,7 @@ function project_prepare_head(Project $project)
|
||||
}
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.urlencode($project->id);
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
|
||||
$head[$h][1] = $langs->trans("TimeSpent");
|
||||
if ($nbTimeSpent > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">...</span>';
|
||||
@ -207,7 +208,7 @@ function project_prepare_head(Project $project)
|
||||
if ($conf->eventorganization->enabled && !empty($project->usage_organize_event)) {
|
||||
$langs->load('eventorganization');
|
||||
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id;
|
||||
$head[$h][1] = $langs->trans("ConferenceOrBoothTab");
|
||||
$head[$h][1] = $langs->trans("EventOrganization");
|
||||
|
||||
// Enable caching of conf or booth count
|
||||
$nbConfOrBooth = 0;
|
||||
|
||||
@ -611,7 +611,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta
|
||||
$feature = 'projet_task';
|
||||
}
|
||||
|
||||
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salary', 'website'); // Test on entity only (Objects with no link to company)
|
||||
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website'); // Test on entity only (Objects with no link to company)
|
||||
$checksoc = array('societe'); // Test for societe object
|
||||
$checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
|
||||
$checkproject = array('projet', 'project'); // Test for project object
|
||||
|
||||
@ -382,12 +382,18 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
'submenus' => array(),
|
||||
);
|
||||
|
||||
// Tickets and knwoledge base
|
||||
// Tickets and knowledge base
|
||||
$tmpentry = array(
|
||||
'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knwoledgemanagement->enabled)),
|
||||
'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knwoledgemanagement->read)),
|
||||
'module'=>'ticket|knwoledgemanagement'
|
||||
'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)),
|
||||
'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)),
|
||||
'module'=>'ticket|knowledgemanagement'
|
||||
);
|
||||
$link = '';
|
||||
if (!empty($conf->ticket->enabled)) {
|
||||
$link = '/ticket/index.php?mainmenu=ticket&leftmenu=';
|
||||
} else {
|
||||
$link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu=';
|
||||
}
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Ticket',
|
||||
'link' => '/ticket/index.php?mainmenu=ticket&leftmenu=',
|
||||
@ -2092,8 +2098,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url']));
|
||||
}
|
||||
|
||||
if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') { // Enabled so visible, except if parent was not enabled.
|
||||
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring;
|
||||
if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') {
|
||||
// Enabled so visible, except if parent was not enabled.
|
||||
print '<div class="menu_contenu'.$cssmenu.'">';
|
||||
print $tabstring;
|
||||
if ($shorturlwithoutparam) {
|
||||
print '<a class="vsmenu" title="'.dol_escape_htmltag(dol_string_nohtmltag($menu_array[$i]['titre'])).'" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>';
|
||||
} else {
|
||||
@ -2110,8 +2118,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
print '<br>';
|
||||
}
|
||||
print '</div>'."\n";
|
||||
} elseif ($showmenu && $lastlevel0 == 'enabled') { // Not enabled but visible (so greyed), except if parent was not enabled.
|
||||
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
|
||||
} elseif ($showmenu && $lastlevel0 == 'enabled') {
|
||||
// Not enabled but visible (so greyed), except if parent was not enabled.
|
||||
print '<div class="menu_contenu'.$cssmenu.'">';
|
||||
print $tabstring;
|
||||
print '<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -206,6 +206,7 @@ class MenuManager
|
||||
$canonnexturl = preg_replace('/\?.*$/', '', $nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
//var_dump($canonnexturl);
|
||||
|
||||
print '<ul>'."\n";
|
||||
if (($canonrelurl != $canonnexturl && !in_array($val['mainmenu'], array('tools')))
|
||||
|| (strpos($canonrelurl, '/product/index.php') !== false || strpos($canonrelurl, '/compta/bank/list.php') !== false)) {
|
||||
@ -225,15 +226,18 @@ class MenuManager
|
||||
print '</li>'."\n";
|
||||
}
|
||||
|
||||
/*
|
||||
if ($val['level'] == 0) {
|
||||
if ($val['enabled']) {
|
||||
$lastlevel[0] = 'enabled';
|
||||
} elseif ($showmenu) { // Not enabled but visible (so greyed)
|
||||
} elseif ($showmenu) {
|
||||
// Not enabled but visible (so greyed)
|
||||
$lastlevel[0] = 'greyed';
|
||||
} else {
|
||||
$lastlevel[0] = 'hidden';
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$lastlevel2 = array();
|
||||
foreach ($submenu->liste as $key2 => $val2) { // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
@ -313,7 +317,14 @@ class MenuManager
|
||||
print '</ul>';
|
||||
}
|
||||
if ($val['enabled'] == 2) {
|
||||
print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
|
||||
print '<font class="vsmenudisabled">';
|
||||
// Add font-awesome
|
||||
if ($val['level'] == 0 && !empty($val['prefix'])) {
|
||||
print $val['prefix'];
|
||||
}
|
||||
|
||||
print $val['titre'];
|
||||
print '</font>';
|
||||
}
|
||||
print '</li>';
|
||||
print '</ul>'."\n";
|
||||
|
||||
@ -285,13 +285,12 @@ class MenuManager
|
||||
}
|
||||
print $disabled.'">'; // ui-btn to highlight on clic
|
||||
if ($relurl2) {
|
||||
if ($val2['enabled']) { // Allowed
|
||||
print '<a href="'.$relurl2.'"';
|
||||
//print ' data-ajax="false"';
|
||||
print '>';
|
||||
if ($val2['enabled']) {
|
||||
// Allowed
|
||||
print '<a href="'.$relurl2.'">';
|
||||
$lastlevel2[$val2['level']] = 'enabled';
|
||||
} else // Not allowed but visible (greyed)
|
||||
{
|
||||
} else {
|
||||
// Not allowed but visible (greyed)
|
||||
print '<a href="#" class="vsmenudisabled">';
|
||||
$lastlevel2[$val2['level']] = 'greyed';
|
||||
}
|
||||
@ -310,6 +309,7 @@ class MenuManager
|
||||
// Allowed
|
||||
print '</a>';
|
||||
} else {
|
||||
// Not allowed
|
||||
print '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1221,6 +1221,14 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$outputlangsbis = null;
|
||||
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||
$outputlangsbis = new Translate('', $conf);
|
||||
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||
$default_font_size--;
|
||||
}
|
||||
|
||||
$tab2_top = $posy;
|
||||
$tab2_hl = 4;
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
@ -1239,7 +1247,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// Total HT
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1);
|
||||
|
||||
$total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||
|
||||
@ -1368,7 +1368,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$posy = $pdf->GetY();
|
||||
}
|
||||
|
||||
// cumul TVA précédent
|
||||
// Cumulate preceding VAT
|
||||
$index++;
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $posy);
|
||||
@ -1442,7 +1442,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
// Total remise
|
||||
$total_line_remise = 0;
|
||||
foreach ($object->lines as $i => $line) {
|
||||
$total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this methode to core/lib/pdf.lib
|
||||
$total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this method to core/lib/pdf.lib
|
||||
// Gestion remise sous forme de ligne négative
|
||||
if ($line->total_ht < 0) {
|
||||
$total_line_remise += -$line->total_ht;
|
||||
@ -1473,7 +1473,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
// Total HT
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1);
|
||||
|
||||
$total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
@ -75,7 +75,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
|
||||
$tooltip .= $langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Setting the prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):</td>';
|
||||
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):</span></td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskinvoice" value="'.$conf->global->FACTURE_MERCURE_MASK_INVOICE.'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="3"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
@ -83,17 +83,17 @@ class mod_facture_mercure extends ModeleNumRefFactures
|
||||
$texte .= '</tr>';
|
||||
|
||||
// Prefix setting of replacement invoices
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>';
|
||||
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</span></td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskreplacement" value="'.$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '</tr>';
|
||||
|
||||
// Prefix setting of credit note
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</td>';
|
||||
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</span></td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskcredit" value="'.$conf->global->FACTURE_MERCURE_MASK_CREDIT.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '</tr>';
|
||||
|
||||
// Prefix setting of deposit
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):</td>';
|
||||
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):</span></td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskdeposit" value="'.$conf->global->FACTURE_MERCURE_MASK_DEPOSIT.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '</tr>';
|
||||
|
||||
|
||||
@ -134,16 +134,18 @@ class modApi extends DolibarrModules
|
||||
|
||||
// Permissions
|
||||
$this->rights = array(); // Permission array used by this module
|
||||
$this->rights_admin_allowed = 1; // Admin is always granted of permission (even when module is disabled)
|
||||
|
||||
$r = 0;
|
||||
|
||||
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
|
||||
// Example:
|
||||
// $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
// $this->rights[$r][1] = 'Permision label'; // Permission label
|
||||
// $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
// $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
// $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
// $r++;
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Générer / modifier la clé API des utilisateurs'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'apikey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = 'generate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
|
||||
// Main menu entries
|
||||
|
||||
@ -69,12 +69,12 @@ class modFckeditor extends DolibarrModules
|
||||
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for description and note (except products/services)");
|
||||
$this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for products/services description and note");
|
||||
$this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings");
|
||||
$this->const[3] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities");
|
||||
$this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature");
|
||||
$this->const[5] = array("FCKEDITOR_ENABLE_MAIL", "yesno", "1", "WYSIWIG for products details lines for all entities");
|
||||
$this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for description and note (except products/services)");
|
||||
$this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for products/services description and note");
|
||||
$this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings");
|
||||
$this->const[3] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities");
|
||||
$this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature");
|
||||
$this->const[5] = array("FCKEDITOR_ENABLE_MAIL", "yesno", "1", "WYSIWIG for products details lines for all entities");
|
||||
$this->const[6] = array("FCKEDITOR_SKIN", "string", "moono-lisa", "Skin by default for fckeditor");
|
||||
|
||||
// Boxes
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user