NEW Upgrade jsChantImproved to 2.8.10

This commit is contained in:
Laurent Destailleur 2024-03-23 17:18:11 +01:00
parent 8906df343a
commit 50aadc43f9
8 changed files with 1566 additions and 961 deletions

View File

@ -68,7 +68,7 @@ jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for filetree
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
jsGanttImproved 2.7.3 BSD License Yes JS library (to build Gantt reports)
jsGanttImproved 2.8.10 BSD License Yes JS library (to build Gantt reports)
SwaggerUI 2.2.10 GPL-2+ Yes JS library to offer the REST API explorer
Image libraries:

View File

@ -31,7 +31,7 @@ Replace:
d.items&&
With
d&&d.items&&
ESCPOS:
-------
@ -55,8 +55,8 @@ NUSOAP:
* Line 1257 of file nusoap.php. Add:
libxml_disable_entity_loader(true); // Avoid load of external entities (security problem). Required only for libxml < 2.
* Line 4346 of file nusoap.php
$rev = array();
@ -128,13 +128,13 @@ with
if (!@TCPDF_STATIC::file_exists($file)) {
// DOL CHANGE If we keep this, the image is not visible on pages after the first one.
//var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
//return false;
//return false;
$tfile = str_replace(' ', '%20', $file);
if (@TCPDF_STATIC::file_exists($tfile)) {
$file = $tfile;
}
}
* Replace in tcpdf.php:
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
with
@ -174,7 +174,7 @@ with
imagesetpixel($imgalpha, $xpx, $ypx, $alpha);
into
imagesetpixel($imgalpha, $xpx, $ypx, (int) $alpha);
* Removed useless directories ("examples", "tools")
* Optionally, removed all fonts except
@ -243,7 +243,7 @@ with:
with
foreach ($value[1] as $k => $v) {
* Fix by replacing
* Fix by replacing
if ($res[0] == PDF_TYPE_OBJECT)
with
if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT)
@ -253,23 +253,16 @@ with
JSGANTT:
--------
* Replace in function JSGantt.taskLink
var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
window.open(pRef, 'newwin', 'height=' + vHeight + ',width=' + vWidth);
with
// LDR To open in same window
// @CHANGE DOLI To open in same window
//var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
window.location.href=pRef
* Replace
vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
with
var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
vTmpNode.setAttribute('href',vTaskList[i].getLink());
* Replace '% Comp.' to have a smaller text column header
'comp':'% Comp.'
'comp': '%...'
with
'comp':'%'
'comp': '%'
@ -307,19 +300,19 @@ RESTLER:
// @CHANGE LDR
if (!is_string($haystack)) return false;
* Replace
* Replace
$loaders = array_unique(static::$rogueLoaders);
with
with
$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
* Replace CommentParser.php line 423
elseif (count($value) && is_numeric($value[0]))
with
elseif (count($value) && isset($value[0]) && is_numeric($value[0]))
* Add CommentParser.php line 406 & 407 to remove a warning on api request in php 8.1
@ -417,5 +410,3 @@ Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug:
.select2-hidden-accessible {
margin: -10000px !important; /* line to restore */
}

View File

@ -2,7 +2,7 @@
div.gantt {
font-family: tahoma, arial, verdana, Sans-serif;
font-size: 10px;
font-size: 12px;
color: #656565;
}
@ -31,10 +31,9 @@ div.gantt {
font-size: 12px;
border: #efefef 1px solid;
text-align: center;
cursor: default
cursor: default;
}
.gtasklist {
height: 19px;
min-width: 5px;
@ -44,7 +43,7 @@ div.gantt {
border-right: none;
}
.gtasknolist-label{
.gtasknolist-label {
padding: 10px 50px;
}
/* all three width values set just to make sure - helps resizing code */
@ -56,7 +55,7 @@ div.gantt {
.gminorheading {
background-color: #ffffff;
font-weight: bold;
font-size: 9px;
font-size: 11px;
white-space: nowrap;
}
@ -154,9 +153,9 @@ td.gspanning {
.gtaskname {
min-width: 170px;
max-width: 170px;
width: 170px;
font-size: 9px;
max-width: 220px;
width: 220px;
font-size: 12px;
border-left: none;
}
@ -246,6 +245,11 @@ span.gfoldercollapse {
background-color: #fffde5;
}
.gitemdifferent td {
background-image: none;
background-color: rgba(0, 0, 0, 0.05);
}
/* task bar caption text styles */
.gmilecaption,
@ -487,7 +491,7 @@ span.gfoldercollapse {
div.gtaskbarcontainer {
z-index: 1;
position: absolute;
top: 0px
top: 0px;
}
.textbar {
@ -510,7 +514,7 @@ div.gtaskbarcontainer {
font-size: 10px;
display: block;
background: #ffffff;
color: #656565
color: #656565;
}
.gTaskInfo {
@ -652,7 +656,7 @@ div.gtaskbarcontainer {
/* Old Internet Explorer version hacks */
.gantt {
_height: 100%
_height: 100%;
}
/* otherwise the chart disappears! */
@ -777,7 +781,6 @@ td.gspanning div {
}
@media print {
/* All your print styles go here */
html,
.gchartgrid {
@ -787,6 +790,32 @@ td.gspanning div {
.glistgrid {
float: none !important;
}
/* Hide scrollbar for Chrome, Safari and Opera */
.gchartcontainer *::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.gchartcontainer * {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
/* Hide tool-tip */
.JSGanttToolTip {
display: none !important;
}
/* This is the default css, injected by the JSGantt.printChart(width,height); function -->
@page {
size: ${width}mm ${height}mm;
}
.gchartcontainer {
width: ${width}mm;
}
<-- This will be injected by the JSGantt.printChart() function */
}
/* if using setUseSingleCell(1) the following is a suggested set of CSS3 styles to recreate the table grid - won't work on old browsers
@ -812,16 +841,21 @@ td.gspanning div {
display: flex;
flex-direction: column;
/* Allow resize */
resize: horizontal;
}
.gmainright {
overflow: hidden;
flex: auto;
flex: 1 1 auto;
}
.gmainleft {
overflow: hidden;
flex: 0 0 50%;
flex: 0 0 20%;
min-width: 220px;
/* Allow side to grow and shrink */
flex: 1 0 auto;
}
.gtasktableh tr,
@ -927,25 +961,25 @@ td.gspanning div {
}
table {
page-break-after: auto
page-break-after: auto;
}
tr {
page-break-inside: avoid;
page-break-after: auto
page-break-after: auto;
}
td {
page-break-inside: avoid;
page-break-after: auto
page-break-after: auto;
}
thead {
display: table-header-group
display: table-header-group;
}
tfoot {
display: table-footer-group
display: table-footer-group;
}
}
@ -966,7 +1000,7 @@ td.gspanning div {
border-radius: 8px;
border: 2px solid white;
/* should match background, can't be transparent */
background-color: rgba(0, 0, 0, .5);
background-color: rgba(0, 0, 0, 0.5);
}
.frame::-webkit-scrollbar-track {
@ -979,4 +1013,4 @@ td.gspanning div {
overflow: scroll;
-ms-overflow-style: scrollbar;
display: block;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -204,7 +204,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje
//$parent = $task["task_parent"];
}
// Define percent
$percent = $task['task_percent_complete'] ? $task['task_percent_complete'] : 0;
$percent = empty($task['task_percent_complete']) ? 0 : $task['task_percent_complete'];
// Link (more information)
if ($task["task_id"] < 0) {
//$link=DOL_URL_ROOT.'/projet/tasks.php?withproject=1&id='.abs($task["task_id"]);
@ -264,9 +264,9 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje
$taskid = $task["task_alternate_id"];
//$taskid = $task['task_id'];
$note = $task['note'];
$note = empty($task['note']) ? '' : $task['note'];
$note = dol_concatdesc($note, $langs->trans("Workload").' : '.($task['task_planned_workload'] ? convertSecondToTime($task['task_planned_workload'], 'allhourmin') : ''));
$note = dol_concatdesc($note, $langs->trans("Workload").' : '.(empty($task['task_planned_workload']) ? '' : convertSecondToTime($task['task_planned_workload'], 'allhourmin')));
$s .= "g.AddTaskItem(new JSGantt.TaskItem('".$taskid."', '".dol_escape_js(trim($name))."', '".$start_date."', '".$end_date."', '".$css."', '".$link."', ".$task['task_milestone'].", '".dol_escape_js($resources)."', ".($percent >= 0 ? $percent : 0).", ".$line_is_auto_group.", '".$parent."', 1, '".$dependency."', '".(empty($task["task_is_group"]) ? (($percent >= 0 && $percent != '') ? $percent.'%' : '') : '')."', '".dol_escape_js($note)."', g));";
echo $s;

View File

@ -356,7 +356,7 @@ if (count($tasksarray) > 0) {
//if ($s) $tasks[$taskcursor]['task_resources']=implode(',',$idofusers);
$tasks[$taskcursor]['task_resources'] = $s;
if ($s) {
$tasks[$taskcursor]['task_resources'] = '<a href="'.DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$val->id.'&withproject=1" title="'.dol_escape_htmltag($s).'">'.$langs->trans("List").'</a>';
$tasks[$taskcursor]['task_resources'] = '<a href="'.DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$val->id.'&withproject=1" title="'.dol_escape_htmltag($s).'">'.$langs->trans("Contacts").'</a>';
}
//print "xxx".$val->id.$tasks[$taskcursor]['task_resources'];
$tasks[$taskcursor]['note'] = $task->note_public;

View File

@ -413,7 +413,7 @@ if ($id > 0 || !empty($ref)) {
print '<td>';
$formcompany->selectTypeContact($object, '', 'type', 'internal', 'position');
print '</td>';
print '<td class="right" colspan="3" ><input type="submit" class="button button-add" value="'.$langs->trans("Add").'" name="addsourceinternal"></td>';
print '<td class="right" colspan="3" ><input type="submit" class="button button-add small" value="'.$langs->trans("Add").'" name="addsourceinternal"></td>';
print '</tr>';
// Line to add an external contact. Only if project linked to a third party.
@ -438,7 +438,7 @@ if ($id > 0 || !empty($ref)) {
print '<td>';
$formcompany->selectTypeContact($object, '', 'typecontact', 'external', 'position');
print '</td>';
print '<td class="right" colspan="3" ><input type="submit" class="button" id="add-customer-contact" name="addsourceexternal" value="'.$langs->trans("Add").'"';
print '<td class="right" colspan="3" ><input type="submit" class="button button-add small" id="add-customer-contact" name="addsourceexternal" value="'.$langs->trans("Add").'"';
if (!$nbofcontacts) {
print ' disabled';
}

View File

@ -6081,7 +6081,7 @@ td.gminorheading {
}*/
.gtaskname div, .gtaskname {
min-width: 250px !important;
max-width: unset !important;
max-width: 500px !important;
width: unset !important;
}
.gpccomplete div, .gpccomplete {