Compare commits

...

14 Commits

Author SHA1 Message Date
Laurent Destailleur
998d8c4b50 Fix warning 2025-12-04 14:53:33 +01:00
Laurent Destailleur
966bdc84e5 Fix warning 2025-12-04 14:46:10 +01:00
Laurent Destailleur
863dd31ab1 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2025-12-04 14:20:24 +01:00
Laurent Destailleur
9e63298b2e CSS 2025-12-04 14:20:08 +01:00
Laurent Destailleur
0a45c9b368 Merge pull request #36524 from FHenry/22_feat_subtotal_defaut_values
new: defaut to True show unit price on title and sub total
2025-12-04 14:06:47 +01:00
Laurent Destailleur
39e200eb50 Debug v23 2025-12-04 14:00:34 +01:00
Laurent Destailleur
e329c11e82 Fix warning 2025-12-04 12:54:56 +01:00
Laurent Destailleur
03f26d3a6d Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2025-12-04 12:51:59 +01:00
Laurent Destailleur
c635f5f9c5 Fix detection of security commit 2025-12-04 12:51:49 +01:00
Laurent Destailleur
69cfb09b62 Fix detection of security commit 2025-12-04 12:42:02 +01:00
Laurent Destailleur
11787eb4ff Trans 2025-12-04 12:30:17 +01:00
Laurent Destailleur
47896f320a Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2025-12-04 12:23:17 +01:00
Laurent Destailleur
b530ab7e5d Debug v23 - Navigation in timespent and style 2025-12-04 12:22:44 +01:00
Florian HENRY
6b05561ee8 new: defaut to True show unit price on title and sub total 2025-12-04 10:22:47 +01:00
20 changed files with 150 additions and 113 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

@@ -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

@@ -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

@@ -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

@@ -74,14 +74,17 @@ 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) {

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();