Merge branch 'develop' into patch-781201

This commit is contained in:
Laurent Destailleur 2025-12-04 16:53:26 +01:00 committed by GitHub
commit bdb4a66088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 354 additions and 235 deletions

View file

@ -61,7 +61,7 @@ if (empty($argv[1])) {
$outputpath = $argv[1];
$outputdir = dirname($outputpath);
$outputfile = basename($outputpath);
$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss';
$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss'; // Replace the .html by -security.rss
if (!is_dir($outputdir)) {
print 'Error: dir '.$outputdir.' does not exists or is not writable'."\n";
@ -271,7 +271,7 @@ $nbofmonth = 6;
$delay = (3600 * 24 * 30 * $nbofmonth);
$arrayofalerts = array();
$commandcheck = "git log --all --shortstat --no-renames --use-mailmap --pretty=".escapeshellarg('format:%cI;%H;%aN;%aE;%ce;%s')." --since=".escapeshellarg(dol_print_date(dol_now() - $delay, '%Y-%m-%d'))." | grep -i -E ".escapeshellarg("(#yogosha|CVE|Sec:|Sec |Sec$)");
$commandcheck = "git log --all --shortstat --no-renames --use-mailmap --pretty=".escapeshellarg('format:%cI;%H;%aN;%aE;%ce;%s')." --since=".escapeshellarg(dol_print_date(dol_now() - $delay, '%Y-%m-%d'))." | grep -i -E ".escapeshellarg("(#yogosha|CVE|Sec:|Sec |^Sec$)");
print 'Execute git log to get commits related to security: '.$commandcheck."\n";
$output_arrglpu = array();
$resexecglpu = 0;
@ -280,7 +280,7 @@ foreach ($output_arrglpu as $valgitlog) { // The most recent lines are first.
// Parse the line to split interesting data
$tmpval = cleanVal2($valgitlog);
if (preg_match('/(#yogosha|CVE[\s\-]*\d|Sec:|Sec\s|Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..."
if (preg_match('/(#yogosha|CVE[\s\-]*\d|Sec:|Sec\s|^Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..."
$alreadyfound = '';
$alreadyfoundcommitid = '';
foreach ($arrayofalerts as $val) { // Loop on already found alerts
@ -932,7 +932,7 @@ $html .= '</div>';
$html .= '</div>';
$html .= '<br>';
$html .= 'Note:Search is done in git repository on regex string "#yogosha|CVE[\s\-]*\d|Sec:|Sec\s" (not case sensitive)<br>';
$html .= 'Note:Search is done in git repository on regex string "#yogosha|CVE[\s\-]*\d|Sec:|Sec |^Sec\s" (not case sensitive)<br>';
$html .= 'You can use this URL for RSS notifications: <a href="/'.$outputfilerss.'">'.$outputfilerss.'</a><br><br>';
$html .= '</section>';

View file

@ -747,25 +747,9 @@ class Asset extends CommonObject
return -1;
}
// Old request with 'WITH'
/*
$sql = "WITH in_accounting_bookkeeping(fk_docdet) AS (";
$sql .= " SELECT DISTINCT fk_docdet";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
$sql .= " WHERE doc_type = 'asset'";
$sql .= ")";
$sql .= "SELECT ad.rowid, ad.depreciation_mode, ad.ref, ad.depreciation_date, ad.depreciation_ht, ad.cumulative_depreciation_ht";
$sql .= ", " . $this->db->ifsql('iab.fk_docdet IS NOT NULL', 1, 0) . " AS bookkeeping";
$sql = "SELECT ad.rowid, ad.depreciation_mode, ad.ref, ad.depreciation_date, ad.depreciation_ht, ad.cumulative_depreciation_ht,";
$sql .= " " . $this->db->ifsql('EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type = \'asset\' AND ab.fk_docdet = ad.rowid)', '1', '0') . " AS bookkeeping";
$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation AS ad";
$sql .= " LEFT JOIN in_accounting_bookkeeping as iab ON iab.fk_docdet = ad.rowid";
$sql .= " WHERE ad.fk_asset = " . (int) $this->id;
$sql .= " ORDER BY ad.depreciation_date ASC";
*/
$sql = "SELECT ad.rowid, ad.depreciation_mode, ad.ref, ad.depreciation_date, ad.depreciation_ht, ad.cumulative_depreciation_ht";
$sql .= ", " . $this->db->ifsql('iab.fk_docdet IS NOT NULL', '1', '0') . " AS bookkeeping";
$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation AS ad";
$sql .= " LEFT JOIN (SELECT DISTINCT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset') AS iab ON iab.fk_docdet = ad.rowid";
$sql .= " WHERE ad.fk_asset = " . (int) $this->id;
$sql .= " ORDER BY ad.depreciation_date ASC";

View file

@ -120,10 +120,9 @@ print '<span class="opacitymedium">'.$langs->trans("BlockedLogDesc")."</span><br
if ($mysoc->country_code == 'FR') {
$htmltext = $langs->trans("UnalterableLogTool1FR").'<br>';
print info_admin($htmltext, 0, 0, 'warning');
}
print info_admin($htmltext, 0, 0, 'warning');
print '<br>';
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table

View file

@ -54,7 +54,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : get
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$hmacexportkey = GETPOST('hmacexportkey', 'password');
//$hmacexportkey = GETPOST('hmacexportkey', 'password');
$search_showonlyerrors = GETPOSTINT('search_showonlyerrors');
if ($search_showonlyerrors < 0) {
@ -179,10 +179,12 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Year")), null, "errors");
$error++;
}
/*
if (empty($hmacexportkey)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Password")), null, "errors");
$error++;
}
*/
$dates = dol_get_first_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 1);
$datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12);
@ -256,14 +258,17 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
$sql .= " FROM ".MAIN_DB_PREFIX."blockedlog";
$sql .= " WHERE entity = ".((int) $conf->entity);
if (GETPOSTINT('monthtoexport') > 0 || GETPOSTINT('yeartoexport') > 0) {
$dates = dol_get_first_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 1);
$datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12);
$dates = dol_get_first_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') > 0 ? GETPOSTINT('monthtoexport') : 1);
$datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') > 0 ? GETPOSTINT('monthtoexport') : 12);
$sql .= " AND date_creation BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'";
}
$sql .= " ORDER BY rowid ASC"; // Required so later we can use the parameter $previoushash of checkSignature()
$resql = $db->query($sql);
if ($resql) {
$registrationnumber = getHashUniqueIdOfRegistration();
$secretkey = $registrationnumber;
$yearmonthtoexport = GETPOSTINT('yeartoexport').(GETPOSTINT('monthtoexport') > 0 ? sprintf("%02d", GETPOSTINT('monthtoexport')) : '');
$yearmonthdateofexport = dol_print_date(dol_now(), 'dayhourlog', 'gmt');
@ -275,7 +280,7 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
$fh = fopen($tmpfile, 'w');
// Print line with title
fwrite($fh, "BEGIN - date=".$yearmonthdateofexport
fwrite($fh, "BEGIN - date=".$yearmonthdateofexport." - period=".$yearmonthtoexport
.';'.$langs->transnoentities('Id')
.';'.$langs->transnoentities('DateCreation')
.';'.$langs->transnoentities('Action')
@ -290,6 +295,7 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
.';'.$langs->transnoentities('Fingerprint')
.';'.$langs->transnoentities('Status')
.';'.$langs->transnoentities('FingerprintExport')
//.';'.$langs->transnoentities('FingerprintExportHMAC')
."\n");
$loweridinerror = 0;
@ -355,6 +361,7 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
}
$signatureexport = 'TODO';
$signatureexporthmac = 'TODO';
fwrite($fh,
';'.$block_static->id
@ -370,7 +377,8 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
.';"'.str_replace('"', '""', $block_static->object_version).'";"'
.str_replace('"', '""', $block_static->signature).'";"'
.str_replace('"', '""', $statusofrecord).'";"'
.str_replace('"', '""', $signatureexport).'"'
.str_replace('"', '""', $signatureexport).'";'
//.str_replace('"', '""', $signatureexporthmac).'"'
//.';'.$statusofrecordnote
."\n");
@ -384,11 +392,11 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
// Calculate the md5 of the file (the last line has a return line)
$algo = 'sha256';
$secretkey = 'TODOASKBEFOREEXPORT';
$sha256 = hash_file($algo, $tmpfile);
$hmacsha256 = hash_hmac_file($algo, $tmpfile, $secretkey);
// Now add a signature to check integrity at end of file
file_put_contents($tmpfile, 'END - hmac_sha256='.$hmacsha256, FILE_APPEND);
file_put_contents($tmpfile, 'END - sha256='.$sha256.' - hmac_sha256='.$hmacsha256, FILE_APPEND);
setEventMessages($langs->trans("FileGenerated"), null);
} else {
@ -540,7 +548,8 @@ print '<input type="text" name="yeartoexport" class="valignmiddle maxwidth75imp"
print ' ';
print '<input type="text" name="hmacexportkey" class="valignmiddle minwidth150imp maxwidth300imp" required value="'.GETPOST('hmacexportkey').'" placeholder="'.$langs->trans("Password").'">';
// Disabled, we will use the getHashUniqueIdOfRegistration() as secret HMAC
//print '<input type="text" name="hmacexportkey" class="valignmiddle minwidth150imp maxwidth300imp" required value="'.GETPOST('hmacexportkey').'" placeholder="'.$langs->trans("Password").'">';
print ' ';

View file

@ -426,7 +426,7 @@ $htmltext = '';
$htmltext .= $langs->trans("UnalterableLogTool2", $langs->transnoentitiesnoconv("Archives"))."<br>";
$htmltext .= $langs->trans("UnalterableLogTool3")."<br>";
print info_admin($htmltext);
print info_admin($htmltext, 0, 0, 'warning');
print '<br>';

View file

@ -129,6 +129,8 @@ function formatObject($objtoshow, $prefix)
'pos_source' => "POSTerminal",
'posmodule' => 'POSModule',
'posnumber' => 'POSTerminal',
'pos_print_counter' => "NumberOfPrints",
'email_sent_counter' => "NumberOfEmailsSent",
'managers' => 'Managers',
'type_code' => 'PaymentMode',
'datec' => 'DateCreation',
@ -153,11 +155,13 @@ function formatObject($objtoshow, $prefix)
'tva_tx' => 'VatRate',
'localtax1_tx' => 'Localtax1Rate',
'localtax2_tx' => 'Localtax2Rate',
'vat_src_code' => 'VatCode',
'multicurrency_code' => 'Currency',
'qty' => 'Quantity',
'nom' => 'Name',
'name' => 'Name',
'email' => 'Email',
'state_code' => 'State',
'revenuestamp' => 'RevenueStamp',
'code_client' => 'CustomerCode',
'capital' => 'Capital',
@ -167,9 +171,10 @@ function formatObject($objtoshow, $prefix)
'localtax2_value' => 'LocalTax2DefaultValue',
'subprice' => 'UnitPrice',
'product_type' => 'ProductType',
'product_label' => 'ProductLabel',
'type' => 'InvoiceType',
'info_bits' => 'TVA NPR or NOT',
'special_code' => 'Special line (WEEE line, option, id of module...)'
'special_code' => 'Special line (WEEE line, option, id of module...)',
);
if (is_object($newobjtoshow) || is_array($newobjtoshow)) {

View file

@ -193,7 +193,7 @@ class BlockedLog
$sep = 0;
// Customer Invoice/Facture / Payment
// Customer Invoice/Facture / Payment (For most VAT antifraud laws)
if (isModEnabled('invoice')) {
$sep++;
$this->trackedevents['separator_'.$sep] = array('id' => 'separator_'.$sep, 'label' => '----------', 'labelhtml' => '<span class="opacitymedium">----- '.$langs->trans("Invoices").' | '.$langs->trans("Payments").'</span>', 'disabled' => 1);
@ -221,7 +221,7 @@ class BlockedLog
*/
// Donation
if (isModEnabled('don')) {
if (isModEnabled('don') && getDolGlobalString('BLOCKEDLOG_ENABLE_DONATION')) { // For countries that need unalterable logs for donations
if (!empty($this->trackedevents)) {
$sep++;
$this->trackedevents['separator_'.$sep] = array('id' => 'separator_'.$sep, 'label' => '----------', 'labelhtml' => '<span class="opacitymedium">----- '.$langs->trans("Donations").' | '.$langs->trans("Payments").'</span>', 'disabled' => 1);
@ -244,7 +244,7 @@ class BlockedLog
*/
// Members
if (isModEnabled('member')) {
if (isModEnabled('member') && getDolGlobalString('BLOCKEDLOG_ENABLE_MEMBER')) { // For countries that need unalterable logs for membership management
if (!empty($this->trackedevents)) {
$sep++;
$this->trackedevents['separator_'.$sep] = array('id' => 'separator_'.$sep, 'label' => '----------', 'labelhtml' => '<span class="opacitymedium">----- '.$langs->trans("MenuMembers").'</span>', 'disabled' => 1);
@ -256,6 +256,7 @@ class BlockedLog
}
// Bank
/*
if (isModEnabled("bank")) {
if (!empty($this->trackedevents)) {
$sep++;
@ -266,6 +267,7 @@ class BlockedLog
$this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = array('id' => 'PAYMENT_VARIOUS_MODIFY', 'label' => 'logPAYMENT_VARIOUS_MODIFY', 'labelhtml' => img_picto('', 'bank', 'class="pictofixedwidth").').$langs->trans('logPAYMENT_VARIOUS_MODIFY'));
$this->trackedevents['PAYMENT_VARIOUS_DELETE'] = array('id' => 'PAYMENT_VARIOUS_DELETE', 'label' => 'logPAYMENT_VARIOUS_DELETE', 'labelhtml' => img_picto('', 'bank', 'class="pictofixedwidth").').$langs->trans('logPAYMENT_VARIOUS_DELETE'));
}
*/
// Cash register closing
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules
@ -279,8 +281,8 @@ class BlockedLog
$this->trackedevents['CASHCONTROL_VALIDATE'] = array('id' => 'CASHCONTROL_VALIDATE', 'label' => 'logCASHCONTROL_VALIDATE', 'labelhtml' => img_picto('', 'pos', 'class="pictofixedwidth").').$langs->trans('logCASHCONTROL_VALIDATE'));
}
// Add more action to track from a conf variable
// For example: STOCK_MOVEMENT,...
// Add more action to track from a conf variable. For the case we want to track other actions into the unalterable log.
// For example: STOCK_MOVEMENT, ...
if (getDolGlobalString('BLOCKEDLOG_ADD_ACTIONS_SUPPORTED')) {
if (!empty($this->trackedevents)) {
$sep++;
@ -515,7 +517,8 @@ class BlockedLog
'table_element', 'fields',
'ref_previous', 'ref_next',
'origin', 'origin_id',
'oldcopy', 'picto', 'error', 'errors', 'model_pdf', 'modelpdf', 'last_main_doc', 'civility_id', 'contact', 'contact_id',
'oldcopy', 'picto', 'error', 'errors',
'model_pdf', 'modelpdf', 'last_main_doc', 'civility_id', 'contact', 'contact_id',
'table_element_line', 'ismultientitymanaged', 'isextrafieldmanaged',
'array_languages',
'childtables',
@ -554,17 +557,32 @@ class BlockedLog
// List of fields qualified
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', 'tva_assuj', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur'
'tva_intra', 'tva_assuj', 'localtax1_assuj', 'localtax2_assuj', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur'
))) {
continue; // Discard if not into this dedicated list
}
if (!is_object($value) && !is_null($value) && $value !== '') {
$valuequalifiedforstorage = false;
if (!is_object($value)) {
if (empty($value) && in_array($key, array('country_code', 'idprof1', 'idprof2', 'tva_intra'))) {
$valuequalifiedforstorage = true; // We accept '' value for some fields
$value = (string) $value;
}
if (!is_null($value) && empty($value) && in_array($key, array('tva_assuj', 'localtax1_assuj', 'localtax2_assuj'))) {
$valuequalifiedforstorage = true; // We accept zero value for amounts
}
if (!is_null($value) && (string) $value !== '') {
$valuequalifiedforstorage = true;
}
}
if ($valuequalifiedforstorage) {
$this->object_data->thirdparty->$key = $value;
}
}
}
// Add company info
// Add my company info
if (!empty($mysoc)) {
$this->object_data->mycompany = new stdClass();
@ -572,14 +590,29 @@ class BlockedLog
if (in_array($key, $arrayoffieldstoexclude)) {
continue; // Discard some properties
}
// List of fields qualified
// List of fields qualified to keep
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_assuj', '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 this dedicated list
}
if (!is_object($value) && !is_null($value) && $value !== '') {
$valuequalifiedforstorage = false;
if (!is_object($value)) {
if (empty($value) && in_array($key, array('country_code', 'idprof1', 'idprof2', 'tva_intra'))) {
$valuequalifiedforstorage = true; // We accept '' value for some fields
$value = (string) $value;
}
if (!is_null($value) && empty($value) && in_array($key, array('tva_assuj'))) {
$valuequalifiedforstorage = true; // We accept zero value for amounts
}
if (!is_null($value) && (string) $value !== '') {
$valuequalifiedforstorage = true;
}
}
if ($valuequalifiedforstorage) {
$this->object_data->mycompany->$key = $value;
}
}
@ -600,10 +633,14 @@ class BlockedLog
}
// List of fields qualified
if (!in_array($key, array(
'ref', 'ref_client', 'ref_supplier', 'date', 'datef', 'datev', 'type', 'total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'revenuestamp', 'datepointoftax', 'note_public', 'lines',
'module_source', 'pos_source'
'ref', 'ref_client', 'ref_supplier', 'date', 'datef', 'datev', 'type',
//'vat_src_code', 'tva_tx', 'localtax1_tx', 'localtax2_tx', There is no rate at full doc level
'total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2',
'revenuestamp', 'datepointoftax', 'note_public',
'lines',
'module_source', 'pos_source', 'pos_print_counter', 'email_sent_counter'
))) {
continue; // Discard if not into a dedicated list
continue; // Discarded if not into the dedicated list
}
if ($key == 'lines') {
$lineid = 0;
@ -612,8 +649,7 @@ class BlockedLog
foreach ($tmpline as $keyline => $valueline) {
if (!in_array($keyline, array(
'ref', 'product_type', 'product_label',
'qty',
'subprice',
'qty', 'subprice',
'vat_src_code', 'tva_tx', 'localtax1_tx', 'localtax2_tx',
'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2',
'multicurrency_code', 'multicurrency_total_ht', 'multicurrency_total_tva', 'multicurrency_total_ttc',
@ -626,13 +662,43 @@ class BlockedLog
$this->object_data->invoiceline[$lineid] = new stdClass();
}
if (!is_object($valueline) && !is_null($valueline) && $valueline !== '') {
$valuequalifiedforstorage = false;
if (!is_object($valueline)) {
if (!is_null($valueline) && empty($valueline) && in_array($key, array('tva_tx', 'localtax1_tx', 'localtax2_tx', 'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2'))) {
$valuequalifiedforstorage = true; // We accept zero value for amounts
}
if (!is_null($valueline) && (string) $valueline !== '') {
$valuequalifiedforstorage = true;
}
}
if ($keyline == 'product_label' && empty($valueline)) {
$valueline = dol_trunc(dolGetFirstLineOfText($tmpline->desc)); // Fallback on description if label is empty
$valuequalifiedforstorage = true;
}
if ($valuequalifiedforstorage) {
$this->object_data->invoiceline[$lineid]->$keyline = $valueline;
}
}
}
} elseif (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->$key = $value;
} else {
$valuequalifiedforstorage = false;
if (!is_object($value)) {
if (empty($value) && in_array($key, array('pos_source', 'module_source'))) {
$valuequalifiedforstorage = true; // We accept '' value for some fields
$value = (string) $value;
}
if (!is_null($value) && empty($value) && in_array($key, array('total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'pos_print_counter', 'email_sent_counter'))) {
$valuequalifiedforstorage = true; // We accept zero value for amounts
}
if (!is_null($value) && (string) $value !== '') {
$valuequalifiedforstorage = true;
}
}
if ($valuequalifiedforstorage) {
$this->object_data->$key = $value;
}
}
}
@ -651,7 +717,22 @@ class BlockedLog
))) {
continue; // Discard if not into a dedicated list
}
if (!is_object($value) && !is_null($value) && $value !== '') {
$valuequalifiedforstorage = false;
if (!is_object($value)) {
if (empty($value) && in_array($key, array('pos_source', 'module_source'))) {
$valuequalifiedforstorage = true; // We accept '' value for some fields
$value = (string) $value;
}
if (!is_null($value) && empty($value) && in_array($key, array('total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'pos_print_counter', 'email_sent_counter'))) {
$valuequalifiedforstorage = true; // We accept zero value for amounts
}
if (!is_null($value) && (string) $value !== '') {
$valuequalifiedforstorage = true;
}
}
if ($valuequalifiedforstorage) {
$this->object_data->$key = $value;
}
}
@ -679,7 +760,7 @@ class BlockedLog
$totalamount = 0;
// Loop on each invoice payment amount (payment_part)
// Loop on each invoice payment amount (the payment_part)
if (is_array($object->amounts) && !empty($object->amounts)) {
$paymentpartnumber = 0;
foreach ($object->amounts as $objid => $amount) {
@ -738,7 +819,7 @@ class BlockedLog
if (in_array($key, $arrayoffieldstoexclude)) {
continue; // Discard some properties
}
// List of fields qualified
// List of thirdparty fields qualified
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'
@ -754,6 +835,8 @@ class BlockedLog
// Init object to avoid warnings
if ($this->element == 'payment_donation') {
$paymentpart->donation = new stdClass();
} elseif ($this->element == 'payment_various') {
$paymentpart->various = new stdClass();
} else {
$paymentpart->invoice = new stdClass();
}
@ -765,11 +848,27 @@ class BlockedLog
}
// List of fields qualified
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'
'ref', 'ref_client', 'ref_supplier', 'date', 'datef', 'type', 'total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'revenuestamp', 'datepointoftax', 'note_public',
'pos_source', 'module_source', 'pos_print_counter', 'email_sent_counter'
))) {
continue; // Discard if not into a dedicated list
}
if (!is_object($value) && !is_null($value) && $value !== '') {
$valuequalifiedforstorage = false;
if (!is_object($value)) {
if (empty($value) && in_array($key, array('pos_source', 'module_source'))) {
$valuequalifiedforstorage = true; // We accept '' value for some fields
$value = (string) $value;
}
if (!is_null($value) && empty($value) && in_array($key, array('total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'pos_print_counter', 'email_sent_counter'))) {
$valuequalifiedforstorage = true; // We accept zero value for amounts
}
if (!is_null($value) && (string) $value !== '') {
$valuequalifiedforstorage = true;
}
}
if ($valuequalifiedforstorage) {
if ($this->element == 'payment_donation') {
$paymentpart->donation->$key = $value;
} elseif ($this->element == 'payment_various') {

View file

@ -801,7 +801,8 @@ if ($sql) {
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardAccountancy', $parameters, $object); // Note that $action and $object may have been modified by hook
$object = null;
$reshook = $hookmanager->executeHooks('dashboardAccountancy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();

View file

@ -9874,7 +9874,7 @@ abstract class CommonObject
}
}
if (empty($buyPrice) && isset($conf->global->MARGIN_TYPE) && in_array($conf->global->MARGIN_TYPE, array('1', 'pmp', 'costprice'))) {
if (empty($buyPrice) && in_array(getDolGlobalString('MARGIN_TYPE'), array('1', 'pmp', 'costprice'))) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0) {

View file

@ -7579,7 +7579,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
//print $amount."-";
$data = explode('.', $amount);
$decpart = isset($data[1]) ? $data[1] : '';
$decpart = preg_replace('/0+$/i', '', $decpart); // Supprime les 0 de fin de partie decimale
$decpart = preg_replace('/0+$/i', '', $decpart); // Remove 0 at end of decimal part
//print "decpart=".$decpart."<br>";
$end = '';
@ -7662,7 +7662,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
*/
function price2num($amount, $rounding = '', $option = 0)
{
global $langs, $conf;
global $langs;
// Clean parameters
if (is_null($amount)) {
@ -12698,7 +12698,6 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
function printCommonFooter($zone = 'private')
{
global $conf, $hookmanager, $user, $langs;
global $debugbar;
global $action;
global $micro_start_time;
@ -12712,8 +12711,9 @@ function printCommonFooter($zone = 'private')
print "\n<!-- A div to store page_y POST parameter -->\n";
print '<div id="page_y" style="display: none;">' . (GETPOST('page_y') ? GETPOST('page_y') : '') . '</div>' . "\n";
$parameters = array();
$reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
$parameters = array('zone' => $zone);
$tmpobject = null;
$reshook = $hookmanager->executeHooks('printCommonFooter', $parameters, $tmpobject, $action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
if (getDolGlobalString('MAIN_HTML_FOOTER')) {
print getDolGlobalString('MAIN_HTML_FOOTER') . "\n";
@ -12907,7 +12907,7 @@ function printCommonFooter($zone = 'private')
print "\n" . '</script>' . "\n";
// Google Analytics
// TODO Add a hook here
// TODO Remove this, can be replaced with the hook printCommonFooter
if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AN_ID')) {
$tmptagarray = explode(',', getDolGlobalString('MAIN_GOOGLE_AN_ID'));
foreach ($tmptagarray as $tmptag) {
@ -12933,15 +12933,23 @@ function printCommonFooter($zone = 'private')
print_r(xdebug_get_code_coverage());
}
// Output string from hooks
if (!empty($hookmanager->resPrint)) {
print $hookmanager->resPrint;
}
// Add DebugBar data
if ($user->hasRight('debugbar', 'read') && $debugbar instanceof DebugBar\DebugBar) {
if (isset($debugbar['time'])) {
// @phan-suppress-next-line PhanPluginUnknownObjectMethodCall
$debugbar['time']->stopMeasure('pageaftermaster');
if ($user->hasRight('debugbar', 'read')) {
global $debugbar;
if ($debugbar instanceof DebugBar\DebugBar) {
if (isset($debugbar['time'])) {
// @phan-suppress-next-line PhanPluginUnknownObjectMethodCall
$debugbar['time']->stopMeasure('pageaftermaster');
}
print '<!-- Output debugbar data -->' . "\n";
$renderer = $debugbar->getJavascriptRenderer();
print $renderer->render();
}
print '<!-- Output debugbar data -->' . "\n";
$renderer = $debugbar->getJavascriptRenderer();
print $renderer->render();
} elseif (count($conf->logbuffer)) { // If there is some logs in buffer to show
print "\n";
print "<!-- Start of log output\n";

View file

@ -1771,7 +1771,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
// Note
print '<td class="center">';
print '<textarea name="'.$lines[$i]->id.'note" rows="'.ROWS_2.'" id="'.$lines[$i]->id.'note"'.($disabledtask ? ' disabled="disabled"' : '').'>';
print '<textarea class="padding3" name="'.$lines[$i]->id.'note" rows="'.ROWS_2.'" id="'.$lines[$i]->id.'note"'.($disabledtask ? ' disabled="disabled"' : '').'>';
print '</textarea>';
print '</td>';

View file

@ -50,14 +50,14 @@ if ($type == 'title') {
$formquestion = array(
array('type' => 'text', 'name' => 'subtotallinedesc', 'label' => $langs->trans("SubtotalLineDesc"), 'moreattr' => 'placeholder="' . $langs->trans("Description") . '"'),
array('type' => 'select', 'name' => 'subtotallinelevel', 'label' => $langs->trans("SubtotalLineLevel"), 'values' => $depth_array, 'default' => 1, 'select_show_empty' => 0),
array('type' => 'checkbox', 'value' => false, 'name' => 'titleshowuponpdf', 'label' => $langs->trans("ShowUPOnPDF")),
array('type' => 'checkbox', 'value' => false, 'name' => 'titleshowtotalexludingvatonpdf', 'label' => $langs->trans("ShowTotalExludingVATOnPDF")),
array('type' => 'checkbox', 'value' => true, 'name' => 'titleshowuponpdf', 'label' => $langs->trans("ShowUPOnPDF")),
array('type' => 'checkbox', 'value' => true, 'name' => 'titleshowtotalexludingvatonpdf', 'label' => $langs->trans("ShowTotalExludingVATOnPDF")),
array('type' => 'checkbox', 'value' => false, 'name' => 'titleforcepagebreak', 'label' => $langs->trans("ForcePageBreak")),
);
} elseif ($type == 'subtotal') {
$formquestion = array(
array('type' => 'select', 'name' => 'subtotaltitleline', 'label' => $langs->trans("CorrespondingTitleLine"), 'values' => $titles, 'select_show_empty' => 0),
array('type' => 'checkbox', 'value' => false, 'name' => 'subtotalshowtotalexludingvatonpdf', 'label' => $langs->trans("ShowTotalExludingVATOnPDF")),
array('type' => 'checkbox', 'value' => true, 'name' => 'subtotalshowtotalexludingvatonpdf', 'label' => $langs->trans("ShowTotalExludingVATOnPDF")),
);
}

View file

@ -3679,9 +3679,9 @@ if ($action == 'create') {
$s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>';
$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>';
$s .= ' / ';
$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>';
$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . ($conf->dol_optimize_smallscreen ? "2" : $langs->trans("Mode2")) . '</a>';
print '<div class="inline-block">';
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help', 'class="paddingleft paddingright"'), '', 3, '', 0, 'recalculate');
print '&nbsp; &nbsp; &nbsp; &nbsp;';
print '</div>';
}
@ -3817,7 +3817,7 @@ if ($action == 'create') {
$bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
}
print '<td class="right">';
print '<td class="right nowraponall">';
if ($objp->baid > 0) {
print $bankaccountstatic->getNomUrl(1, 'transactions');
}

View file

@ -4,7 +4,7 @@ Fingerprints=Archived events and fingerprints
FingerprintsDesc=This is the tool to browse or extract the unalterable logs. Unalterable logs are generated and store into a dedicated table of the systel, in real time when a business event appears.
ArchivesDesc=You can use this tool to export Unalterable Logs into archive files. They are kept into the system but you should download and copy them into external supports.
UnalterableLogTool1=The law of some countries (like in France when doing B2C), ask that you do it on a regular basis.
UnalterableLogTool1FR=In France, you MUST generate archives, at least, once every year, we recommand to do it once per month. Also, you MUST keep these archives for at least 7 years. According to the law, It is the user's responsibility to store their archives on media that guarantee their preservation, including in the event of hardware failure, so we recommand to store them on at least 2 different physical supports.
UnalterableLogTool1FR=In France, you MUST generate archives of the unalterable logs, at least, once every year. We recommand to do it once per month. Also, you MUST keep these archives for at least 7 years. According to the law, It is the user's responsibility to store their archives on media that guarantee their preservation, including in the event of hardware failure, so we recommand to store them on at least 2 different physical supports.
UnalterableLogTool2=This unalterable Logs contains the history of unalterable data. It is the responsibility of the application user to ensure system backups, in order to comply with legal obligations. If you decide to secure your unalterable logs by exporting and storing archives files instead of a full database backup (tab <b>%s</b>), it is recommended to store the exported archive files in different places (Secured cloud, External USB drive, ...).
UnalterableLogTool3=Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non-valid fingerprint.
FingerprintsDesc2=If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed).
@ -24,6 +24,7 @@ BlockedlogInfoDialog=Log Details
ListOfTrackedEvents=List of tracked events
Fingerprint=Fingerprint
FingerprintExport=Fingerprint export
FingerprintExportHMAC=Fingerprint export HMAC
DownloadLogCSV=Export unalterable logs (CSV)
DataOfArchivedEvent=Complete data of archived event
DataOfArchivedEventHelp=This field contains the complementary data that was archived on real time. Even if some parent business event could have been canceled or modified, the data stored here is the original data, and it can't be modified.
@ -51,6 +52,9 @@ TotalForAction=Total for event %s
SecretKey=Secret key
ErrorPeriodMustBePastToAllowExport=Export into archives is allowed only if period is completely past
RegistrationNumber=Registration number
NumberOfPrints=Number of prints
NumberOfEmailsSent=Number of emails sent
VatCode=Vat code
## logTypes
logBILL_DELETE=Customer invoice logically deleted

View file

@ -120,6 +120,7 @@ ActivityOnProjectThisYear=Activity on project this year
ChildOfProjectTask=Child of project/task
ChildOfTask=Child of task
TaskHasChild=Task has child
ParentTask=Parent task
NotOwnerOfProject=Not owner of this private project
AffectedTo=Allocated to
CantRemoveProject=This project can't be removed as it is referenced by some other objects (invoice, orders or other). See tab '%s'.

View file

@ -23,13 +23,7 @@
* \brief Page to setup margin module
*/
include '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
require_once '../../main.inc.php';
/**
* @var Conf $conf
* @var DoliDB $db
@ -37,6 +31,10 @@ require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
* @var Translate $langs
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
$langs->loadLangs(array("admin", "bills", "margins", "stocks"));
@ -72,29 +70,28 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
}
}
if ($action == 'remises') {
if (dolibarr_set_const($db, 'MARGIN_METHODE_FOR_DISCOUNT', GETPOST('MARGIN_METHODE_FOR_DISCOUNT'), 'chaine', 0, '', $conf->entity) > 0) {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} else {
if ($action == 'update') {
$error = 0;
if (dolibarr_set_const($db, 'MARGIN_METHODE_FOR_DISCOUNT', GETPOST('MARGIN_METHODE_FOR_DISCOUNT'), 'chaine', 0, '', $conf->entity) <= 0) {
dol_print_error($db);
$error++;
}
if (dolibarr_set_const($db, 'MARGIN_TYPE', GETPOST('MARGIN_TYPE'), 'chaine', 0, '', $conf->entity) <= 0) {
dol_print_error($db);
$error++;
}
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', GETPOST('AGENT_CONTACT_TYPE'), 'chaine', 0, '', $conf->entity) <= 0) {
dol_print_error($db);
$error++;
}
if (!$error) {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
}
}
if ($action == 'typemarges') {
if (dolibarr_set_const($db, 'MARGIN_TYPE', GETPOST('MARGIN_TYPE'), 'chaine', 0, '', $conf->entity) > 0) {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} else {
dol_print_error($db);
}
}
if ($action == 'contact') {
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', GETPOST('AGENT_CONTACT_TYPE'), 'chaine', 0, '', $conf->entity) > 0) {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} else {
dol_print_error($db);
}
}
/*
* View
@ -113,53 +110,49 @@ $head = marges_admin_prepare_head();
print dol_get_fiche_head($head, 'parameters', $langs->trans("Margins"), -1, 'margin');
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width=300>'.$langs->trans("MemberMainOptions").'</td>';
print '<td colspan="2">'.$langs->trans("Value").'</td>'."\n";
print '<td class="left">'.$langs->trans("Description").'</td>'."\n";
print '<td colspan="3">'.$langs->trans("MemberMainOptions").'</td>';
print '</tr>';
// GLOBAL DISCOUNT MANAGEMENT
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print "<input type=\"hidden\" name=\"action\" value=\"typemarges\">";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MARGIN_TYPE").'</td>';
print '<td>';
print ' <input type="radio" name="MARGIN_TYPE" value="1" ';
print '<td class="minwidth150">';
print ' <input type="radio" name="MARGIN_TYPE" id="MARGIN_TYPE1" value="1" ';
if (getDolGlobalString('MARGIN_TYPE') == '1') {
print 'checked ';
}
print '/> ';
print $langs->trans('MargeType1');
print '<label for="MARGIN_TYPE1">'.$langs->trans('MargeType1').'</label>';
print '<br>';
print ' <input type="radio" name="MARGIN_TYPE" value="pmp" ';
print ' <input type="radio" name="MARGIN_TYPE" id="MARGIN_TYPE2" value="pmp" ';
if (getDolGlobalString('MARGIN_TYPE') == 'pmp') {
print 'checked ';
}
print '/> ';
print $langs->trans('MargeType2');
print '<label for="MARGIN_TYPE2">'.$langs->trans('MargeType2').'</label>';
print '<br>';
print ' <input type="radio" name="MARGIN_TYPE" value="costprice" ';
print ' <input type="radio" name="MARGIN_TYPE" id="MARGIN_TYPE3" value="costprice" ';
if (getDolGlobalString('MARGIN_TYPE') == 'costprice') {
print 'checked ';
}
print '/> ';
print $langs->trans('MargeType3');
print '<label for="MARGIN_TYPE3">'.$langs->trans('MargeType3').'</label>';
print '</td>';
print '<td>';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" class="button">';
print '</td>';
print '<td>'.$langs->trans('MarginTypeDesc');
print '<td class="minwidth200"><span class="small">'.$langs->trans('MarginTypeDesc').'</span>';
print '</td>';
print '</tr>';
print '</form>';
// DISPLAY MARGIN RATES
print '<tr class="oddeven">';
print '<td>'.$langs->trans("DisplayMarginRates").'</td>';
print '<td colspan="2">';
print '<td>';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('DISPLAY_MARGIN_RATES');
} else {
@ -170,13 +163,13 @@ if (!empty($conf->use_javascript_ajax)) {
}
}
print '</td>';
print '<td>'.$langs->trans('MarginRate').' = '.$langs->trans('Margin').' / '.$langs->trans('BuyingPrice').'</td>';
print '<td><span class="small">'.$langs->trans('MarginRate').' = '.$langs->trans('Margin').' / '.$langs->trans('BuyingPrice').'</span></td>';
print '</tr>';
// DISPLAY MARK RATES
print '<tr class="oddeven">';
print '<td>'.$langs->trans("DisplayMarkRates").'</td>';
print '<td colspan="2">';
print '<td>';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('DISPLAY_MARK_RATES');
} else {
@ -187,13 +180,13 @@ if (!empty($conf->use_javascript_ajax)) {
}
}
print '</td>';
print '<td>'.$langs->trans('MarkRate').' = '.$langs->trans('Margin').' / '.$langs->trans('SellingPrice').'</td>';
print '<td><span class="small">'.$langs->trans('MarkRate').' = '.$langs->trans('Margin').' / '.$langs->trans('SellingPrice').'</span></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ForceBuyingPriceIfNull").'</td>';
print '<td colspan="2">';
print '<td>';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('ForceBuyingPriceIfNull');
} else {
@ -204,7 +197,7 @@ if (!empty($conf->use_javascript_ajax)) {
}
}
print '</td>';
print '<td>'.$langs->trans('ForceBuyingPriceIfNullDetails').'</td>';
print '<td><span class="small">'.$langs->trans('ForceBuyingPriceIfNullDetails').'</span></td>';
print '</tr>';
// GLOBAL DISCOUNT MANAGEMENT
@ -215,25 +208,15 @@ $methods = array(
);
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="remises">';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MARGIN_METHODE_FOR_DISCOUNT").'</td>';
print '<td class="left">';
print Form::selectarray('MARGIN_METHODE_FOR_DISCOUNT', $methods, getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT'));
print '</td>';
print '<td>';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print '</td>';
print '<td>'.$langs->trans('MARGIN_METHODE_FOR_DISCOUNT_DETAILS').'</td>';
print '<td><span class="small">'.$langs->trans('MARGIN_METHODE_FOR_DISCOUNT_DETAILS').'</span></td>';
print '</tr>';
print '</form>';
// INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="contact">';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AgentContactType").'</td>';
print '<td class="left">';
@ -241,14 +224,15 @@ $formcompany = new FormCompany($db);
$facture = new Facture($db);
print $formcompany->selectTypeContact($facture, getDolGlobalString('AGENT_CONTACT_TYPE'), "AGENT_CONTACT_TYPE", "internal", "code", 1, "maxwidth250");
print '</td>';
print '<td>';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print '</td>';
print '<td>'.$langs->trans('AgentContactTypeDetails').'</td>';
print '<td><span class="small">'.$langs->trans('AgentContactTypeDetails').'</span></td>';
print '</tr>';
print '</form>';
print '</table>';
print '</div>';
print '<center><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" class="button"></center>';
print '</form>';
print dol_get_fiche_end();

View file

@ -27,15 +27,6 @@
*/
require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
@ -44,6 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
* @var Translate $langs
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
// Load translation files required by the page
$langs->loadLangs(array('projects', 'users', 'companies'));
@ -161,6 +160,7 @@ $search_array_options_task = $extrafields->getOptionalsFromPost($object->table_e
/*
* Actions
*/
$error = 0;
$parameters = array('id' => $id, 'taskid' => $taskid, 'projectid' => $projectid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
@ -460,24 +460,24 @@ $head = project_timesheet_prepare_head($mode, $usertoprocess);
print dol_get_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, $picto);
// Show description of content
print '<div class="hideonsmartphone opacitymedium">';
$s = '';
if ($mine || ($usertoprocess->id == $user->id)) {
print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
} else {
if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
} else {
print $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
}
}
}
if ($mine || ($usertoprocess->id == $user->id)) {
print $langs->trans("OnlyYourTaskAreVisible").'<br>';
$s .= $langs->trans("OnlyYourTaskAreVisible").'<br>';
} else {
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
$s .= $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
}
print '</div>';
print info_admin($s, 0, 0, 'info', 'nomargintop');
print dol_get_fiche_end();
@ -700,7 +700,6 @@ if ($conf->use_javascript_ajax && count($tasksarray) >= getDolGlobalInt('NBLINES
print '<td class="liste_total"></td>';
}
print '<td class="liste_total leftborder">';
//print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
print '</td>';
print '<td class="liste_total center'.($cssonholiday ? ' '.$cssonholiday : '').($cssweekend ? ' '.$cssweekend : '').'"><div class="totalDay0">&nbsp;</div></td>';
@ -764,14 +763,11 @@ if (count($tasksarray) > 0) {
print '<td class="leftborder"></td>';
print '<td class="right">';
$timeonothertasks = ($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]);
//if ($timeonothertasks)
//{
print '<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center width50" disabled="" id="timespent[-1][0]" name="task[-1][0]" value="';
if ($timeonothertasks) {
print convertSecondToTime($timeonothertasks, 'allhourmin');
}
print '"></span>';
//}
print '</td>';
print ' <td class="liste_total borderleft"></td>';
print ' <td class="liste_total"></td>';
@ -793,9 +789,9 @@ if (count($tasksarray) > 0) {
print '<td class="liste_total center'.($cssonholiday ? ' '.$cssonholiday : '').($cssweekend ? ' '.$cssweekend : '').'"><div class="totalDay0">&nbsp;</div></td>';
print '<td class="liste_total"></td>
<td class="liste_total"></td>
</tr>';
print '<td class="liste_total"></td>';
print '<td class="liste_total"></td>';
print '</tr>';
}
} else {
print '<tr><td colspan="14"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';

View file

@ -473,24 +473,24 @@ $head = project_timesheet_prepare_head($mode, $usertoprocess);
print dol_get_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, $picto);
// Show description of content
print '<div class="hideonsmartphone opacitymedium">';
$s = '';
if ($mine || ($usertoprocess->id == $user->id)) {
print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
} else {
if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
} else {
print $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
}
}
}
if ($mine || ($usertoprocess->id == $user->id)) {
print $langs->trans("OnlyYourTaskAreVisible").'<br>';
$s .= $langs->trans("OnlyYourTaskAreVisible").'<br>';
} else {
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
$s .= $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
}
print '</div>';
print info_admin($s, 0, 0, 'info', 'nomargintop');
print dol_get_fiche_end();

View file

@ -472,24 +472,24 @@ $head = project_timesheet_prepare_head($mode, $usertoprocess);
print dol_get_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, $picto);
// Show description of content
print '<div class="hideonsmartphone opacitymedium">';
$s = '';
if ($mine || ($usertoprocess->id == $user->id)) {
print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
} else {
if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
} else {
print $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
$s .= $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
}
}
}
if ($mine || ($usertoprocess->id == $user->id)) {
print $langs->trans("OnlyYourTaskAreVisible").'<br>';
$s .= $langs->trans("OnlyYourTaskAreVisible").'<br>';
} else {
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
$s .= $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
}
print '</div>';
print info_admin($s, 0, 0, 'info', 'nomargintop');
print dol_get_fiche_end();

View file

@ -27,12 +27,6 @@
*/
require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
@ -40,14 +34,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
* @var Translate $langs
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
// Load translation files required by the page
$langs->loadLangs(array('projects', 'companies'));
$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOSTINT('id'); // Id of task
$ref = GETPOST('ref', 'alpha'); // Ref of task
$withproject = GETPOSTINT('withproject');
$project_ref = GETPOST('project_ref', 'alpha');
@ -56,6 +56,7 @@ $projectstatic = new Project($db);
$hookmanager->initHooks(array('projecttaskcontact', 'globalcard'));
// Load task
if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
@ -184,11 +185,11 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-project project-task
if ($id > 0 || !empty($ref)) {
if ($object->fetch($id, $ref) > 0) {
$id = $object->id; // So when doing a search from ref, id is also set correctly.
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_TASK') && empty($object->comments)) {
$object->fetchComments();
}
$id = $object->id; // So when doing a search from ref, id is also set correctly.
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
$projectstatic->fetchComments();
}
@ -227,7 +228,7 @@ if ($id > 0 || !empty($ref)) {
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
@ -270,7 +271,7 @@ if ($id > 0 || !empty($ref)) {
// Budget
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
}
print '</td></tr>';

View file

@ -29,13 +29,6 @@
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
@ -43,6 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
* @var Translate $langs
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
$langs->loadLangs(array('projects', 'other'));
@ -90,6 +89,7 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
$permissiontoadd = $user->hasRight('projet', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
/*
* Actions
*/

View file

@ -23,11 +23,8 @@
* \brief Page to show information on a task
*/
require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
// Load Dolibarr environment
require '../../main.inc.php';
/**
* @var Conf $conf
* @var DoliDB $db
@ -35,9 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
* @var Translate $langs
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
// Load translation files required by the page
$langs->load('projects');
$langs->loadLangs(array('projects'));
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
@ -88,7 +88,8 @@ if (!empty($project_ref) && !empty($withproject)) {
$id = $tasksarray[0]->id;
$object->fetch($id);
} else {
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode));
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
exit;
}
}
}
@ -134,6 +135,8 @@ $help_url = '';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-project project-tasks page-task_note');
if ($object->id > 0) {
$projectstatic->fetch_thirdparty();
$userWrite = $projectstatic->restrictedProjectArea($user, 'write');
if (!empty($withproject)) {
@ -245,7 +248,7 @@ if ($object->id > 0) {
print '<div class="fichehalfright">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">';
print '<table class="border tableforfield centpercent">';
// Categories
if (isModEnabled('category')) {
@ -285,9 +288,9 @@ if ($object->id > 0) {
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = " fk_projet:IN:".$db->sanitize($projectsListId);
$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
} else {
$object->next_prev_filter = " fk_projet:=:".((int) $projectstatic->id);
$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
}
$morehtmlref = '';
@ -301,7 +304,9 @@ if ($object->id > 0) {
// Third party
$morehtmlref .= $langs->trans("ThirdParty").': ';
$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
if (is_object($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0) {
$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
}
$morehtmlref .= '</div>';
}

View file

@ -95,6 +95,7 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
/*
* Actions
*/
$error = 0;
if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('projet', 'creer')) {
@ -320,7 +321,6 @@ if ($id > 0 || !empty($ref)) {
$object->fetchComments();
}
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
$projectstatic->fetchComments();
}
@ -474,9 +474,6 @@ if ($id > 0 || !empty($ref)) {
print '<br>';
}
/*
* Actions
*/
// To verify role of users
//$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
@ -494,6 +491,16 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
$param = (GETPOST('withproject') ? '&withproject=1' : '');
$linkback = GETPOST('withproject') ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
} else {
$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
}
print '<table class="border centpercent">';
// Ref

View file

@ -61,7 +61,7 @@ if (isModEnabled('eventorganization')) {
$langs->loadLangs($langsLoad);
$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
@ -72,9 +72,9 @@ $optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'alpha');
$id = GETPOSTINT('id'); // Id of task
$ref = GETPOST('ref', 'alpha'); // Ref of task
$projectid = GETPOSTINT('projectid'); // Id of project
$lineid = GETPOSTINT('lineid'); // Id of time spent line
$ref = GETPOST('ref', 'alpha');
$withproject = GETPOSTINT('withproject');
$project_ref = GETPOST('project_ref', 'alpha');
$tab = GETPOST('tab', 'aZ09');
@ -140,6 +140,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load task
if ($id > 0 || $ref) {
$object->fetch($id, $ref);
$id = $object->id; // So when doing a search from ref, id is also set correctly.
}
@ -1162,7 +1163,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$head = task_prepare_head($object);
print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
$param = (GETPOST('withproject') ? '&withproject=1' : '');
$linkback = GETPOST('withproject') ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
if ($action == 'deleteline') {
$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . $param;
@ -1202,7 +1204,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '<table class="border centpercent tableforfield">';
// Task parent
print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
print '<tr><td>' . $langs->trans("ParentTask") . '</td><td>';
if ($object->fk_task_parent > 0) {
$tasktmp = new Task($db);
$tasktmp->fetch($object->fk_task_parent);
@ -1323,6 +1325,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.((int) $limit);
}
if ($id > 0) {
$param .= '&id='.((int) $id);
}
if ($search_month > 0) {
$param .= '&search_month=' . urlencode((string) ($search_month));
}
@ -1336,16 +1341,16 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$param .= '&search_task_ref=' . urlencode($search_task_ref);
}
if ($search_company != '') {
$param .= '&amp;$search_company=' . urlencode($search_company);
$param .= '&search_company=' . urlencode($search_company);
}
if ($search_company_alias != '') {
$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
$param .= '&search_company_alias=' . urlencode($search_company_alias);
}
if ($search_project_ref != '') {
$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
$param .= '&search_project_ref=' . urlencode($search_project_ref);
}
if ($search_project_label != '') {
$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
$param .= '&search_project_label=' . urlencode($search_project_label);
}
if ($search_task_label != '') {
$param .= '&search_task_label=' . urlencode($search_task_label);
@ -1354,7 +1359,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$param .= '&search_note=' . urlencode($search_note);
}
if ($search_duration != '') {
$param .= '&amp;search_field2=' . urlencode((string) ($search_duration));
$param .= '&search_field2=' . urlencode((string) ($search_duration));
}
if ($optioncss != '') {
$param .= '&optioncss=' . urlencode($optioncss);
@ -1389,7 +1394,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if ($search_timespent_endmin) {
$param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin));
}
/*
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@ -2043,7 +2047,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['t.element_date']['checked'])) {
@ -2113,7 +2117,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
$totalarray['nbfield']++;
}
print "</tr>\n";

View file

@ -1190,6 +1190,12 @@ td.wordbreak img, td.wordbreakimp img {
.nopaddingbottomimp {
padding-bottom: 0 !important;
}
.padding2 {
padding: 2px;
}
.padding3 {
padding: 3px;
}
.paddingleft {
padding-<?php print $left; ?>: 4px;
}
@ -1278,7 +1284,7 @@ td.wordbreak img, td.wordbreakimp img {
.borderimp {
border: 1px solid #888 !important;
}
.text-warning{
.text-warning {
color : <?php print $textWarning; ?>
}
/* CSS used for long description and extrafield text */
@ -7967,8 +7973,8 @@ div.kanban.column div.ui-sortable-helper {
/* ============================================================================== */
.searchpage .tagtr .tagtd {
padding-top: 2px;
padding-bottom: 2px;
padding-top: 5px;
padding-bottom: 5px;
}
.searchpage .tagtr .tagtd .button {
background: unset;

View file

@ -1352,6 +1352,12 @@ td.wordbreak img, td.wordbreakimp img {
.nopaddingbottomimp {
padding-bottom: 0 !important;
}
.padding2 {
padding: 2px;
}
.padding3 {
padding: 3px;
}
.paddingleft {
padding-<?php print $left; ?>: 4px;
}

View file

@ -309,8 +309,8 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type, $stopcode = 1)
}
}
// Prevent the use of method TRACE
if ($_SERVER["REQUEST_METHOD"] == "TRACE") {
// Prevent the use of method TRACE in case of the web server authorizes it (some do it by default). TRACE method can be used by attacker to steal cookies or other sensitive information.
if (!empty($_SERVER["REQUEST_METHOD"]) && $_SERVER["REQUEST_METHOD"] == "TRACE") {
print 'Access refused with request method TRACE';
http_response_code(405);
exit();