Merge branch 'develop' into patch-11

This commit is contained in:
Frédéric FRANCE 2024-03-15 09:04:30 +01:00 committed by GitHub
commit 983e7b693c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 207 additions and 85 deletions

View file

@ -79,6 +79,7 @@
$object->periode = $dateperiod;
$return .= '<br><span class="opacitymedium">'.$langs->trans("Payement").'</span> : <span class="info-box-label">'.$this->type_payment.'</span>';
$sortfield = "datea";
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
$sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->escape($obj->datee)."'" : "null");
$sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)";
@ -325,6 +326,7 @@ $usercanread = (($user->hasRight('stock', 'mouvement', 'lire')));
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere.
- New: Add proposals into referer page of thirdparty.
NEW: ModuleBuilder: Checkin comments begin and end before each actions
for /F "tokens=2 delims=," %%i in ('tasklist /FI "IMAGENAME eq php.exe" /FO CSV /NH') do (
foreach ($TWeek as $week_number) {
function checkES($IentOfi, $InumCta)

View file

@ -9,8 +9,9 @@
*/
return [
// # Issue statistics:
// PhanPluginSuspiciousParamPosition : 45+ occurrences
// PhanPluginDuplicateIfStatements : 30+ occurrences
// PhanParamSignatureMismatch : 25+ occurrences
// PhanPluginSuspiciousParamPosition : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences
// PhanTypeArraySuspiciousNull : 10+ occurrences
@ -33,34 +34,21 @@ return [
'htdocs/adherents/stats/geo.php' => ['PhanTypeArraySuspiciousNull'],
'htdocs/adherents/type.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/admin/receiptprinter.php' => ['PhanRedefineFunctionInternal'],
'htdocs/admin/translation.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected'],
'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/collab/index.php' => ['PhanParamTooMany'],
'htdocs/comm/action/index.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/comm/action/index.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/comm/mailing/cibles.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/comm/mailing/info.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/accounting-files.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/compta/bank/various_payment/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanParamTooMany'],
'htdocs/compta/prelevement/create.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/compta/sociales/document.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/sociales/info.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/sociales/note.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/compta/tva/document.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/core/actions_massactions.inc.php' => ['PhanPluginSuspiciousParamOrder'],
'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'],
'htdocs/core/class/commonobject.class.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/core/class/evalmath.class.php' => ['PhanPluginUnsafeEval'],
'htdocs/core/class/html.form.class.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/core/class/html.formmail.class.php' => ['PhanNoopArray'],
@ -68,7 +56,6 @@ return [
'htdocs/core/db/mysqli.class.php' => ['PhanParamSignatureMismatch'],
'htdocs/core/db/pgsql.class.php' => ['PhanParamSignatureMismatch'],
'htdocs/core/db/sqlite3.class.php' => ['PhanParamSignatureMismatch'],
'htdocs/core/filemanagerdol/connectors/php/connector.lib.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/core/get_info.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginAlwaysReturnFunction', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'],
@ -78,7 +65,6 @@ return [
'htdocs/core/menus/standard/eldy_menu.php' => ['PhanParamSuspiciousOrder'],
'htdocs/core/menus/standard/empty.php' => ['PhanParamSuspiciousOrder'],
'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanParamSignatureMismatch'],
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/core/modules/member/doc/pdf_standard.class.php' => ['PhanParamSignatureMismatch'],
'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'],
@ -87,18 +73,10 @@ return [
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginSuspiciousParamOrder'],
'htdocs/fourn/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'],
'htdocs/loan/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/loan/document.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/loan/info.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/loan/note.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/loan/payment/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/loan/schedule.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/mrp/class/mo.class.php' => ['PhanParamSignatureMismatch'],
'htdocs/product/admin/product_tools.php' => ['PhanNoopStringLiteral'],
'htdocs/product/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/projet/tasks/list.php' => ['PhanTypeArraySuspiciousNull'],
'htdocs/public/bookcal/index.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
'htdocs/public/opensurvey/index.php' => ['PhanPluginSuspiciousParamOrder'],

View file

@ -530,7 +530,7 @@ return [
// 'PhanNoopBinaryOperator',
// 'PhanTypeInvalidBitwiseBinaryOperator',
// 'PhanPluginDescriptionlessCommentOnFunction',
'PhanPluginPHPDocInWrongComment',
// 'PhanPluginPHPDocInWrongComment',
'PhanRedefineClassInternal',
// 'PhanTypeInvalidThrowsIsInterface',
// 'PhanPluginRedundantAssignmentInLoop',

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2007-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -301,7 +302,9 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) {
}
//var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey);
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
if ($result < 0) {
print 'Failed to load language file '.$tmpfile.'<br>'."\n";
@ -313,6 +316,7 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) {
}
//print 'After loading lang '.$langkey.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$result = $langsenfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
}
$i++;

View file

@ -302,8 +302,8 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) {
'src' => getDolUserString($source),
'name' => dol_string_nohtmltag(getDolUserString($name)),
'offsettz' => (int) (empty($user->conf->$offsettz) ? 0 : $user->conf->$offsettz),
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
'color' => dol_string_nohtmltag(getDolUserString($color)),
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
'default' => dol_string_nohtmltag(getDolUserString($default)),
'buggedfile' => dol_string_nohtmltag(isset($user->conf->buggedfile) ? $user->conf->buggedfile : '')
);

View file

@ -1023,20 +1023,20 @@ if ($action == 'create') {
$morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string', '', null, null, '', 1);
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
$nbtry = $nbok = 0;
if ($object->status == 2 || $object->status == 3) {
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
$morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) {
$morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
$morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error");
}
$morehtmlright .= ') &nbsp; ';
$morehtmlstatus .= ') &nbsp; ';
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
@ -1345,20 +1345,20 @@ if ($action == 'create') {
$morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string', '', null, null, '', 1);
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
$nbtry = $nbok = 0;
if ($object->status == 2 || $object->status == 3) {
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
$morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) {
$morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
$morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error");
}
$morehtmlright .= ') &nbsp; ';
$morehtmlstatus .= ') &nbsp; ';
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';

View file

@ -3,6 +3,7 @@
* Copyright (C) 2005-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -278,21 +279,21 @@ if ($object->fetch($id) >= 0) {
$morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, 0, 'string', '', null, null, '', 1);
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
$nbtry = $nbok = 0;
if ($object->status == $object::STATUS_SENTPARTIALY || $object->status == $object::STATUS_SENTCOMPLETELY) {
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$nbok = ($nbtry - $nbko);
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
$morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) {
$morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
$morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error");
}
$morehtmlright .= ') &nbsp; ';
$morehtmlstatus .= ') &nbsp; ';
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
@ -364,6 +365,7 @@ if ($object->fetch($id) >= 0) {
$nbemail .= ' '.img_warning($langs->trans('ToAddRecipientsChooseHere'));//.' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
}
if ($text) {
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
print $form->textwithpicto($nbemail, $text, 1, 'warning');
} else {
print $nbemail;

View file

@ -64,20 +64,20 @@ if ($object->fetch($id) >= 0) {
$morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, 0, 'string', '', null, null, '', 1);
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
$nbtry = $nbok = 0;
if ($object->status == 2 || $object->status == 3) {
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
$morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) {
$morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
$morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error");
}
$morehtmlright .= ') &nbsp; ';
$morehtmlstatus .= ') &nbsp; ';
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="underbanner clearboth"></div><br>';

View file

@ -614,9 +614,9 @@ if ($id) {
$morehtmlref .= '</div>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -128,7 +129,8 @@ if ($object->id) {
$morehtmlref .= '</div>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
$morehtmlstatus = $morehtmlright;
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -88,7 +89,8 @@ if (isModEnabled('project')) {
$morehtmlref .= '</div>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
$morehtmlstatus = $morehtmlright;
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -175,9 +175,9 @@ if ($object->id > 0) {
}
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
@ -211,19 +211,19 @@ if ($object->id > 0) {
//$out.="</a>";
}
$morehtmlright = '';
$morehtmlstatus = '';
//$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
//$morehtmlstatus .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
//$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
//$morehtmlstatus .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
if (isModEnabled('agenda')) {
/*
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
$morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
} else {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
$morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
}
*/
}
@ -245,8 +245,8 @@ if ($object->id > 0) {
$cachekey = 'count_events_facture_'.$object->id;
$nbEvent = dol_getcache($cachekey);
print_barre_liste($langs->trans("ActionsOnBillRec").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
//print_barre_liste($langs->trans("ActionsOnBill"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
print_barre_liste($langs->trans("ActionsOnBillRec").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlstatus, '', 0, 1, 1);
//print_barre_liste($langs->trans("ActionsOnBill"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlstatus, '', 0, 1, 1);
// List of all actions
$filters = array();

View file

@ -1282,9 +1282,9 @@ if ($action == 'create') {
}
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';

View file

@ -6,6 +6,7 @@
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Markus Welters <markus@welters.de>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -241,6 +242,7 @@ if ($type == 'bank-transfer') {
llxHeader('', $title);
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$head = bon_prelevement_prepare_head($bprev, $bprev->nbOfInvoiceToPay($type), $bprev->nbOfInvoiceToPay($type, 'salary'));
if ($type) {
print dol_get_fiche_head($head, (!GETPOSTISSET('sourcetype') ? 'invoice' : 'salary'), $langs->trans("Invoices"), -1, $bprev->picto);

View file

@ -142,9 +142,9 @@ if ($object->id) {
$object->totalpaid = $alreadypayed; // To give a chance to dol_banner_tab to use already paid amount to show correct status
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -111,8 +111,8 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?restore_lastsear
$object->totalpaid = $alreadypayed; // To give a chance to dol_banner_tab to use already paid amount to show correct status
$morehtmlright = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
$morehtmlstatus = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -116,9 +116,9 @@ if ($id > 0 || !empty($ref)) {
//$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';

View file

@ -126,8 +126,8 @@ if ($object->id) {
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/tva/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlright = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
$morehtmlstatus = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -604,7 +604,7 @@ class Contact extends CommonObject
$this->fax = trim($this->fax);
$this->zip = (empty($this->zip) ? '' : trim($this->zip));
$this->town = (empty($this->town) ? '' : trim($this->town));
$this->country_id = ($this->country_id > 0 ? 0 : $this->country_id);
$this->country_id = (empty($this->country_id) || $this->country_id < 0) ? 0 : $this->country_id;
if (empty($this->statut)) {
$this->statut = 0;
}

View file

@ -9785,6 +9785,7 @@ abstract class CommonObject
foreach ($fieldvalues as $k => $v) {
$keys[$k] = $k;
$value = $this->fields[$k];
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null
}
@ -10087,7 +10088,9 @@ abstract class CommonObject
foreach ($fieldvalues as $k => $v) {
$keys[$k] = $k;
$value = $this->fields[$k];
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$values[$k] = $this->quote($v, $value);
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$tmp[] = $k.'='.$this->quote($v, $this->fields[$k]);
}

View file

@ -22,6 +22,8 @@
* \brief File of class to parse RSS feeds
*/
// @phan-file-suppress PhanPluginPHPDocInWrongComment
/**
* Class to parse RSS files
*/
@ -805,7 +807,6 @@ class RssParser
}
}
// @phan-suppress PhanPluginPHPDocInWrongComment
/*
* A method for the xml_set_external_entity_ref_handler()
*

View file

@ -551,8 +551,8 @@ function GetParentFolder($folderPath)
/**
* CreateServerFolder
*
* @param string $folderPath Folder
* @param string $lastFolder Folder
* @param string $folderPath Folder - Folder to create (recursively)
* @param ?string $lastFolder Internal - Child Folder we are creating, prevents recursion
* @return string ''=success, error message otherwise
*/
function CreateServerFolder($folderPath, $lastFolder = null)
@ -585,6 +585,7 @@ function CreateServerFolder($folderPath, $lastFolder = null)
return "Can't create $folderPath directory";
}
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$sErrorMsg = CreateServerFolder($sParent, $folderPath);
if ($sErrorMsg != '') {
return $sErrorMsg;

View file

@ -960,6 +960,104 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
dol_print_error($db);
}
//projects linked to that thirdpart because of a people of that company is linked to a project
if (getDolGlobalString('PROJECT_DISPLAY_LINKED_BY_CONTACT')) {
print "\n";
print load_fiche_titre($langs->trans("ProjectsLinkedToThisThirdParty"), '', '');
print '<div class="div-table-responsive">'."\n";
print '<table class="noborder centpercent">';
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
$sql .= ", cls.code as opp_status_code";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec on p.rowid = ec.element_id";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sc on ec.fk_socpeople = sc.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
$sql .= " WHERE sc.fk_soc = ".((int) $object->id);
$sql .= " AND p.entity IN (".getEntity('project').")";
$sql .= " AND tc.element = 'project'";
$sql .= " ORDER BY p.dateo DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("Name").'</td>';
print '<td class="center">'.$langs->trans("DateStart").'</td>';
print '<td class="center">'.$langs->trans("DateEnd").'</td>';
print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>';
print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>';
print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>';
print '<td class="right">'.$langs->trans("Status").'</td>';
print '</tr>';
if ($num > 0) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$projecttmp = new Project($db);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($result);
$projecttmp->fetch($obj->id);
// To verify role of users
$userAccess = $projecttmp->restrictedProjectArea($user);
if ($user->rights->projet->lire && $userAccess > 0) {
print '<tr class="oddeven">';
// Ref
print '<td class="nowraponall">';
print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__');
print '</td>';
// Label
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>';
// Date start
print '<td class="center">'.dol_print_date($db->jdate($obj->do), "day").'</td>';
// Date end
print '<td class="center">'.dol_print_date($db->jdate($obj->de), "day").'</td>';
// Opp amount
print '<td class="right">';
if ($obj->opp_status_code) {
print '<span class="amount">'.price($obj->opp_amount, 1, '', 1, -1, -1, '').'</span>';
}
print '</td>';
// Opp status
print '<td class="center">';
if ($obj->opp_status_code) {
print $langs->trans("OppStatus".$obj->opp_status_code);
}
print '</td>';
// Opp percent
print '<td class="right">';
if ($obj->opp_percent) {
print price($obj->opp_percent, 1, '', 1, 0).'%';
}
print '</td>';
// Status
print '<td class="right">'.$projecttmp->getLibStatut(5).'</td>';
print '</tr>';
}
$i++;
}
} else {
print '<tr class="oddeven"><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
$db->free($result);
} else {
dol_print_error($db);
}
}
$parameters = array('sql' => $sql, 'function' => 'show_projects');
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View file

@ -3,6 +3,7 @@
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -519,6 +520,7 @@ class ImportXlsx extends ModeleImports
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
} elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) {
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element']));
} else {
$this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile';

View file

@ -1184,9 +1184,9 @@ if ($action == 'create') {
}
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';

View file

@ -88,6 +88,8 @@ SearchString=Search string
NotAvailableWhenAjaxDisabled=Not available when Ajax disabled
AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party
TimesheetPreventAfterFollowingMonths=Prevent recording time spent after the following number of months
PROJECT_DISPLAY_LINKED_BY_CONTACT=Display project linked by a common contact
PROJECT_DISPLAY_LINKED_BY_CONTACT_help=That option add a new list on Project tab with all projects linked to that thirdparty via a contact relationship
JavascriptDisabled=JavaScript disabled
UsePreviewTabs=Use preview tabs
ShowPreview=Show preview

View file

@ -142,6 +142,7 @@ DoNotShowMyTasksOnly=See also tasks not assigned to me
ShowMyTasksOnly=View only tasks assigned to me
TaskRessourceLinks=Contacts of task
ProjectsDedicatedToThisThirdParty=Projects dedicated to this third party
ProjectsLinkedToThisThirdParty=Projects having a contact that is a contact of the third party
NoTasks=No tasks for this project
LinkedToAnotherCompany=Linked to other third party
TaskIsNotAssignedToUser=Task not assigned to user. Use button '<strong>%s</strong>' to assign task now.

View file

@ -88,6 +88,8 @@ SearchString=Chaîne de recherche
NotAvailableWhenAjaxDisabled=Non disponible quand Ajax est désactivé
AllowToSelectProjectFromOtherCompany=Sur les éléments d'un tiers, autorise la sélection d'un projet lié à un autre tiers
TimesheetPreventAfterFollowingMonths=Empêcher l'enregistrement du temps consacré après le nombre de mois suivant
PROJECT_DISPLAY_LINKED_BY_CONTACT=Afficher les projets liés par un contact
PROJECT_DISPLAY_LINKED_BY_CONTACT_help=Cette option permet d'ajouter la liste de tous les projets dans lesquels un des contact du tiers est rattaché
JavascriptDisabled=Javascript désactivé
UsePreviewTabs=Afficher les onglets "Aperçu"
ShowPreview=Afficher aperçu

View file

@ -142,6 +142,7 @@ DoNotShowMyTasksOnly=Voir aussi les tâches qui ne me sont pas affectées
ShowMyTasksOnly=Ne voir que les tâches qui me sont affectées
TaskRessourceLinks=Contacts de la tâche
ProjectsDedicatedToThisThirdParty=Projets dédiés à ce tiers
ProjectsLinkedToThisThirdParty=Projets liés à ce tiers par un contact commun
NoTasks=Aucune tâche pour ce projet
LinkedToAnotherCompany=Liés à autre société
TaskIsNotAssignedToUser=Tâche non assignée à l'utilisateur. Utilisez le bouton '<strong>%s</strong>' pour assigner la tâche maintenant.

View file

@ -258,7 +258,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formproject = new FormProjets($db);
$morehtmlright = '';
$morehtmlstatus = '';
$outputlangs = $langs;
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
@ -474,7 +474,7 @@ if ($id > 0) {
$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, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2014-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -140,7 +141,8 @@ if ($object->id) {
$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);
$morehtmlstatus = $morehtmlright;
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2014-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -102,7 +103,8 @@ $morehtmlref .= '</div>';
$linkback = '<a href="'.DOL_URL_ROOT.'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
$morehtmlstatus = $morehtmlright;
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -6,6 +6,7 @@
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2016-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -129,7 +130,8 @@ if ($id > 0) {
$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);
$morehtmlstatus = $morehtmlright;
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -103,9 +103,9 @@ if ($action == 'delete') {
$linkback = '';
$morehtmlref = '';
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($payment, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($payment, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View file

@ -185,9 +185,9 @@ if (isModEnabled('project')) {
}
$morehtmlref .= '</div>';
$morehtmlright = '';
$morehtmlstatus = '';
dol_banner_tab($object, 'loanid', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
dol_banner_tab($object, 'loanid', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
?>
<script type="text/javascript">

View file

@ -974,6 +974,7 @@ if (empty($reshook)) {
} else {
if (count($clone->errors)) {
setEventMessages($clone->error, $clone->errors, 'errors');
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
dol_print_error($db, $clone->errors);
} else {
setEventMessages($langs->trans($clone->error), null, 'errors');

View file

@ -841,6 +841,18 @@ print '<input type="number" class="width50" id="timesheetFreezeDuration" name="t
print '<input type="submit" class="button small reposition" name="PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr>';
$key = 'PROJECT_DISPLAY_LINKED_BY_CONTACT';
echo '<tr class="oddeven">',
'<td class="left">',
$form->textwithpicto($langs->transnoentities($key), $langs->transnoentities($key . '_help')),
'</td>',
'<td class="right" colspan="2">',
ajax_constantonoff($key),
'</td>',
'</tr>';
print '</table>';
print '</div>';