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

This commit is contained in:
Laurent Destailleur 2024-04-30 08:36:01 +02:00
commit e3f1f9d35f
23 changed files with 461 additions and 196 deletions

View file

@ -36,6 +36,7 @@ global $langs, $user;
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php';
//require_once "../class/myclass.class.php";
// Translations
@ -68,9 +69,15 @@ $setupnotempty = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
$moduledir = 'hrm';
$myTmpObjects = array();
// TODO Scan list of objects to fill this array
$myTmpObjects['evaluation'] = array('label' => 'Evaluation', 'includerefgeneration' => 1, 'includedocgeneration' => 0, 'class' => 'Evaluation');
$myTmpObjects = [
'evaluation' => [
'label' => 'Evaluation',
'includerefgeneration' => 1,
'includedocgeneration' => 1,
'class' => 'Evaluation'
],
];
$tmpobjectkey = GETPOST('object', 'aZ09');
if ($tmpobjectkey && !array_key_exists($tmpobjectkey, $myTmpObjects)) {
@ -130,7 +137,7 @@ if ($action == 'update') {
$classname = '';
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/hrm/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
$file = dol_buildpath($reldir."core/modules/hrm/doc/pdf_".$modele.".modules.php", 0);
if (file_exists($file)) {
$classname = "pdf_".$modele;
break;
@ -144,7 +151,7 @@ if ($action == 'update') {
'@phan-var-force CommonDocGenerator $module';
if ($module->write_file($tmpobject, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=hrm&file=evaluation/SPECIMEN.pdf");
return;
} else {
setEventMessages($module->error, null, 'errors');
@ -361,8 +368,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
dol_print_error($db);
}
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
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">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
@ -477,6 +485,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
}
print '</table>';
print '</div>';
}
}

View file

@ -8,8 +8,8 @@
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -819,84 +819,6 @@ if ($resql) {
print '<input type="hidden" name="bid" value="'.GETPOSTINT("bid").'">';
}
// Form to reconcile
if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') {
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
if (getDolGlobalInt('NW_RECEIPTNUMBERFORMAT')) {
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
print '<input class="flat width175" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve') ? GETPOST('num_releve') : '').'">';
} else {
$texttoshow = $langs->trans("InputReceiptNumber").': ';
$yyyy = dol_substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1);
$mm = dol_substr($langs->transnoentitiesnoconv("Month"), 0, 1).substr($langs->transnoentitiesnoconv("Month"), 0, 1);
$dd = dol_substr($langs->transnoentitiesnoconv("Day"), 0, 1).substr($langs->transnoentitiesnoconv("Day"), 0, 1);
$placeholder = $yyyy.$mm;
$placeholder .= ' '.$langs->trans("or").' ';
$placeholder .= $yyyy.$mm.$dd;
if (!$placeholder) {
$texttoshow .= $langs->trans("InputReceiptNumberBis");
}
print $texttoshow;
print '<input class="flat width175" pattern="[0-9]+" title="'.dol_escape_htmltag($texttoshow.($placeholder ? ': '.$placeholder : '')).'" id="num_releve" name="num_releve" placeholder="'.dol_escape_htmltag($placeholder).'" type="text" value="'.(GETPOSTINT('num_releve') ? GETPOSTINT('num_releve') : '').'">'; // The only default value is value we just entered
}
print '</div>';
if (is_array($options) && count($options)) {
print $langs->trans("EventualyAddCategory").': ';
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
}
print '<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans("ThenCheckLinesAndConciliate").'</span> ';
print '<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans("SaveStatementOnly").'">';
print ' '.$langs->trans("or").' ';
print '<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
print ' '.$langs->trans("or").' ';
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
// Show last bank statements
$nbmax = 12; // We show last 12 receipts (so we can have more than one year)
$liste = "";
$sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
$sql .= " WHERE fk_account = ".((int) $object->id)." AND num_releve IS NOT NULL";
$sql .= $db->order("num_releve", "DESC");
$sql .= $db->plimit($nbmax + 1);
print '<br>';
print $langs->trans("LastAccountStatements").' : ';
$resqlr = $db->query($sql);
if ($resqlr) {
$numr = $db->num_rows($resqlr);
$i = 0;
$last_ok = 0;
while (($i < $numr) && ($i < $nbmax)) {
$objr = $db->fetch_object($resqlr);
if (!$last_ok) {
$last_releve = $objr->num_releve;
$last_ok = 1;
}
$i++;
$liste = '<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$id.'&amp;num='.$objr->num_releve.'">'.$objr->num_releve.'</a> &nbsp; '.$liste;
}
if ($numr >= $nbmax) {
$liste = "... &nbsp; ".$liste;
}
print $liste;
if ($numr <= 0) {
print '<b>'.$langs->trans("None").'</b>';
}
} else {
dol_print_error($db);
}
// Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
if (getDolGlobalString('BANK_REPORT_LAST_NUM_RELEVE')) {
print '
<script type="text/javascript">
$("#num_releve").val("' . $last_releve.'");
</script>
';
}
print '<br><br>';
}
// Form to add a transaction with no invoice
if ($user->hasRight('banque', 'modifier') && $action == 'addline' && getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) {
print load_fiche_titre($langs->trans("AddBankRecordLong"), '', '');
@ -991,7 +913,7 @@ if ($resql) {
$bankcateg = new BankCateg($db);
$newcardbutton = '';
if ($action != 'addline' && $action != 'reconcile') {
if ($action != 'addline') {
if (!getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
if (!getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) { // Default is to record miscellaneous direct entries using miscellaneous payments
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.urlencode($search_account).'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier);
@ -1015,7 +937,7 @@ if ($resql) {
$morehtml .= $buttonreconcile;
}
$morehtml .= '<!-- Add New button -->'.$newcardbutton;
$morehtmlright = '<!-- Add New button -->'.$newcardbutton;
$picto = 'bank_account';
if ($id > 0 || !empty($ref)) {
@ -1023,7 +945,86 @@ if ($resql) {
}
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1);
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton.$morehtml, $num, $nbtotalofrecords, $picto, 0, $morehtmlright, '', $limit, 0, 0, 1);
// Form to reconcile
if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') {
print '<!-- form with reconciliation input -->'."\n";
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
if (getDolGlobalInt('NW_RECEIPTNUMBERFORMAT')) {
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
print '<input class="flat width175" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve') ? GETPOST('num_releve') : '').'">';
} else {
$texttoshow = $langs->trans("InputReceiptNumber").': ';
$yyyy = dol_substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1);
$mm = dol_substr($langs->transnoentitiesnoconv("Month"), 0, 1).substr($langs->transnoentitiesnoconv("Month"), 0, 1);
$dd = dol_substr($langs->transnoentitiesnoconv("Day"), 0, 1).substr($langs->transnoentitiesnoconv("Day"), 0, 1);
$placeholder = $yyyy.$mm;
$placeholder .= ' '.$langs->trans("or").' ';
$placeholder .= $yyyy.$mm.$dd;
if (!$placeholder) {
$texttoshow .= $langs->trans("InputReceiptNumberBis");
}
print $texttoshow;
print '<input class="flat width175" pattern="[0-9]+" title="'.dol_escape_htmltag($texttoshow.($placeholder ? ': '.$placeholder : '')).'" id="num_releve" name="num_releve" placeholder="'.dol_escape_htmltag($placeholder).'" type="text" value="'.(GETPOSTINT('num_releve') ? GETPOSTINT('num_releve') : '').'">'; // The only default value is value we just entered
}
print '</div>';
if (is_array($options) && count($options)) {
print $langs->trans("EventualyAddCategory").': ';
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
}
print '<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans("ThenCheckLinesAndConciliate").'</span> ';
print '<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans("SaveStatementOnly").'">';
print ' '.$langs->trans("or").' ';
print '<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
print ' '.$langs->trans("or").' ';
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
// Show last bank statements
$nbmax = 12; // We show last 12 receipts (so we can have more than one year)
$liste = "";
$sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
$sql .= " WHERE fk_account = ".((int) $object->id)." AND num_releve IS NOT NULL";
$sql .= $db->order("num_releve", "DESC");
$sql .= $db->plimit($nbmax + 1);
print '<br>';
print $langs->trans("LastAccountStatements").' : ';
$resqlr = $db->query($sql);
if ($resqlr) {
$numr = $db->num_rows($resqlr);
$i = 0;
$last_ok = 0;
while (($i < $numr) && ($i < $nbmax)) {
$objr = $db->fetch_object($resqlr);
if (!$last_ok) {
$last_releve = $objr->num_releve;
$last_ok = 1;
}
$i++;
$liste = '<a target="_blank" href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.((int) $id).'&num='.urlencode($objr->num_releve).'">'.dol_escape_htmltag($objr->num_releve).'</a> &nbsp; '.$liste;
}
if ($numr >= $nbmax) {
$liste = "... &nbsp; ".$liste;
}
print $liste;
if ($numr <= 0) {
print '<b>'.$langs->trans("None").'</b>';
}
} else {
dol_print_error($db);
}
// Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
if (getDolGlobalString('BANK_REPORT_LAST_NUM_RELEVE')) {
print '
<script type="text/javascript">
$("#num_releve").val("' . $last_releve.'");
</script>
';
}
print '<br><br>';
}
// We can add page now to param
if ($page != '') {
@ -1031,7 +1032,6 @@ if ($resql) {
}
$moreforfilter = '';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('DateOperationShort');
$moreforfilter .= ($conf->browser->layout == 'phone' ? '<br>' : ' ');
@ -1086,6 +1086,8 @@ if ($resql) {
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
$selectedfields .= ($action == 'reconcile' ? $form->showCheckAddButtons('checkforselect', 1) : '');
// When action is 'reconcile', we force to have the column num_releve always enabled (otherwise we can't make reconciliation).
if ($action == 'reconcile') {
$arrayfields['b.num_releve']['checked'] = 1;
@ -1401,14 +1403,7 @@ if ($resql) {
print '</td>';
}
if (!empty($arrayfields['b.num_releve']['checked'])) {
print '<td class="center">';
print '<input type="checkbox" id="selectAll" title="'.dol_escape_htmltag($langs->trans("SelectAll")).'" />';
print ' <script type="text/javascript">
$("input#selectAll").change(function() {
$("input[type=checkbox][name^=rowid]").prop("checked", $(this).is(":checked"));
});
</script>';
print '</td>';
print '<td></td>';
}
// conciliate
@ -1461,13 +1456,9 @@ if ($resql) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td>';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
print '<td class="center">';
if (!$objp->conciliated && $action == 'reconcile') {
print '<input class="flat checkforselect" name="rowid['.$objp->rowid.']" type="checkbox" name="toselect[]" value="'.$objp->rowid.'" size="1"'.(!empty($tmparray[$objp->rowid]) ? ' checked' : '').'>';
}
print '</td>';
if (!$i) {
@ -1799,13 +1790,6 @@ if ($resql) {
if ($objp->num_releve) {
print '<a href="releve.php?num='.urlencode($objp->num_releve).'&account='.urlencode($objp->bankid).'&save_lastsearch_values=1">'.dol_escape_htmltag($objp->num_releve).'</a>';
}
if (!$objp->conciliated && $action == 'reconcile') {
if ($objp->num_releve) {
print '&nbsp;';
}
$tmparray = GETPOST('rowid', 'array:int');
print '<input class="flat" name="rowid['.$objp->rowid.']" type="checkbox" value="'.$objp->rowid.'" size="1"'.(!empty($tmparray[$objp->rowid]) ? ' checked' : '').'>';
}
}
print '</td>';
if (!$i) {
@ -1873,13 +1857,9 @@ if ($resql) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td>';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($objp->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$objp->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$objp->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
print '<td class="center">';
if (!$objp->conciliated && $action == 'reconcile') {
print '<input class="flat checkforselect" name="rowid['.$objp->rowid.']" type="checkbox" value="'.$objp->rowid.'" size="1"'.(!empty($tmparray[$objp->rowid]) ? ' checked' : '').'>';
}
print '</td>';
if (!$i) {
@ -1911,7 +1891,7 @@ if ($resql) {
} elseif ($i == $posconciliatecol) {
print '<td class="center">';
if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') {
print '<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
print '<input class="button smallpaddingimp" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
}
print '</td>';
} else {

View file

@ -274,6 +274,7 @@ if (empty($numref)) {
$sql = "SELECT DISTINCT(b.num_releve) as numr";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql .= " WHERE b.fk_account = ".((int) $object->id);
$sql .= " AND b.num_releve IS NOT NULL";
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
@ -285,9 +286,9 @@ if (empty($numref)) {
$sql .= $db->plimit($conf->liste_limit + 1, $offset);
$result = $db->query($sql);
if ($result) {
$numrows = $db->num_rows($result);
$resql = $db->query($sql);
if ($resql) {
$numrows = $db->num_rows($resql);
$i = 0;
// Onglets
@ -360,7 +361,7 @@ if (empty($numref)) {
$content = array();
while ($i < min($numrows, $conf->liste_limit)) {
$objp = $db->fetch_object($result);
$objp = $db->fetch_object($resql);
if (!isset($objp->numr)) {
//
@ -414,6 +415,11 @@ if (empty($numref)) {
}
$i++;
}
if (empty($numrows)) {
print '<tr><td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print "</table>\n";
print '</form>';
@ -481,9 +487,9 @@ if (empty($numref)) {
// Recherche les ecritures pour le releve
$sql = $sqlrequestforbankline;
$result = $db->query($sql);
if ($result) {
$numrows = $db->num_rows($result);
$resql = $db->query($sql);
if ($resql) {
$numrows = $db->num_rows($resql);
$i = 0;
// Ligne Solde debut releve
@ -493,7 +499,7 @@ if (empty($numref)) {
print "</tr>\n";
while ($i < $numrows) {
$objp = $db->fetch_object($result);
$objp = $db->fetch_object($resql);
$total = $total + $objp->amount;
print '<tr class="oddeven">';
@ -696,7 +702,7 @@ if (empty($numref)) {
print "</tr>";
$i++;
}
$db->free($result);
$db->free($resql);
} else {
dol_print_error($db);
}

View file

@ -8587,6 +8587,7 @@ class Form
}
}
$out .= "</select>";
// Add code for jquery to use multiselect
if ($addjscombo && $jsbeautify) {
// Enhance with select2

View file

@ -3254,7 +3254,6 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($fuser->hasRight('banque', $lire) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
}
$original_file = $conf->bank->dir_output.'/checkdeposits/'.$original_file; // original_file should contains relative path so include the get_exdir result
} elseif (($modulepart == 'banque' || $modulepart == 'bank') && !empty($conf->bank->dir_output)) {
// Wrapping for bank

View file

@ -6235,7 +6235,7 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
print '<datalist id="limitlist">';
} else {
print '<li class="paginationxxx">';
print '<select class="flat selectlimit nopadding maxwidth75 center" id="limit" name="limit" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
print '<select id="limit" class="flat selectlimit nopadding maxwidth75 center" name="limit" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
}
$tmpchoice = explode(',', $pagesizechoices);
$tmpkey = $limit.':'.$limit;
@ -6263,7 +6263,8 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
print '</datalist>';
} else {
print '</select>';
print ajax_combobox("limit");
print ajax_combobox("limit", array(), 0, 0, 'resolve', -1, 'limit');
//print ajax_combobox("limit");
}
if ($conf->use_javascript_ajax) {

View file

@ -590,6 +590,7 @@ class pdf_standard extends ModelePDFEvaluation
$carac_emetteur .= ($carac_emetteur ? "\n" : '').$outputlangs->transnoentities('Employee').' : '.$outputlangs->convToOutputCharset(ucfirst($employee->firstname) . ' ' . strtoupper($employee->lastname));
// Position
include_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
$job = new Job($db);
$job->fetch($object->fk_job);
$carac_emetteur .= ($carac_emetteur ? "\n" : '').$outputlangs->transnoentities('JobProfile').' : '.$outputlangs->convToOutputCharset($job->label);

View file

@ -103,7 +103,7 @@ $original_file = GETPOST('file', 'alphanohtml');
$hashp = GETPOST('hashp', 'aZ09');
$modulepart = GETPOST('modulepart', 'alpha');
$urlsource = GETPOST('urlsource', 'alpha');
$entity = GETPOSTINT('entity') ?GETPOSTINT('entity') : $conf->entity;
$entity = GETPOSTINT('entity', $conf->entity);
// Security check
if (empty($modulepart) && empty($hashp)) {

View file

@ -8,7 +8,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2018 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
@ -27,7 +27,7 @@
*/
/**
* \file fichinter/card-rec.php
* \file htdocs/fichinter/card-rec.php
* \ingroup intervention
* \brief Page to show predefined fichinter
*/
@ -98,7 +98,7 @@ $extrafields = new ExtraFields($db);
$arrayfields = array(
'f.titre' => array('label' => "Ref", 'checked' => 1),
'f.title' => array('label' => "Ref", 'checked' => 1),
's.nom' => array('label' => "ThirdParty", 'checked' => 1),
'f.fk_contrat' => array('label' => "Contract", 'checked' => 1),
'f.duree' => array('label' => "Duration", 'checked' => 1),
@ -130,7 +130,7 @@ if ($cancel) {
// Create predefined intervention
if ($action == 'add') {
if (!GETPOST('titre')) {
if (!GETPOST('title')) {
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors');
$action = "create";
$error++;
@ -167,7 +167,7 @@ if ($action == 'add') {
if (!$error) {
$object->id_origin = $id;
$object->title = GETPOST('titre', 'alpha');
$object->title = GETPOST('title', 'alpha');
$object->description = GETPOST('description', 'restricthtml');
$object->socid = GETPOSTINT('socid');
$object->fk_project = GETPOSTINT('projectid');
@ -322,7 +322,7 @@ if ($action == 'create') {
// Title
print '<tr><td class="fieldrequired">'.$langs->trans("Title").'</td><td>';
print '<input class="flat quatrevingtpercent" type="text" name="titre" value="'.dol_escape_htmltag(GETPOST("titre", "alphanohtml")).'">';
print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", "alphanohtml")).'">';
print '</td>';
// Note
@ -777,9 +777,9 @@ if ($action == 'create') {
/*
* List mode
*/
$sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title,";
$sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.title,";
$sql .= " f.duree, f.fk_contrat, f.fk_projet as fk_project, f.frequency, f.nb_gen_done, f.nb_gen_max,";
$sql .= " f.date_last_gen, f.date_when, f.datec";
$sql .= " f.date_last_gen, f.date_when, f.datec, f.status";
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter_rec as f";
$sql .= " , ".MAIN_DB_PREFIX."societe as s ";
@ -796,7 +796,7 @@ if ($action == 'create') {
}
/*
if (!empty($search_ref)) {
$sql .= natural_search('f.titre', $search_ref);
$sql .= natural_search('f.title', $search_ref);
}
*/
if (!empty($search_societe)) {
@ -824,7 +824,7 @@ if ($action == 'create') {
$i = 0;
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.title", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
if (isModEnabled('contract')) {
print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');

View file

@ -290,11 +290,12 @@ class FichinterRec extends Fichinter
*/
public function fetch($rowid = 0, $ref = '', $ref_ext = '')
{
$sql = 'SELECT f.title as title, f.fk_soc';
$sql = 'SELECT f.title, f.fk_soc';
$sql .= ', f.datec, f.duree, f.fk_projet, f.fk_contrat, f.description';
$sql .= ', f.note_private, f.note_public, f.fk_user_author';
$sql .= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.auto_validate';
$sql .= ', f.note_private, f.note_public, f.fk_user_author';
$sql .= ', f.status';
$sql .= ' FROM '.MAIN_DB_PREFIX.'fichinter_rec as f';
if ($rowid > 0) {
$sql .= " WHERE f.rowid = ".((int) $rowid);
@ -311,28 +312,28 @@ class FichinterRec extends Fichinter
$this->id = $rowid;
$this->title = $obj->title;
$this->ref = $obj->title;
$this->ref = $obj->title;
$this->description = $obj->description;
$this->datec = $obj->datec;
$this->datec = $obj->datec;
$this->duration = $obj->duree;
$this->socid = $obj->fk_soc;
$this->status = 0;
$this->statut = 0; // deprecated
$this->fk_project = $obj->fk_projet;
$this->fk_contrat = $obj->fk_contrat;
$this->socid = $obj->fk_soc;
$this->status = $obj->status;
$this->statut = $obj->status; // deprecated
$this->fk_project = $obj->fk_projet;
$this->fk_contrat = $obj->fk_contrat;
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author;
$this->model_pdf = empty($obj->model_pdf) ? "" : $obj->model_pdf;
$this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author;
$this->model_pdf = empty($obj->model_pdf) ? "" : $obj->model_pdf;
$this->rang = !empty($obj->rang) ? $obj->rang : "";
$this->special_code = !empty($obj->special_code) ? $obj->special_code : "";
$this->frequency = $obj->frequency;
$this->frequency = $obj->frequency;
$this->unit_frequency = $obj->unit_frequency;
$this->date_when = $this->db->jdate($obj->date_when);
$this->date_last_gen = $this->db->jdate($obj->date_last_gen);
$this->date_when = $this->db->jdate($obj->date_when);
$this->date_last_gen = $this->db->jdate($obj->date_last_gen);
$this->nb_gen_done = $obj->nb_gen_done;
$this->nb_gen_max = $obj->nb_gen_max;
$this->auto_validate = $obj->auto_validate;
$this->auto_validate = $obj->auto_validate;
// Lines
$result = $this->fetch_lines();
@ -874,7 +875,7 @@ class FichinterRec extends Fichinter
$sql .= ' , date_last_gen = now()';
// si on et arrivé à la fin des génération
if ($this->nb_gen_max <= $this->nb_gen_done + 1) {
$sql .= ' , statut = 1';
$sql .= ' , status = 1';
}
$sql .= " WHERE rowid = ".((int) $this->id);

View file

@ -189,7 +189,8 @@ ALTER TABLE llx_product_customer_price_log ADD COLUMN price_label varchar(255) A
ALTER TABLE llx_product_customer_price ADD COLUMN price_label varchar(255) AFTER fk_user;
ALTER TABLE llx_product ADD COLUMN price_label varchar(255) AFTER price_base_type;
ALTER TABLE llx_fichinter_rec ADD COLUMN status smallint DEFAULT 0;
ALTER TABLE llx_fichinter_rec CHANGE COLUMN titre title varchar(50) NOT NULL;
CREATE TABLE llx_product_thirdparty
(
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
@ -230,6 +231,8 @@ ALTER TABLE llx_product DROP COLUMN onportal;
ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255);
ALTER TABLE llx_hrm_evaluation ADD COLUMN last_main_doc varchar(255);
ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext;
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields;
@ -313,4 +316,3 @@ DELETE FROM llx_c_action_trigger WHERE code = 'BILLREC_AUTOCREATEBILL';
-- element_element, see https://github.com/Dolibarr/dolibarr/pull/29329
ALTER TABLE element_element ADD COLUMN relationtype varchar(64) DEFAULT NULL AFTER targettype;

View file

@ -23,7 +23,7 @@
create table llx_fichinter_rec
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
titre varchar(50) NOT NULL,
title varchar(50) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer DEFAULT NULL,
datec datetime, -- date de creation
@ -43,6 +43,6 @@ create table llx_fichinter_rec
date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice)
nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented)
nb_gen_max integer DEFAULT NULL, -- maximum number of generation
auto_validate integer NULL DEFAULT NULL -- statut of the generated intervention
auto_validate integer NULL DEFAULT NULL, -- status of the generated intervention
status smallint DEFAULT 0 -- status of the model
)ENGINE=innodb;

View file

@ -18,22 +18,23 @@
CREATE TABLE llx_hrm_evaluation(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
label varchar(255),
description text,
note_public text,
note_private text,
model_pdf varchar(255),
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
label varchar(255),
description text,
note_public text,
note_private text,
model_pdf varchar(255),
last_main_doc varchar(255),
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
status smallint NOT NULL,
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
status smallint NOT NULL,
date_eval date,
fk_user integer NOT NULL,
fk_job integer NOT NULL
fk_user integer NOT NULL,
fk_job integer NOT NULL,
last_main_doc varchar(255)
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;

View file

@ -24,7 +24,7 @@ SkillsManagement=Skills management
HRM_MAXRANK=Maximum number of levels to rank a skill
HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created
deplacement=Shift
DateEval=Evaluation date
DateEval=Competency assessment date
JobCard=Job card
NewJobProfile=New Job Profile
JobProfile=Job profile
@ -41,12 +41,12 @@ Skill=Skill
Skills=Skills
SkillCard=Skill card
EmployeeSkillsUpdated=Employee skills have been updated (see "Skills" tab of employee card)
Eval=Evaluation
Evals=Evaluations
NewEval=New evaluation
ValidateEvaluation=Validate evaluation
ConfirmValidateEvaluation=Are you sure you want to validate this evaluation with the reference <b>%s</b>?
EvaluationCard=Evaluation card
Eval=Competency assessment
Evals=Competency assessments
NewEval=New competency assessment
ValidateEvaluation=Validate competency assessment
ConfirmValidateEvaluation=Are you sure you want to validate this competency assessment with the reference <b>%s</b>?
EvaluationCard=Competency assessment
RequiredRank=Required rank for the job profile
RequiredRankShort=Required rank
PositionsWithThisProfile=Positions with this job profiles
@ -90,8 +90,9 @@ SaveAddSkill = Skill(s) added
SaveLevelSkill = Skill(s) level saved
DeleteSkill = Skill removed
SkillsExtraFields=Complementary attributes (Skills)
JobsExtraFields=Complementary attributes (Job profile)
EvaluationsExtraFields=Complementary attributes (Evaluations)
JobsExtraFields=Complementary attributes (Job profiles)
EvaluationsExtraFields=Complementary attributes (Competency assessments)
NeedBusinessTravels=Need business travels
NoDescription=No description
TheJobProfileHasNoSkillsDefinedFixBefore=The evaluated job profile of this employee has no skill defined on it. Please add skill(s), then delete and restart the evaluation.
PDFStandardHrmEvaluation=Standard template to generate a PDF document for a competency assessment

View file

@ -95,7 +95,7 @@ nolimitbyEX_YEA=by year (no limitation)
NoTripsToExportCSV=No expense report to export for this period.
NOT_AUTHOR=You are not the author of this expense report. Operation canceled.
OnExpense=Expense line
PDFStandardExpenseReports=Standard template to generate a PDF document for expense report
PDFStandardExpenseReports=Standard template to generate a PDF document for an expense report
PaidTrip=Pay an expense report
REFUSEUR=Denied by
RangeIk=Mileage range

View file

@ -190,6 +190,12 @@ if ($id > 0 || $ref) {
$out = '';
$morehtmlcenter = '';
$messagingUrl = DOL_URL_ROOT.'/product/messaging.php?id='.$object->id;
$morehtmlcenter .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
$messagingUrl = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id;
$morehtmlcenter .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
if (isModEnabled('agenda')) {
$permok = $user->hasRight('agenda', 'myactions', 'create');
if ((!empty($objproduct->id) || !empty($objcon->id)) && $permok) {
@ -200,9 +206,10 @@ if ($id > 0 || $ref) {
}
$linktocreatetimeBtnStatus = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create');
$morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
$morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
}
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
print '<br>';
@ -215,7 +222,7 @@ if ($id > 0 || $ref) {
}
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans("ActionsOnProduct"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1);
print_barre_liste($langs->trans("ActionsOnProduct"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 0);
// List of all actions
$filters = array();

View file

@ -3,6 +3,7 @@
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -44,7 +45,8 @@ require '../../main.inc.php';
$htmlname = GETPOST('htmlname', 'aZ09');
$socid = GETPOSTINT('socid');
$type = GETPOSTINT('type');
// type can be empty string or 0 or 1
$type = GETPOST('type', 'int');
$mode = GETPOSTINT('mode');
$status = ((GETPOSTINT('status') >= 0) ? GETPOSTINT('status') : - 1); // status buy when mode = customer , status purchase when mode = supplier
$status_purchase = ((GETPOSTINT('status_purchase') >= 0) ? GETPOSTINT('status_purchase') : - 1); // status purchase when mode = customer

View file

@ -3080,8 +3080,10 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
print '</div><div class="fichehalfright">';
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
$morehtmlcenter = '<div class="nowraponall">';
$morehtmlcenter .= dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/product/messaging.php?id='.$object->id);
$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
$morehtmlcenter .= '</div>';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View file

@ -0,0 +1,237 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/societe/messaging.php
* \ingroup societe
* \brief Page of third party events
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// Load translation files required by the page
$langs->loadLangs(array('agenda', 'bills', 'companies', 'orders', 'propal'));
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'thirdpartyagenda';
if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_rowid = GETPOST('search_rowid');
$search_agenda_label = GETPOST('search_agenda_label');
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
if (empty($page) || $page == -1) {
$page = 0;
} // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) {
$sortfield = 'a.datep,a.id';
}
if (!$sortorder) {
$sortorder = 'DESC,DESC';
}
// Initialize technical objects
$object = new Product($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('agendathirdparty', 'globalcard'));
// Security check
$id = GETPOSTINT('id');
$socid =0;
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'produit', $socid, '');
/*
* Actions
*/
$parameters = array('id' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
// Cancel
if (GETPOST('cancel', 'alpha') && !empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$actioncode = '';
$search_agenda_label = '';
}
}
/*
* View
*/
$form = new Form($db);
$result = $object->fetch($id, $ref);
$title = $langs->trans("Agenda");
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|DE:Modul_Terminplanung';
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/productnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
$title = $object->name." - ".$title;
}
llxHeader('', $title, $help_url);
if (isModEnabled('notification')) {
$langs->load("mails");
}
$type = $langs->trans('Product');
if ($object->isService()) {
$type = $langs->trans('Service');
}
$head = product_prepare_head($object);
$titre = $langs->trans("CardProduct".$object->type);
$picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
print dol_get_fiche_head($head, 'agenda', $titre, -1, $picto);
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '';
dol_banner_tab($object, 'id', $linkback, ($user->socid ? 0 : 1), 'rowid', 'label', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$object->info($id);
dol_print_object_info($object, 1);
print '</div>';
print dol_get_fiche_end();
// Actions buttons
$objthirdparty = $object;
$objcon = new stdClass();
$out = '';
$permok = $user->hasRight('agenda', 'myactions', 'create');
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') {
$out .= '&amp;originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&amp;socid='.$objthirdparty->id : '').'&amp;backtopage='.urlencode($_SERVER['PHP_SELF'].($objthirdparty->id > 0 ? '?socid='.$objthirdparty->id : ''));
}
$out .= (!empty($objcon->id) ? '&amp;contactid='.$objcon->id : '');
$out .= '&amp;datep='.dol_print_date(dol_now(), 'dayhourlog', 'tzuserrel');
}
$morehtmlright = '';
$messagingUrl = DOL_URL_ROOT.'/product/messaging.php?id='.$object->id;
$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2);
$messagingUrl = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id;
$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1);
// // Show link to send an email (if read and not closed)
// $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
// $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle';
// $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus);
// // Show link to add a private message (if read and not closed)
// $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
// $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle';
// $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
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);
}
}
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
print '<br>';
$param = '&socid='.urlencode((string) ($socid));
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.((int) $limit);
}
// Try to know count of actioncomm from cache
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
$cachekey = 'count_events_thirdparty_'.$object->id;
$nbEvent = dol_getcache($cachekey);
$titlelist = $langs->trans("ActionsOnCompany").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : '');
if (!empty($conf->dol_optimize_smallscreen)) {
$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : '');
}
print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0);
// List of all actions
$filters = array();
$filters['search_agenda_label'] = $search_agenda_label;
$filters['search_rowid'] = $search_rowid;
// TODO Replace this with same code than into list.php
show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
}
// End of page
llxFooter();
$db->close();

View file

@ -335,6 +335,7 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
//print $sql;
$result = $db->query($sql);
if ($result) {
@ -358,7 +359,9 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/LEFT JOIN [a-z]+_product_stock as ps ON t.rowid = ps.fk_entrepot LEFT JOIN [a-z]+_product as p ON ps.fk_product = p.rowid/', '', $sqlforcount);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
@ -557,7 +560,7 @@ foreach ($object->fields as $key => $val) {
if (!empty($arrayfields['t.'.$key]['checked'])) {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), (isset($val['notnull']) ? $val['notnull'] : 0), 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {

View file

@ -1406,7 +1406,7 @@ select.flat.selectlimit {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.selectlimit, .marginrightonly {
.marginrightonly {
margin-<?php echo $right; ?>: 10px !important;
}
.marginleftonly {
@ -6833,6 +6833,11 @@ select.multiselectononeline {
}
}
/* must be after the other .select2-container.select2-container--open .select2-dropdown.ui-dialog */
.limit.select2-container.select2-container--open .select2-dropdown.ui-dialog {
min-width: 100px !important;
}
/* ============================================================================== */
/* For categories */

View file

@ -6714,6 +6714,11 @@ select.multiselectononeline {
}
}
/* must be after the other .select2-container.select2-container--open .select2-dropdown.ui-dialog */
.limit.select2-container.select2-container--open .select2-dropdown.ui-dialog {
min-width: 100px !important;
}
.parentonrightofpage {
direction: rtl;
}

View file

@ -44,6 +44,7 @@ parameters:
polluteScopeWithAlwaysIterableForeach: true
reportMagicMethods: false
reportMagicProperties: false
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '#Result of function fieldList#'
- '#Caught class Stripe#'
@ -54,6 +55,7 @@ parameters:
- '#(\$force_dolibarr_lib|\$dolibarr_main_db).*in empty\(\) is never defined.#'
- '#Sprain\\SwissQrBill\\#'
- '#Constructor of class .* has an unused parameter #'
- '#.*phan-var-force #'
internalErrorsCountLimit: 50
cache:
nodesByFileCountMax: 512