Merge remote-tracking branch 'upstream/develop' into socialnetworks
This commit is contained in:
commit
9ec7836387
@ -347,7 +347,7 @@ script:
|
||||
mysql -e 'DROP DATABASE IF EXISTS travis;'
|
||||
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
|
||||
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
||||
mysql -e 'FLUSH PRIVILEGES;'
|
||||
mysql -e 'FLUSH PRIVILEGES;'
|
||||
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
fi
|
||||
if [ "$DB" = 'postgresql' ]; then
|
||||
@ -362,7 +362,7 @@ script:
|
||||
#echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis
|
||||
fi
|
||||
echo
|
||||
|
||||
|
||||
- |
|
||||
echo "Upgrading Dolibarr"
|
||||
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
|
||||
|
||||
@ -30,7 +30,7 @@ Following changes may create regressions for some external modules, but were nec
|
||||
***** ChangeLog for 10.0.3 compared to 10.0.2 *****
|
||||
IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card.
|
||||
The unit were not saved correctly in database making calculation on shipments wrong.
|
||||
Update to this version must be done if you use them and have installed version 10.0.0, 10.0.1 or 10.0.2 and set some products after installing or upgrading to this version.
|
||||
Update to this version must be done if you use them and have installed version 10.0.0, 10.0.1 or 10.0.2 and set some products after installing or upgrading to one of this version.
|
||||
Once update is done you must then edit (manually) the product that has bad unit to set the correct unit to have features restored.
|
||||
|
||||
FIX: #11702
|
||||
@ -92,6 +92,9 @@ FIX: Update of leave request when CSRF with token is on
|
||||
FIX: Var not enough sanitized
|
||||
FIX: wrong test
|
||||
FIX: XSS
|
||||
FIX: Payment from POS ware not recorded.
|
||||
FIX: Can validate invoice with amount including tax of zero for the case of having a final invoice with
|
||||
VAT that includes a deposit without vat.
|
||||
|
||||
***** ChangeLog for 10.0.2 compared to 10.0.1 *****
|
||||
FIX: #10460 compatibility with MariaDB 10.4
|
||||
|
||||
@ -88,11 +88,11 @@ if ($action == 'setlistsorttodo') {
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setlistsortdone') {
|
||||
@ -100,11 +100,11 @@ if ($action == 'setlistsortdone') {
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setmanagezero') {
|
||||
@ -112,11 +112,11 @@ if ($action == 'setmanagezero') {
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdisabledirectinput') {
|
||||
@ -124,11 +124,11 @@ if ($action == 'setdisabledirectinput') {
|
||||
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setenabledraftexport') {
|
||||
@ -136,11 +136,11 @@ if ($action == 'setenabledraftexport') {
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setenablesubsidiarylist') {
|
||||
|
||||
@ -180,8 +180,6 @@ if ($massaction == 'ventil') {
|
||||
}
|
||||
$msg.='</div>';
|
||||
$msg.= '<div>' . $langs->trans("EndProcessing") . '</div>';
|
||||
//} else {
|
||||
// setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -161,8 +161,6 @@ if ($massaction == 'ventil') {
|
||||
}
|
||||
$msg.='</div>';
|
||||
$msg.= '<div>' . $langs->trans("EndProcessing") . '</div>';
|
||||
//} else {
|
||||
// setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -996,7 +996,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
||||
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
|
||||
}
|
||||
else {
|
||||
if ($in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
|
||||
@ -306,49 +306,49 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'expense_report';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
// get compte id and label
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'expense_report';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
|
||||
$accountingaccount->fetch($k, null, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
$accountingaccount->fetch($k, null, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
|
||||
$bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %';
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
$bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %';
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
$totaldebit += $bookkeeping->debit;
|
||||
$totalcredit += $bookkeeping->credit;
|
||||
$totaldebit += $bookkeeping->debit;
|
||||
$totalcredit += $bookkeeping->credit;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -438,48 +438,48 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print "\n";
|
||||
|
||||
foreach ($taber as $key => $val) {
|
||||
$date = dol_print_date($val["date"], 'day');
|
||||
$date = dol_print_date($val["date"], 'day');
|
||||
|
||||
$userstatic->id = $tabuser[$key]['id'];
|
||||
$userstatic->name = $tabuser[$key]['name'];
|
||||
$userstatic->id = $tabuser[$key]['id'];
|
||||
$userstatic->name = $tabuser[$key]['name'];
|
||||
|
||||
// Fees
|
||||
foreach ($tabht[$key] as $k => $mt) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||
print "\n";
|
||||
// Fees
|
||||
foreach ($tabht[$key] as $k => $mt) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
// VAT
|
||||
foreach ($tabtva[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($langs->trans("VAT")) . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||
print "\n";
|
||||
// VAT
|
||||
foreach ($tabtva[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($langs->trans("VAT")) . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Third party
|
||||
foreach ($tabttc[$key] as $k => $mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($userstatic->name) . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||
}
|
||||
print "\n";
|
||||
// Third party
|
||||
foreach ($tabttc[$key] as $k => $mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($userstatic->name) . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -638,29 +638,29 @@ if (empty($action) || $action == 'view') {
|
||||
if ($numtax == 2) $arrayofvat = $tablocaltax2;
|
||||
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- VAT -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $expensereportstatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").'</span>';
|
||||
if ($mt) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- VAT -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $expensereportstatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
print "<td>" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:'');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
print "<td>" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:'');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,7 +294,61 @@ if ($action == 'writebookkeeping') {
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ($tabttc[$key] as $k => $mt) {
|
||||
//if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->date_lim_reglement = $val["datereg"];
|
||||
$bookkeeping->doc_ref = $val["refsologest"];
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_fournisseur;
|
||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
|
||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount");
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
$totaldebit += $bookkeeping->debit;
|
||||
$totalcredit += $bookkeeping->credit;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='alreadyjournalized';
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='other';
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ($tabht[$key] as $k => $mt) {
|
||||
// get compte id and label
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->date_lim_reglement = $val["datereg"];
|
||||
@ -302,20 +356,17 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_fournisseur;
|
||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
|
||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount");
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
@ -341,62 +392,7 @@ if ($action == 'writebookkeeping') {
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ($tabht[$key] as $k => $mt) {
|
||||
//if ($mt) {
|
||||
// get compte id and label
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->date_lim_reglement = $val["datereg"];
|
||||
$bookkeeping->doc_ref = $val["refsologest"];
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_fournisseur;
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
$totaldebit += $bookkeeping->debit;
|
||||
$totalcredit += $bookkeeping->credit;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='alreadyjournalized';
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='other';
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -865,34 +861,32 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Third party
|
||||
foreach ($tabttc[$key] as $k => $mt) {
|
||||
//if ($mt) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Thirdparty -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount") . "</td>";
|
||||
print '<td class="right nowraponall">'. ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
//}
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Thirdparty -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount") . "</td>";
|
||||
print '<td class="right nowraponall">'. ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
@ -900,30 +894,28 @@ if (empty($action) || $action == 'view') {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
|
||||
//if ($mt) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Product -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
//}
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Product -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
// VAT
|
||||
|
||||
@ -124,7 +124,7 @@ if ($in_bookkeeping == 'already')
|
||||
if ($in_bookkeeping == 'notyet')
|
||||
{
|
||||
$sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
|
||||
// $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account
|
||||
// $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account
|
||||
}
|
||||
$sql .= " ORDER BY f.datef";
|
||||
//print $sql;
|
||||
@ -305,7 +305,61 @@ if ($action == 'writebookkeeping') {
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ($tabttc[$key] as $k => $mt) {
|
||||
//if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->date_lim_reglement = $val["datereg"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_client;
|
||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
|
||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount");
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt < 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
$totaldebit += $bookkeeping->debit;
|
||||
$totalcredit += $bookkeeping->credit;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='alreadyjournalized';
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='other';
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ($tabht[$key] as $k => $mt) {
|
||||
// get compte id and label
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->date_lim_reglement = $val["datereg"];
|
||||
@ -315,18 +369,15 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_client;
|
||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
|
||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount");
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt < 0) ? -$mt : 0;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
@ -352,62 +403,7 @@ if ($action == 'writebookkeeping') {
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ($tabht[$key] as $k => $mt) {
|
||||
//if ($mt) {
|
||||
// get compte id and label
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->date_lim_reglement = $val["datereg"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_client;
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
$totaldebit += $bookkeeping->debit;
|
||||
$totalcredit += $bookkeeping->credit;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='alreadyjournalized';
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
$errorforinvoice[$key]='other';
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,34 +797,32 @@ if (empty($action) || $action == 'view') {
|
||||
// Third party
|
||||
foreach ($tabttc[$key] as $k => $mt)
|
||||
{
|
||||
//if ($mt) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Thirdparty -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount") . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
//}
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Thirdparty -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount") . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
@ -837,30 +831,28 @@ if (empty($action) || $action == 'view') {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
|
||||
//if ($mt) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Product -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
//}
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- Product -->";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
// VAT
|
||||
|
||||
@ -184,8 +184,6 @@ if ($massaction == 'ventil') {
|
||||
}
|
||||
$msg.='</div>';
|
||||
$msg.= '<div>' . $langs->trans("EndProcessing") . '</div>';
|
||||
//} else {
|
||||
// setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,17 +26,12 @@ if (empty($conf) || ! is_object($conf))
|
||||
|
||||
$contact = $GLOBALS['objcanvas']->control->object;
|
||||
|
||||
?>
|
||||
echo "<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->\n";
|
||||
echo $this->control->tpl['showhead'];
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->
|
||||
<?php echo $this->control->tpl['showhead']; ?>
|
||||
|
||||
<?php
|
||||
dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
|
||||
?>
|
||||
|
||||
<?php if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?>
|
||||
<?php if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
|
||||
if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user'];
|
||||
if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
|
||||
|
||||
<table class="border allwidth">
|
||||
|
||||
@ -121,29 +116,28 @@ dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors'
|
||||
|
||||
</table>
|
||||
|
||||
<?php echo $this->control->tpl['showend']; ?>
|
||||
<?php echo $this->control->tpl['showend'];
|
||||
|
||||
<?php if (empty($user->societe_id)) { ?>
|
||||
<div class="tabsAction">
|
||||
if (empty($user->societe_id)) {
|
||||
echo '<div class="tabsAction">';
|
||||
|
||||
<?php if ($user->rights->adherent->creer) { ?>
|
||||
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&canvas='.$canvas; ?>"><?php echo $langs->trans('Modify'); ?></a>
|
||||
<?php } ?>
|
||||
if ($user->rights->adherent->creer) {
|
||||
echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
<?php if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) { ?>
|
||||
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=create_user&canvas='.$canvas; ?>"><?php echo $langs->trans("CreateDolibarrLogin"); ?></a>
|
||||
<?php } ?>
|
||||
if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) {
|
||||
echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=create_user&canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
}
|
||||
|
||||
<?php if ($user->rights->adherent->supprimer) { ?>
|
||||
<a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
echo '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
|
||||
</div><br>
|
||||
<?php }
|
||||
echo '</div><br>';
|
||||
}
|
||||
|
||||
echo $this->control->tpl['actionstodo'];
|
||||
|
||||
echo $this->control->tpl['actionsdone'];
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
echo "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -882,18 +882,18 @@ else
|
||||
$object->country_code=$tmparray['code'];
|
||||
$object->country=$tmparray['label'];
|
||||
}
|
||||
|
||||
if (!empty($socid)) {
|
||||
$object = new Societe($db);
|
||||
if ($socid > 0) $object->fetch($socid);
|
||||
|
||||
if (! ($object->id > 0))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print($langs->trans('ErrorRecordNotFound'));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if (!empty($socid)) {
|
||||
$object = new Societe($db);
|
||||
if ($socid > 0) $object->fetch($socid);
|
||||
|
||||
if (! ($object->id > 0))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print($langs->trans('ErrorRecordNotFound'));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
@ -1661,14 +1661,14 @@ if (! ($object->id > 0))
|
||||
else
|
||||
{
|
||||
if ($object->need_subscription == 0)
|
||||
{
|
||||
print $langs->trans("SubscriptionNotNeeded");
|
||||
{
|
||||
print $langs->trans("SubscriptionNotNeeded");
|
||||
}
|
||||
elseif (! $adht->subscription)
|
||||
elseif (! $adht->subscription)
|
||||
{
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
|
||||
@ -2470,7 +2470,7 @@ class Adherent extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
/**
|
||||
* Initialise tableau info (tableau des attributs LDAP)
|
||||
*
|
||||
* @return array Tableau info des attributs
|
||||
|
||||
@ -88,8 +88,8 @@ class AdherentType extends CommonObject
|
||||
|
||||
/** @var array Array of members */
|
||||
public $members=array();
|
||||
|
||||
public $multilangs=array();
|
||||
|
||||
public $multilangs=array();
|
||||
|
||||
|
||||
/**
|
||||
@ -129,9 +129,9 @@ class AdherentType extends CommonObject
|
||||
$this->description = $obj->description;
|
||||
$this->email = $obj->email;
|
||||
}
|
||||
$this->multilangs["$obj->lang"]["label"] = $obj->label;
|
||||
$this->multilangs["$obj->lang"]["description"] = $obj->description;
|
||||
$this->multilangs["$obj->lang"]["email"] = $obj->email;
|
||||
$this->multilangs["$obj->lang"]["label"] = $obj->label;
|
||||
$this->multilangs["$obj->lang"]["description"] = $obj->description;
|
||||
$this->multilangs["$obj->lang"]["email"] = $obj->email;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -141,7 +141,7 @@ class AdherentType extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update or add a translation for a product
|
||||
*
|
||||
@ -248,7 +248,7 @@ class AdherentType extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a language for this product
|
||||
*
|
||||
@ -361,7 +361,7 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public function update($user, $notrigger = 0)
|
||||
{
|
||||
global $langs, $conf, $hookmanager;
|
||||
global $langs, $conf, $hookmanager;
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -383,16 +383,16 @@ class AdherentType extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$this->description = $this->db->escape($this->note);
|
||||
$this->description = $this->db->escape($this->note);
|
||||
|
||||
// Multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||
if ($this->setMultiLangs($user) < 0) {
|
||||
$this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql;
|
||||
return -2;
|
||||
}
|
||||
// Multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||
if ($this->setMultiLangs($user) < 0) {
|
||||
$this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql;
|
||||
return -2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$action='update';
|
||||
|
||||
// Actions on extra fields
|
||||
@ -474,8 +474,8 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
||||
@ -498,11 +498,11 @@ class AdherentType extends CommonObject
|
||||
$this->mail_valid = $obj->mail_valid;
|
||||
$this->note = $obj->note;
|
||||
$this->vote = $obj->vote;
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||
$this->getMultiLangs();
|
||||
}
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||
$this->getMultiLangs();
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@ -24,11 +24,7 @@ if (empty($conf) || ! is_object($conf))
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
|
||||
<?php
|
||||
echo "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
|
||||
global $user;
|
||||
|
||||
@ -39,22 +35,20 @@ $langs->load("members");
|
||||
$total=0;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
?>
|
||||
<tr class="oddeven" >
|
||||
<td><?php echo $langs->trans("Subscription"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->dateh, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
echo '<tr class="oddeven">';
|
||||
echo '<td>'.$langs->trans("Subscription").'</td>';
|
||||
echo '<td>'.$objectlink->getNomUrl(1).'</td>';
|
||||
echo '<td class="center"></td>';
|
||||
echo '<td class="center">'.dol_print_date($objectlink->dateh, 'day').'</td>';
|
||||
echo '<td class="right">';
|
||||
if ($user->rights->adherent->lire) {
|
||||
$total = $total + $objectlink->amount;
|
||||
echo price($objectlink->amount);
|
||||
} ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td class="right"></td>';
|
||||
echo '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
echo "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -523,14 +523,14 @@ if ($rowid > 0)
|
||||
{
|
||||
$sql.= natural_search("d.email", $search_email);
|
||||
}
|
||||
if ($filter == 'uptodate')
|
||||
{
|
||||
$sql.=" AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)";
|
||||
}
|
||||
if ($filter == 'outofdate')
|
||||
{
|
||||
$sql.=" AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
||||
}
|
||||
if ($filter == 'uptodate')
|
||||
{
|
||||
$sql.=" AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)";
|
||||
}
|
||||
if ($filter == 'outofdate')
|
||||
{
|
||||
$sql.=" AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
||||
}
|
||||
|
||||
$sql.= " ".$db->order($sortfield, $sortorder);
|
||||
|
||||
|
||||
@ -295,7 +295,7 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Language').'</td><td>';
|
||||
print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
|
||||
print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
|
||||
@ -114,7 +114,7 @@ print '<tr class="oddeven liste_titre"><th class="titlefield wordbreak">'.$langs
|
||||
|
||||
// Name
|
||||
print '<tr><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom", 'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom", 'nohtml')) . '"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
// Address
|
||||
print '<tr><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
@ -156,7 +156,7 @@ print '</td></tr>'."\n";
|
||||
|
||||
// Code
|
||||
print '<tr><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
||||
print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code", 'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code", 'nohtml')) . '"></td></tr>'."\n";
|
||||
|
||||
// Note
|
||||
print '<tr><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
|
||||
@ -268,17 +268,17 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
}
|
||||
print '<td class="center">'."\n";
|
||||
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
|
||||
@ -96,29 +96,29 @@ elseif ($action == 'updateengine')
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
if (GETPOST('coder'.$obj->rowid, 'alpha'))
|
||||
{
|
||||
$coder = GETPOST('coder'.$obj->rowid, 'alpha');
|
||||
$code_id = $obj->rowid;
|
||||
if (GETPOST('coder'.$obj->rowid, 'alpha'))
|
||||
{
|
||||
$coder = GETPOST('coder'.$obj->rowid, 'alpha');
|
||||
$code_id = $obj->rowid;
|
||||
|
||||
$sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sqlp.= " SET coder = '" . $coder."'";
|
||||
$sqlp.= " WHERE rowid = ". $code_id;
|
||||
$sqlp.= " AND entity = ".$conf->entity;
|
||||
$sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sqlp.= " SET coder = '" . $coder."'";
|
||||
$sqlp.= " WHERE rowid = ". $code_id;
|
||||
$sqlp.= " AND entity = ".$conf->entity;
|
||||
|
||||
$upsql=$db->query($sqlp);
|
||||
if (! $upsql) dol_print_error($db);
|
||||
}
|
||||
$upsql=$db->query($sqlp);
|
||||
if (! $upsql) dol_print_error($db);
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -430,7 +430,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -470,7 +470,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -409,7 +409,7 @@ print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans(
|
||||
// Name
|
||||
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom", 'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom", 'nohtml')) . '"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
// Addresse
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||
// Add logic to show/hide buttons
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#updateconst").hide();
|
||||
@ -181,7 +181,7 @@ jQuery(document).ready(function() {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherSetup"), '', 'title_setup');
|
||||
|
||||
@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -563,27 +563,27 @@ $elementList = array();
|
||||
$sourceList=array();
|
||||
if ($id == 11)
|
||||
{
|
||||
$elementList = array(
|
||||
'' => '',
|
||||
'societe' => $langs->trans('ThirdParty'),
|
||||
// 'proposal' => $langs->trans('Proposal'),
|
||||
// 'order' => $langs->trans('Order'),
|
||||
// 'invoice' => $langs->trans('Bill'),
|
||||
'supplier_proposal' => $langs->trans('SupplierProposal'),
|
||||
'order_supplier' => $langs->trans('SupplierOrder'),
|
||||
'invoice_supplier' => $langs->trans('SupplierBill'),
|
||||
// 'intervention' => $langs->trans('InterventionCard'),
|
||||
// 'contract' => $langs->trans('Contract'),
|
||||
'project' => $langs->trans('Project'),
|
||||
'project_task' => $langs->trans('Task'),
|
||||
'agenda' => $langs->trans('Agenda'),
|
||||
'dolresource' => $langs->trans('Resource'),
|
||||
// old deprecated
|
||||
'propal' => $langs->trans('Proposal'),
|
||||
'commande' => $langs->trans('Order'),
|
||||
'facture' => $langs->trans('Bill'),
|
||||
'fichinter' => $langs->trans('InterventionCard'),
|
||||
'contrat' => $langs->trans('Contract')
|
||||
$elementList = array(
|
||||
'' => '',
|
||||
'societe' => $langs->trans('ThirdParty'),
|
||||
// 'proposal' => $langs->trans('Proposal'),
|
||||
// 'order' => $langs->trans('Order'),
|
||||
// 'invoice' => $langs->trans('Bill'),
|
||||
'supplier_proposal' => $langs->trans('SupplierProposal'),
|
||||
'order_supplier' => $langs->trans('SupplierOrder'),
|
||||
'invoice_supplier' => $langs->trans('SupplierBill'),
|
||||
// 'intervention' => $langs->trans('InterventionCard'),
|
||||
// 'contract' => $langs->trans('Contract'),
|
||||
'project' => $langs->trans('Project'),
|
||||
'project_task' => $langs->trans('Task'),
|
||||
'agenda' => $langs->trans('Agenda'),
|
||||
'dolresource' => $langs->trans('Resource'),
|
||||
// old deprecated
|
||||
'propal' => $langs->trans('Proposal'),
|
||||
'commande' => $langs->trans('Order'),
|
||||
'facture' => $langs->trans('Bill'),
|
||||
'fichinter' => $langs->trans('InterventionCard'),
|
||||
'contrat' => $langs->trans('Contract'),
|
||||
);
|
||||
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
|
||||
|
||||
@ -601,13 +601,13 @@ $localtax_typeList = array();
|
||||
if ($id == 10)
|
||||
{
|
||||
$localtax_typeList = array(
|
||||
"0" => $langs->trans("No"),
|
||||
"1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
|
||||
"2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
|
||||
"3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
|
||||
"4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
|
||||
"5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
|
||||
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
|
||||
"0" => $langs->trans("No"),
|
||||
"1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
|
||||
"2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
|
||||
"3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
|
||||
"4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
|
||||
"5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
|
||||
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -648,8 +648,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory
|
||||
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
|
||||
)
|
||||
)
|
||||
{
|
||||
) {
|
||||
$ok=0;
|
||||
$fieldnamekey=$listfield[$f];
|
||||
// We take translate key of field
|
||||
@ -1574,18 +1573,18 @@ if ($id)
|
||||
$class="center";
|
||||
}
|
||||
elseif ($fieldlist[$field]=='localtax1_type') {
|
||||
if ($obj->localtax1 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
if ($obj->localtax1 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
}
|
||||
elseif ($fieldlist[$field]=='localtax2_type') {
|
||||
if ($obj->localtax2 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
if ($obj->localtax2 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
}
|
||||
elseif ($fieldlist[$field]=='taux') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
|
||||
@ -423,17 +423,20 @@ class PrestaShopWebservice
|
||||
*/
|
||||
public function delete($options)
|
||||
{
|
||||
if (isset($options['url']))
|
||||
if (isset($options['url'])) {
|
||||
$url = $options['url'];
|
||||
elseif (isset($options['resource']) && isset($options['id']))
|
||||
} elseif (isset($options['resource']) && isset($options['id'])) {
|
||||
if (is_array($options['id']))
|
||||
$url = $this->url.'/api/'.$options['resource'].'/?id=['.implode(',', $options['id']).']';
|
||||
else
|
||||
$url = $this->url.'/api/'.$options['resource'].'/'.$options['id'];
|
||||
if (isset($options['id_shop']))
|
||||
$url .= '&id_shop='.$options['id_shop'];
|
||||
if (isset($options['id_group_shop']))
|
||||
$url .= '&id_group_shop='.$options['id_group_shop'];
|
||||
$url = $this->url.'/api/'.$options['resource'].'/'.$options['id'];
|
||||
}
|
||||
if (isset($options['id_shop'])) {
|
||||
$url .= '&id_shop='.$options['id_shop'];
|
||||
}
|
||||
if (isset($options['id_group_shop'])) {
|
||||
$url .= '&id_group_shop='.$options['id_group_shop'];
|
||||
}
|
||||
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE'));
|
||||
self::checkStatusCode($request['status_code']);// check the response validity
|
||||
return true;
|
||||
|
||||
@ -32,8 +32,8 @@ class Dolistore
|
||||
* beginning of pagination
|
||||
* @var int
|
||||
*/
|
||||
public $start;
|
||||
|
||||
public $start;
|
||||
/**
|
||||
* end of pagination
|
||||
* @var int
|
||||
|
||||
@ -513,7 +513,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$noparam=array();
|
||||
foreach($arrayoftypes as $key => $value)
|
||||
{
|
||||
if ($value['noparam']) $noparam[]=$key;
|
||||
if ($value['noparam']) $noparam[]=$key;
|
||||
}
|
||||
print '})';
|
||||
print '</script>'."\n";
|
||||
|
||||
@ -415,7 +415,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -79,7 +79,7 @@ if ($action == 'add' || GETPOST("modify"))
|
||||
if ($_POST["modify"])
|
||||
{
|
||||
// Supprime boite box_external_rss de definition des boites
|
||||
/* $sql = "UPDATE ".MAIN_DB_PREFIX."boxes_def";
|
||||
/* $sql = "UPDATE ".MAIN_DB_PREFIX."boxes_def";
|
||||
$sql.= " SET name = '".$boxlabel."'";
|
||||
$sql.= " WHERE file ='box_external_rss.php' AND note like '".$_POST["norss"]." %'";
|
||||
|
||||
@ -89,7 +89,7 @@ if ($action == 'add' || GETPOST("modify"))
|
||||
dol_print_error($db,"sql=$sql");
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -207,8 +207,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
|
||||
}
|
||||
} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
|
||||
$val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||
$conf->entity);
|
||||
$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
@ -220,33 +219,31 @@ $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ?
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
|
||||
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||
$conf->entity);
|
||||
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
|
||||
$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||
$conf->entity);
|
||||
$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -300,8 +300,14 @@ print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
dol_fiche_end();
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Documents models for Holidays
|
||||
*/
|
||||
@ -317,8 +323,8 @@ $sql.= " AND entity = ".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num_rows=$db->num_rows($resql);
|
||||
$i = 0;
|
||||
$num_rows=$db->num_rows($resql);
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$array = $db->fetch_array($resql);
|
||||
@ -416,7 +422,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
@ -518,7 +524,7 @@ print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@ -478,7 +478,7 @@ if (function_exists("ldap_connect"))
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ if ($action == 'set')
|
||||
|
||||
if ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity);
|
||||
|
||||
@ -45,11 +45,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("errors","admin","mails","languages"));
|
||||
|
||||
$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view';
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view';
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'alpha');
|
||||
$search_label=GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)'
|
||||
$search_type_template=GETPOST('search_type_template', 'alpha');
|
||||
$search_lang=GETPOST('search_lang', 'alpha');
|
||||
@ -327,7 +327,7 @@ if (empty($reshook))
|
||||
$i++;
|
||||
}
|
||||
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";
|
||||
//print $sql;exit;
|
||||
//print $sql;exit;
|
||||
dol_syslog("actionmodify", LOG_DEBUG);
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -923,19 +923,17 @@ if ($mode == 'marketplace')
|
||||
|
||||
</div>
|
||||
<div class="divsearchfield right">
|
||||
<?php
|
||||
print $previouslink;
|
||||
print $nextlink;
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
print $previouslink;
|
||||
print $nextlink;
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
<?php
|
||||
|
||||
print '</div></div>';
|
||||
print '<div class="clearboth"></div>';
|
||||
print '</div></div>';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<div id="category-tree-left">
|
||||
<ul class="tree">
|
||||
|
||||
@ -29,7 +29,7 @@ $action=GETPOST('action', 'aZ09');
|
||||
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'adminaccoutant'; // To manage different context of search
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'companies'));
|
||||
$langs->loadLangs(array('admin', 'companies', 'other'));
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@ -66,6 +66,8 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url='';
|
||||
llxHeader('', $langs->trans("CompanyFoundation"), $help_url);
|
||||
|
||||
@ -75,12 +77,10 @@ $head = company_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company');
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("OpeningHoursDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
if ($action == 'edit' || $action == 'updateedit')
|
||||
if (empty($action) || $action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
/**
|
||||
* Edit parameters
|
||||
@ -92,66 +92,50 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="monday">'.$langs->trans("Monday").'</label></td><td>';
|
||||
print '<input name="monday" id="monday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY?$conf->global->MAIN_INFO_OPENINGHOURS_MONDAY: GETPOST("monday", 'alpha')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="monday" id="monday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY?$conf->global->MAIN_INFO_OPENINGHOURS_MONDAY: GETPOST("monday", 'alpha')) . '"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="tuesday">'.$langs->trans("Tuesday").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="tuesday" id="tuesday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY?$conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY: GETPOST("tuesday", 'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="wednesday">'.$langs->trans("Wednesday").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="wednesday" id="wednesday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY?$conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY: GETPOST("wednesday", 'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="thursday">'.$langs->trans("Thursday").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="thursday" id="thursday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY?$conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY: GETPOST("thursday", 'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="friday">'.$langs->trans("Friday").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="friday" id="friday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY?$conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY: GETPOST("friday", 'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="saturday">'.$langs->trans("Saturday").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="saturday" id="saturday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY?$conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY: GETPOST("saturday", 'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="sunday">'.$langs->trans("Sunday").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="sunday" id="sunday" class="minwidth100" value="'. ($conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY?$conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY: GETPOST("sunday", 'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Show parameters
|
||||
*/
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Day").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Monday").'</td><td>' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_MONDAY) . '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Tuesday").'</td><td>' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY) . '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Wednesday").'</td><td>' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY) . '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Thursday").'</td><td>' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY) . '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Friday").'</td><td>' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY) . '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Saturday").'</td><td>' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY) . '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Sunday").'</td><td>' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY) . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print "</div>";
|
||||
|
||||
print '</form>';
|
||||
|
||||
// Actions buttons
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a></div>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@ -467,7 +467,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = $langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -262,11 +262,11 @@ else
|
||||
|
||||
if (count($listofmethods) && ! empty($conf->global->MAIN_SMS_SENDMODE))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>';
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -113,12 +113,12 @@ print '<td>'.$langs->trans("DeStockOnBill").'</td>';
|
||||
print '<td class="right">';
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -133,12 +133,12 @@ print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -155,12 +155,12 @@ print '<td>'.$langs->trans("DeStockOnShipment").'</td>';
|
||||
print '<td class="right">';
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -175,12 +175,12 @@ print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
|
||||
print '<td class="right">';
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -215,12 +215,12 @@ print '<td>'.$langs->trans("ReStockOnBill").'</td>';
|
||||
print '<td class="right">';
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -236,12 +236,12 @@ print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -254,29 +254,29 @@ if (!empty($conf->reception->enabled))
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("StockOnReception").'</td>';
|
||||
print '<td class="right">';
|
||||
print '<td class="right">';
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
|
||||
}
|
||||
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("StockOnReceptionOnClosing").'</td>';
|
||||
print '<td class="right">';
|
||||
print '<td class="right">';
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
}
|
||||
@ -284,15 +284,15 @@ else
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
print '<td class="right">';
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -338,28 +338,28 @@ if($conf->invoice->enabled)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
|
||||
}
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
|
||||
}
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if($conf->order->enabled)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
|
||||
}
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
|
||||
}
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -368,13 +368,13 @@ if($conf->expedition->enabled)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
|
||||
}
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
|
||||
}
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -383,27 +383,30 @@ print '</table>';
|
||||
print '<br>';
|
||||
|
||||
$virtualdiffersfromphysical=0;
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
||||
|| ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
|
||||
) $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs.
|
||||
if (
|
||||
! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
||||
|| ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
|
||||
) {
|
||||
$virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs.
|
||||
}
|
||||
|
||||
if ($virtualdiffersfromphysical)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."</td>\n";
|
||||
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
||||
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("UseVirtualStockByDefault").'</td>';
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_USE_VIRTUAL_STOCK", $arrval, $conf->global->STOCK_USE_VIRTUAL_STOCK);
|
||||
}
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_USE_VIRTUAL_STOCK", $arrval, $conf->global->STOCK_USE_VIRTUAL_STOCK);
|
||||
}
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
print '</table>';
|
||||
@ -504,7 +507,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
@ -512,8 +514,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
|
||||
if ($conf->global->PRODUIT_SOUSPRODUITS)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("IndependantSubProductStock").'</td>';
|
||||
print '<td class="right">';
|
||||
|
||||
@ -413,8 +413,8 @@ foreach ($dirmodels as $reldir)
|
||||
print "<td>\n";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db, $specimenthirdparty);
|
||||
if (method_exists($module, 'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
if (method_exists($module, 'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
// Active
|
||||
|
||||
@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -189,8 +189,8 @@ else
|
||||
if ($base == 4)
|
||||
{
|
||||
// Sqlite by PDO or by Sqlite3
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||
|
||||
@ -94,10 +94,10 @@ if ($db->type == 'pgsql')
|
||||
{
|
||||
// Check option standard_conforming_strings is on
|
||||
$paramarray=$db->getServerParametersValues('standard_conforming_strings');
|
||||
// if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1)
|
||||
// {
|
||||
// $langs->load("errors");
|
||||
// }
|
||||
// if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1)
|
||||
// {
|
||||
// $langs->load("errors");
|
||||
// }
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -111,13 +111,15 @@ jQuery(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
if (in_array($type, array('mysql', 'mysqli'))) print 'jQuery("#radio_dump_mysql").click();';
|
||||
if (in_array($type, array('pgsql'))) print 'jQuery("#radio_dump_postgresql").click();';
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
print 'jQuery("#radio_dump_mysql").click();';
|
||||
}
|
||||
if (in_array($type, array('pgsql'))) {
|
||||
print 'jQuery("#radio_dump_postgresql").click();';
|
||||
}
|
||||
print "});\n";
|
||||
print "</script>\n";
|
||||
|
||||
print load_fiche_titre($langs->trans("Backup"), '', 'title_setup');
|
||||
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
|
||||
@ -127,24 +129,17 @@ print $langs->trans("BackupDesc", DOL_DATA_ROOT);
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
?>
|
||||
print "<!-- Dump of a server -->\n";
|
||||
print '<form method="post" action="export.php" name="dump">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||
print '<input type="hidden" name="export_type" value="server" />';
|
||||
print '<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>';
|
||||
|
||||
<!-- Dump of a server -->
|
||||
<form method="post" action="export.php" name="dump"><input type="hidden"
|
||||
name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input
|
||||
type="hidden" name="export_type" value="server" />
|
||||
|
||||
<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>
|
||||
|
||||
<?php
|
||||
print $langs->trans("BackupDesc3", $dolibarr_main_db_name).'<br>';
|
||||
//print $langs->trans("BackupDescY").'<br>';
|
||||
print '<br>';
|
||||
?>
|
||||
|
||||
<div id="backupdatabaseleft" class="fichehalfleft" >
|
||||
|
||||
<?php
|
||||
print '<div id="backupdatabaseleft" class="fichehalfleft" >';
|
||||
|
||||
print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard"));
|
||||
|
||||
@ -155,275 +150,296 @@ print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
||||
?>
|
||||
<table class="centpercent">
|
||||
<tr>
|
||||
<td class="tdtop">
|
||||
print '<table class="centpercent">';
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">';
|
||||
|
||||
<div id="div_container_exportoptions">
|
||||
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
|
||||
<?php
|
||||
if (in_array($type, array('mysql', 'mysqli')))
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow"><input type="radio" name="what" value="mysql" id="radio_dump_mysql" />
|
||||
<label for="radio_dump_mysql">MySQL Dump (mysqldump)</label>
|
||||
</div>
|
||||
<br>
|
||||
<div class="formelementrow"><input type="radio" name="what" value="mysqlnobin" id="radio_dump_mysql_nobin" />
|
||||
<label for="radio_dump_mysql">MySQL Dump (php) <?php print img_warning($langs->trans('BackupPHPWarning')) ?></label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
elseif (in_array($type, array('pgsql')))
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
|
||||
<label for="radio_dump_postgresql">PostgreSQL Dump (pg_dump)</label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'No method available with database '.$label;
|
||||
}
|
||||
?>
|
||||
</fieldset>
|
||||
</div>
|
||||
print '<div id="div_container_exportoptions">';
|
||||
print '<fieldset id="exportoptions"><legend>'.$langs->trans("ExportMethod").'</legend>';
|
||||
if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
print '<div class="formelementrow"><input type="radio" name="what" value="mysql" id="radio_dump_mysql" />';
|
||||
print '<label for="radio_dump_mysql">MySQL Dump (mysqldump)</label>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
print '<div class="formelementrow"><input type="radio" name="what" value="mysqlnobin" id="radio_dump_mysql_nobin" />';
|
||||
print '<label for="radio_dump_mysql">MySQL Dump (php) '.img_warning($langs->trans('BackupPHPWarning')).'</label>';
|
||||
print '</div>';
|
||||
} elseif (in_array($type, array('pgsql'))) {
|
||||
print '<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />';
|
||||
print '<label for="radio_dump_postgresql">PostgreSQL Dump (pg_dump)</label>';
|
||||
print '</div>';
|
||||
} else {
|
||||
print 'No method available with database '.$label;
|
||||
}
|
||||
print '</fieldset>';
|
||||
print '</div>';
|
||||
|
||||
</td>
|
||||
<td class="tdtop">
|
||||
print '</td>';
|
||||
print '<td class="tdtop">';
|
||||
|
||||
|
||||
<div id="div_container_sub_exportoptions">
|
||||
<?php
|
||||
if (in_array($type, array('mysql', 'mysqli')))
|
||||
{
|
||||
?> <!-- Fieldset mysqldump -->
|
||||
<fieldset id="mysql_options"><legend><?php echo $langs->trans("MySqlExportParameters"); ?></legend>
|
||||
print '<div id="div_container_sub_exportoptions">';
|
||||
if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
print "<!-- Fieldset mysqldump -->\n";
|
||||
print '<fieldset id="mysql_options"><legend>'.$langs->trans("MySqlExportParameters").'</legend>';
|
||||
|
||||
<div class="formelementrow"><?php echo $langs->trans("FullPathToMysqldumpCommand");
|
||||
if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP))
|
||||
{
|
||||
$fullpathofmysqldump=$db->getPathOfDump();
|
||||
}
|
||||
else
|
||||
{
|
||||
$fullpathofmysqldump=$conf->global->SYSTEMTOOLS_MYSQLDUMP;
|
||||
}
|
||||
?><br>
|
||||
<input type="text" name="mysqldump" style="width: 80%"
|
||||
value="<?php echo $fullpathofmysqldump; ?>" /></div>
|
||||
print '<div class="formelementrow">'.$langs->trans("FullPathToMysqldumpCommand");
|
||||
if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP))
|
||||
{
|
||||
$fullpathofmysqldump=$db->getPathOfDump();
|
||||
}
|
||||
else
|
||||
{
|
||||
$fullpathofmysqldump=$conf->global->SYSTEMTOOLS_MYSQLDUMP;
|
||||
}
|
||||
print '<br>';
|
||||
print '<input type="text" name="mysqldump" style="width: 80%" value="'.$fullpathofmysqldump.'" /></div>';
|
||||
|
||||
<br>
|
||||
<fieldset><legend><?php echo $langs->trans("ExportOptions"); ?></legend>
|
||||
<div class="formelementrow"><input type="checkbox"
|
||||
name="use_transaction" value="yes" id="checkbox_use_transaction" /> <label
|
||||
for="checkbox_use_transaction"> <?php echo $langs->trans("UseTransactionnalMode"); ?></label>
|
||||
print '<br>';
|
||||
print '<fieldset><legend>'.$langs->trans("ExportOptions").'</legend>';
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" />';
|
||||
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
|
||||
|
||||
</div>
|
||||
print '</div>';
|
||||
|
||||
<?php if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) { ?>
|
||||
<div class="formelementrow"><input type="checkbox" name="disable_fk"
|
||||
value="yes" id="checkbox_disable_fk" checked /> <label
|
||||
for="checkbox_disable_fk"> <?php echo $langs->trans("CommandsToDisableForeignKeysForImport"); ?> <?php print img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')); ?></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" checked />';
|
||||
print '<label for="checkbox_disable_fk">'.$langs->trans("CommandsToDisableForeignKeysForImport").' '.img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')).'</label>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
<label for="select_sql_compat"> <?php echo $langs->trans("ExportCompatibility"); ?></label>
|
||||
print '<label for="select_sql_compat">'.$langs->trans("ExportCompatibility").'</label>';
|
||||
|
||||
<select name="sql_compat" id="select_sql_compat" class="flat">
|
||||
<option value="NONE" selected>NONE</option>
|
||||
<option value="ANSI">ANSI</option>
|
||||
<option value="DB2">DB2</option>
|
||||
<option value="MAXDB">MAXDB</option>
|
||||
<option value="MYSQL323">MYSQL323</option>
|
||||
<option value="MYSQL40">MYSQL40</option>
|
||||
<option value="MSSQL">MSSQL</option>
|
||||
<option value="ORACLE">ORACLE</option>
|
||||
<option value="POSTGRESQL">POSTGRESQL</option>
|
||||
</select> <br>
|
||||
<!-- <input type="checkbox" name="drop_database" value="yes"
|
||||
id="checkbox_drop_database" /> <label for="checkbox_drop_database"><?php echo $langs->trans("AddDropDatabase"); ?></label>
|
||||
-->
|
||||
</fieldset>
|
||||
print '<select name="sql_compat" id="select_sql_compat" class="flat">';
|
||||
print '<option value="NONE" selected>NONE</option>';
|
||||
print '<option value="ANSI">ANSI</option>';
|
||||
print '<option value="DB2">DB2</option>';
|
||||
print '<option value="MAXDB">MAXDB</option>';
|
||||
print '<option value="MYSQL323">MYSQL323</option>';
|
||||
print '<option value="MYSQL40">MYSQL40</option>';
|
||||
print '<option value="MSSQL">MSSQL</option>';
|
||||
print '<option value="ORACLE">ORACLE</option>';
|
||||
print '<option value="POSTGRESQL">POSTGRESQL</option>';
|
||||
print '</select>';
|
||||
print '<br>';
|
||||
print '<!-- <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" />';
|
||||
print '<label for="checkbox_drop_database">'.$langs->trans("AddDropDatabase").'</label>';
|
||||
print '-->';
|
||||
print '</fieldset>';
|
||||
|
||||
<br>
|
||||
<fieldset><legend> <input type="checkbox" name="sql_structure"
|
||||
value="structure" id="checkbox_sql_structure" checked /> <label
|
||||
for="checkbox_sql_structure"> <?php echo $langs->trans('ExportStructure') ?></label> </legend> <input
|
||||
type="checkbox" name="drop"<?php echo ((! isset($_GET["drop"]) && ! isset($_POST["drop"])) || GETPOST('drop'))?' checked':''; ?> id="checkbox_dump_drop" /> <label
|
||||
for="checkbox_dump_drop"><?php echo $langs->trans("AddDropTable"); ?></label><br>
|
||||
</fieldset>
|
||||
print '<br>';
|
||||
print '<fieldset>';
|
||||
print '<legend>';
|
||||
print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />';
|
||||
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
|
||||
print '</legend>';
|
||||
print '<input type="checkbox" name="drop"'.((! isset($_GET["drop"]) && ! isset($_POST["drop"])) || GETPOST('drop'))?' checked':''.' id="checkbox_dump_drop" />';
|
||||
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
|
||||
print '<br>';
|
||||
print '</fieldset>';
|
||||
|
||||
<br>
|
||||
<fieldset><legend> <input type="checkbox" name="sql_data" value="data"
|
||||
id="checkbox_sql_data" checked /> <label for="checkbox_sql_data">
|
||||
<?php echo $langs->trans("Datas"); ?></label> </legend> <input
|
||||
type="checkbox" name="showcolumns" value="yes"
|
||||
id="checkbox_dump_showcolumns" checked /> <label
|
||||
for="checkbox_dump_showcolumns"> <?php echo $langs->trans("NameColumn"); ?></label><br>
|
||||
print '<br>';
|
||||
print '<fieldset>';
|
||||
print '<legend>';
|
||||
print '<input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" checked />';
|
||||
print '<label for="checkbox_sql_data">'.$langs->trans("Datas").'</label>';
|
||||
print '</legend>';
|
||||
print '<input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" checked />';
|
||||
print '<label for="checkbox_dump_showcolumns">'.$langs->trans("NameColumn").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="extended_ins" value="yes"
|
||||
id="checkbox_dump_extended_ins" checked /> <label
|
||||
for="checkbox_dump_extended_ins"> <?php echo $langs->trans("ExtendedInsert"); ?></label><br>
|
||||
print '<input type="checkbox" name="extended_ins" value="yes" id="checkbox_dump_extended_ins" checked />';
|
||||
print '<label for="checkbox_dump_extended_ins">'.$langs->trans("ExtendedInsert").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="disable-add-locks" value="no"
|
||||
id="checkbox_dump_disable-add-locks" /> <label
|
||||
for="checkbox_dump_disable-add-locks"> <?php echo $langs->trans("NoLockBeforeInsert"); ?></label><br>
|
||||
print '<input type="checkbox" name="disable-add-locks" value="no" id="checkbox_dump_disable-add-locks" />';
|
||||
print '<label for="checkbox_dump_disable-add-locks">'.$langs->trans("NoLockBeforeInsert").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="delayed" value="yes"
|
||||
id="checkbox_dump_delayed" /> <label for="checkbox_dump_delayed"> <?php echo $langs->trans("DelayedInsert"); ?></label><br>
|
||||
print '<input type="checkbox" name="delayed" value="yes" id="checkbox_dump_delayed" />';
|
||||
print '<label for="checkbox_dump_delayed">'.$langs->trans("DelayedInsert").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="sql_ignore" value="yes"
|
||||
id="checkbox_dump_ignore" /> <label for="checkbox_dump_ignore"> <?php echo $langs->trans("IgnoreDuplicateRecords"); ?></label><br>
|
||||
print '<input type="checkbox" name="sql_ignore" value="yes" id="checkbox_dump_ignore" />';
|
||||
print '<label for="checkbox_dump_ignore">'.$langs->trans("IgnoreDuplicateRecords").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="hexforbinary" value="yes"
|
||||
id="checkbox_hexforbinary" checked /> <label
|
||||
for="checkbox_hexforbinary"> <?php echo $langs->trans("EncodeBinariesInHexa"); ?></label><br>
|
||||
print '<input type="checkbox" name="hexforbinary" value="yes" id="checkbox_hexforbinary" checked />';
|
||||
print '<label for="checkbox_hexforbinary">'.$langs->trans("EncodeBinariesInHexa").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="charset_utf8" value="yes"
|
||||
id="checkbox_charset_utf8" checked disabled /> <label
|
||||
for="checkbox_charset_utf8"> <?php echo $langs->trans("UTF8"); ?></label><br>
|
||||
print '<input type="checkbox" name="charset_utf8" value="yes" id="checkbox_charset_utf8" checked disabled />';
|
||||
print '<label for="checkbox_charset_utf8">'.$langs->trans("UTF8").'</label>';
|
||||
print '<br>';
|
||||
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
print '</fieldset>';
|
||||
print '</fieldset>';
|
||||
print "<!-- Fieldset mysql_nobin -->\n";
|
||||
print '<fieldset id="mysql_nobin_options">';
|
||||
print '<legend>'.$langs->trans("MySqlExportParameters").'</legend>';
|
||||
print '<fieldset>';
|
||||
print '<legend>'.$langs->trans("ExportOptions").'</legend>';
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="nobin_use_transaction" value="yes" id="checkbox_use_transaction" />';
|
||||
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
|
||||
|
||||
<!-- Fieldset mysql_nobin -->
|
||||
<fieldset id="mysql_nobin_options"><legend><?php echo $langs->trans("MySqlExportParameters"); ?></legend>
|
||||
<fieldset>
|
||||
<legend><?php echo $langs->trans("ExportOptions"); ?></legend>
|
||||
<div class="formelementrow"><input type="checkbox"
|
||||
name="nobin_use_transaction" value="yes" id="checkbox_use_transaction" /> <label
|
||||
for="checkbox_use_transaction"> <?php echo $langs->trans("UseTransactionnalMode"); ?></label>
|
||||
print '</div>';
|
||||
if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="nobin_disable_fk" value="yes" id="checkbox_disable_fk" checked />';
|
||||
print '<label for="checkbox_disable_fk">'.$langs->trans("CommandsToDisableForeignKeysForImport").' '.img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')).'</label>';
|
||||
print '</div>';
|
||||
}
|
||||
print '</fieldset>';
|
||||
|
||||
</div>
|
||||
<?php if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) { ?>
|
||||
<div class="formelementrow"><input type="checkbox" name="nobin_disable_fk"
|
||||
value="yes" id="checkbox_disable_fk" checked /> <label
|
||||
for="checkbox_disable_fk"> <?php echo $langs->trans("CommandsToDisableForeignKeysForImport"); ?> <?php print img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')); ?></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</fieldset>
|
||||
print '<br>';
|
||||
print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>';
|
||||
print '<input type="checkbox" name="nobin_drop"'.((! isset($_GET["nobin_drop"]) && ! isset($_POST["nobin_drop"])) || GETPOST('nobin_drop'))?' checked':''.' id="checkbox_dump_drop" />';
|
||||
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
|
||||
print '<br>';
|
||||
print '</fieldset>';
|
||||
|
||||
<br>
|
||||
<fieldset><legend><?php echo $langs->trans('ExportStructure') ?></legend> <input
|
||||
type="checkbox" name="nobin_drop"<?php echo ((! isset($_GET["nobin_drop"]) && ! isset($_POST["nobin_drop"])) || GETPOST('nobin_drop'))?' checked':''; ?> id="checkbox_dump_drop" /> <label
|
||||
for="checkbox_dump_drop"><?php echo $langs->trans("AddDropTable"); ?></label><br>
|
||||
</fieldset>
|
||||
print '<br>';
|
||||
print '<fieldset>';
|
||||
print '<legend>'.$langs->trans("Datas").'</legend>';
|
||||
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend><?php echo $langs->trans("Datas"); ?></legend>
|
||||
print '<input type="checkbox" name="nobin_nolocks" value="no" id="checkbox_dump_disable-add-locks" />';
|
||||
print '<label for="checkbox_dump_disable-add-locks">'.$langs->trans("NoLockBeforeInsert").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="nobin_nolocks" value="no"
|
||||
id="checkbox_dump_disable-add-locks" /> <label
|
||||
for="checkbox_dump_disable-add-locks"> <?php echo $langs->trans("NoLockBeforeInsert"); ?></label><br>
|
||||
print '<input type="checkbox" name="nobin_delayed" value="yes" id="checkbox_dump_delayed" />';
|
||||
print '<label for="checkbox_dump_delayed">'.$langs->trans("DelayedInsert").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="nobin_delayed" value="yes"
|
||||
id="checkbox_dump_delayed" /> <label for="checkbox_dump_delayed"> <?php echo $langs->trans("DelayedInsert"); ?></label><br>
|
||||
print '<input type="checkbox" name="nobin_sql_ignore" value="yes" id="checkbox_dump_ignore" />';
|
||||
print '<label for="checkbox_dump_ignore">'.$langs->trans("IgnoreDuplicateRecords").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="nobin_sql_ignore" value="yes"
|
||||
id="checkbox_dump_ignore" /> <label for="checkbox_dump_ignore"> <?php echo $langs->trans("IgnoreDuplicateRecords"); ?></label><br>
|
||||
print '<input type="checkbox" name="nobin_charset_utf8" value="yes" id="checkbox_charset_utf8" checked disabled />';
|
||||
print '<label for="checkbox_charset_utf8">'.$langs->trans("UTF8").'</label>';
|
||||
print '<br>';
|
||||
|
||||
<input type="checkbox" name="nobin_charset_utf8" value="yes"
|
||||
id="checkbox_charset_utf8" checked disabled /> <label
|
||||
for="checkbox_charset_utf8"> <?php echo $langs->trans("UTF8"); ?></label><br>
|
||||
print '</fieldset>';
|
||||
print '</fieldset>';
|
||||
}
|
||||
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
if (in_array($type, array('pgsql'))) {
|
||||
print "<!-- Fieldset pg_dump -->\n";
|
||||
print '<fieldset id="postgresql_options"><legend>'.$langs->trans("PostgreSqlExportParameters").'</legend>';
|
||||
|
||||
<?php
|
||||
}
|
||||
print '<div class="formelementrow">'.$langs->trans("FullPathToPostgreSQLdumpCommand");
|
||||
if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) {
|
||||
$fullpathofpgdump=$db->getPathOfDump();
|
||||
}
|
||||
else
|
||||
{
|
||||
$fullpathofpgdump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP;
|
||||
}
|
||||
print '<br>';
|
||||
print '<input type="text" name="postgresqldump" style="width: 80%" value="'.$fullpathofpgdump.'" /></div>';
|
||||
|
||||
if (in_array($type, array('pgsql')))
|
||||
{
|
||||
?> <!-- Fieldset pg_dump -->
|
||||
<fieldset id="postgresql_options"><legend><?php echo $langs->trans("PostgreSqlExportParameters"); ?></legend>
|
||||
print '<br>';
|
||||
print '<fieldset>';
|
||||
print '<legend>'.$langs->trans("ExportOptions").'</legend>';
|
||||
print '<label for="select_sql_compat">'.$langs->trans("ExportCompatibility").'</label>';
|
||||
print '<select name="sql_compat" id="select_sql_compat" class="flat">';
|
||||
print '<option value="POSTGRESQL" selected>POSTGRESQL</option>';
|
||||
print '<option value="ANSI">ANSI</option>';
|
||||
print '</select>';
|
||||
print '<br>';
|
||||
print '<!-- <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" />';
|
||||
print '<label for="checkbox_drop_database">'.$langs->trans("AddDropDatabase").'</label>';
|
||||
print '-->';
|
||||
print '</fieldset>';
|
||||
print '<br>';
|
||||
print '<fieldset>';
|
||||
print '<legend>';
|
||||
print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />';
|
||||
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
|
||||
print '</legend>';
|
||||
print '</fieldset>';
|
||||
print '<br>';
|
||||
print '<fieldset>';
|
||||
print '<legend>';
|
||||
print '<input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" checked />';
|
||||
print '<label for="checkbox_sql_data">'.$langs->trans("Datas").'</label>';
|
||||
print '</legend>';
|
||||
print '<input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" checked />';
|
||||
print '<label for="checkbox_dump_showcolumns">'.$langs->trans("NameColumn").'</label>';
|
||||
print '<br>';
|
||||
print '</fieldset>';
|
||||
print '</fieldset>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
<div class="formelementrow"><?php echo $langs->trans("FullPathToPostgreSQLdumpCommand");
|
||||
if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP))
|
||||
{
|
||||
$fullpathofpgdump=$db->getPathOfDump();
|
||||
}
|
||||
else
|
||||
{
|
||||
$fullpathofpgdump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP;
|
||||
}
|
||||
?><br>
|
||||
<input type="text" name="postgresqldump" style="width: 80%"
|
||||
value="<?php echo $fullpathofpgdump; ?>" /></div>
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
<br>
|
||||
<fieldset><legend><?php echo $langs->trans("ExportOptions"); ?></legend>
|
||||
<label for="select_sql_compat"> <?php echo $langs->trans("ExportCompatibility"); ?></label>
|
||||
<select name="sql_compat" id="select_sql_compat" class="flat">
|
||||
<option value="POSTGRESQL" selected>POSTGRESQL</option>
|
||||
<option value="ANSI">ANSI</option>
|
||||
</select><br>
|
||||
<!-- <input type="checkbox" name="drop_database" value="yes"
|
||||
id="checkbox_drop_database" /> <label for="checkbox_drop_database"><?php echo $langs->trans("AddDropDatabase"); ?></label>
|
||||
-->
|
||||
</fieldset>
|
||||
|
||||
<br>
|
||||
<fieldset><legend> <input type="checkbox" name="sql_structure"
|
||||
value="structure" id="checkbox_sql_structure" checked /> <label
|
||||
for="checkbox_sql_structure"> <?php echo $langs->trans('ExportStructure') ?></label> </legend></fieldset>
|
||||
|
||||
<br>
|
||||
<fieldset><legend> <input type="checkbox" name="sql_data" value="data"
|
||||
id="checkbox_sql_data" checked /> <label for="checkbox_sql_data">
|
||||
<?php echo $langs->trans("Datas"); ?></label> </legend> <input
|
||||
type="checkbox" name="showcolumns" value="yes"
|
||||
id="checkbox_dump_showcolumns" checked /> <label
|
||||
for="checkbox_dump_showcolumns"> <?php echo $langs->trans("NameColumn"); ?></label><br>
|
||||
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<!--<fieldset>
|
||||
<legend><?php echo $langs->trans("Destination"); ?></legend> -->
|
||||
<br>
|
||||
<label for="filename_template"> <?php echo $langs->trans("FileNameToGenerate"); ?></label><br>
|
||||
<input type="text" name="filename_template" style="width: 90%"
|
||||
id="filename_template"
|
||||
value="<?php
|
||||
print '<!--<fieldset>';
|
||||
print '<legend>'.$langs->trans("Destination").'</legend> -->';
|
||||
print '<br>';
|
||||
print '<label for="filename_template">'.$langs->trans("FileNameToGenerate").'</label>';
|
||||
print '<br>';
|
||||
$prefix='dump';
|
||||
$ext='.sql';
|
||||
if (in_array($type, array('mysql', 'mysqli'))) { $prefix='mysqldump'; $ext='sql'; }
|
||||
//if ($label == 'PostgreSQL') { $prefix='pg_dump'; $ext='dump'; }
|
||||
if (in_array($type, array('pgsql'))) { $prefix='pg_dump'; $ext='sql'; }
|
||||
if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
$prefix='mysqldump';
|
||||
$ext='sql';
|
||||
}
|
||||
//if ($label == 'PostgreSQL') {
|
||||
// $prefix='pg_dump';
|
||||
// $ext='dump';
|
||||
//}
|
||||
if (in_array($type, array('pgsql'))) {
|
||||
$prefix='pg_dump';
|
||||
$ext='sql';
|
||||
}
|
||||
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
|
||||
echo $file;
|
||||
?>" /> <br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
print '<input type="text" name="filename_template" style="width: 90%" id="filename_template" value="'.$file.'" />';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
// Define compressions array
|
||||
$compression=array();
|
||||
if (in_array($type, array('mysql', 'mysqli')))
|
||||
{
|
||||
$compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None"));
|
||||
$compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip"));
|
||||
// $compression['zip']= array('function' => 'dol_compress', 'id' => 'radio_compression_zip', 'label' => $langs->trans("FormatZip")); // Not open source format. Must implement dol_compress function
|
||||
$compression['bz'] = array('function' => 'bzopen', 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2"));
|
||||
if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
$compression['none'] = array(
|
||||
'function' => '',
|
||||
'id' => 'radio_compression_none',
|
||||
'label' => $langs->trans("None")
|
||||
);
|
||||
$compression['gz'] = array(
|
||||
'function' => 'gzopen',
|
||||
'id' => 'radio_compression_gzip',
|
||||
'label' => $langs->trans("Gzip")
|
||||
);
|
||||
// Not open source format. Must implement dol_compress function
|
||||
// $compression['zip']= array(
|
||||
// 'function' => 'dol_compress',
|
||||
// 'id' => 'radio_compression_zip',
|
||||
// 'label' => $langs->trans("FormatZip")
|
||||
// );
|
||||
$compression['bz'] = array(
|
||||
'function' => 'bzopen',
|
||||
'id' => 'radio_compression_bzip',
|
||||
'label' => $langs->trans("Bzip2")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("Default"));
|
||||
$compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip"));
|
||||
$compression['none'] = array(
|
||||
'function' => '',
|
||||
'id' => 'radio_compression_none',
|
||||
'label' => $langs->trans("Default")
|
||||
);
|
||||
$compression['gz'] = array(
|
||||
'function' => 'gzopen',
|
||||
'id' => 'radio_compression_gzip',
|
||||
'label' => $langs->trans("Gzip")
|
||||
);
|
||||
}
|
||||
|
||||
// Show compression choices
|
||||
@ -434,13 +450,14 @@ print $langs->trans("Compression").': ';
|
||||
|
||||
foreach($compression as $key => $val)
|
||||
{
|
||||
if (! $val['function'] || function_exists($val['function'])) // Enabled export format
|
||||
{
|
||||
if (! $val['function'] || function_exists($val['function'])) {
|
||||
// Enabled export format
|
||||
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" checked>';
|
||||
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
||||
}
|
||||
else // Disabled export format
|
||||
else
|
||||
{
|
||||
// Disabled export format
|
||||
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
|
||||
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
||||
print ' ('.$langs->trans("NotAvailable").')';
|
||||
@ -451,20 +468,18 @@ foreach($compression as $key => $val)
|
||||
print '</div>';
|
||||
print "\n";
|
||||
|
||||
?><!--</fieldset>--> <!-- End destination -->
|
||||
print "<!--</fieldset>--> <!-- End destination -->\n";
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button reposition" value="'.$langs->trans("GenerateBackup").'" id="buttonGo">';
|
||||
print '<input type="hidden" name="page_y" value="'.GETPOST('page_y', 'int').'">';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
<br>
|
||||
<div class="center">
|
||||
<input type="submit" class="button reposition" value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo">
|
||||
<input type="hidden" name="page_y" value="<?php echo GETPOST('page_y', 'int'); ?>">
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
if (! empty($_SESSION["commandbackuplastdone"]))
|
||||
{
|
||||
print '<br><b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n";
|
||||
print '<br><b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n";
|
||||
print '<textarea rows="'.ROWS_2.'" class="centpercent">'.$_SESSION["commandbackuplastdone"].'</textarea><br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
@ -491,71 +506,51 @@ if (! empty($_SESSION["commandbackuptorun"]))
|
||||
$_SESSION["commandbackuptorun"]='';
|
||||
$_SESSION["commandbackupresult"]='';
|
||||
}
|
||||
?>
|
||||
|
||||
</div> <!-- end div center button -->
|
||||
print "</div> <!-- end div center button -->\n";
|
||||
|
||||
<?php
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div> <!-- end div fichehalfleft -->
|
||||
print "</div> <!-- end div fichehalfleft -->\n";
|
||||
|
||||
|
||||
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">
|
||||
<div class="ficheaddleft">
|
||||
print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">';
|
||||
print '<div class="ficheaddleft">';
|
||||
|
||||
<?php
|
||||
$filearray=dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
|
||||
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
|
||||
print '<br>';
|
||||
?>
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
print '</fieldset>';
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
print "<br>\n";
|
||||
print "<!-- Dump of a server -->\n";
|
||||
|
||||
<br>
|
||||
<!-- Dump of a server -->
|
||||
print '<form method="post" action="export_files.php" name="dump">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||
print '<input type="hidden" name="export_type" value="server" />';
|
||||
|
||||
<form method="post" action="export_files.php" name="dump">
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||
<input type="hidden" name="export_type" value="server" />
|
||||
print '<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>';
|
||||
|
||||
<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>
|
||||
|
||||
<?php
|
||||
print $langs->trans("BackupDesc2", DOL_DATA_ROOT).'<br>';
|
||||
print $langs->trans("BackupDescX").'<br><br>';
|
||||
|
||||
?>
|
||||
|
||||
<div id="backupfilesleft" class="fichehalfleft">
|
||||
|
||||
<?php
|
||||
print '<div id="backupfilesleft" class="fichehalfleft">';
|
||||
|
||||
print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard"));
|
||||
?>
|
||||
|
||||
<label for="zipfilename_template"> <?php echo $langs->trans("FileNameToGenerate"); ?></label><br>
|
||||
<input type="text" name="zipfilename_template" style="width: 90%"
|
||||
id="zipfilename_template"
|
||||
value="<?php
|
||||
print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>';
|
||||
$prefix='documents';
|
||||
$ext='zip';
|
||||
|
||||
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
|
||||
echo $file;
|
||||
?>" /> <br>
|
||||
<br>
|
||||
print '<input type="text" name="zipfilename_template" style="width: 90%" id="zipfilename_template" value="'.$file.'" /> <br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
<?php
|
||||
// Show compression choices
|
||||
print '<div class="formelementrow">';
|
||||
print "\n";
|
||||
@ -584,32 +579,26 @@ foreach($filecompression as $key => $val)
|
||||
print '</div>';
|
||||
print "\n";
|
||||
|
||||
?>
|
||||
<br>
|
||||
<div class="center"><input type="submit" class="button reposition"
|
||||
value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo" /><br>
|
||||
<br>
|
||||
</div>
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button reposition" value="'.$langs->trans("GenerateBackup").'" id="buttonGo" /><br>';
|
||||
print '<br>';
|
||||
print '</div>';
|
||||
|
||||
</div>
|
||||
print '</div>';
|
||||
|
||||
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">
|
||||
<div class="ficheaddleft">
|
||||
print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">';
|
||||
print '<div class="ficheaddleft">';
|
||||
|
||||
<?php
|
||||
$filearray=dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
|
||||
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
|
||||
print '<br>';
|
||||
?>
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
print '</fieldset>';
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@ -99,21 +99,21 @@ print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'<br><br>';
|
||||
<?php
|
||||
if (in_array($type, array('mysql', 'mysqli')))
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<div class="formelementrow">
|
||||
<input type="radio" name="what" value="mysql" id="radio_dump_mysql"<?php echo ($radio_dump=='mysql_options'?' checked':''); ?> />
|
||||
<label for="radio_dump_mysql">MySQL (mysql)</label>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
elseif (in_array($type, array('pgsql')))
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<div class="formelementrow">
|
||||
<input type="radio" name="what" value="mysql" id="radio_dump_postgresql"<?php echo ($radio_dump=='postgresql_options'?' checked':''); ?> />
|
||||
<label for="radio_dump_postgresql">PostgreSQL Restore (pg_restore or psql)</label>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -131,11 +131,9 @@ print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'<br><br>';
|
||||
<?php
|
||||
if (in_array($type, array('mysql', 'mysqli')))
|
||||
{
|
||||
?>
|
||||
<fieldset id="mysql_options">
|
||||
<legend><?php echo $langs->trans('RestoreMySQL') ?></legend>
|
||||
<div class="formelementrow centpercent">
|
||||
<?php
|
||||
print '<fieldset id="mysql_options">';
|
||||
print '<legend>'.$langs->trans('RestoreMySQL').'</legend>';
|
||||
print '<div class="formelementrow centpercent">';
|
||||
// Parameteres execution
|
||||
$command=$db->getPathOfRestore();
|
||||
if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command
|
||||
@ -157,20 +155,18 @@ if (in_array($type, array('mysql', 'mysqli')))
|
||||
print '<textarea rows="1" id="restorecommand" class="centpercent">'.$langs->trans("ImportMySqlCommand", $command, ($showpass?$paramclear:$paramcrypted)).'</textarea><br>';
|
||||
print ajax_autoselect('restorecommand');
|
||||
|
||||
if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&radio_dump=mysql_options">'.$langs->trans("UnHidePassword").'</a>';
|
||||
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
|
||||
?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php
|
||||
if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) {
|
||||
print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&radio_dump=mysql_options">'.$langs->trans("UnHidePassword").'</a>';
|
||||
}
|
||||
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
|
||||
print '</div>';
|
||||
print '</fieldset>';
|
||||
}
|
||||
elseif (in_array($type, array('pgsql')))
|
||||
{
|
||||
?>
|
||||
<fieldset id="postgresql_options">
|
||||
<legend>Restore PostgreSQL</legend>
|
||||
<div class="formelementrow">
|
||||
<?php
|
||||
print '<fieldset id="postgresql_options">';
|
||||
print '<legend>Restore PostgreSQL</legend>';
|
||||
print '<div class="formelementrow">';
|
||||
// Parameteres execution
|
||||
$command=$db->getPathOfRestore();
|
||||
if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command
|
||||
@ -198,20 +194,16 @@ elseif (in_array($type, array('pgsql')))
|
||||
print ajax_autoselect('restorecommand');
|
||||
//if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&radio_dump=postgresql_options">'.$langs->trans("UnHidePassword").'</a>';
|
||||
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
|
||||
?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php
|
||||
print '</div>';
|
||||
print '</fieldset>';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
print '</div>';
|
||||
|
||||
|
||||
</td></tr></table>
|
||||
</fieldset>
|
||||
print '</td></tr></table>';
|
||||
print '</fieldset>';
|
||||
|
||||
<?php
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -37,8 +37,8 @@ $confirm=GETPOST('confirm', 'alpha');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
|
||||
@ -97,9 +97,9 @@ if (! empty($conf->syslog->enabled))
|
||||
$filelogparam=$filelog;
|
||||
if ($user->admin && preg_match('/^dolibarr.*\.log$/', basename($filelog)))
|
||||
{
|
||||
$filelogparam ='<a class="wordbreak" href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file=';
|
||||
$filelogparam.=basename($filelog);
|
||||
$filelogparam.='">'.$filelog.'</a>';
|
||||
$filelogparam ='<a class="wordbreak" href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file=';
|
||||
$filelogparam.=basename($filelog);
|
||||
$filelogparam.='">'.$filelog.'</a>';
|
||||
}
|
||||
print '> '.$langs->trans("PurgeDeleteLogFile", $filelogparam);
|
||||
print '<br><br>';
|
||||
|
||||
@ -288,9 +288,9 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.= '<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
|
||||
@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
|
||||
@ -148,7 +148,7 @@ foreach ($modulesdir as $dir)
|
||||
}*/
|
||||
|
||||
//$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched);
|
||||
/* }
|
||||
/* }
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
@ -262,9 +262,9 @@ class DolibarrApi
|
||||
if ($tmp[$i]==')') $counter--;
|
||||
if ($counter < 0)
|
||||
{
|
||||
$error="Bad sqlfilters=".$sqlfilters;
|
||||
dol_syslog($error, LOG_WARNING);
|
||||
return false;
|
||||
$error="Bad sqlfilters=".$sqlfilters;
|
||||
dol_syslog($error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -383,7 +383,7 @@ class Setup extends DolibarrApi
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of contacts types.
|
||||
*
|
||||
@ -533,13 +533,15 @@ class Setup extends DolibarrApi
|
||||
if (!empty($multicurrency)) $sql.= " , cr.date_sync, cr.rate ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_currencies as t";
|
||||
if (!empty($multicurrency)) {
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency as m ON m.code=t.code_iso";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency_rate as cr ON (m.rowid = cr.fk_multicurrency)";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency as m ON m.code=t.code_iso";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency_rate as cr ON (m.rowid = cr.fk_multicurrency)";
|
||||
}
|
||||
$sql.= " WHERE t.active = ".$active;
|
||||
if (!empty($multicurrency)) {
|
||||
$sql.= " AND m.entity IN (".getEntity('multicurrency').")";
|
||||
if (!empty($multicurrency) && $multicurrency != 2) $sql.= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM ".MAIN_DB_PREFIX."multicurrency_rate AS cr2 WHERE cr2.fk_multicurrency = m.rowid)";
|
||||
$sql.= " AND m.entity IN (".getEntity('multicurrency').")";
|
||||
if (!empty($multicurrency) && $multicurrency != 2) {
|
||||
$sql.= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM ".MAIN_DB_PREFIX."multicurrency_rate AS cr2 WHERE cr2.fk_multicurrency = m.rowid)";
|
||||
}
|
||||
}
|
||||
|
||||
// Add sql filters
|
||||
@ -924,7 +926,7 @@ class Setup extends DolibarrApi
|
||||
|
||||
$sql = "SELECT rowid, code, pos, label, use_default, description";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t";
|
||||
$sql.= " WHERE t.active = ".$active;
|
||||
$sql.= " WHERE t.active = ".$active;
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
|
||||
@ -574,7 +574,7 @@ jQuery(document).ready(function () {
|
||||
|
||||
if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL))
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
$.ajax({
|
||||
@ -592,7 +592,7 @@ if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->globa
|
||||
});
|
||||
|
||||
</script>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
if (GETPOST('withtab', 'alpha'))
|
||||
|
||||
@ -575,7 +575,7 @@ class BlockedLog
|
||||
foreach($tmpobject->thirdparty as $key=>$value)
|
||||
{
|
||||
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
|
||||
if (! in_array($key, array(
|
||||
if (! in_array($key, array(
|
||||
'name','name_alias','ref_ext','address','zip','town','state_code','country_code','idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','phone','fax','email','barcode',
|
||||
'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur'
|
||||
))) continue; // Discard if not into a dedicated list
|
||||
@ -592,7 +592,7 @@ class BlockedLog
|
||||
foreach($tmpobject as $key=>$value)
|
||||
{
|
||||
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
|
||||
if (! in_array($key, array(
|
||||
if (! in_array($key, array(
|
||||
'ref','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
||||
))) continue; // Discard if not into a dedicated list
|
||||
if (!is_object($value))
|
||||
|
||||
@ -47,22 +47,20 @@ $colspan = 3; // Columns: total ht + col edit + col delete
|
||||
|
||||
// Lines for extrafield
|
||||
$objectline = new BOMLine($this->db);
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->
|
||||
<?php
|
||||
print "<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->\n";
|
||||
|
||||
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
|
||||
if ($nolinesbefore) {
|
||||
?>
|
||||
<tr class="liste_titre<?php echo ($nolinesbefore?'':' liste_titre_add_') ?> nodrag nodrop">
|
||||
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td class="linecolnum center"></td>
|
||||
<?php } ?>
|
||||
<td class="linecoldescription minwidth500imp">
|
||||
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?>
|
||||
</td>
|
||||
<td class="linecolqty right"><?php echo $langs->trans('Qty'); ?></td>
|
||||
<?php
|
||||
print '<tr class="liste_titre'.($nolinesbefore?'':' liste_titre_add_').' nodrag nodrop">';
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
print '<td class="linecolnum center"></td>';
|
||||
}
|
||||
print '<td class="linecoldescription minwidth500imp">';
|
||||
print '<div id="add"></div><span class="hideonsmartphone">'.$langs->trans('AddNewLine').'</span>';
|
||||
// echo $langs->trans("FreeZone");
|
||||
print '</td>';
|
||||
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
||||
if ($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<td class="linecoluseunit left">';
|
||||
@ -70,76 +68,68 @@ if ($nolinesbefore) {
|
||||
print $langs->trans('Unit');
|
||||
print '</span></td>';
|
||||
}
|
||||
?>
|
||||
<td class="linecollost right"><?php echo $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')); ?></td>
|
||||
<td class="linecoledit" colspan="<?php echo $colspan; ?>"> </td>
|
||||
</tr>
|
||||
<?php
|
||||
print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
|
||||
print '<td class="linecoledit" colspan="'.$colspan.'"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
?>
|
||||
<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'; ?>">
|
||||
<?php
|
||||
$coldisplay=0;
|
||||
|
||||
// Adds a line numbering column
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
$coldisplay++;
|
||||
echo '<td class="nobottom linecolnum center"></td>';
|
||||
}
|
||||
print '<tr class="pair nodrag nodrop nohoverpair'.($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'.'">';
|
||||
$coldisplay=0;
|
||||
|
||||
// Adds a line numbering column
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom linecoldescription minwidth500imp">
|
||||
echo '<td class="nobottom linecolnum center"></td>';
|
||||
}
|
||||
|
||||
<?php
|
||||
// Predefined product/service
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoldescription minwidth500imp">';
|
||||
|
||||
// Predefined product/service
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
{
|
||||
if ($forceall >= 0 && $freelines) echo '<br>';
|
||||
echo '<span class="prod_entry_mode_predef">';
|
||||
$filtertype='';
|
||||
if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1';
|
||||
|
||||
$statustoshow = -1;
|
||||
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
|
||||
{
|
||||
if ($forceall >= 0 && $freelines) echo '<br>';
|
||||
echo '<span class="prod_entry_mode_predef">';
|
||||
$filtertype='';
|
||||
if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1';
|
||||
|
||||
$statustoshow = -1;
|
||||
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
|
||||
{
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
|
||||
}
|
||||
|
||||
echo '</span>';
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
|
||||
}
|
||||
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1); ?>">
|
||||
</td>
|
||||
<?php
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoluseunit left">';
|
||||
print $form->selectUnits($line->fk_unit, "units");
|
||||
print '</td>';
|
||||
}
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom nowrap linecollost right"><input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="<?php echo (GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1); ?>"></td>
|
||||
<?php
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1).'">';
|
||||
print '</td>';
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoluseunit left">';
|
||||
print $form->selectUnits($line->fk_unit, "units");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
$coldisplay+=$colspan;
|
||||
?>
|
||||
<td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>">
|
||||
<input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
|
||||
</td>
|
||||
</tr>
|
||||
$coldisplay++;
|
||||
|
||||
print '<td class="nobottom nowrap linecollost right">';
|
||||
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.(GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1).'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
$coldisplay += $colspan;
|
||||
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline" id="addline">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
<?php
|
||||
if (is_object($objectline)) {
|
||||
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
|
||||
@ -49,22 +49,19 @@ $colspan = 3; // Columns: total ht + col edit + col delete
|
||||
|
||||
// Lines for extrafield
|
||||
$objectline = new BOMLine($this->db);
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->
|
||||
print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
|
||||
|
||||
<?php
|
||||
$coldisplay=0;
|
||||
?>
|
||||
<tr class="oddeven tredited">
|
||||
<?php
|
||||
// Adds a line numbering column
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
|
||||
<?php }
|
||||
|
||||
print '<tr class="oddeven tredited">';
|
||||
// Adds a line numbering column
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
print '<td class="linecolnum center">'.($i+1).'</td>';
|
||||
$coldisplay++;
|
||||
?>
|
||||
}
|
||||
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td>
|
||||
<div id="line_<?php echo $line->id; ?>"></div>
|
||||
|
||||
@ -74,72 +71,66 @@ $coldisplay=0;
|
||||
<input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
|
||||
<input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>">
|
||||
|
||||
<?php
|
||||
// Predefined product/service
|
||||
if ($line->fk_product > 0) {
|
||||
$tmpproduct = new Product($object->db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
}
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
|
||||
$parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
|
||||
$reshook=$hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
|
||||
<?php
|
||||
/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
|
||||
{
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
|
||||
<?php
|
||||
*/
|
||||
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom linecolqty right">
|
||||
<?php if (($line->info_bits & 2) != 2) {
|
||||
// I comment this because it shows info even when not required
|
||||
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
|
||||
// must also not be output for most entities (proposal, intervention, ...)
|
||||
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
|
||||
print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '">';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<?php
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoluseunit left">';
|
||||
print $form->selectUnits($line->fk_unit, "units");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom nowrap linecollost right"><input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="<?php echo $line->efficiency; ?>"></td>
|
||||
<?php
|
||||
|
||||
$coldisplay+=$colspan;
|
||||
?>
|
||||
<td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=$colspan; ?>
|
||||
<input type="submit" class="button" id="savelinebutton" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
|
||||
<input type="submit" class="button" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
// Predefined product/service
|
||||
if ($line->fk_product > 0) {
|
||||
$tmpproduct = new Product($object->db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
}
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
|
||||
$parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
|
||||
$reshook=$hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
|
||||
{
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
|
||||
<?php
|
||||
*/
|
||||
|
||||
$coldisplay++;
|
||||
|
||||
print '<td class="nobottom linecolqty right">';
|
||||
if (($line->info_bits & 2) != 2) {
|
||||
// I comment this because it shows info even when not required
|
||||
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
|
||||
// must also not be output for most entities (proposal, intervention, ...)
|
||||
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
|
||||
print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '">';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
if ($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoluseunit left">';
|
||||
print $form->selectUnits($line->fk_unit, "units");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom nowrap linecollost right">';
|
||||
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
|
||||
|
||||
$coldisplay+=$colspan;
|
||||
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
|
||||
$coldisplay+=$colspan;
|
||||
print '<input type="submit" class="button" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<br>';
|
||||
print '<input type="submit" class="button" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (is_object($objectline)) {
|
||||
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE objectline_edit.tpl.php -->
|
||||
print "<!-- END PHP TEMPLATE objectline_edit.tpl.php -->\n";
|
||||
|
||||
@ -39,9 +39,7 @@ if (empty($object) || ! is_object($object))
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->
|
||||
<?php
|
||||
print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
|
||||
// Title line
|
||||
print "<thead>\n";
|
||||
|
||||
@ -79,6 +77,5 @@ if ($action == 'selectlines')
|
||||
|
||||
print "</tr>\n";
|
||||
print "</thead>\n";
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE objectline_title.tpl.php -->
|
||||
print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";
|
||||
|
||||
@ -59,100 +59,93 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
|
||||
// Lines for extrafield
|
||||
$objectline = new BOMLine($object->db);
|
||||
|
||||
?>
|
||||
<?php $coldisplay=0; ?>
|
||||
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
|
||||
<tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> >
|
||||
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
|
||||
<?php } ?>
|
||||
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
|
||||
<?php
|
||||
$tmpproduct = new Product($object->db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
?>
|
||||
</td>
|
||||
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
|
||||
<?php
|
||||
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
|
||||
?>
|
||||
</td>
|
||||
$coldisplay=0;
|
||||
print "<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->\n";
|
||||
print '<tr id="row-'.$line->id.'" class="drag drop oddeven" '.$domData.' >';
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
print '<td class="linecolnum center">'.($i+1).'</td>';
|
||||
$coldisplay++;
|
||||
}
|
||||
print '<td class="linecoldescription minwidth300imp">';
|
||||
print '<div id="line_'.$line->id.'"></div>';
|
||||
$coldisplay++;
|
||||
$tmpproduct = new Product($object->db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td class="linecolqty nowrap right">';
|
||||
$coldisplay++;
|
||||
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
|
||||
print '</td>';
|
||||
|
||||
<?php
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<td class="linecoluseunit nowrap left">';
|
||||
$label = $line->getLabelOfUnit('short');
|
||||
if ($label !== '') {
|
||||
print $langs->trans($label);
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<td class="linecoluseunit nowrap left">';
|
||||
$label = $line->getLabelOfUnit('short');
|
||||
if ($label !== '') {
|
||||
print $langs->trans($label);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="linecolqty nowrap right">';
|
||||
$coldisplay++;
|
||||
echo $line->efficiency;
|
||||
print '</td>';
|
||||
|
||||
if ($this->statut == 0 && ($object_rights->write) && $action != 'selectlines' ) {
|
||||
print '<td class="linecoledit center">';
|
||||
$coldisplay++;
|
||||
if (($line->info_bits & 2) == 2 || ! empty($disableedit)) {
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id.'">'.img_edit().'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="linecoldelete center">';
|
||||
$coldisplay++;
|
||||
if (($line->fk_prev_id == null ) && empty($disableremove)) {
|
||||
//La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=deleteline&lineid=' . $line->id . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
|
||||
print '<td class="linecolmove tdlineupdown center">';
|
||||
$coldisplay++;
|
||||
if ($i > 0) {
|
||||
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id.'">';
|
||||
echo img_up('default', 0, 'imgupforline');
|
||||
print '</a>';
|
||||
}
|
||||
if ($i < $num-1) {
|
||||
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id.'">';
|
||||
echo img_down('default', 0, 'imgdownforline');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"').'></td>';
|
||||
$coldisplay++;
|
||||
}
|
||||
?>
|
||||
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
|
||||
<?php
|
||||
echo $line->efficiency;
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
} else {
|
||||
print '<td colspan="3"></td>';
|
||||
$coldisplay=$coldisplay+3;
|
||||
}
|
||||
|
||||
if ($this->statut == 0 && ($object_rights->write) && $action != 'selectlines' ) { ?>
|
||||
<td class="linecoledit center"><?php $coldisplay++; ?>
|
||||
<?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id; ?>">
|
||||
<?php echo img_edit(); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
if ($action == 'selectlines') {
|
||||
print '<td class="linecolcheck center">';
|
||||
print '<input type="checkbox" class="linecheckbox" name="line_checkbox['.($i+1).']" value="'.$line->id.'" >';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
<td class="linecoldelete center"><?php $coldisplay++; ?>
|
||||
<?php
|
||||
if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=deleteline&lineid=' . $line->id . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
print '</tr>';
|
||||
|
||||
<?php
|
||||
if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) { ?>
|
||||
<td class="linecolmove tdlineupdown center"><?php $coldisplay++; ?>
|
||||
<?php if ($i > 0) { ?>
|
||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
||||
<?php echo img_up('default', 0, 'imgupforline'); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if ($i < $num-1) { ?>
|
||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
||||
<?php echo img_down('default', 0, 'imgdownforline'); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
|
||||
<?php } ?>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
|
||||
<?php
|
||||
}
|
||||
|
||||
if($action == 'selectlines'){ ?>
|
||||
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td>
|
||||
<?php } ?>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
//Line extrafield
|
||||
if (!empty($extrafields))
|
||||
{
|
||||
print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE objectline_view.tpl.php -->
|
||||
print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";
|
||||
|
||||
@ -24,16 +24,11 @@
|
||||
/**
|
||||
* Add area with bookmarks in menu
|
||||
*
|
||||
* @param DoliDb $aDb Database handler
|
||||
* @param Translate $aLangs Object lang
|
||||
* @return string
|
||||
*/
|
||||
function printBookmarksList($aDb, $aLangs)
|
||||
function printBookmarksList()
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
$db = $aDb;
|
||||
$langs = $aLangs;
|
||||
global $conf, $user, $db, $langs;
|
||||
|
||||
$ret = '<div class="menu_top"></div>'."\n";
|
||||
|
||||
@ -155,16 +150,11 @@ function printBookmarksList($aDb, $aLangs)
|
||||
/**
|
||||
* Add area with bookmarks in top menu
|
||||
*
|
||||
* @param DoliDb $aDb Database handler
|
||||
* @param Translate $aLangs Object lang
|
||||
* @return string
|
||||
*/
|
||||
function printDropdownBookmarksList($aDb, $aLangs)
|
||||
function printDropdownBookmarksList()
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
$db = $aDb;
|
||||
$langs = $aLangs;
|
||||
global $conf, $user, $db, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
||||
@ -271,7 +261,7 @@ function printDropdownBookmarksList($aDb, $aLangs)
|
||||
|
||||
var filter = $(this).val(), count = 0;
|
||||
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
||||
|
||||
|
||||
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
||||
$(this).addClass("hidden-search-result");
|
||||
} else {
|
||||
|
||||
@ -1835,13 +1835,13 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('CATEGORY_SET_MULTILANGS', $user);
|
||||
if ($result < 0) {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('CATEGORY_SET_MULTILANGS', $user);
|
||||
if ($result < 0) {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1461,7 +1461,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= " a.fk_contact, a.percent as percentage,";
|
||||
$sql.= " a.fk_element, a.elementtype,";
|
||||
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
|
||||
$sql.= " u.firstname, u.lastname,";
|
||||
$sql.= " u.firstname, u.lastname, u.email,";
|
||||
$sql.= " s.nom as socname,";
|
||||
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||
@ -1569,6 +1569,7 @@ class ActionComm extends CommonObject
|
||||
$event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
|
||||
$event['punctual']=$obj->punctual;
|
||||
$event['category']=$obj->libelle; // libelle type action
|
||||
$event['email']=$obj->email;
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
|
||||
@ -44,8 +44,9 @@ require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||
if (! empty($conf->propal->enabled))
|
||||
if (! empty($conf->propal->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
|
||||
}
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||
@ -757,8 +758,8 @@ if (empty($reshook))
|
||||
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
|
||||
{
|
||||
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||
}
|
||||
}
|
||||
// If price per customer
|
||||
|
||||
@ -52,7 +52,7 @@ class Orders extends DolibarrApi
|
||||
}
|
||||
|
||||
/**
|
||||
* Get properties of an order object
|
||||
* Get properties of an order object by id
|
||||
*
|
||||
* Return an array with order informations
|
||||
*
|
||||
@ -64,26 +64,79 @@ class Orders extends DolibarrApi
|
||||
*/
|
||||
public function get($id, $contact_list = 1)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->commande->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
return $this->_fetch($id, '', '', '', $contact_list);
|
||||
}
|
||||
|
||||
$result = $this->commande->fetch($id);
|
||||
/**
|
||||
* Get properties of an order object by ref
|
||||
*
|
||||
* Return an array with order informations
|
||||
*
|
||||
* @param string $ref Ref of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @url GET byRef/{ref}
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRef($ref, $contact_list = 1)
|
||||
{
|
||||
return $this->_fetch('', $ref, '', '', $contact_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get properties of an order object by ref_ext
|
||||
*
|
||||
* Return an array with order informations
|
||||
*
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @url GET byRefExt/{ref_ext}
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRefExt($ref_ext, $contact_list = 1)
|
||||
{
|
||||
return $this->_fetch('', '', $ref_ext, '', $contact_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get properties of an order object
|
||||
*
|
||||
* Return an array with order informations
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @param string $ref Ref of object
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param string $ref_int Internal reference of other objec
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
private function _fetch($id, $ref = '', $ref_ext = '', $ref_int = '', $contact_list = 1)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->commande->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->commande->fetch($id, $ref, $ref_ext, $ref_int);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Order not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
// Add external contacts ids
|
||||
$this->commande->contacts_ids = $this->commande->liste_contact(-1, 'external', $contact_list);
|
||||
$this->commande->fetchObjectLinked();
|
||||
return $this->_cleanObjectDatas($this->commande);
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
// Add external contacts ids
|
||||
$this->commande->contacts_ids = $this->commande->liste_contact(-1, 'external', $contact_list);
|
||||
$this->commande->fetchObjectLinked();
|
||||
return $this->_cleanObjectDatas($this->commande);
|
||||
}
|
||||
|
||||
/**
|
||||
* List orders
|
||||
@ -437,7 +490,7 @@ class Orders extends DolibarrApi
|
||||
return $this->commande;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Delete a contact type of given order
|
||||
*
|
||||
* @param int $id Id of order to update
|
||||
|
||||
@ -1995,9 +1995,9 @@ class Commande extends CommonOrder
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
}
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
@ -164,20 +164,21 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -127,20 +127,21 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -84,20 +84,21 @@ if (! empty($conf->projet->enabled))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -97,20 +97,21 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -18,17 +18,12 @@
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
if (empty($conf) || ! is_object($conf)) {
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
|
||||
<?php
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
@ -41,54 +36,48 @@ $langs->load("orders");
|
||||
|
||||
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$total=0;
|
||||
$ilink=0;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
$trclass='oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" >
|
||||
<td class="linkedcol-element" ><?php echo $langs->trans("CustomerOrder"); ?>
|
||||
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
|
||||
</td>
|
||||
<td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
|
||||
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="linkedcol-amount right"><?php
|
||||
if ($user->rights->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></td>
|
||||
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="linkedcol-action right">
|
||||
<?php
|
||||
// For now, shipments must stay linked to order, so link is not deletable
|
||||
if($object->element != 'shipping') {
|
||||
?>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
echo '<tr class="'.$trclass.'" >';
|
||||
echo '<td class="linkedcol-element" >'.$langs->trans("CustomerOrder");
|
||||
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
|
||||
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
|
||||
echo '<td class="linkedcol-ref" align="center">'.$objectlink->ref_client.'</td>';
|
||||
echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
echo '<td class="linkedcol-amount right">';
|
||||
if ($user->rights->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
|
||||
echo '<td class="linkedcol-action right">';
|
||||
// For now, shipments must stay linked to order, so link is not deletable
|
||||
if($object->element != 'shipping') {
|
||||
echo '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
|
||||
}
|
||||
echo '</td>';
|
||||
echo "</tr>\n";
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
?>
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (count($linkedObjectBlock) > 1) {
|
||||
echo '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':'').'">';
|
||||
echo '<td>'.$langs->trans("Total").'</td>';
|
||||
echo '<td></td>';
|
||||
echo '<td class="center"></td>';
|
||||
echo '<td class="center"></td>';
|
||||
echo '<td class="right">'.price($total).'</td>';
|
||||
echo '<td class="right"></td>';
|
||||
echo '<td class="right"></td>';
|
||||
echo "</tr>\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
echo "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -294,7 +294,18 @@ if ($result && $action == "dl" && ! $error)
|
||||
|
||||
dol_mkdir($dirfortmpfile);
|
||||
|
||||
$log=$langs->transnoentitiesnoconv("Type").','.$langs->transnoentitiesnoconv("Date").','.$langs->transnoentitiesnoconv("Ref").','.$langs->transnoentitiesnoconv("TotalHT").','.$langs->transnoentitiesnoconv("TotalTTC").','.$langs->transnoentitiesnoconv("TotalVAT").','.$langs->transnoentitiesnoconv("Paid").',filename,item_id,'.$langs->transnoentitiesnoconv("ThirdParty").','.$langs->transnoentitiesnoconv("Code").','.$langs->transnoentitiesnoconv("Country").','.$langs->transnoentitiesnoconv("VATIntra")."\n";
|
||||
$log = $langs->transnoentitiesnoconv("Type");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("Date");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("Ref");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("TotalHT");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("TotalTTC");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("TotalVAT");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("Paid");
|
||||
$log .= ',filename,item_id';
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("ThirdParty");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("Code");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("Country");
|
||||
$log .= ',' . $langs->transnoentitiesnoconv("VATIntra")."\n";
|
||||
$zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip';
|
||||
|
||||
dol_delete_file($zipname);
|
||||
@ -305,8 +316,20 @@ if ($result && $action == "dl" && ! $error)
|
||||
{
|
||||
foreach ($filesarray as $key => $file)
|
||||
{
|
||||
if (file_exists($file["fullname"])) $zip->addFile($file["fullname"], $file["relpathnamelang"]); //
|
||||
$log.=$file['item'].','.dol_print_date($file['date'], 'dayrfc').','.$file['ref'].','.$file['amount_ht'].','.$file['amount_ttc'].','.$file['amount_vat'].','.$file['paid'].','.$file["name"].','.$file['fk'].','.$file['thirdparty_name'].','.$file['thirdparty_code'].','.$file['country_code'].',"'.$file['vatnum'].'"'."\n";
|
||||
if (file_exists($file["fullname"])) $zip->addFile($file["fullname"], $file["relpathnamelang"]);
|
||||
$log .= $file['item'];
|
||||
$log .= ',' . dol_print_date($file['date'], 'dayrfc');
|
||||
$log .= ',' . $file['ref'];
|
||||
$log .= ',' . $file['amount_ht'];
|
||||
$log .= ',' . $file['amount_ttc'];
|
||||
$log .= ',' . $file['amount_vat'];
|
||||
$log .= ',' . $file['paid'];
|
||||
$log .= ',' . $file["name"];
|
||||
$log .= ',' . $file['fk'];
|
||||
$log .= ',' . $file['thirdparty_name'];
|
||||
$log .= ',' . $file['thirdparty_code'];
|
||||
$log .= ',' . $file['country_code'];
|
||||
$log .= ',"' . $file['vatnum'].'"'."\n";
|
||||
}
|
||||
$zip->addFromString('transactions.csv', $log);
|
||||
$zip->close();
|
||||
|
||||
@ -278,8 +278,11 @@ if (empty($reshook))
|
||||
$action = '';
|
||||
}
|
||||
} else {
|
||||
// Si non avoir, le signe doit etre positif
|
||||
if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) {
|
||||
// If not a credit note, amount with tax must be positive or nul.
|
||||
// Note that amount excluding tax can be negative because you can have a invoice of 100 with vat of 20 that
|
||||
// consumes a credit note of 100 with vat 0 (total with tax is 0 but without tax is -20).
|
||||
// For some cases, credit notes can have a vat of 0 (for example when selling goods in France).
|
||||
if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ttc < 0) {
|
||||
setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
|
||||
@ -2702,45 +2702,74 @@ class Facture extends CommonInvoice
|
||||
|
||||
|
||||
/**
|
||||
* Add an invoice line into database (linked to product/service or not).
|
||||
* Les parametres sont deja cense etre juste et avec valeurs finales a l'appel
|
||||
* de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini
|
||||
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit)
|
||||
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
||||
* Add an invoice line into database (linked to product/service or not).
|
||||
* Les parametres sont deja cense etre juste et avec valeurs finales a l'appel
|
||||
* de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini
|
||||
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit)
|
||||
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
||||
*
|
||||
* @param string $desc Description of line
|
||||
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
|
||||
* @param double $qty Quantity
|
||||
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||
* @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||
* @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||
* @param int $fk_product Id of predefined product/service
|
||||
* @param double $remise_percent Percent of discount on line
|
||||
* @param int $date_start Date start of service
|
||||
* @param int $date_end Date end of service
|
||||
* @param int $ventil Code of dispatching into accountancy
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_remise_except Id discount used
|
||||
* @param string $price_base_type 'HT' or 'TTC'
|
||||
* @param double $pu_ttc Unit price with tax (> 0 even for credit note)
|
||||
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @param string $origin 'order', ...
|
||||
* @param int $origin_id Id of origin object
|
||||
* @param int $fk_parent_line Id of parent line
|
||||
* @param int $fk_fournprice Supplier price id (to calculate margin) or ''
|
||||
* @param int $pa_ht Buying price of line (to calculate margin) or ''
|
||||
* @param string $label Label of the line (deprecated, do not use)
|
||||
* @param array $array_options extrafields array
|
||||
* @param int $situation_percent Situation advance percentage
|
||||
* @param int $fk_prev_id Previous situation line id reference
|
||||
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
||||
* @param double $pu_ht_devise Unit price in currency
|
||||
* @return int <0 if KO, Id of line if OK
|
||||
* @param string $desc Description of line
|
||||
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
|
||||
* @param double $qty Quantity
|
||||
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||
* @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||
* @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||
* @param int $fk_product Id of predefined product/service
|
||||
* @param double $remise_percent Percent of discount on line
|
||||
* @param int $date_start Date start of service
|
||||
* @param int $date_end Date end of service
|
||||
* @param int $ventil Code of dispatching into accountancy
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_remise_except Id discount used
|
||||
* @param string $price_base_type 'HT' or 'TTC'
|
||||
* @param double $pu_ttc Unit price with tax (> 0 even for credit note)
|
||||
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @param string $origin 'order', ...
|
||||
* @param int $origin_id Id of origin object
|
||||
* @param int $fk_parent_line Id of parent line
|
||||
* @param int $fk_fournprice Supplier price id (to calculate margin) or ''
|
||||
* @param int $pa_ht Buying price of line (to calculate margin) or ''
|
||||
* @param string $label Label of the line (deprecated, do not use)
|
||||
* @param array $array_options extrafields array
|
||||
* @param int $situation_percent Situation advance percentage
|
||||
* @param int $fk_prev_id Previous situation line id reference
|
||||
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
||||
* @param double $pu_ht_devise Unit price in currency
|
||||
* @return int <0 if KO, Id of line if OK
|
||||
*/
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = 0, $fk_remise_except = '', $price_base_type = 'HT', $pu_ttc = 0, $type = self::TYPE_STANDARD, $rang = -1, $special_code = 0, $origin = '', $origin_id = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $situation_percent = 100, $fk_prev_id = 0, $fk_unit = null, $pu_ht_devise = 0)
|
||||
{
|
||||
public function addline(
|
||||
$desc,
|
||||
$pu_ht,
|
||||
$qty,
|
||||
$txtva,
|
||||
$txlocaltax1 = 0,
|
||||
$txlocaltax2 = 0,
|
||||
$fk_product = 0,
|
||||
$remise_percent = 0,
|
||||
$date_start = '',
|
||||
$date_end = '',
|
||||
$ventil = 0,
|
||||
$info_bits = 0,
|
||||
$fk_remise_except = '',
|
||||
$price_base_type = 'HT',
|
||||
$pu_ttc = 0,
|
||||
$type = self::TYPE_STANDARD,
|
||||
$rang = -1,
|
||||
$special_code = 0,
|
||||
$origin = '',
|
||||
$origin_id = 0,
|
||||
$fk_parent_line = 0,
|
||||
$fk_fournprice = null,
|
||||
$pa_ht = 0,
|
||||
$label = '',
|
||||
$array_options = 0,
|
||||
$situation_percent = 100,
|
||||
$fk_prev_id = 0,
|
||||
$fk_unit = null,
|
||||
$pu_ht_devise = 0
|
||||
) {
|
||||
// Deprecation warning
|
||||
if ($label) {
|
||||
dol_syslog(__METHOD__ . ": using line label is deprecated", LOG_WARNING);
|
||||
|
||||
@ -114,7 +114,7 @@ if ($object->id)
|
||||
$morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/tva/index.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/tva/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
@ -672,7 +672,7 @@ class Contact extends CommonObject
|
||||
if ($this->birthday_alert)
|
||||
{
|
||||
//check existing
|
||||
$sql_check = "SELECT * FROM ".MAIN_DB_PREFIX."user_alert WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
|
||||
$sql_check = "SELECT rowid FROM ".MAIN_DB_PREFIX."user_alert WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
|
||||
$result_check = $this->db->query($sql_check);
|
||||
if (! $result_check || ($this->db->num_rows($result_check)<1))
|
||||
{
|
||||
|
||||
@ -155,8 +155,8 @@ $type='directory';
|
||||
// This test if file exists should be useless. We keep it to find bug more easily
|
||||
if (! dol_is_dir($upload_dir))
|
||||
{
|
||||
// dol_mkdir($upload_dir);
|
||||
/* $langs->load("install");
|
||||
//dol_mkdir($upload_dir);
|
||||
/*$langs->load("install");
|
||||
dol_print_error(0,$langs->trans("ErrorDirDoesNotExists",$upload_dir));
|
||||
exit;*/
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ if ($boxorder && $zone != '' && $userid > 0)
|
||||
$langs->load("boxes");
|
||||
if (! GETPOST('closing'))
|
||||
{
|
||||
setEventMessages($langs->trans("BoxAdded"), null);
|
||||
setEventMessages($langs->trans("BoxAdded"), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,7 +144,8 @@ class box_produits extends ModeleBoxes
|
||||
'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
|
||||
'text' => $objp->label,
|
||||
);
|
||||
|
||||
$price = '';
|
||||
$price_base_type = '';
|
||||
if (empty($conf->dynamicprices->enabled) || empty($objp->fk_price_expression)) {
|
||||
$price_base_type=$langs->trans($objp->price_base_type);
|
||||
$price=($objp->price_base_type == 'HT')?price($objp->price):$price=price($objp->price_ttc);
|
||||
|
||||
@ -219,9 +219,9 @@ abstract class CommonInvoice extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie tableau des ids de facture avoir issus de la facture
|
||||
* Returns array of credit note ids from the invoice
|
||||
*
|
||||
* @return array Tableau d'id de factures avoirs
|
||||
* @return array Array of credit note ids
|
||||
*/
|
||||
public function getListIdAvoirFromInvoice()
|
||||
{
|
||||
@ -251,10 +251,10 @@ abstract class CommonInvoice extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie l'id de la facture qui la remplace
|
||||
* Returns the id of the invoice that replaces it
|
||||
*
|
||||
* @param string $option filtre sur statut ('', 'validated', ...)
|
||||
* @return int <0 si KO, 0 si aucune facture ne remplace, id facture sinon
|
||||
* @param string $option status filter ('', 'validated', ...)
|
||||
* @return int <0 si KO, 0 if no invoice replaces it, id of invoice otherwise
|
||||
*/
|
||||
public function getIdReplacingInvoice($option = '')
|
||||
{
|
||||
@ -264,10 +264,10 @@ abstract class CommonInvoice extends CommonObject
|
||||
$sql.= ' AND type < 2';
|
||||
if ($option == 'validated') $sql.= ' AND fk_statut = 1';
|
||||
// PROTECTION BAD DATA
|
||||
// Au cas ou base corrompue et qu'il y a une facture de remplacement validee
|
||||
// et une autre non, on donne priorite a la validee.
|
||||
// Ne devrait pas arriver (sauf si acces concurrentiel et que 2 personnes
|
||||
// ont cree en meme temps une facture de remplacement pour la meme facture)
|
||||
// In case the database is corrupted and there is a valid replectement invoice
|
||||
// and another no, priority is given to the valid one.
|
||||
// Should not happen (unless concurrent access and 2 people have created a
|
||||
// replacement invoice for the same invoice at the same time)
|
||||
$sql.= ' ORDER BY fk_statut DESC';
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
@ -276,12 +276,12 @@ abstract class CommonInvoice extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
// Si il y en a
|
||||
// If there is any
|
||||
return $obj->rowid;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si aucune facture ne remplace
|
||||
// If no invoice replaces it
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -544,8 +544,8 @@ abstract class CommonInvoice extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoi une date limite de reglement de facture en fonction des
|
||||
* conditions de reglements de la facture et date de facturation.
|
||||
* Returns an invoice payment deadline based on the invoice settlement
|
||||
* conditions and billing date.
|
||||
*
|
||||
* @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition.
|
||||
* @return integer Date limite de reglement si ok, <0 si ko
|
||||
@ -589,14 +589,14 @@ abstract class CommonInvoice extends CommonObject
|
||||
|
||||
/* Definition de la date limite */
|
||||
|
||||
// 0 : ajout du nombre de jours
|
||||
// 0 : adding the number of days
|
||||
if ($cdr_type == 0)
|
||||
{
|
||||
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
|
||||
|
||||
$datelim += ($cdr_decalage * 3600 * 24);
|
||||
}
|
||||
// 1 : application de la regle "fin de mois"
|
||||
// 1 : application of the "end of the month" rule
|
||||
elseif ($cdr_type == 1)
|
||||
{
|
||||
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
|
||||
@ -612,13 +612,13 @@ abstract class CommonInvoice extends CommonObject
|
||||
{
|
||||
$mois += 1;
|
||||
}
|
||||
// On se deplace au debut du mois suivant, et on retire un jour
|
||||
// We move at the beginning of the next month, and we take a day off
|
||||
$datelim=dol_mktime(12, 0, 0, $mois, 1, $annee);
|
||||
$datelim -= (3600 * 24);
|
||||
|
||||
$datelim += ($cdr_decalage * 3600 * 24);
|
||||
}
|
||||
// 2 : application de la règle, le N du mois courant ou suivant
|
||||
// 2 : application of the rule, the N of the current or next month
|
||||
elseif ($cdr_type == 2 && !empty($cdr_decalage))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@ -733,7 +733,7 @@ abstract class CommonInvoiceLine extends CommonObjectLine
|
||||
public $total_ttc;
|
||||
|
||||
/**
|
||||
* Liste d'options cumulables:
|
||||
* List of cumulative options:
|
||||
* Bit 0: 0 si TVA normal - 1 si TVA NPR
|
||||
* Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
|
||||
* @var int
|
||||
|
||||
@ -91,13 +91,15 @@ class DiscountAbsolute
|
||||
public $fk_facture;
|
||||
|
||||
/**
|
||||
* @var int ID credit note having caused the discount
|
||||
* @var int ID credit note or deposit used to create the discount
|
||||
*/
|
||||
public $fk_facture_source;
|
||||
public $ref_facture_source; // Ref credit note or deposit used to create the discount
|
||||
public $type_facture_source;
|
||||
|
||||
public $ref_facture_source; // Ref credit note having caused the discount
|
||||
|
||||
public $ref_invoice_supplier_source;
|
||||
public $fk_invoice_supplier_source;
|
||||
public $ref_invoice_supplier_source; // Ref credit note or deposit used to create the discount
|
||||
public $type_invoice_supplier_source;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -135,11 +137,12 @@ class DiscountAbsolute
|
||||
$sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,";
|
||||
$sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.fk_invoice_supplier_line, sr.fk_invoice_supplier, sr.fk_invoice_supplier_source, sr.description,";
|
||||
$sql.= " sr.datec,";
|
||||
$sql.= " f.ref as ref_facture_source, fsup.ref as ref_invoice_supplier_source";
|
||||
$sql.= " f.ref as ref_facture_source, f.type as type_facture_source,";
|
||||
$sql.= " fsup.ref as ref_invoice_supplier_source, fsup.type as type_invoice_supplier_source";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid";
|
||||
$sql.= " WHERE sr.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " WHERE sr.entity IN (".getEntity('invoice').")";
|
||||
if ($rowid) $sql.= " AND sr.rowid=".$rowid;
|
||||
if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source;
|
||||
if ($fk_invoice_supplier_source) $sql.= " AND sr.fk_invoice_supplier_source=".$fk_invoice_supplier_source;
|
||||
@ -168,12 +171,14 @@ class DiscountAbsolute
|
||||
$this->fk_user = $obj->fk_user;
|
||||
$this->fk_facture_line = $obj->fk_facture_line;
|
||||
$this->fk_facture = $obj->fk_facture;
|
||||
$this->fk_facture_source = $obj->fk_facture_source; // Id avoir source
|
||||
$this->ref_facture_source = $obj->ref_facture_source; // Ref avoir source
|
||||
$this->fk_facture_source = $obj->fk_facture_source; // Id credit note or deposit source
|
||||
$this->ref_facture_source = $obj->ref_facture_source; // Ref credit note or deposit source
|
||||
$this->type_facture_source = $obj->type_facture_source; // Type credit note or deposit source
|
||||
$this->fk_invoice_supplier_line = $obj->fk_invoice_supplier_line;
|
||||
$this->fk_invoice_supplier = $obj->fk_invoice_supplier;
|
||||
$this->fk_invoice_supplier_source = $obj->fk_invoice_supplier_source; // Id avoir source
|
||||
$this->ref_invoice_supplier_source = $obj->ref_invoice_supplier_source; // Ref avoir source
|
||||
$this->fk_invoice_supplier_source = $obj->fk_invoice_supplier_source; // Id credit note or deposit source
|
||||
$this->ref_invoice_supplier_source = $obj->ref_invoice_supplier_source; // Ref credit note or deposit source
|
||||
$this->type_invoice_supplier_source = $obj->type_invoice_supplier_source; // Type credit note or deposit source
|
||||
$this->description = $obj->description;
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
|
||||
@ -688,7 +693,7 @@ class DiscountAbsolute
|
||||
if ($option == 'invoice') {
|
||||
$facid=! empty($this->discount_type)?$this->fk_invoice_supplier_source:$this->fk_facture_source;
|
||||
$link=! empty($this->discount_type)?'/fourn/facture/card.php':'/compta/facture/card.php';
|
||||
$label=$langs->trans("ShowDiscount").': '.$this->ref_facture_source;
|
||||
$label=$langs->trans("ShowSourceInvoice").': '.$this->ref_facture_source;
|
||||
$link = '<a href="'.DOL_URL_ROOT.$link.'?facid='.$facid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend='</a>';
|
||||
$ref=! empty($this->discount_type)?$this->ref_invoice_supplier_source:$this->ref_facture_source;
|
||||
|
||||
@ -7129,8 +7129,8 @@ class Form
|
||||
// Left part of banner
|
||||
if ($morehtmlleft)
|
||||
{
|
||||
if ($conf->browser->layout == 'phone') $ret.='<!-- morehmltleft --><div class="floatleft">'.$morehtmlleft.'</div>'; // class="center" to have photo in middle
|
||||
else $ret.='<!-- morehmltleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
||||
if ($conf->browser->layout == 'phone') $ret.='<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; // class="center" to have photo in middle
|
||||
else $ret.='<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
||||
}
|
||||
|
||||
//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
|
||||
|
||||
@ -77,23 +77,23 @@ class FormCron extends Form
|
||||
$out.='</SELECT>';
|
||||
}
|
||||
} else {
|
||||
$out='<SELECT class="flat" name="'.$htmlname.'" id="'.$htmlname.'" />';
|
||||
$out='<SELECT class="flat" name="'.$htmlname.'" id="'.$htmlname.'" />';
|
||||
|
||||
if ($selected=='command') {
|
||||
$selected_attr=' selected ';
|
||||
} else {
|
||||
$selected_attr='';
|
||||
}
|
||||
$out.= '<OPTION value="command" '.$selected_attr.'>'.$langs->trans('CronType_command').'</OPTION>';
|
||||
if ($selected=='command') {
|
||||
$selected_attr=' selected ';
|
||||
} else {
|
||||
$selected_attr='';
|
||||
}
|
||||
$out.= '<OPTION value="command" '.$selected_attr.'>'.$langs->trans('CronType_command').'</OPTION>';
|
||||
|
||||
if ($selected=='method') {
|
||||
$selected_attr=' selected ';
|
||||
} else {
|
||||
$selected_attr='';
|
||||
}
|
||||
$out.= '<OPTION value="method" '.$selected_attr.'>'.$langs->trans('CronType_method').'</OPTION>';
|
||||
if ($selected=='method') {
|
||||
$selected_attr=' selected ';
|
||||
} else {
|
||||
$selected_attr='';
|
||||
}
|
||||
$out.= '<OPTION value="method" '.$selected_attr.'>'.$langs->trans('CronType_method').'</OPTION>';
|
||||
|
||||
$out.='</SELECT>';
|
||||
$out.='</SELECT>';
|
||||
}
|
||||
|
||||
return $out;
|
||||
|
||||
@ -496,17 +496,31 @@ class SMTPs
|
||||
return $_retVal;
|
||||
}
|
||||
}
|
||||
|
||||
// Default authentication method is LOGIN
|
||||
if (empty($conf->global->MAIL_SMTP_AUTH_TYPE)) $conf->global->MAIL_SMTP_AUTH_TYPE = 'LOGIN';
|
||||
|
||||
// Send Authentication to Server
|
||||
// Check for errors along the way
|
||||
$this->socket_send_str('AUTH LOGIN', '334');
|
||||
|
||||
// User name will not return any error, server will take anything we give it.
|
||||
$this->socket_send_str(base64_encode($this->_smtpsID), '334');
|
||||
|
||||
// The error here just means the ID/password combo doesn't work.
|
||||
// There is not a method to determine which is the problem, ID or password
|
||||
if ( ! $_retVal = $this->socket_send_str(base64_encode($this->_smtpsPW), '235') )
|
||||
$this->_setErr(130, 'Invalid Authentication Credentials.');
|
||||
switch ($conf->global->MAIL_SMTP_AUTH_TYPE) {
|
||||
case 'PLAIN':
|
||||
$this->socket_send_str('AUTH PLAIN', '334');
|
||||
// The error here just means the ID/password combo doesn't work.
|
||||
$_retVal = $this->socket_send_str(base64_encode("\0" . $this->_smtpsID . "\0" . $this->_smtpsPW), '235');
|
||||
break;
|
||||
case 'LOGIN':
|
||||
default:
|
||||
$this->socket_send_str('AUTH LOGIN', '334');
|
||||
// User name will not return any error, server will take anything we give it.
|
||||
$this->socket_send_str(base64_encode($this->_smtpsID), '334');
|
||||
// The error here just means the ID/password combo doesn't work.
|
||||
// There is not a method to determine which is the problem, ID or password
|
||||
$_retVal = $this->socket_send_str(base64_encode($this->_smtpsPW), '235');
|
||||
break;
|
||||
}
|
||||
if (! $_retVal) {
|
||||
$this->_setErr(130, 'Invalid Authentication Credentials.');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1004,7 +1004,7 @@ class Utils
|
||||
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n");
|
||||
else fwrite($handle, "/*!40000 ALTER TABLE `".$table."` DISABLE KEYS */;\n");
|
||||
|
||||
$sql='SELECT * FROM '.$table;
|
||||
$sql='SELECT * FROM '.$table; // Here SELECT * is allowed because we don't have definition of columns to take
|
||||
$result = $db->query($sql);
|
||||
while($row = $db->fetch_row($result))
|
||||
{
|
||||
|
||||
@ -318,7 +318,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
|
||||
else
|
||||
{
|
||||
//issue the CKEditor Callback
|
||||
SendCKEditorResults(
|
||||
SendCKEditorResults(
|
||||
$CKEcallback,
|
||||
$sFileUrl,
|
||||
($sErrorNumber != 0 ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful')
|
||||
|
||||
@ -401,11 +401,11 @@ EOF;
|
||||
*/
|
||||
function SendCKEditorResults($callback, $sFileUrl, $customMsg = '')
|
||||
{
|
||||
echo '<script type="text/javascript">';
|
||||
echo '<script type="text/javascript">';
|
||||
|
||||
$rpl = array( '\\' => '\\\\', '"' => '\\"' );
|
||||
$rpl = array( '\\' => '\\\\', '"' => '\\"' );
|
||||
|
||||
echo 'window.parent.CKEDITOR.tools.callFunction("'. $callback. '","'. strtr($sFileUrl, $rpl). '", "'. strtr($customMsg, $rpl). '");' ;
|
||||
echo 'window.parent.CKEDITOR.tools.callFunction("'. $callback. '","'. strtr($sFileUrl, $rpl). '", "'. strtr($customMsg, $rpl). '");' ;
|
||||
|
||||
echo '</script>';
|
||||
echo '</script>';
|
||||
}
|
||||
|
||||
@ -1039,16 +1039,16 @@ function price2numjs(amount) {
|
||||
if (amount == '') return '';
|
||||
|
||||
<?php
|
||||
$dec = ',';
|
||||
$thousand = ' ';
|
||||
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
|
||||
$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
|
||||
}
|
||||
if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
|
||||
$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
|
||||
}
|
||||
if ($thousand == 'Space') $thousand=' ';
|
||||
print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript
|
||||
$dec = ',';
|
||||
$thousand = ' ';
|
||||
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
|
||||
$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
|
||||
}
|
||||
if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
|
||||
$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
|
||||
}
|
||||
if ($thousand == 'Space') $thousand=' ';
|
||||
print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript
|
||||
?>
|
||||
|
||||
var main_max_dec_shown = <?php echo (int) str_replace('.', '', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>;
|
||||
|
||||
@ -140,5 +140,5 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
||||
time_js_next_test += time_auto_update;
|
||||
console.log('Updated time_js_next_test. New value is '+time_js_next_test);
|
||||
}
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ function show_array_actions_to_do($max = 5)
|
||||
$staticaction->id=$obj->id;
|
||||
print '<td>'.$staticaction->getNomUrl(1, 34).'</td>';
|
||||
|
||||
// print '<td>'.dol_trunc($obj->label,22).'</td>';
|
||||
// print '<td>'.dol_trunc($obj->label,22).'</td>';
|
||||
|
||||
print '<td>';
|
||||
if ($obj->rowid > 0)
|
||||
@ -414,10 +414,10 @@ function agenda_prepare_head()
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php";
|
||||
$head[$h][1] = $langs->trans("Reminders");
|
||||
$head[$h][2] = 'reminders';
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php";
|
||||
$head[$h][1] = $langs->trans("Reminders");
|
||||
$head[$h][2] = 'reminders';
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php";
|
||||
|
||||
@ -47,13 +47,13 @@ function bank_prepare_head(Account $object)
|
||||
$head[$h][2] = 'journal';
|
||||
$h++;
|
||||
|
||||
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
|
||||
// {
|
||||
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
|
||||
// {
|
||||
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/treso.php?account=" . $object->id;
|
||||
$head[$h][1] = $langs->trans("PlannedTransactions");
|
||||
$head[$h][2] = 'cash';
|
||||
$h++;
|
||||
// }
|
||||
// }
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/annuel.php?account=" . $object->id;
|
||||
$head[$h][1] = $langs->trans("IOMonthlyReporting");
|
||||
|
||||
@ -624,7 +624,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
|
||||
|
||||
if (empty($arrayreplacementisregex))
|
||||
{
|
||||
$content = make_substitutions($content, $arrayreplacement, null);
|
||||
$content = make_substitutions($content, $arrayreplacement, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1044,8 +1044,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
$checkvirusarray=dolCheckVirus($src_file);
|
||||
if (count($checkvirusarray))
|
||||
{
|
||||
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: errors='.join(',', $checkvirusarray), LOG_WARNING);
|
||||
return 'ErrorFileIsInfectedWithAVirus: '.join(',', $checkvirusarray);
|
||||
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: errors='.join(',', $checkvirusarray), LOG_WARNING);
|
||||
return 'ErrorFileIsInfectedWithAVirus: '.join(',', $checkvirusarray);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -45,9 +45,9 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php';
|
||||
*
|
||||
* @param string $type Type of database (mysql, pgsql...)
|
||||
* @param string $host Address of database server
|
||||
* @param string $user Nom de l'utilisateur autorise
|
||||
* @param string $pass Mot de passe
|
||||
* @param string $name Nom de la database
|
||||
* @param string $user Authorized username
|
||||
* @param string $pass Password
|
||||
* @param string $name Name of database
|
||||
* @param int $port Port of database server
|
||||
* @return DoliDB A DoliDB instance
|
||||
*/
|
||||
@ -464,36 +464,36 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
|
||||
$maxloop=20; $loopnb=0; // Protection against infinite loop
|
||||
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
|
||||
{
|
||||
$loopnb++; $newout = '';
|
||||
$loopnb++; $newout = '';
|
||||
|
||||
if ($reg[1] == 'DAY') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mday']; }
|
||||
elseif ($reg[1] == 'MONTH') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mon']; }
|
||||
elseif ($reg[1] == 'YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['year']; }
|
||||
elseif ($reg[1] == 'PREVIOUS_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; }
|
||||
elseif ($reg[1] == 'PREVIOUS_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; }
|
||||
elseif ($reg[1] == 'PREVIOUS_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] - 1); }
|
||||
elseif ($reg[1] == 'NEXT_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; }
|
||||
elseif ($reg[1] == 'NEXT_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; }
|
||||
elseif ($reg[1] == 'NEXT_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] + 1); }
|
||||
elseif ($reg[1] == 'MYCOMPANY_COUNTRY_ID' || $reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID')
|
||||
{
|
||||
$newout = $mysoc->country_id;
|
||||
}
|
||||
elseif ($reg[1] == 'USER_ID' || $reg[1] == 'USERID')
|
||||
{
|
||||
$newout = $user->id;
|
||||
}
|
||||
elseif ($reg[1] == 'USER_SUPERVISOR_ID' || $reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID')
|
||||
{
|
||||
$newout = $user->fk_user;
|
||||
}
|
||||
elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID')
|
||||
{
|
||||
$newout = $conf->entity;
|
||||
}
|
||||
else $newout = ''; // Key not found, we replace with empty string
|
||||
//var_dump('__'.$reg[1].'__ -> '.$newout);
|
||||
$out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out);
|
||||
if ($reg[1] == 'DAY') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mday']; }
|
||||
elseif ($reg[1] == 'MONTH') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mon']; }
|
||||
elseif ($reg[1] == 'YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['year']; }
|
||||
elseif ($reg[1] == 'PREVIOUS_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; }
|
||||
elseif ($reg[1] == 'PREVIOUS_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; }
|
||||
elseif ($reg[1] == 'PREVIOUS_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] - 1); }
|
||||
elseif ($reg[1] == 'NEXT_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; }
|
||||
elseif ($reg[1] == 'NEXT_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; }
|
||||
elseif ($reg[1] == 'NEXT_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] + 1); }
|
||||
elseif ($reg[1] == 'MYCOMPANY_COUNTRY_ID' || $reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID')
|
||||
{
|
||||
$newout = $mysoc->country_id;
|
||||
}
|
||||
elseif ($reg[1] == 'USER_ID' || $reg[1] == 'USERID')
|
||||
{
|
||||
$newout = $user->id;
|
||||
}
|
||||
elseif ($reg[1] == 'USER_SUPERVISOR_ID' || $reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID')
|
||||
{
|
||||
$newout = $user->fk_user;
|
||||
}
|
||||
elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID')
|
||||
{
|
||||
$newout = $conf->entity;
|
||||
}
|
||||
else $newout = ''; // Key not found, we replace with empty string
|
||||
//var_dump('__'.$reg[1].'__ -> '.$newout);
|
||||
$out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -876,7 +876,7 @@ function dol_string_unaccent($str)
|
||||
else
|
||||
{
|
||||
// See http://www.ascii-code.com/
|
||||
$string = strtr(
|
||||
$string = strtr(
|
||||
$str,
|
||||
"\xC0\xC1\xC2\xC3\xC4\xC5\xC7
|
||||
\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1
|
||||
@ -3418,7 +3418,7 @@ function img_edit_remove($titlealt = 'default', $other = '')
|
||||
* Show logo editer/modifier fiche
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param integer $float Si il faut y mettre le style "float: right"
|
||||
* @param integer $float If you have to put the style "float: right"
|
||||
* @param string $other Add more attributes on img
|
||||
* @return string Return tag img
|
||||
*/
|
||||
@ -3435,7 +3435,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '')
|
||||
* Show logo view card
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param integer $float Si il faut y mettre le style "float: right"
|
||||
* @param integer $float If you have to put the style "float: right"
|
||||
* @param string $other Add more attributes on img
|
||||
* @return string Return tag img
|
||||
*/
|
||||
@ -3793,10 +3793,9 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss
|
||||
|
||||
|
||||
/**
|
||||
* Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remontee des bugs.
|
||||
* On doit appeler cette fonction quand une erreur technique bloquante est rencontree.
|
||||
* Toutefois, il faut essayer de ne l'appeler qu'au sein de pages php, les classes devant
|
||||
* renvoyer leur erreur par l'intermediaire de leur propriete "error".
|
||||
* Displays error message system with all the information to facilitate the diagnosis and the escalation of the bugs.
|
||||
* This function must be called when a blocking technical error is encountered.
|
||||
* However, one must try to call it only within php pages, classes must return their error through their property "error".
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param mixed $error String or array of errors strings to show
|
||||
@ -3857,7 +3856,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
|
||||
|
||||
if (! empty($conf->modules))
|
||||
{
|
||||
$out.="<b>".$langs->trans("Modules").":</b> ".join(', ', $conf->modules)."<br>\n";
|
||||
$out.="<b>".$langs->trans("Modules").":</b> ".join(', ', $conf->modules)."<br>\n";
|
||||
}
|
||||
|
||||
if (is_object($db))
|
||||
@ -5895,7 +5894,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
// Add SIGNATURE into substitutionarray first, so, when we will make the substitution,
|
||||
// this will include signature content first and then replace var found into content of signature
|
||||
$signature = $user->signature;
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
'__USER_SIGNATURE__' => (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '')
|
||||
)
|
||||
);
|
||||
@ -5905,7 +5904,7 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray['__SIGNATURE__'] = (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '');
|
||||
}
|
||||
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
'__USER_ID__' => (string) $user->id,
|
||||
'__USER_LOGIN__' => (string) $user->login,
|
||||
'__USER_LASTNAME__' => (string) $user->lastname,
|
||||
@ -5918,7 +5917,7 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
}
|
||||
if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc))
|
||||
{
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
'__MYCOMPANY_NAME__' => $mysoc->name,
|
||||
'__MYCOMPANY_EMAIL__' => $mysoc->email,
|
||||
'__MYCOMPANY_PROFID1__' => $mysoc->idprof1,
|
||||
@ -6416,11 +6415,11 @@ function dolGetFirstLastname($firstname, $lastname, $nameorder = -1)
|
||||
}
|
||||
elseif ($nameorder == 2 || $nameorder == 3)
|
||||
{
|
||||
$ret.=$firstname;
|
||||
if (empty($ret) && $nameorder == 3)
|
||||
{
|
||||
$ret.=$lastname;
|
||||
}
|
||||
$ret.=$firstname;
|
||||
if (empty($ret) && $nameorder == 3)
|
||||
{
|
||||
$ret.=$lastname;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7956,7 +7955,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield
|
||||
if (!isset($dictvalues[$tablename]))
|
||||
{
|
||||
$dictvalues[$tablename] = array();
|
||||
$sql = 'SELECT * FROM '.$tablename.' WHERE 1';
|
||||
$sql = 'SELECT * FROM '.$tablename.' WHERE 1'; // Here select * is allowed as it is generic code and we don't have list of fields
|
||||
if ($checkentity) $sql.= ' AND entity IN (0,'.getEntity($tablename).')';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -505,14 +505,7 @@ function dolAddEmailTrackId($email, $trackingid)
|
||||
function isValidMailDomain($mail)
|
||||
{
|
||||
list($user, $domain) = explode("@", $mail, 2);
|
||||
if (checkdnsrr($domain, "MX"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return checkdnsrr($domain, "MX");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -317,19 +317,19 @@ function utf162utf8($utf16)
|
||||
|
||||
switch(true) {
|
||||
case ((0x7F & $bytes) == $bytes):
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr($bytes);
|
||||
|
||||
case (0x07FF & $bytes) == $bytes:
|
||||
// return a 2-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
// return a 2-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xC0 | (($bytes >> 6) & 0x1F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
|
||||
case (0xFFFF & $bytes) == $bytes:
|
||||
// return a 3-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
// return a 3-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xE0 | (($bytes >> 12) & 0x0F))
|
||||
. chr(0x80 | (($bytes >> 6) & 0x3F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
|
||||
@ -780,171 +780,171 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
|
||||
|
||||
//if ($lines[$i]->fk_task_parent == $parent)
|
||||
//{
|
||||
// If we want all or we have a role on task, we show it
|
||||
if (empty($mine) || ! empty($tasksrole[$lines[$i]->id]))
|
||||
// If we want all or we have a role on task, we show it
|
||||
if (empty($mine) || ! empty($tasksrole[$lines[$i]->id]))
|
||||
{
|
||||
//dol_syslog("projectLinesPerWeek Found line ".$i.", a qualified task (i have role or want to show all tasks) with id=".$lines[$i]->id." project id=".$lines[$i]->fk_project);
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
|
||||
{
|
||||
//dol_syslog("projectLinesPerWeek Found line ".$i.", a qualified task (i have role or want to show all tasks) with id=".$lines[$i]->id." project id=".$lines[$i]->fk_project);
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
|
||||
$lastprojectid=$lines[$i]->fk_project;
|
||||
if ($preselectedday)
|
||||
{
|
||||
$lastprojectid=$lines[$i]->fk_project;
|
||||
if ($preselectedday)
|
||||
{
|
||||
$projectstatic->id = $lines[$i]->fk_project;
|
||||
}
|
||||
$projectstatic->id = $lines[$i]->fk_project;
|
||||
}
|
||||
|
||||
if (empty($workloadforid[$projectstatic->id]))
|
||||
{
|
||||
if ($preselectedday)
|
||||
{
|
||||
$projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id); // Load time spent from table projet_task_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week
|
||||
$workloadforid[$projectstatic->id]=1;
|
||||
}
|
||||
}
|
||||
|
||||
$projectstatic->id=$lines[$i]->fk_project;
|
||||
$projectstatic->ref=$lines[$i]->project_ref;
|
||||
$projectstatic->title=$lines[$i]->project_label;
|
||||
$projectstatic->public=$lines[$i]->public;
|
||||
|
||||
$taskstatic->id=$lines[$i]->task_id;
|
||||
$taskstatic->ref=($lines[$i]->task_ref?$lines[$i]->task_ref:$lines[$i]->task_id);
|
||||
$taskstatic->label=$lines[$i]->task_label;
|
||||
$taskstatic->date_start=$lines[$i]->date_start;
|
||||
$taskstatic->date_end=$lines[$i]->date_end;
|
||||
|
||||
$thirdpartystatic->id=$lines[$i]->socid;
|
||||
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
|
||||
$thirdpartystatic->email=$lines[$i]->thirdparty_email;
|
||||
|
||||
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
||||
{
|
||||
print '<tr class="oddeven trforbreak">'."\n";
|
||||
print '<td colspan="11">';
|
||||
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
if ($projectstatic->title)
|
||||
{
|
||||
print ' - ';
|
||||
print $projectstatic->title;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id;
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
|
||||
// User
|
||||
/*
|
||||
print '<td class="nowrap">';
|
||||
print $fuser->getNomUrl(1, 'withproject', 'time');
|
||||
print '</td>';
|
||||
*/
|
||||
|
||||
// Project
|
||||
print "<td>";
|
||||
if ($oldprojectforbreak == -1)
|
||||
{
|
||||
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
print '<br>'.$projectstatic->title;
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Thirdparty
|
||||
print '<td class="tdoverflowmax100">';
|
||||
if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
||||
print '</td>';
|
||||
|
||||
// Ref
|
||||
print '<td>';
|
||||
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
||||
for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
||||
// Label task
|
||||
print '<br>';
|
||||
for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
print $taskstatic->label;
|
||||
//print "<br>";
|
||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
||||
print "</td>\n";
|
||||
|
||||
// Date
|
||||
print '<td class="center">';
|
||||
print dol_print_date($lines[$i]->timespent_datehour, 'day');
|
||||
print '</td>';
|
||||
|
||||
$disabledproject=1;$disabledtask=1;
|
||||
//print "x".$lines[$i]->fk_project;
|
||||
//var_dump($lines[$i]);
|
||||
//var_dump($projectsrole[$lines[$i]->fk_project]);
|
||||
// If at least one role for project
|
||||
if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
|
||||
{
|
||||
$disabledproject=0;
|
||||
$disabledtask=0;
|
||||
}
|
||||
// If $restricteditformytask is on and I have no role on task, i disable edit
|
||||
if ($restricteditformytask && empty($tasksrole[$lines[$i]->id]))
|
||||
{
|
||||
$disabledtask=1;
|
||||
}
|
||||
|
||||
// Hour
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($lines[$i]->timespent_datehour, 'hour');
|
||||
print '</td>';
|
||||
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$preselectedday]['morning'] && ! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$preselectedday]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
// Duration
|
||||
print '<td class="duration'.($cssonholiday?' '.$cssonholiday:'').' center">';
|
||||
|
||||
$dayWorkLoad = $lines[$i]->timespent_duration;
|
||||
$totalforeachline[$preselectedday]+=$lines[$i]->timespent_duration;
|
||||
|
||||
$alreadyspent='';
|
||||
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
|
||||
|
||||
print convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
|
||||
|
||||
$modeinput='hours';
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput."') });";
|
||||
print "})\n";
|
||||
print '</script>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Note
|
||||
print '<td class="center">';
|
||||
print '<textarea name="'.$lines[$i]->id.'note" rows="'.ROWS_2.'" id="'.$lines[$i]->id.'note"'.($disabledtask?' disabled="disabled"':'').'>';
|
||||
print $lines[$i]->timespent_note;
|
||||
print '</textarea>';
|
||||
print '</td>';
|
||||
|
||||
// Warning
|
||||
print '<td class="right">';
|
||||
/*if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
|
||||
else if ($disabledtask)
|
||||
{
|
||||
$titleassigntask = $langs->trans("AssignTaskToMe");
|
||||
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
|
||||
|
||||
print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask));
|
||||
}*/
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if (empty($workloadforid[$projectstatic->id]))
|
||||
{
|
||||
if ($preselectedday)
|
||||
{
|
||||
$projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id); // Load time spent from table projet_task_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week
|
||||
$workloadforid[$projectstatic->id]=1;
|
||||
}
|
||||
}
|
||||
|
||||
$projectstatic->id=$lines[$i]->fk_project;
|
||||
$projectstatic->ref=$lines[$i]->project_ref;
|
||||
$projectstatic->title=$lines[$i]->project_label;
|
||||
$projectstatic->public=$lines[$i]->public;
|
||||
|
||||
$taskstatic->id=$lines[$i]->task_id;
|
||||
$taskstatic->ref=($lines[$i]->task_ref?$lines[$i]->task_ref:$lines[$i]->task_id);
|
||||
$taskstatic->label=$lines[$i]->task_label;
|
||||
$taskstatic->date_start=$lines[$i]->date_start;
|
||||
$taskstatic->date_end=$lines[$i]->date_end;
|
||||
|
||||
$thirdpartystatic->id=$lines[$i]->socid;
|
||||
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
|
||||
$thirdpartystatic->email=$lines[$i]->thirdparty_email;
|
||||
|
||||
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
||||
{
|
||||
print '<tr class="oddeven trforbreak">'."\n";
|
||||
print '<td colspan="11">';
|
||||
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
if ($projectstatic->title)
|
||||
{
|
||||
print ' - ';
|
||||
print $projectstatic->title;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id;
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
|
||||
// User
|
||||
/*
|
||||
print '<td class="nowrap">';
|
||||
print $fuser->getNomUrl(1, 'withproject', 'time');
|
||||
print '</td>';
|
||||
*/
|
||||
|
||||
// Project
|
||||
print "<td>";
|
||||
if ($oldprojectforbreak == -1)
|
||||
{
|
||||
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
print '<br>'.$projectstatic->title;
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Thirdparty
|
||||
print '<td class="tdoverflowmax100">';
|
||||
if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
||||
print '</td>';
|
||||
|
||||
// Ref
|
||||
print '<td>';
|
||||
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
||||
for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
||||
// Label task
|
||||
print '<br>';
|
||||
for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
print $taskstatic->label;
|
||||
//print "<br>";
|
||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
||||
print "</td>\n";
|
||||
|
||||
// Date
|
||||
print '<td class="center">';
|
||||
print dol_print_date($lines[$i]->timespent_datehour, 'day');
|
||||
print '</td>';
|
||||
|
||||
$disabledproject=1;$disabledtask=1;
|
||||
//print "x".$lines[$i]->fk_project;
|
||||
//var_dump($lines[$i]);
|
||||
//var_dump($projectsrole[$lines[$i]->fk_project]);
|
||||
// If at least one role for project
|
||||
if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
|
||||
{
|
||||
$disabledproject=0;
|
||||
$disabledtask=0;
|
||||
}
|
||||
// If $restricteditformytask is on and I have no role on task, i disable edit
|
||||
if ($restricteditformytask && empty($tasksrole[$lines[$i]->id]))
|
||||
{
|
||||
$disabledtask=1;
|
||||
}
|
||||
|
||||
// Hour
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($lines[$i]->timespent_datehour, 'hour');
|
||||
print '</td>';
|
||||
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$preselectedday]['morning'] && ! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$preselectedday]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
// Duration
|
||||
print '<td class="duration'.($cssonholiday?' '.$cssonholiday:'').' center">';
|
||||
|
||||
$dayWorkLoad = $lines[$i]->timespent_duration;
|
||||
$totalforeachline[$preselectedday]+=$lines[$i]->timespent_duration;
|
||||
|
||||
$alreadyspent='';
|
||||
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
|
||||
|
||||
print convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
|
||||
|
||||
$modeinput='hours';
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput."') });";
|
||||
print "})\n";
|
||||
print '</script>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Note
|
||||
print '<td class="center">';
|
||||
print '<textarea name="'.$lines[$i]->id.'note" rows="'.ROWS_2.'" id="'.$lines[$i]->id.'note"'.($disabledtask?' disabled="disabled"':'').'>';
|
||||
print $lines[$i]->timespent_note;
|
||||
print '</textarea>';
|
||||
print '</td>';
|
||||
|
||||
// Warning
|
||||
print '<td class="right">';
|
||||
/*if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
|
||||
else if ($disabledtask)
|
||||
{
|
||||
$titleassigntask = $langs->trans("AssignTaskToMe");
|
||||
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
|
||||
|
||||
print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask));
|
||||
}*/
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
|
||||
@ -105,18 +105,18 @@ function reception_admin_prepare_head()
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$head[$h][2] = 'attributes_reception';
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$head[$h][2] = 'attributes_reception';
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$head[$h][2] = 'attributeslines_reception';
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$head[$h][2] = 'attributeslines_reception';
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -180,7 +180,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
|
||||
|
||||
if (! empty($location)) fwrite($calfileh, "LOCATION:".$encoding.$location."\n");
|
||||
if ($fulldayevent) fwrite($calfileh, "X-FUNAMBOL-ALLDAY:1\n");
|
||||
|
||||
|
||||
// see https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/0f262da6-c5fd-459e-9f18-145eba86b5d2
|
||||
if ($fulldayevent) fwrite($calfileh, "X-MICROSOFT-CDO-ALLDAYEVENT:TRUE\n");
|
||||
|
||||
@ -320,7 +320,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
|
||||
fwrite($fichier, $form);
|
||||
|
||||
$form='<description><![CDATA['.$desc.'.]]></description>'."\n".
|
||||
// '<language>fr</language>'."\n".
|
||||
// '<language>fr</language>'."\n".
|
||||
'<copyright>Dolibarr</copyright>'."\n".
|
||||
'<lastBuildDate>'.$date.'</lastBuildDate>'."\n".
|
||||
'<generator>Dolibarr</generator>'."\n";
|
||||
|
||||
@ -149,7 +149,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$this->description = $langs->trans('PDFSpongeDescription');
|
||||
$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
|
||||
|
||||
// Dimensiont page
|
||||
// Dimension page
|
||||
$this->type = 'pdf';
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
@ -423,7 +423,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
}
|
||||
}
|
||||
|
||||
// Affiche notes
|
||||
// Display notes
|
||||
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
|
||||
{
|
||||
@ -462,7 +462,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
{
|
||||
$pdf->rollbackTransaction(true);
|
||||
|
||||
// prepar pages to receive notes
|
||||
// prepare pages to receive notes
|
||||
while ($pagenb < $pageposafternote) {
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
@ -496,7 +496,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
}
|
||||
|
||||
|
||||
// apply note frame to previus pages
|
||||
// apply note frame to previous pages
|
||||
$i = $pageposbeforenote;
|
||||
while ($i < $pageposafternote) {
|
||||
$pdf->setPage($i);
|
||||
@ -557,17 +557,17 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$height_note=0;
|
||||
}
|
||||
|
||||
// Use new auto collum system
|
||||
// Use new auto column system
|
||||
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
// Simulation de tableau pour connaitre la hauteur de la ligne de titre
|
||||
$pdf->startTransaction();
|
||||
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
||||
$pdf->rollbackTransaction(true);
|
||||
// Table simulation to know the height of the title line
|
||||
$pdf->startTransaction();
|
||||
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
||||
$pdf->rollbackTransaction(true);
|
||||
|
||||
$iniY = $tab_top + $this->tabTitleHeight + 2;
|
||||
$curY = $tab_top + $this->tabTitleHeight + 2;
|
||||
$nexY = $tab_top + $this->tabTitleHeight + 2;
|
||||
$iniY = $tab_top + $this->tabTitleHeight + 2;
|
||||
$curY = $tab_top + $this->tabTitleHeight + 2;
|
||||
$nexY = $tab_top + $this->tabTitleHeight + 2;
|
||||
|
||||
// Loop on each lines
|
||||
$pageposbeforeprintlines=$pdf->getPage();
|
||||
@ -842,19 +842,19 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
// Affiche zone infos
|
||||
// Display infos area
|
||||
$posy=$this->drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs);
|
||||
|
||||
// Affiche zone totaux
|
||||
// Display total zone
|
||||
$posy=$this->drawTotalTable($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
// Affiche zone versements
|
||||
// Display payment area
|
||||
if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
|
||||
{
|
||||
$posy=$this->drawPaymentsTable($pdf, $object, $posy, $outputlangs);
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
// Pagefoot
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||
|
||||
@ -1125,7 +1125,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
// Show payment mode CHQ
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||
{
|
||||
// Si mode reglement non force ou si force a CHQ
|
||||
// If payment mode not forced or forced to CHQ
|
||||
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||
{
|
||||
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
||||
@ -1213,7 +1213,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$tab2_hl = 4;
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
|
||||
// Tableau total
|
||||
// Total table
|
||||
$col1x = 120; $col2x = 170;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
@ -1226,7 +1226,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
|
||||
|
||||
|
||||
// pourcentage global d'avancement
|
||||
// overall percentage of advancement
|
||||
$percent = 0;
|
||||
$i=0;
|
||||
foreach ($object->lines as $line)
|
||||
@ -1305,7 +1305,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$pdf->setY($posy);
|
||||
}
|
||||
|
||||
// Display curent total
|
||||
// Display current total
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $posy);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $object->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||
@ -1313,7 +1313,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$pdf->SetXY($col2x, $posy);
|
||||
$facSign = '';
|
||||
if($i>1){
|
||||
$facSign = $object->total_ht>=0?'+':''; // gestion d'un cas particulier client
|
||||
$facSign = $object->total_ht>=0?'+':''; // management of a particular customer case
|
||||
}
|
||||
|
||||
if($fac->type === facture::TYPE_CREDIT_NOTE){
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user