Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_add_OrderNotificationTriggers

This commit is contained in:
Florian HENRY 2022-12-01 13:30:59 +01:00
commit 85c69694e3
45 changed files with 329 additions and 191 deletions

View File

@ -644,8 +644,8 @@ if ($action == 'create') {
print_liste_field_titre("AccountAccountingShort"); print_liste_field_titre("AccountAccountingShort");
print_liste_field_titre("SubledgerAccount"); print_liste_field_titre("SubledgerAccount");
print_liste_field_titre("LabelOperation"); print_liste_field_titre("LabelOperation");
print_liste_field_titre("Debit", "", "", "", "", 'class="right"'); print_liste_field_titre("AccountingDebit", "", "", "", "", 'class="right"');
print_liste_field_titre("Credit", "", "", "", "", 'class="right"'); print_liste_field_titre("AccountingCredit", "", "", "", "", 'class="right"');
if (empty($object->date_validation)) { if (empty($object->date_validation)) {
print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center '); print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center ');
} else { } else {

View File

@ -192,8 +192,8 @@ $arrayfields = array(
't.numero_compte'=>array('label'=>$langs->trans("AccountAccountingShort"), 'checked'=>1), 't.numero_compte'=>array('label'=>$langs->trans("AccountAccountingShort"), 'checked'=>1),
't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1), 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1),
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1), 't.debit'=>array('label'=>$langs->trans("AccountingDebit"), 'checked'=>1),
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.credit'=>array('label'=>$langs->trans("AccountingCredit"), 'checked'=>1),
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),

View File

@ -163,8 +163,8 @@ $arrayfields = array(
't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1), 't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1),
't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1), 't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1),
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1), 't.debit'=>array('label'=>$langs->trans("AccountingDebit"), 'checked'=>1),
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.credit'=>array('label'=>$langs->trans("AccountingCredit"), 'checked'=>1),
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),

View File

@ -987,8 +987,8 @@ class AccountingJournal extends CommonObject
$langs->transnoentitiesnoconv("LedgerAccount"), $langs->transnoentitiesnoconv("LedgerAccount"),
$langs->transnoentitiesnoconv("SubledgerAccount"), $langs->transnoentitiesnoconv("SubledgerAccount"),
$langs->transnoentitiesnoconv("Label"), $langs->transnoentitiesnoconv("Label"),
$langs->transnoentitiesnoconv("Debit"), $langs->transnoentitiesnoconv("AccountingDebit"),
$langs->transnoentitiesnoconv("Credit"), $langs->transnoentitiesnoconv("AccountingCredit"),
$langs->transnoentitiesnoconv("Journal"), $langs->transnoentitiesnoconv("Journal"),
$langs->transnoentitiesnoconv("Note"), $langs->transnoentitiesnoconv("Note"),
); );
@ -998,8 +998,8 @@ class AccountingJournal extends CommonObject
$langs->transnoentitiesnoconv("Piece"), $langs->transnoentitiesnoconv("Piece"),
$langs->transnoentitiesnoconv("AccountAccounting"), $langs->transnoentitiesnoconv("AccountAccounting"),
$langs->transnoentitiesnoconv("LabelOperation"), $langs->transnoentitiesnoconv("LabelOperation"),
$langs->transnoentitiesnoconv("Debit"), $langs->transnoentitiesnoconv("AccountingDebit"),
$langs->transnoentitiesnoconv("Credit"), $langs->transnoentitiesnoconv("AccountingCredit"),
); );
} elseif ($this->nature == 1) { } elseif ($this->nature == 1) {
$header = array( $header = array(
@ -1007,8 +1007,8 @@ class AccountingJournal extends CommonObject
$langs->transnoentitiesnoconv("Piece"), $langs->transnoentitiesnoconv("Piece"),
$langs->transnoentitiesnoconv("AccountAccounting"), $langs->transnoentitiesnoconv("AccountAccounting"),
$langs->transnoentitiesnoconv("LabelOperation"), $langs->transnoentitiesnoconv("LabelOperation"),
$langs->transnoentitiesnoconv("Debit"), $langs->transnoentitiesnoconv("AccountingDebit"),
$langs->transnoentitiesnoconv("Credit"), $langs->transnoentitiesnoconv("AccountingCredit"),
); );
} }

View File

@ -912,8 +912,8 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$langs->transnoentitiesnoconv("LedgerAccount").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("LedgerAccount").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("SubledgerAccount").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("SubledgerAccount").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("Label").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("Label").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("Debit").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("AccountingDebit").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("Credit").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("AccountingCredit").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("Journal").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("Journal").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep;
print "\n"; print "\n";
@ -1136,8 +1136,8 @@ if (empty($action) || $action == 'view') {
print "<td>".$langs->trans("SubledgerAccount")."</td>"; print "<td>".$langs->trans("SubledgerAccount")."</td>";
print "<td>".$langs->trans("LabelOperation")."</td>"; print "<td>".$langs->trans("LabelOperation")."</td>";
print '<td class="center">'.$langs->trans("PaymentMode")."</td>"; print '<td class="center">'.$langs->trans("PaymentMode")."</td>";
print '<td class="right">'.$langs->trans("Debit")."</td>"; print '<td class="right">'.$langs->trans("AccountingDebit")."</td>";
print '<td class="right">'.$langs->trans("Credit")."</td>"; print '<td class="right">'.$langs->trans("AccountingCredit")."</td>";
print "</tr>\n"; print "</tr>\n";
$r = ''; $r = '';

View File

@ -445,8 +445,8 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$langs->transnoentitiesnoconv("Piece").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("Piece").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("AccountAccounting").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("AccountAccounting").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("LabelOperation").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("LabelOperation").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("Debit").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("AccountingDebit").'"'.$sep;
print '"'.$langs->transnoentitiesnoconv("Credit").'"'.$sep; print '"'.$langs->transnoentitiesnoconv("AccountingCredit").'"'.$sep;
print "\n"; print "\n";
foreach ($taber as $key => $val) { foreach ($taber as $key => $val) {
@ -569,8 +569,8 @@ if (empty($action) || $action == 'view') {
print "<td>".$langs->trans("AccountAccounting")."</td>"; print "<td>".$langs->trans("AccountAccounting")."</td>";
print "<td>".$langs->trans("SubledgerAccount")."</td>"; print "<td>".$langs->trans("SubledgerAccount")."</td>";
print "<td>".$langs->trans("LabelOperation")."</td>"; print "<td>".$langs->trans("LabelOperation")."</td>";
print '<td class="right">'.$langs->trans("Debit")."</td>"; print '<td class="right">'.$langs->trans("AccountingDebit")."</td>";
print '<td class="right">'.$langs->trans("Credit")."</td>"; print '<td class="right">'.$langs->trans("AccountingCredit")."</td>";
print "</tr>\n"; print "</tr>\n";
$r = ''; $r = '';

View File

@ -833,8 +833,8 @@ if (empty($action) || $action == 'view') {
print "<td>".$langs->trans("AccountAccounting")."</td>"; print "<td>".$langs->trans("AccountAccounting")."</td>";
print "<td>".$langs->trans("SubledgerAccount")."</td>"; print "<td>".$langs->trans("SubledgerAccount")."</td>";
print "<td>".$langs->trans("LabelOperation")."</td>"; print "<td>".$langs->trans("LabelOperation")."</td>";
print '<td class="center">'.$langs->trans("Debit")."</td>"; print '<td class="center">'.$langs->trans("AccountingDebit")."</td>";
print '<td class="center">'.$langs->trans("Credit")."</td>"; print '<td class="center">'.$langs->trans("AccountingCredit")."</td>";
print "</tr>\n"; print "</tr>\n";
$r = ''; $r = '';

View File

@ -776,8 +776,8 @@ if (empty($action) || $action == 'view') {
print "<td>".$langs->trans("AccountAccounting")."</td>"; print "<td>".$langs->trans("AccountAccounting")."</td>";
print "<td>".$langs->trans("SubledgerAccount")."</td>"; print "<td>".$langs->trans("SubledgerAccount")."</td>";
print "<td>".$langs->trans("LabelOperation")."</td>"; print "<td>".$langs->trans("LabelOperation")."</td>";
print '<td class="center">'.$langs->trans("Debit")."</td>"; print '<td class="center">'.$langs->trans("AccountingDebit")."</td>";
print '<td class="center">'.$langs->trans("Credit")."</td>"; print '<td class="center">'.$langs->trans("AccountingCredit")."</td>";
print "</tr>\n"; print "</tr>\n";
$r = ''; $r = '';

View File

@ -286,8 +286,8 @@ print '<td>' . $langs->trans("AccountAccounting") . '</td>';
print '<td>' . $langs->trans("SubledgerAccount") . '</td>'; print '<td>' . $langs->trans("SubledgerAccount") . '</td>';
print '<td>' . $langs->trans("LabelOperation") . '</td>'; print '<td>' . $langs->trans("LabelOperation") . '</td>';
if ($object->nature == 4) print '<td class="center">' . $langs->trans("PaymentMode") . '</td>'; // bank if ($object->nature == 4) print '<td class="center">' . $langs->trans("PaymentMode") . '</td>'; // bank
print '<td class="right">' . $langs->trans("Debit") . '</td>'; print '<td class="right">' . $langs->trans("AccountingDebit") . '</td>';
print '<td class="right">' . $langs->trans("Credit") . '</td>'; print '<td class="right">' . $langs->trans("AccountingCredit") . '</td>';
print "</tr>\n"; print "</tr>\n";
if (is_array($journal_data) && !empty($journal_data)) { if (is_array($journal_data) && !empty($journal_data)) {

View File

@ -1966,7 +1966,7 @@ if ($id > 0) {
$valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country);
} }
} elseif ($value == 'recuperableonly' || $value == 'deductible' || $value == 'category_type') { } elseif ($value == 'recuperableonly' || $value == 'deductible' || $value == 'category_type') {
$valuetoshow = yn($valuetoshow); $valuetoshow = yn($valuetoshow ? 1 : 0);
$class = "center"; $class = "center";
} elseif ($value == 'type_cdr') { } elseif ($value == 'type_cdr') {
if (empty($valuetoshow)) { if (empty($valuetoshow)) {

View File

@ -39,6 +39,9 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', 160);
$id = GETPOST('account') ?GETPOST('account', 'alpha') : GETPOST('id'); $id = GETPOST('account') ?GETPOST('account', 'alpha') : GETPOST('id');
$ref = GETPOST('ref'); $ref = GETPOST('ref');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('bankannualreport', 'globalcard'));
// Security check // Security check
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
$fieldtype = (!empty($ref) ? 'ref' : 'rowid'); $fieldtype = (!empty($ref) ? 'ref' : 'rowid');

View File

@ -38,6 +38,9 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('bankaccountdocuments', 'globalcard'));
// Security check // Security check
if ($user->socid) { if ($user->socid) {
$action = ''; $action = '';

View File

@ -35,6 +35,9 @@ $langs->loadLangs(array('banks', 'categories'));
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', 768); $WIDTH = DolGraph::getDefaultGraphSizeForStats('width', 768);
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', 200); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', 200);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('bankstats', 'globalcard'));
// Security check // Security check
if (GETPOST('account') || GETPOST('ref')) { if (GETPOST('account') || GETPOST('ref')) {
$id = GETPOST('account') ? GETPOST('account') : GETPOST('ref'); $id = GETPOST('account') ? GETPOST('account') : GETPOST('ref');

View File

@ -62,6 +62,9 @@ $newbankreceipt = GETPOST('newbankreceipt', 'alpha');
$rel = GETPOST("rel", 'alphanohtml'); $rel = GETPOST("rel", 'alphanohtml');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('bankaccountstatement', 'globalcard'));
// Security check // Security check
$fieldid = (!empty($ref) ? $ref : $id); $fieldid = (!empty($ref) ? $ref : $id);
$fieldname = (!empty($ref) ? 'ref' : 'rowid'); $fieldname = (!empty($ref) ? 'ref' : 'rowid');

View File

@ -171,6 +171,8 @@ class Facture extends CommonInvoice
public $total_ttc; public $total_ttc;
public $revenuestamp; public $revenuestamp;
public $resteapayer;
/** /**
* ! Closing after partial payment: discount_vat, badcustomer or badsupplier, bankcharge, other * ! Closing after partial payment: discount_vat, badcustomer or badsupplier, bankcharge, other
* ! Closing when no payment: replaced, abandoned * ! Closing when no payment: replaced, abandoned

View File

@ -198,7 +198,9 @@ print "<tr class=\"liste_titre\">";
print "<td>".$langs->trans("Date")."</td>"; print "<td>".$langs->trans("Date")."</td>";
print "<td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>"; print "<td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>";
print "<td>".$langs->trans("Account")."</td>"; print "<td>".$langs->trans("Account")."</td>";
print "<td>".$langs->trans("Type")."</td><td class='right'>".$langs->trans("Debit")."</td><td class='right'>".$langs->trans("Credit")."</td>"; print "<td>".$langs->trans("Type")."</td>";
print "<td class='right'>".$langs->trans("AccountingDebit")."</td>";
print "<td class='right'>".$langs->trans("AccountingCredit")."</td>";
print "</tr>\n"; print "</tr>\n";

View File

@ -242,7 +242,9 @@ print '<tr class="liste_titre">';
//print "<td>".$langs->trans("JournalNum")."</td>"; //print "<td>".$langs->trans("JournalNum")."</td>";
print '<td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Piece').' ('.$langs->trans('InvoiceRef').')</td>'; print '<td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Piece').' ('.$langs->trans('InvoiceRef').')</td>';
print '<td>'.$langs->trans('Account').'</td>'; print '<td>'.$langs->trans('Account').'</td>';
print '<td>'.$langs->trans('Type').'</td><td class="right">'.$langs->trans('Debit').'</td><td class="right">'.$langs->trans('Credit').'</td>'; print '<td>'.$langs->trans('Type').'</td>';
print '<td class="right">'.$langs->trans('AccountingDebit').'</td>';
print '<td class="right">'.$langs->trans('AccountingCredit').'</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -1166,7 +1166,7 @@ if ($modecompta == 'BOOKKEEPING') {
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print "<td>".$langs->trans("Debit")."</td>\n"; print "<td>".$langs->trans("AccountingDebit")."</td>\n";
print '<td class="right">'; print '<td class="right">';
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
print '<span class="amount">'.price(-$obj->amount).'</span>'; print '<span class="amount">'.price(-$obj->amount).'</span>';
@ -1185,7 +1185,7 @@ if ($modecompta == 'BOOKKEEPING') {
$total_ttc_income += $obj->amount; $total_ttc_income += $obj->amount;
} }
print '<tr class="oddeven"><td>&nbsp;</td>'; print '<tr class="oddeven"><td>&nbsp;</td>';
print "<td>".$langs->trans("Credit")."</td>\n"; print "<td>".$langs->trans("AccountingCredit")."</td>\n";
print '<td class="right">'; print '<td class="right">';
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
print '<span class="amount">'.price($obj->amount).'</span>'; print '<span class="amount">'.price($obj->amount).'</span>';

View File

@ -6270,7 +6270,7 @@ abstract class CommonObject
case 'date': case 'date':
case 'datetime': case 'datetime':
// If data is a string instead of a timestamp, we convert it // If data is a string instead of a timestamp, we convert it
if (!is_int($this->array_options[$key])) { if (!is_numeric($this->array_options[$key]) || $this->array_options[$key] != intval($this->array_options[$key])) {
$this->array_options[$key] = strtotime($this->array_options[$key]); $this->array_options[$key] = strtotime($this->array_options[$key]);
} }
$new_array_options[$key] = $this->db->idate($this->array_options[$key]); $new_array_options[$key] = $this->db->idate($this->array_options[$key]);
@ -8057,8 +8057,9 @@ abstract class CommonObject
$out = ''; $out = '';
$parameters = array(); $parameters = array('mode'=>$mode, 'params'=>$params, 'keysuffix'=>$keysuffix, 'keyprefix'=>$keyprefix, 'display_type'=>$display_type);
$reshook = $hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) { if (empty($reshook)) {
if (is_array($extrafields->attributes[$this->table_element]) && key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { if (is_array($extrafields->attributes[$this->table_element]) && key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
$out .= "\n"; $out .= "\n";

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com> /* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -130,11 +131,14 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object)
*/ */
function expensereport_admin_prepare_head() function expensereport_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$h = 0; $h = 0;
$head = array(); $head = array();
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('expensereport');
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport.php"; $head[$h][0] = DOL_URL_ROOT."/admin/expensereport.php";
@ -162,6 +166,10 @@ function expensereport_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/admin/expensereport_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/expensereport_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['expensereport']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Marc Barilley <marc@ocebo.com> * Copyright (C) 2006 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -249,7 +250,13 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
*/ */
function supplierorder_admin_prepare_head() function supplierorder_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('commande_fournisseur');
$extrafields->fetch_name_optionals_label('commande_fournisseurdet');
$extrafields->fetch_name_optionals_label('facture_fourn');
$extrafields->fetch_name_optionals_label('facture_fourn_det');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -273,21 +280,37 @@ function supplierorder_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierorder_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/supplierorder_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierOrders"); $head[$h][1] = $langs->trans("ExtraFieldsSupplierOrders");
$nbExtrafields = $extrafields->attributes['commande_fournisseur']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'supplierorder'; $head[$h][2] = 'supplierorder';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierorderdet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/supplierorderdet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierOrdersLines"); $head[$h][1] = $langs->trans("ExtraFieldsSupplierOrdersLines");
$nbExtrafields = $extrafields->attributes['commande_fournisseurdet']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'supplierorderdet'; $head[$h][2] = 'supplierorderdet';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoices"); $head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoices");
$nbExtrafields = $extrafields->attributes['facture_fourn']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'supplierinvoice'; $head[$h][2] = 'supplierinvoice';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoicedet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoicedet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoicesLines"); $head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoicesLines");
$nbExtrafields = $extrafields->attributes['facture_fourn_det']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'supplierinvoicedet'; $head[$h][2] = 'supplierinvoicedet';
$h++; $h++;

View File

@ -2235,6 +2235,10 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
$classfile = 'facture-rec'; $classfile = 'facture-rec';
$classname = 'FactureRec'; $classname = 'FactureRec';
$module = 'facture'; $module = 'facture';
} elseif ($objecttype == 'mailing') {
$classpath = 'comm/mailing/class';
$classfile = 'mailing';
$classname = 'Mailing';
} }
if (isModEnabled($module)) { if (isModEnabled($module)) {

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,7 +19,7 @@
/** /**
* \file htdocs/core/lib/holiday.lib.php * \file htdocs/core/lib/holiday.lib.php
* \brief Ensemble de fonctions de base pour les adherents * \brief base functions for holiday
*/ */
/** /**
@ -53,6 +54,8 @@ function holiday_prepare_head($object)
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'holiday', 'add', 'core');
$head[$h][0] = DOL_URL_ROOT.'/holiday/info.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/holiday/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
@ -62,7 +65,7 @@ function holiday_prepare_head($object)
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'holiday'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'holiday', 'add', 'external');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'holiday', 'remove'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'holiday', 'remove');
@ -79,6 +82,9 @@ function holiday_admin_prepare_head()
{ {
global $db, $langs, $conf, $user; global $db, $langs, $conf, $user;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('holiday');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -95,6 +101,10 @@ function holiday_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/admin/holiday_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/holiday_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['holiday']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;

View File

@ -374,7 +374,10 @@ function product_admin_prepare_head()
*/ */
function product_lot_admin_prepare_head() function product_lot_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('product_lot');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -392,6 +395,10 @@ function product_lot_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_lot_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_lot_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['product_lot']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;

View File

@ -110,9 +110,13 @@ function reception_prepare_head(Reception $object)
*/ */
function reception_admin_prepare_head() function reception_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$langs->load("receptions"); $langs->load("receptions");
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('reception');
$extrafields->fetch_name_optionals_label('commande_fournisseur_dispatch');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -126,6 +130,10 @@ function reception_admin_prepare_head()
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) { if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
$head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['reception']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_reception'; $head[$h][2] = 'attributes_reception';
$h++; $h++;
} }
@ -133,6 +141,10 @@ function reception_admin_prepare_head()
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) { if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
$head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$nbExtrafields = $extrafields->attributes['commande_fournisseur_dispatch']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributeslines_reception'; $head[$h][2] = 'attributeslines_reception';
$h++; $h++;
} }

View File

@ -191,7 +191,23 @@ if (!function_exists('dol_loginfunction')) {
// and the conf file is loaded. // and the conf file is loaded.
$prefix = dol_getprefix(''); $prefix = dol_getprefix('');
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix; $sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
if (!empty($conf->global->MAIN_SESSION_TIMEOUT)) { if (!empty($conf->global->MAIN_SESSION_TIMEOUT)) {
if (PHP_VERSION_ID < 70300) {
session_set_cookie_params(0, '/', null, ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
} else {
// Only available for php >= 7.3
$sessioncookieparams = array(
'lifetime' => 0,
'path' => '/',
//'domain' => '.mywebsite.com', // the dot at the beginning allows compatibility with subdomains
'secure' => ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true),
'httponly' => true,
'samesite' => 'Lax' // None || Lax || Strict
);
session_set_cookie_params($sessioncookieparams);
}
setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, (empty($dolibarr_main_force_https) ? false : true), true); setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, (empty($dolibarr_main_force_https) ? false : true), true);
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -110,7 +111,11 @@ function supplier_proposal_prepare_head($object)
*/ */
function supplier_proposal_admin_prepare_head() function supplier_proposal_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('supplier_proposal');
$extrafields->fetch_name_optionals_label('supplier_proposaldet');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -128,11 +133,19 @@ function supplier_proposal_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/admin/supplier_proposal_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/admin/supplier_proposal_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['supplier_proposal']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/admin/supplier_proposaldet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/admin/supplier_proposaldet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$nbExtrafields = $extrafields->attributes['supplier_proposaldet']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributeslines'; $head[$h][2] = 'attributeslines';
$h++; $h++;

View File

@ -860,7 +860,7 @@ class modProduct extends DolibarrModules
)); ));
} }
$this->import_updatekeys_array[$r] = array('sp.fk_product'=>'ProductOrService', 'sp.ref_fourn'=>'SupplierRef', 'sp.fk_soc'=>'Supplier'); $this->import_updatekeys_array[$r] = array('sp.fk_product'=>'ProductOrService', 'sp.ref_fourn'=>'SupplierRef', 'sp.fk_soc'=>'Supplier', 'sp.quantity'=>"QtyMin");
} }
if (!empty($conf->global->PRODUIT_MULTIPRICES)) { if (!empty($conf->global->PRODUIT_MULTIPRICES)) {

View File

@ -54,6 +54,8 @@ ALTER TABLE llx_user DROP COLUMN idpers3;
UPDATE llx_c_actioncomm SET type = 'system' WHERE code = 'AC_OTH'; UPDATE llx_c_actioncomm SET type = 'system' WHERE code = 'AC_OTH';
ALTER TABLE llx_opensurvey_user_studs MODIFY reponses VARCHAR(200) NOT NULL;
-- v17 -- v17
ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_type varchar(32); ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_type varchar(32);

View File

@ -19,7 +19,7 @@ CREATE TABLE llx_opensurvey_user_studs (
id_users INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, id_users INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(64) NOT NULL, nom VARCHAR(64) NOT NULL,
id_sondage VARCHAR(16) NOT NULL, id_sondage VARCHAR(16) NOT NULL,
reponses VARCHAR(100) NOT NULL, -- Not used for 'F' surveys reponses VARCHAR(200) NOT NULL, -- Not used for 'F' surveys
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
date_creation datetime NOT NULL, date_creation datetime NOT NULL,
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -28,10 +28,13 @@
*/ */
function knowledgemanagementAdminPrepareHead() function knowledgemanagementAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf, $db;
$langs->load("knowledgemanagement"); $langs->load("knowledgemanagement");
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('knowledgemanagement_knowledgerecord');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -43,14 +46,13 @@ function knowledgemanagementAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT.'/admin/knowledgerecord_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/knowledgerecord_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['knowledgemanagement_knowledgerecord']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'extra'; $head[$h][2] = 'extra';
$h++; $h++;
/*$head[$h][0] = DOL_URL_ROOT.'/knowledgemanagement/admin/about.php';
$head[$h][1] = $langs->trans("About");
$head[$h][2] = 'about';
$h++;*/
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
//$this->tabs = array( //$this->tabs = array(

View File

@ -29,6 +29,8 @@ BalanceBefore=Balance (before)
Balance=Balance Balance=Balance
Debit=Debit Debit=Debit
Credit=Credit Credit=Credit
AccountingDebit=Debit
AccountingCredit=Credit
Piece=Accounting Doc. Piece=Accounting Doc.
AmountHTVATRealReceived=Net collected AmountHTVATRealReceived=Net collected
AmountHTVATRealPaid=Net paid AmountHTVATRealPaid=Net paid

View File

@ -280,8 +280,8 @@ ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.
ErrorIsNotADraft=%s is not a draft ErrorIsNotADraft=%s is not a draft
ErrorExecIdFailed=Can't execute command "id" ErrorExecIdFailed=Can't execute command "id"
ErrorBadCharIntoLoginName=Unauthorized character in the login name ErrorBadCharIntoLoginName=Unauthorized character in the field %s
ErrorRequestTooLarge=Error, request too large ErrorRequestTooLarge=Error, request too large or session expired
ErrorNotApproverForHoliday=You are not the approver for leave %s ErrorNotApproverForHoliday=You are not the approver for leave %s
ErrorAttributeIsUsedIntoProduct=This attribute is used in one or more product variants ErrorAttributeIsUsedIntoProduct=This attribute is used in one or more product variants
ErrorAttributeValueIsUsedIntoProduct=This attribute value is used in one or more product variants ErrorAttributeValueIsUsedIntoProduct=This attribute value is used in one or more product variants

View File

@ -102,8 +102,6 @@ $morehtmlref .= '</div>';
$linkback = '<a href="'.DOL_URL_ROOT.'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -37,6 +37,7 @@ if (!$user->rights->opensurvey->write) {
$_SESSION["formatsondage"] = "D"; $_SESSION["formatsondage"] = "D";
$erreur = false; $erreur = false;
$erreurNbchoice = 0;
/* /*
* Actions * Actions
@ -49,6 +50,10 @@ if (GETPOST('confirmation')) {
$nbofchoice = count($_SESSION["totalchoixjour"]); $nbofchoice = count($_SESSION["totalchoixjour"]);
$errheure = array(); $errheure = array();
if ($nbofchoice * $_SESSION["nbrecaseshoraires"] > 200) {
setEventMessages($langs->trans("ErrorFieldTooLong"), null, 'errors');
$erreurNb++;
} else {
for ($i = 0; $i < $nbofchoice; $i++) { for ($i = 0; $i < $nbofchoice; $i++) {
// Show hours choices // Show hours choices
for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) {
@ -156,6 +161,8 @@ if (GETPOST('confirmation')) {
} }
} }
} }
}
if (!empty($errheure)) { if (!empty($errheure)) {
setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors'); setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors');
@ -170,7 +177,7 @@ if (GETPOST('confirmation')) {
} }
// Add survey into database // Add survey into database
if (!$erreur) { if (!$erreur && $erreurNb == 0) {
$_SESSION["toutchoix"] = substr("$choixdate", 1); $_SESSION["toutchoix"] = substr("$choixdate", 1);
ajouter_sondage(); ajouter_sondage();

View File

@ -17,18 +17,14 @@
*/ */
/** /**
* \file class/partnership.class.php * \file htdocs/partnership/class/partnership.class.php
* \ingroup partnership * \ingroup partnership
* \brief This file is a CRUD class file for Partnership (Create/Read/Update/Delete) * \brief This file is a CRUD class file for Partnership (Create/Read/Update/Delete)
*/ */
use Illuminate\Support\Arr;
// Put here all includes required by your class file // Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/** /**
* Class for Partnership * Class for Partnership
@ -198,7 +194,7 @@ class Partnership extends CommonObject
$this->db = $db; $this->db = $db;
if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') {
$this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member', 'csslist'=>'tdoverflowmax150'); $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member', 'csslist'=>'tdoverflowmax150');
} else { } else {
$this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150'); $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150');

View File

@ -28,10 +28,13 @@
*/ */
function partnershipAdminPrepareHead() function partnershipAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf, $db;
$langs->loadLangs(array("members", "partnership")); $langs->loadLangs(array("members", "partnership"));
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('partnership');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -43,6 +46,10 @@ function partnershipAdminPrepareHead()
$head[$h][0] = dol_buildpath("/partnership/admin/partnership_extrafields.php", 1); $head[$h][0] = dol_buildpath("/partnership/admin/partnership_extrafields.php", 1);
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['partnership']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'partnership_extrafields'; $head[$h][2] = 'partnership_extrafields';
$h++; $h++;
@ -51,13 +58,6 @@ function partnershipAdminPrepareHead()
$head[$h][2] = 'website'; $head[$h][2] = 'website';
$h++; $h++;
/*
$head[$h][0] = dol_buildpath("/partnership/admin/about.php", 1);
$head[$h][1] = $langs->trans("About");
$head[$h][2] = 'about';
$h++;
*/
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
//$this->tabs = array( //$this->tabs = array(

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -62,10 +63,24 @@ class RecruitmentJobPosition extends CommonObject
*/ */
public $picto = 'recruitmentjobposition'; public $picto = 'recruitmentjobposition';
/**
* Draft status
*/
const STATUS_DRAFT = 0; const STATUS_DRAFT = 0;
/**
* Validated
*/
const STATUS_VALIDATED = 1; const STATUS_VALIDATED = 1;
/**
* Recruited
*/
const STATUS_RECRUITED = 3; const STATUS_RECRUITED = 3;
/**
* Canceled
*/
const STATUS_CANCELED = 9; const STATUS_CANCELED = 9;
@ -651,7 +666,7 @@ class RecruitmentJobPosition extends CommonObject
} }
/** /**
* Close the commercial proposal * Close the recruitment
* *
* @param User $user Object user that close * @param User $user Object user that close
* @param int $status Statut * @param int $status Statut
@ -683,12 +698,6 @@ class RecruitmentJobPosition extends CommonObject
if ($status == self::STATUS_RECRUITED) { if ($status == self::STATUS_RECRUITED) {
$triggerName = 'RECRUITMENTJOB_CLOSE_RECRUITED'; $triggerName = 'RECRUITMENTJOB_CLOSE_RECRUITED';
$modelpdf = $this->model_pdf; $modelpdf = $this->model_pdf;
if ($result < 0) {
$this->error = $this->db->lasterror();
$this->db->rollback();
return -2;
}
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {

View File

@ -287,7 +287,11 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
//print "conf->societe->dir_temp=".$conf->societe->dir_temp; //print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->recruitment->dir_temp); dol_mkdir($conf->recruitment->dir_temp);
if (!is_writable($conf->recruitment->dir_temp)) {
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->recruitment->dir_temp);
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on order, we use it // If CUSTOMER contact defined on order, we use it
$usecontact = false; $usecontact = false;

View File

@ -114,10 +114,6 @@ llxHeader('', $langs->trans("Resource"));
// View and edit mode // View and edit mode
if ($id > 0 || !empty($ref)) { if ($id > 0 || !empty($ref)) {
$soc = new Societe($db);
$soc->fetch($object->socid);
$head = resource_prepare_head($object); $head = resource_prepare_head($object);
print dol_get_fiche_head($head, 'contact', $langs->trans("ResourceSingular"), -1, 'resource'); print dol_get_fiche_head($head, 'contact', $langs->trans("ResourceSingular"), -1, 'resource');

View File

@ -1522,7 +1522,7 @@ class User extends CommonObject
return -1; return -1;
} elseif (preg_match('/['.preg_quote($badCharUnauthorizedIntoLoginName, '/').']/', $this->login)) { } elseif (preg_match('/['.preg_quote($badCharUnauthorizedIntoLoginName, '/').']/', $this->login)) {
$langs->load("errors"); $langs->load("errors");
$this->error = $langs->trans("ErrorBadCharIntoLoginName"); $this->error = $langs->trans("ErrorBadCharIntoLoginName", $langs->transnoentitiesnoconv("Login"));
return -1; return -1;
} }
@ -1918,7 +1918,7 @@ class User extends CommonObject
return -1; return -1;
} elseif (preg_match('/['.preg_quote($badCharUnauthorizedIntoLoginName, '/').']/', $this->login)) { } elseif (preg_match('/['.preg_quote($badCharUnauthorizedIntoLoginName, '/').']/', $this->login)) {
$langs->load("errors"); $langs->load("errors");
$this->error = $langs->trans("ErrorBadCharIntoLoginName"); $this->error = $langs->trans("ErrorBadCharIntoLoginName", $langs->transnoentitiesnoconv("Login"));
return -1; return -1;
} }

View File

@ -1157,7 +1157,7 @@ class Website extends CommonObject
/** /**
* Open a zip with all data of web site and load it into database. * Open a zip with all data of web site and load it into database.
* *
* @param string $pathtofile Path of zip file * @param string $pathtofile Full path of zip file
* @return int <0 if KO, Id of new website if OK * @return int <0 if KO, Id of new website if OK
*/ */
public function importWebSite($pathtofile) public function importWebSite($pathtofile)
@ -1166,6 +1166,8 @@ class Website extends CommonObject
$error = 0; $error = 0;
$pathtofile = dol_sanitizePathName($pathtofile);
$object = $this; $object = $this;
if (empty($object->ref)) { if (empty($object->ref)) {
$this->error = 'Function importWebSite called on object not loaded (object->ref is empty)'; $this->error = 'Function importWebSite called on object not loaded (object->ref is empty)';

View File

@ -2420,14 +2420,17 @@ if ($action == 'importsiteconfirm' && $usercanedit) {
$fileofzip = ''; $fileofzip = '';
if (GETPOSTISSET('templateuserfile')) { if (GETPOSTISSET('templateuserfile')) {
$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // Case we selected one template
$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite()
} elseif (!empty($_FILES)) { } elseif (!empty($_FILES)) {
// Case we upload a new template
if (is_array($_FILES['userfile']['tmp_name'])) { if (is_array($_FILES['userfile']['tmp_name'])) {
$userfiles = $_FILES['userfile']['tmp_name']; $userfiles = $_FILES['userfile']['tmp_name'];
} else { } else {
$userfiles = array($_FILES['userfile']['tmp_name']); $userfiles = array($_FILES['userfile']['tmp_name']);
} }
// Check if $_FILES is ok
foreach ($userfiles as $key => $userfile) { foreach ($userfiles as $key => $userfile) {
if (empty($_FILES['userfile']['tmp_name'][$key])) { if (empty($_FILES['userfile']['tmp_name'][$key])) {
$error++; $error++;
@ -2442,20 +2445,25 @@ if ($action == 'importsiteconfirm' && $usercanedit) {
} }
if (!$error) { if (!$error) {
$upload_dir = $conf->website->dir_temp; //$upload_dir = $conf->website->dir_temp;
$upload_dir = DOL_DATA_ROOT.'/doctemplates/websites/';
$result = dol_add_file_process($upload_dir, 1, -1, 'userfile', ''); $result = dol_add_file_process($upload_dir, 1, -1, 'userfile', '');
} }
// Get name of file (take last one if several name provided) // Get name of file (take last one if several name provided)
/*
$fileofzip = $upload_dir.'/unknown'; $fileofzip = $upload_dir.'/unknown';
foreach ($_FILES as $key => $ifile) { foreach ($_FILES as $key => $ifile) {
foreach ($ifile['name'] as $key2 => $ifile2) { foreach ($ifile['name'] as $key2 => $ifile2) {
$fileofzip = $upload_dir.'/'.$ifile2; $fileofzip = $upload_dir.'/'.$ifile2;
} }
} }
*/
$action = 'importsite';
} }
if (!$error) { if (!$error && GETPOSTISSET('templateuserfile')) {
$result = $object->importWebSite($fileofzip); $result = $object->importWebSite($fileofzip);
if ($result < 0) { if ($result < 0) {