2
0
forked from Wavyzz/dolibarr

Merge pull request #6 from Dolibarr/develop

pull from develop
This commit is contained in:
Tobias Sekan
2020-03-05 14:12:51 +01:00
committed by GitHub
54 changed files with 14316 additions and 378 deletions

View File

@@ -38,6 +38,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
JS libraries:
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
Chart 2.9.3 MIT License Yes JS library for graph
jQuery 3.4.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect

View File

@@ -2,6 +2,69 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 11.0.2 compared to 11.0.1 *****
FIX: #10309
FIX: #13110
FIX: #13118
FIX: #13124
FIX: #13131
FIX: #13135
FIX: #13146 #13198
FIX: #13175
FIX: #13182
FIX: #13183
FIX: #13184
FIX: #13263
FIX: #13267
FIX: an external user can not approve
FIX: API Get list of documents for supplier_invoice
FIX: API to push an expense report
FIX: API upload/download doc for expensereport
FIX: Avoid to download the export if we just press enter to refresh form
FIX: Bad link to template invoices
FIX: Bad sort link in accounting report
FIX: Bad translation for productlot EatBy and SellBy
FIX: better method to check user rights AND usergroup rights !
FIX: CA by product list filter
FIX: CSS
FIX: Disable js if no javascript
FIX: duplicate class name into some log lines
FIX: etrafield with visibilty=5 were not in read only.
FIX: excess paid from situation invoices not counted when calculating remain to pay.
FIX: Force FEC export to txt format.
FIX: Free input for email no more visible.
FIX: Keep assigned users in session when loading projects and tasks
FIX: List of viewed projects too large in task widget.
FIX: Menu truncated. Add tooltip to have all content.
FIX: Missing field "billed" in export.
FIX: missing "statut" for getNomUrl() function
FIX: modFournisseur is required by modSupplierProposal
FIX: Multicompany compatibility
FIX: must be == and not =
FIX: option for topbar search and bookmarks
FIX: option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: some responsive troubles
FIX: round MT in accountancy books
FIX: search with '0'
FIX: sort link
FIX: SQL Overload in default contact trigger.
FIX: SQl syntax error.
FIX: Submit of documents for supplier invoices.
FIX: timezone must be tzserver and not tzuser as on contract card
FIX: token in barcode tools page missing
FIX: Bad name of trigger PROPAL_SUPPLIER_TRIGGER, should be PROPOSAL_SUPPLIER_TRIGGER
FIX: Type of contact for event does not exists and not supported
FIX: Type of contact not saved when creating a contact
FIX: typo on ckeck method
FIX: undefined function measuringUnitString in product list
FIX: Usage of project not available in export.
FIX: wrong test
FIX: z-index for moretabsList with constant MAIN_MAXTABS_IN_CARD
FIX: Use GETPOST instead of POST
FIX: HTML Injection
FIX: Visualization rights correction on last modified contacts box.
FIX: Vulnerability in module from modulebuilder.
FIX: Vulnerability reported by code16
***** ChangeLog for 12.0.0 compared to 11.0.0 *****
For Users:

View File

@@ -1356,7 +1356,7 @@ class Adherent extends CommonObject
require_once DOL_DOCUMENT_ROOT . '/adherents/class/subscription.class.php';
$sql = "SELECT c.rowid, c.fk_adherent, c.subscription, c.note, c.fk_bank,";
$sql = "SELECT c.rowid, c.fk_adherent, c.fk_type, c.subscription, c.note, c.fk_bank,";
$sql .= " c.tms as datem,";
$sql .= " c.datec as datec,";
$sql .= " c.dateadh as dateh,";
@@ -1386,6 +1386,7 @@ class Adherent extends CommonObject
$subscription = new Subscription($this->db);
$subscription->id = $obj->rowid;
$subscription->fk_adherent = $obj->fk_adherent;
$subscription->fk_type = $obj->fk_type;
$subscription->amount = $obj->subscription;
$subscription->note = $obj->note;
$subscription->fk_bank = $obj->fk_bank;

View File

@@ -198,13 +198,16 @@ if ($conf->use_javascript_ajax)
$dataseries[] = array($langs->trans("MembersStatusResiliated"), round($SommeD));
$dataseries[] = array($langs->trans("MembersStatusToValid"), round($SommeA));
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, $badgeStatus6, '-'.$badgeStatus0));
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total ? 0 : 1);

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/comm/propal/contact.php
* \ingroup propal
* \brief Onglet de gestion des contacts de propal
* \brief Tab to manage contacts/adresses of proposal
*/
require '../../main.inc.php';

View File

@@ -144,7 +144,7 @@ if ($resql)
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphthirdparties');
print $dolgraph->show($total ? 0 : 1);

View File

@@ -143,7 +143,7 @@ if ($resql)
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total ? 0 : 1);

View File

@@ -350,10 +350,11 @@ else
}
$datamin[$i] = $object->min_desired;
$dataall[$i] = $object->min_allowed;
if ($xday == '15')
/*if ($xday == '15') // Set only some label for jflot
{
$labels[$i] = dol_print_date($day, "%b");
}
}*/
$labels[$i] = dol_print_date($day, "%Y%m");
$day += 86400;
$textdate = strftime("%Y%m%d", $day);
$xyear = substr($textdate, 0, 4);
@@ -465,10 +466,11 @@ else
}
$datamin[$i] = $object->min_desired;
$dataall[$i] = $object->min_allowed;
if (substr($textdate, 6, 2) == '01' || $i == 0)
/*if (substr($textdate, 6, 2) == '01' || $i == 0) // Set only few label for jflot
{
$labels[$i] = substr($textdate, 4, 2);
}
$labels[$i] = substr($textdate, 0, 6);
}*/
$labels[$i] = substr($textdate, 0, 6);
$day += 86400;
$textdate = strftime("%Y%m%d", $day);
@@ -815,6 +817,8 @@ else
}
print '<br><br></td></tr>';
print '</table>';
// Graphs
if ($mode == 'standard')
@@ -826,39 +830,39 @@ if ($mode == 'standard')
// For month
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"] != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
print '<tr><td class="right">'.$link.'</td></tr>';
print '<div class="right clearboth">'.$link.'</div>';
print '<tr><td class="center">';
print '<div class="center clearboth margintoponly">';
$file = "movement".$account."-".$year.$month.".png";
print $show4;
print '</td></tr>';
print '</div>';
print '<tr><td class="center">';
print '<div class="center clearboth margintoponly">';
print $show1;
print '</td></tr>';
print '</div>';
// For year
$prevyear = $year - 1; $nextyear = $year + 1;
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"] != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
print '<tr><td class="right">'.$link.'</td></tr>';
print '<tr><td class="center">';
print '<div class="right clearboth margintoponly">'.$link.'</div>';
print '<div class="center clearboth margintoponly">';
print $show5;
print '</td></tr>';
print '</div>';
print '<tr><td class="center">';
print '<div class="center clearboth margintoponly">';
print $show2;
print '</td></tr>';
print '</div>';
}
if ($mode == 'showalltime')
{
print '<tr><td class="center">';
print '<div class="center clearboth margintoponly">';
print $show3;
print '</td></tr>';
print '</div>';
}
print '</table>';
// End of page
llxFooter();

View File

@@ -212,7 +212,7 @@ if (!empty($conf->use_javascript_ajax))
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total ? 0 : 1);
@@ -363,10 +363,10 @@ if ($result)
print '</td>';
print '<td class="center">'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>';
//print '<td class="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>';
print '<td class="right" width="32">'.($obj->nb_initial > 0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0, 3) : '').'</td>';
print '<td class="right" width="32">'.($obj->nb_running > 0 ? $obj->nb_running.$staticcontratligne->LibStatut(4, 3, 0) : '').'</td>';
print '<td class="right" width="32">'.($obj->nb_expired > 0 ? $obj->nb_expired.$staticcontratligne->LibStatut(4, 3, 1) : '').'</td>';
print '<td class="right" width="32">'.($obj->nb_closed > 0 ? $obj->nb_closed.$staticcontratligne->LibStatut(5, 3) : '').'</td>';
print '<td class="right nowraponall" width="32">'.($obj->nb_initial > 0 ? '<span class="paddingright">'.$obj->nb_initial.'</span>'.$staticcontratligne->LibStatut(0, 3, -1, 'class="paddingleft"') : '').'</td>';
print '<td class="right nowraponall" width="32">'.($obj->nb_running > 0 ? '<span class="paddingright">'.$obj->nb_running.'</span>'.$staticcontratligne->LibStatut(4, 3, 0, 'class="marginleft"') : '').'</td>';
print '<td class="right nowraponall" width="32">'.($obj->nb_expired > 0 ? '<span class="paddingright">'.$obj->nb_expired.'</span>'.$staticcontratligne->LibStatut(4, 3, 1, 'class="paddingleft"') : '').'</td>';
print '<td class="right nowraponall" width="32">'.($obj->nb_closed > 0 ? '<span class="paddingright">'.$obj->nb_closed.'</span>'.$staticcontratligne->LibStatut(5, 3, -1, 'class="paddingleft"') : '').'</td>';
print "</tr>\n";
$i++;
}

View File

@@ -691,11 +691,11 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
for ($i = 0; $i < $num; $i++)
{
$desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle);
$desc = ($lines[$i]->desc ? $lines[$i]->desc : '');
// If we build one invoice for several order, we must put the invoice of order on the line
if (!empty($createbills_onebythird))
{
$desc = dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs));
$desc = dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day'));
}
if ($lines[$i]->subprice < 0)

View File

@@ -160,6 +160,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
}
$i++;
}
$px1->SetLegend($legend);
$px1->SetMaxValue($px1->GetCeilMaxValue());
$px1->SetWidth($WIDTH);

View File

@@ -683,6 +683,8 @@ class Conf
if (!isset($this->global->MAIN_USE_OLD_TITLE_BUTTON)) $this->global->MAIN_USE_OLD_TITLE_BUTTON = 0;
if (!isset($conf->global->MAIN_JS_GRAPH)) $conf->global->MAIN_JS_GRAPH = 'chart'; // Use chart.js library
if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) $this->global->MAIN_MODULE_DOLISTORE_API_SRV = 'https://www.dolistore.com';
if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) $this->global->MAIN_MODULE_DOLISTORE_API_KEY = 'dolistorecatalogpublickey1234567';

View File

@@ -92,31 +92,13 @@ class DolGraph
/**
* Constructor
*
* @param string $library 'jflot' (default) or 'artichow' (no more supported)
* @param string $library 'auto' (default)
*/
public function __construct($library = 'jflot')
public function __construct($library = 'auto')
{
global $conf;
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor;
// To use old feature
if ($library == 'artichow')
{
$this->_library = 'artichow';
// Test if module GD present
$modules_list = get_loaded_extensions();
$isgdinstalled = 0;
foreach ($modules_list as $module)
{
if ($module == 'gd') $isgdinstalled = 1;
}
if (!$isgdinstalled)
{
$this->error = "Error: PHP GD module is not available. It is required to build graphics.";
}
}
$this->bordercolor = array(235, 235, 224);
$this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220));
$this->bgcolor = array(235, 235, 224);
@@ -130,23 +112,14 @@ class DolGraph
if (isset($theme_bgcolor)) $this->bgcolor = $theme_bgcolor;
}
//print 'bgcolor: '.join(',',$this->bgcolor).'<br>';
$this->_library = $library;
if ($this->_library == 'auto') {
$this->_library = (empty($conf->global->MAIN_JS_GRAPH) ? 'jflot': $conf->global->MAIN_JS_GRAPH);
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Set Y precision
*
* @param float $which_prec Precision
* @return boolean
* @deprecated
*/
public function SetPrecisionY($which_prec)
{
// phpcs:enable
return true;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
@@ -287,7 +260,7 @@ class DolGraph
/**
* Set type
*
* @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars')
* @param array $type Array with type for each serie. Example: array('pie', ...), array('lines', 'linesnopoint', 'bars', 'pie')
* @return void
*/
public function SetType($type)
@@ -686,188 +659,6 @@ class DolGraph
call_user_func_array(array($this, $call), array($file, $fileurl));
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Build a graph onto disk using Artichow library and return img string to it
*
* @param string $file Image file name to use if we save onto disk
* @param string $fileurl Url path to show image if saved onto disk
* @return void
*/
private function draw_artichow($file, $fileurl)
{
// phpcs:enable
global $artichow_defaultfont;
dol_syslog(get_class($this)."::draw_artichow this->type=".join(',', $this->type));
if (!defined('SHADOW_RIGHT_TOP')) define('SHADOW_RIGHT_TOP', 3);
if (!defined('LEGEND_BACKGROUND')) define('LEGEND_BACKGROUND', 2);
if (!defined('LEGEND_LINE')) define('LEGEND_LINE', 1);
// Create graph
$classname = '';
if (!isset($this->type[0]) || $this->type[0] == 'bars') $classname = 'BarPlot'; // Only one type (first one) is supported by artichow
elseif ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $classname = 'LinePlot';
else $classname = 'TypeUnknown';
include_once ARTICHOW_PATH.$classname.'.class.php';
// Definition de couleurs
$bgcolor = new Color($this->bgcolor[0], $this->bgcolor[1], $this->bgcolor[2]);
$bgcolorgrid = new Color($this->bgcolorgrid[0], $this->bgcolorgrid[1], $this->bgcolorgrid[2]);
$colortrans = new Color(0, 0, 0, 100);
$colorsemitrans = new Color(255, 255, 255, 60);
$colorgradient = new LinearGradient(new Color(235, 235, 235), new Color(255, 255, 255), 0);
$colorwhite = new Color(255, 255, 255);
// Graph
$graph = new Graph($this->width, $this->height);
$graph->border->hide();
$graph->setAntiAliasing(true);
if (isset($this->title))
{
$graph->title->set($this->title);
//print $artichow_defaultfont;exit;
$graph->title->setFont(new $artichow_defaultfont(10));
}
if (is_array($this->bgcolor)) $graph->setBackgroundColor($bgcolor);
else $graph->setBackgroundGradient($colorgradient);
$group = new PlotGroup;
//$group->setSpace(5, 5, 0, 0);
$paddleft = 50;
$paddright = 10;
$strl = dol_strlen(max(abs($this->MaxValue), abs($this->MinValue)));
if ($strl > 6) $paddleft += ($strl * 4);
$group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values
$group->legend->setSpace(0);
$group->legend->setPadding(2, 2, 2, 2);
$group->legend->setPosition(null, 0.1);
$group->legend->setBackgroundColor($colorsemitrans);
if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid);
else $group->grid->setBackgroundColor($colortrans);
if ($this->hideXGrid) $group->grid->hideVertical(true);
if ($this->hideYGrid) $group->grid->hideHorizontal(true);
// On boucle sur chaque lot de donnees
$legends = array();
$i = 0;
$nblot = count($this->data[0]) - 1;
while ($i < $nblot)
{
$x = 0;
$values = array();
foreach ($this->data as $key => $valarray)
{
$legends[$x] = $valarray[0];
$values[$x] = $valarray[$i + 1];
$x++;
}
// We fix unknown values to null
$newvalues = array();
foreach ($values as $val)
{
$newvalues[] = (is_numeric($val) ? $val : null);
}
if ($this->type[0] == 'bars')
{
//print "Lot de donnees $i<br>";
//print_r($values);
//print '<br>';
$color = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2], 20);
$colorbis = new Color(min($this->datacolor[$i][0] + 50, 255), min($this->datacolor[$i][1] + 50, 255), min($this->datacolor[$i][2] + 50, 255), 50);
$colorgrey = new Color(100, 100, 100);
$colorborder = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]);
if ($this->mode == 'side') $plot = new BarPlot($newvalues, $i + 1, $nblot);
if ($this->mode == 'depth') $plot = new BarPlot($newvalues, 1, 1, ($nblot - $i - 1) * 5);
$plot->barBorder->setColor($colorgrey);
//$plot->setBarColor($color);
$plot->setBarGradient(new LinearGradient($colorbis, $color, 90));
if ($this->mode == 'side') $plot->setBarPadding(0.1, 0.1);
if ($this->mode == 'depth') $plot->setBarPadding(0.1, 0.4);
if ($this->mode == 'side') $plot->setBarSpace(5);
if ($this->mode == 'depth') $plot->setBarSpace(2);
$plot->barShadow->setSize($this->SetShading);
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
$plot->barShadow->smooth(true);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
}
if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint')
{
$color = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2], 20);
$colorbis = new Color(min($this->datacolor[$i][0] + 20, 255), min($this->datacolor[$i][1] + 20, 255), min($this->datacolor[$i][2] + 20, 255), 60);
$colorter = new Color(min($this->datacolor[$i][0] + 50, 255), min($this->datacolor[$i][1] + 50, 255), min($this->datacolor[$i][2] + 50, 255), 90);
$plot = new LinePlot($newvalues);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
$plot->setColor($color);
$plot->setThickness(1);
// Set line background gradient
$plot->setFillGradient(new LinearGradient($colorter, $colorbis, 90));
$plot->xAxis->setLabelText($legends);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
//$plot->setYAxis(0);
//$plot->hideLine(true);
}
//$plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures
$group->legend->setTextFont(new $artichow_defaultfont(10)); // This is to force Artichow to use awFileFontDriver to
// solve a bug in Artichow with UTF8
if (count($this->Legend))
{
if ($this->type[0] == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
}
$group->add($plot);
$i++;
}
$group->axis->bottom->setLabelText($legends);
$group->axis->bottom->label->setFont(new $artichow_defaultfont(7));
//print $group->axis->bottom->getLabelNumber();
if ($this->labelInterval > 0) $group->axis->bottom->setLabelInterval($this->labelInterval);
$graph->add($group);
// Generate file
$graph->draw($file);
$this->stringtoshow = '<!-- Build using '.$this->_library.' --><img src="'.$fileurl.'" title="'.dol_escape_htmltag($this->title ? $this->title : $this->YLabel).'" alt="'.dol_escape_htmltag($this->title ? $this->title : $this->YLabel).'">';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Build a graph using JFlot library. Input when calling this method should be:
@@ -875,7 +666,7 @@ class DolGraph
* $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x
* $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated
* $this->legend= array("Val1",...,"Valn"); // list of n series name
* $this->type = array('bars',...'lines'); or array('pie')
* $this->type = array('bars',...'lines','linesnopoint'); or array('pie') or array('polar')
* $this->mode = 'depth' ???
* $this->bgcolorgrid
* $this->datacolor
@@ -888,7 +679,7 @@ class DolGraph
private function draw_jflot($file, $fileurl)
{
// phpcs:enable
global $langs;
global $conf, $langs;
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
@@ -924,7 +715,6 @@ class DolGraph
$x++;
}
// TODO Avoid push by adding generated long array...
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie')
{
foreach ($values as $x => $y) {
@@ -943,7 +733,7 @@ class DolGraph
}
$tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));
$this->stringtoshow = '<!-- Build using '.$this->_library.' -->'."\n";
$this->stringtoshow = '<!-- Build using jflot -->'."\n";
if (!empty($this->title)) $this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
if (!empty($this->shownographyet))
{
@@ -962,23 +752,27 @@ class DolGraph
$i = $firstlot;
if ($nblot < 0)
{
$this->stringtoshow .= '<!-- No series of data -->';
$this->stringtoshow .= '<!-- No series of data -->'."\n";
}
else
{
while ($i < $nblot)
{
$this->stringtoshow .= $serie[$i];
$this->stringtoshow .= '<!-- Serie '.$i.' -->'."\n";
$this->stringtoshow .= $serie[$i]."\n";
$i++;
}
}
$this->stringtoshow .= "\n";
// Special case for Graph of type 'pie'
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie')
if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'pie' || $this->type[$firstlot] == 'polar'))
{
$datacolor = array();
foreach ($this->datacolor as $val) $datacolor[] = "#".sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]);
foreach ($this->datacolor as $val) {
if (is_array($val)) $datacolor[] = "#".sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]); // If datacolor is array(R, G, B)
else $datacolor[] = "#".str_replace(array('#', '-'), '', $val); // If $val is '124' or '#124'
}
$urltemp = ''; // TODO Add support for url link into labels
$showlegend = $this->showlegend;
@@ -1131,6 +925,263 @@ class DolGraph
$this->stringtoshow .= '</script>'."\n";
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Build a graph using Chart library. Input when calling this method should be:
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
* $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x
* $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated
* $this->legend= array("Val1",...,"Valn"); // list of n series name
* $this->type = array('bars',...'lines', 'linesnopoint'); or array('pie') or array('polar');
* $this->mode = 'depth' ???
* $this->bgcolorgrid
* $this->datacolor
* $this->shownodatagraph
*
* @param string $file Image file name to use to save onto disk (also used as javascript unique id)
* @param string $fileurl Url path to show image if saved onto disk. Never used here.
* @return void
*/
private function draw_chart($file, $fileurl)
{
// phpcs:enable
global $conf, $langs;
dol_syslog(get_class($this)."::draw_chart this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
if (empty($this->width) && empty($this->height))
{
print 'Error width or height not set';
return;
}
$legends = array();
$nblot = 0;
if (is_array($this->data) && is_array($this->data[0])) {
$nblot = count($this->data[0]) - 1; // -1 to remove legend
}
if ($nblot < 0) dol_syslog('Bad value for property ->data. Must be set by mydolgraph->SetData before calling mydolgrapgh->draw', LOG_WARNING);
$firstlot = 0;
// Works with line but not with bars
//if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x
$i = $firstlot;
$serie = array();
while ($i < $nblot) // Loop on each serie
{
$values = array(); // Array with horizontal y values (specific values of a serie) for each abscisse x
$serie[$i] = "";
// Fill array $values
$x = 0;
foreach ($this->data as $valarray) // Loop on each x
{
$legends[$x] = $valarray[0];
$values[$x] = (is_numeric($valarray[$i + 1]) ? $valarray[$i + 1] : null);
$x++;
}
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie')
{
$j = 0;
foreach ($values as $x => $y) {
//if (isset($y)) $serie[$i] .= 'd'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n";
if (isset($y)) {
//$serie[$i][] = $y;
$serie[$i] .= ($j > 0 ? ", " : "").$y;
$j++;
}
}
}
else
{
$j = 0;
foreach ($values as $x => $y) {
if (isset($y)) {
$serie[$i] .= ($j > 0 ? ", " : "").$y;
$j++;
}
}
}
unset($values);
$i++;
}
$tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));
$this->stringtoshow = '<!-- Build using chart -->'."\n";
if (!empty($this->title)) $this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
if (!empty($this->shownographyet))
{
$this->stringtoshow .= '<div style="width:'.$this->width.(strpos($this->width, '%') > 0 ? '': 'px').'; height:'.$this->height.'px;" class="nographyet"></div>';
$this->stringtoshow .= '<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
return;
}
// Start the div that will contains all the graph
$dolxaxisvertical='';
if (count($this->data) > 20) $dolxaxisvertical='dol-xaxis-vertical';
// No height for the pie grah
$cssfordiv = 'dolgraphchart';
if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'pie' || $this->type[$firstlot] == 'polar')) $cssfordiv .= ' dolgraphcharpie';
$this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="min-height: '.$this->height.(strpos($this->height, '%') > 0 ? '': 'px').'; width:'.$this->width.(strpos($this->width, '%') > 0 ? '': 'px').';" class="'.$cssfordiv.' dolgraph'.(empty($dolxaxisvertical)?'':' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center"><canvas id="canvas_'.$tag.'"></canvas></div>'."\n";
$this->stringtoshow .= '<script id="'.$tag.'">'."\n";
$i = $firstlot;
if ($nblot < 0)
{
$this->stringtoshow .= '<!-- No series of data -->';
}
else
{
while ($i < $nblot)
{
//$this->stringtoshow .= '<!-- Series '.$i.' -->'."\n";
//$this->stringtoshow .= $serie[$i]."\n";
$i++;
}
}
$this->stringtoshow .= "\n";
// Special case for Graph of type 'pie' or 'polar'
if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'pie' || $this->type[$firstlot] == 'polar'))
{
$type = $this->type[$firstlot]; // pie or polar
$this->stringtoshow .= 'var options = { elements: { arc: {'."\n";
$this->stringtoshow .= 'backgroundColor: [';
$i = 0; $foundnegativecolor = 0;
foreach($legends as $val) // Loop on each serie
{
if ($i > 0) $this->stringtoshow .= ', '."\n";
if (is_array($this->datacolor[$i])) $color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')'; // If datacolor is array(R, G, B)
else {
$tmp = str_replace('#', '', $this->datacolor[$i]);
if (strpos($tmp, '-') !== false) {
$foundnegativecolor++;
$color = '#FFFFFF'; // If $val is '-123'
}
else $color = "#".$tmp; // If $val is '123' or '#123'
}
$this->stringtoshow .= "'".$color."'";
$i++;
}
$this->stringtoshow .= '], '."\n";
if ($foundnegativecolor) {
$this->stringtoshow .= 'borderColor: [';
$i = 0;
foreach($legends as $val) // Loop on each serie
{
if ($i > 0) $this->stringtoshow .= ', '."\n";
if (is_array($this->datacolor[$i])) $color = 'null'; // If datacolor is array(R, G, B)
else {
$tmp = str_replace('#', '', $this->datacolor[$i]);
if (strpos($tmp, '-') !== false) $color = '#'.str_replace('-', '', $tmp); // If $val is '-123'
else $color = 'null'; // If $val is '123' or '#123'
}
$this->stringtoshow .= ($color == 'null' ? "'rgba(0,0,0,0.2)'" : "'".$color."'");
$i++;
}
$this->stringtoshow .= ']';
}
$this->stringtoshow .= '} } };'."\n";
$this->stringtoshow .= '
var ctx = document.getElementById("canvas_'.$tag.'").getContext("2d");
var chart = new Chart(ctx, {
// The type of chart we want to create
type: \''.($type == 'pie' ? 'doughnut' : 'polarArea').'\',
// Configuration options go here
options: options,
data: {
labels: [';
$i = 0;
foreach($legends as $val) // Loop on each serie
{
if ($i > 0) $this->stringtoshow .= ', ';
$this->stringtoshow .= "'".$val."'";
$i++;
}
$this->stringtoshow .= '],
datasets: [';
$i = 0;
$i = 0;
while ($i < $nblot) // Loop on each serie
{
$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')';
//$color = (!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor));
if ($i > 0) $this->stringtoshow .= ', '."\n";
$this->stringtoshow .= '{'."\n";
//$this->stringtoshow .= 'borderColor: \''.$color.'\', ';
//$this->stringtoshow .= 'backgroundColor: \''.$color.'\', ';
$this->stringtoshow .= ' data: ['.$serie[$i].']';
$this->stringtoshow .= '}'."\n";
$i++;
}
$this->stringtoshow .= ']'."\n";
$this->stringtoshow .= '}'."\n";
$this->stringtoshow .= '});'."\n";
}
// Other cases, graph of type 'bars', 'lines', 'linesnopoint'
else
{
$type = 'bar';
if (!isset($this->type[$firstlot]) || $this->type[$firstlot] == 'bars') $type = 'bar';
if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'lines' || $this->type[$firstlot] == 'linesnopoint')) $type = 'line';
$this->stringtoshow .= '
var options = { maintainAspectRatio: false, aspectRatio: 2.5 };
var ctx = document.getElementById("canvas_'.$tag.'").getContext("2d");
var chart = new Chart(ctx, {
// The type of chart we want to create
type: \''.$type.'\',
// Configuration options go here
options: options,
data: {
labels: [';
$i = 0;
foreach($legends as $val) // Loop on each serie
{
if ($i > 0) $this->stringtoshow .= ', ';
$this->stringtoshow .= "'".$val."'";
$i++;
}
$this->stringtoshow .= '],
datasets: [';
$i = 0;
while ($i < $nblot) // Loop on each serie
{
$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')';
//$color = (!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor));
if ($i > 0) $this->stringtoshow .= ', '."\n";
$this->stringtoshow .= '{'."\n";
$this->stringtoshow .= 'label: "'.$this->Legend[$i].'",';
$this->stringtoshow .= 'pointStyle: \''.($this->type[$i] == 'linesnopoint' ? 'line' : 'circle').'\', ';
$this->stringtoshow .= 'fill: '.($type == 'bar' ? 'true' : 'false').', ';
$this->stringtoshow .= 'borderColor: \''.$color.'\', ';
$this->stringtoshow .= 'backgroundColor: \''.$color.'\', ';
$this->stringtoshow .= ' data: ['.$serie[$i].']';
$this->stringtoshow .= '}'."\n";
$i++;
}
$this->stringtoshow .= ']'."\n";
$this->stringtoshow .= '}'."\n";
$this->stringtoshow .= '});'."\n";
}
$this->stringtoshow .= '</script>'."\n";
}
/**
* Output HTML string to total value
*

View File

@@ -46,6 +46,7 @@ if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE'))
$search_filters = GETPOST('search_filters', 'array');
$search_measures = GETPOST('search_measures', 'array');
$search_xaxis = GETPOST('search_xaxis', 'array');
$search_groupby = GETPOST('search_groupby', 'array');
$search_yaxis = GETPOST('search_yaxis', 'array');
$search_graph = GETPOST('search_graph', 'none');
@@ -173,6 +174,10 @@ if ($action == 'viewgraph') {
setEventMessages($langs->trans("OnlyOneFieldForXAxisIsPossible"), null, 'warnings');
$search_xaxis = array(0 => $search_xaxis[0]);
}
if (count($search_groupby) >= 2) {
setEventMessages($langs->trans("OnlyOneFieldForGroupByIsPossible"), null, 'warnings');
$search_groupby = array(0 => $search_groupb[0]);
}
if (!count($search_xaxis)) {
setEventMessages($langs->trans("AtLeastOneXAxisIsRequired"), null, 'warnings');
} elseif ($mode == 'graph' && $search_graph == 'bars' && count($search_measures) > 3) {
@@ -191,7 +196,9 @@ $param = '';
$arrayofmesures = array('t.count'=>'Count');
$arrayofxaxis = array();
$arrayofgroupby = array();
$arrayofyaxis = array();
$arrayofvaluesforgroupby = array();
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -256,6 +263,46 @@ print '<div class="inline-block opacitymedium"><span class="fas fa-chart-line pa
print $form->multiselectarray('search_measures', $arrayofmesures, $search_measures, 0, 0, 'minwidth500', 1);
print '</div>';
// Group by
print '<div class="divadvancedsearchfield">';
foreach ($object->fields as $key => $val) {
if (!$val['measure']) {
if (in_array($key, array(
'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) continue;
if (isset($val['enabled']) && !dol_eval($val['enabled'], 1)) continue;
if (isset($val['visible']) && !dol_eval($val['visible'], 1)) continue;
if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) continue;
if (preg_match('/^pass/', $key)) continue;
if (in_array($val['type'], array('html', 'text'))) continue;
if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) {
$arrayofgroupby['t.'.$key.'-year'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Year").')', 'position' => $val['position'].'-y');
$arrayofgroupby['t.'.$key.'-month'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Month").')', 'position' => $val['position'].'-m');
$arrayofgroupby['t.'.$key.'-day'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Day").')', 'position' => $val['position'].'-d');
} else {
$arrayofgroupby['t.'.$key] = array('label' => $val['label'], 'position' => (int) $val['position']);
}
}
// Add measure from extrafields
if ($object->isextrafieldmanaged) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') continue;
$arrayofgroupby['te.'.$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key]);
}
}
}
$arrayofgroupby = dol_sort_array($arrayofgroupby, 'position', 'asc', 1);
$arrayofgroupbylabel = array();
foreach ($arrayofgroupby as $key => $val) {
$arrayofgroupbylabel[$key] = $val['label'];
}
print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright" title="'.$langs->trans("GroupBy").'"></span>'.$langs->trans("GroupBy").'</div> ';
print $form->multiselectarray('search_groupby', $arrayofgroupbylabel, $search_groupby, 0, 0, 'minwidth250', 1);
print '</div>';
// XAxis
print '<div class="divadvancedsearchfield">';
foreach ($object->fields as $key => $val) {
@@ -279,6 +326,7 @@ foreach ($object->fields as $key => $val) {
// Add measure from extrafields
if ($object->isextrafieldmanaged) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') continue;
$arrayofxaxis['te.'.$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key]);
}
}
@@ -290,7 +338,7 @@ foreach ($arrayofxaxis as $key => $val) {
$arrayofxaxislabel[$key] = $val['label'];
}
print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright" title="'.$langs->trans("XAxis").'"></span>'.$langs->trans("XAxis").'</div> ';
print $form->multiselectarray('search_xaxis', $arrayofxaxislabel, $search_xaxis, 0, 0, 'minwidth500', 1);
print $form->multiselectarray('search_xaxis', $arrayofxaxislabel, $search_xaxis, 0, 0, 'minwidth250', 1);
print '</div>';
// YAxis
@@ -342,6 +390,19 @@ print '</div>';
print '</form>';
// Get all possible values of fields when a group by is set
if (is_array($search_groupby) && count($search_groupby)) {
$sql = 'SELECT DISTINCT '.$search_groupby[0].' as val FROM '.MAIN_DB_PREFIX.$object->table_element.' as t';
$resql = $db->query($sql);
if (!$resql) {
dol_print_error($db);
}
while ($obj = $db->fetch_object($resql)) {
$arrayofvaluesforgroupby[$obj->val] = $obj->val;
}
}
// Generate the SQL request
$sql = '';
if (!empty($search_measures) && !empty($search_xaxis))
@@ -362,6 +423,19 @@ if (!empty($search_measures) && !empty($search_xaxis))
}
else $sql .= $val.' as x_'.$key.', ';
}
foreach ($search_groupby as $key => $val) {
if (preg_match('/\-year$/', $val)) {
$tmpval = preg_replace('/\-year$/', '', $val);
$sql .= 'DATE_FORMAT('.$tmpval.", '%Y'), ";
} elseif (preg_match('/\-month$/', $val)) {
$tmpval = preg_replace('/\-month$/', '', $val);
$sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m'), ";
} elseif (preg_match('/\-day$/', $val)) {
$tmpval = preg_replace('/\-day$/', '', $val);
$sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m-%d'), ";
}
else $sql .= $val.', ';
}
foreach ($search_measures as $key => $val) {
if ($val == 't.count') $sql .= 'COUNT(t.'.$fieldid.') as y_'.$key.', ';
elseif (preg_match('/\-sum$/', $val)) {
@@ -417,6 +491,19 @@ if (!empty($search_measures) && !empty($search_xaxis))
}
else $sql .= $val.', ';
}
foreach ($search_groupby as $key => $val) {
if (preg_match('/\-year$/', $val)) {
$tmpval = preg_replace('/\-year$/', '', $val);
$sql .= 'DATE_FORMAT('.$tmpval.", '%Y'), ";
} elseif (preg_match('/\-month$/', $val)) {
$tmpval = preg_replace('/\-month$/', '', $val);
$sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m'), ";
} elseif (preg_match('/\-day$/', $val)) {
$tmpval = preg_replace('/\-day$/', '', $val);
$sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m-%d'), ";
}
else $sql .= $val.', ';
}
$sql = preg_replace('/,\s*$/', '', $sql);
$sql .= ' ORDER BY ';
foreach ($search_xaxis as $key => $val) {
@@ -482,7 +569,7 @@ if ($mode == 'grid') {
if ($mode == 'graph') {
$WIDTH = '80%';
$HEIGHT = 200;
var_dump($data);
// Show graph
$px1 = new DolGraph();
$mesg = $px1->isGraphKo();

View File

@@ -1883,6 +1883,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
$format = str_replace('%A', '__A__', $format);
}
// Analyze date
$reg = array();
if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000

View File

@@ -28,7 +28,6 @@ if (empty($object) || !is_object($object))
exit;
}
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@@ -66,7 +65,8 @@ $userstatic = new User($db);
<div class="tagtable tableforcontact centpercent noborder nobordertop allwidth">
<?php
if ($permission) {
if ($permission)
{
?>
<form class="tagtr liste_titre">
<div class="tagtd liste_titre"><?php echo $langs->trans("NatureOfContact"); ?></div>
@@ -153,94 +153,163 @@ if ($permission) {
<?php
}
}
?>
<form class="tagtr liste_titre liste_titre_add formnoborder">
<div class="tagtd liste_titre"><?php echo $langs->trans("NatureOfContact"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("Users").'/'.$langs->trans("Contacts"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("ContactType"); ?></div>
<div class="tagtd liste_titre center"><?php echo $langs->trans("Status"); ?></div>
<div class="tagtd liste_titre">&nbsp;</div>
</form>
print "</div>";
<?php
$arrayofsource=array('internal','external'); // Show both link to user and thirdparties contacts
foreach($arrayofsource as $source) {
$tmpobject=$object;
if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc;
/**
* Prepare list
*/
// TODO: replace this with direct SQL string to use $db->sort($sortfield, $sortorder)
$list = array();
foreach(array('internal', 'external') as $source)
{
$tmpobject = $object;
if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc))
{
$tmpobject = $objectsrc;
}
$tab = $tmpobject->liste_contact(-1, $source);
$num=count($tab);
$num = count($tab);
$i = 0;
while ($i < $num) {
?>
while ($i < $num)
{
$entry = '';
$entry->id = $tab[$i]['rowid'];
$entry->type = $tab[$i]['libelle'];
if ($tab[$i]['source'] == 'internal')
{
$entry->nature = $langs->trans("User");
}
elseif ($tab[$i]['source'] == 'external')
{
$entry->nature = $langs->trans("ThirdPartyContact");
}
<form class="tagtr oddeven">
<div class="tagtd left">
<?php if ($tab[$i]['source']=='internal') echo $langs->trans("User"); ?>
<?php if ($tab[$i]['source']=='external') echo $langs->trans("ThirdPartyContact"); ?>
</div>
<div class="tagtd left">
<?php
if ($tab[$i]['socid'] > 0)
{
$companystatic->fetch($tab[$i]['socid']);
echo $companystatic->getNomUrl(1);
$entry->thirdparty = $companystatic->getNomUrl(1);
}
if ($tab[$i]['socid'] < 0)
elseif ($tab[$i]['socid'] < 0)
{
echo $conf->global->MAIN_INFO_SOCIETE_NOM;
$entry->thirdparty = $conf->global->MAIN_INFO_SOCIETE_NOM;
}
if (! $tab[$i]['socid'])
elseif (! $tab[$i]['socid'])
{
echo '&nbsp;';
$entry->thirdparty = "";
}
?>
</div>
<div class="tagtd">
<?php
$statusofcontact = $tab[$i]['status'];
if ($tab[$i]['source']=='internal')
{
$userstatic->fetch($tab[$i]['id']);
echo $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle');
$entry->contact = $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle');
}
if ($tab[$i]['source']=='external')
elseif ($tab[$i]['source']=='external')
{
$contactstatic->fetch($tab[$i]['id']);
echo $contactstatic->getNomUrl(1, '', 0, '', 0, 0);
$entry->contact =$contactstatic->getNomUrl(1, '', 0, '', 0, 0);
}
?>
</div>
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
<div class="tagtd center">
<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
if ($tab[$i]['source']=='internal')
{
echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3);
$entry->status = $userstatic->LibStatut($tab[$i]['statuscontact'], 3);
}
if ($tab[$i]['source']=='external')
elseif ($tab[$i]['source']=='external')
{
echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
$entry->status = $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
}
//if ($object->statut >= 0) echo '</a>'; ?>
</div>
<div class="tagtd nowrap right">
<?php if ($permission) { ?>
&nbsp;<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=deletecontact&amp;lineid='.$tab[$i]['rowid']; ?>"><?php echo img_picto($langs->trans('Unlink'), 'unlink'); ?></a>
<?php } ?>
</div>
</form>
<?php $i++;
$i++;
$list[] = $entry;
}
}
print "</div>\n";
print "</div>\n";
$sortfield = GETPOST("sortfield", "alpha");
$sortorder = GETPOST("sortorder", 'alpha');
if (!$sortfield) $sortfield = "nature";
if (!$sortorder) $sortorder = "asc";
// Re-sort list
$list = dol_sort_array($list, $sortfield, $sortorder, 1, 0, 1);
$arrayfields = array(
'rowid' => array('label'=>$langs->trans("Id"), 'checked'=>1),
'nature' => array('label'=>$langs->trans("NatureOfContact"), 'checked'=>1),
'thirdparty' => array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
'contact' => array('label'=>$langs->trans("Users").'/'.$langs->trans("Contacts"), 'checked'=>1),
'type' => array('label'=>$langs->trans("ContactType"), 'checked'=>1),
'status' => array('label'=>$langs->trans("Status"), 'checked'=>1),
'link' => array('label'=>$langs->trans("Link"), 'checked'=>1),
);
$param = 'id='.$object->id.'&mainmenu=home';
/**
* Show list
*/
print '<br>';
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<table class="tagtable nobottomiftotal liste">';
print '<tr class="liste_titre_filter">';
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre($arrayfields['nature']['label'], $_SERVER["PHP_SELF"], "nature", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['thirdparty']['label'], $_SERVER["PHP_SELF"], "thirdparty", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['contact']['label'], $_SERVER["PHP_SELF"], "contact", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['status']['label'], $_SERVER["PHP_SELF"], "statut", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre($arrayfields['link']['label'], $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>";
foreach($list as $entry)
{
print '<tr class="oddeven">';
print '<td class="nowrap">'.$entry->nature.'</td>';
print '<td class="tdoverflowmax200">'.$entry->thirdparty.'</td>';
print '<td class="tdoverflowmax200">'.$entry->contact.'</td>';
print '<td class="tdoverflowmax200">'.$entry->type.'</td>';
print '<td class="tdoverflowmax200 center">'.$entry->status.'</td>';
if ($permission)
{
$href = $_SERVER["PHP_SELF"];
$href .= "?id=".$object->id;
$href .= "&action=deletecontact";
$href .= "&lineid=".$entry->id;
print "<td class='center'>";
print "<a href='$href'>";
print img_picto($langs->trans("Unlink"), "unlink");
print "</a>";
print "</td>";
}
print "</tr>";
}
print "</table>";
print "</div>";
print "</form>";
print "</div>";
print "<!-- TEMPLATE CONTACTS HOOK BEGIN HERE -->\n";
if (is_object($hookmanager)) {
$hookmanager->initHooks(array('contacttpl'));
@@ -248,3 +317,4 @@ if (is_object($hookmanager)) {
$reshook=$hookmanager->executeHooks('formContactTpl', $parameters, $object, $action);
}
print "<!-- END PHP TEMPLATE CONTACTS -->\n";

View File

@@ -140,7 +140,7 @@ if ($conf->use_javascript_ajax)
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total ? 0 : 1);
@@ -159,7 +159,7 @@ $totalnb = 0;
foreach ($listofstatus as $status)
{
print '<tr class="oddeven">';
print '<td><a href="list.php?statut='.$status.'">'.$donstatic->LibStatut($status, 4).'</a></td>';
print '<td><a href="list.php?search_status='.$status.'">'.$donstatic->LibStatut($status, 4).'</a></td>';
print '<td class="right">'.(!empty($nb[$status]) ? $nb[$status] : '&nbsp;').'</td>';
print '<td class="right">'.(!empty($nb[$status]) ?price($somme[$status], 'MT') : '&nbsp;').'</td>';
print '<td class="right">'.(!empty($nb[$status]) ?price(price2num($somme[$status] / $nb[$status], 'MT')) : '&nbsp;').'</td>';

View File

@@ -43,7 +43,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="d.datedon";
$search_status=(GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_status", 'intcomma') : "-1";
$search_status=(GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_status", 'intcomma') : "-4";
$search_all=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$search_ref=GETPOST('search_ref', 'alpha');
$search_company=GETPOST('search_company', 'alpha');
@@ -60,6 +60,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_company = "";
$search_name = "";
$search_amount = "";
$search_status = '';
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -91,7 +92,7 @@ $sql.= " d.amount, d.fk_statut as status,";
$sql.= " p.rowid as pid, p.ref, p.title, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p";
$sql.= " ON p.rowid = d.fk_projet WHERE d.entity IN (".getEntity('donation').")";
if ($search_status != '' && $search_status != '-1')
if ($search_status != '' && $search_status != '-4')
{
$sql .= " AND d.fk_statut IN (".$db->escape($search_status).")";
}
@@ -196,7 +197,15 @@ if ($resql)
print '</td>';
}
print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
print '<td class="liste_titre right"></td>';
print '<td class="liste_titre right">';
$liststatus = array(
Don::STATUS_DRAFT=>$langs->trans("DonationStatusPromiseNotValidated"),
Don::STATUS_VALIDATED=>$langs->trans("DonationStatusPromiseValidated"),
Don::STATUS_PAID=>$langs->trans("DonationStatusPaid"),
Don::STATUS_CANCELED=>$langs->trans("Canceled")
);
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
print '</td>';
print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;

View File

@@ -1015,6 +1015,8 @@ class ExpenseReport extends CommonObject
public function fetch_lines()
{
// phpcs:enable
global $conf;
$this->lines = array();
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,';

View File

@@ -139,7 +139,7 @@ if ($conf->use_javascript_ajax)
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($totalnb ? 0 : 1);

View File

@@ -36,6 +36,35 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
*/
class Fichinter extends CommonObject
{
public $fields=array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>45),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
'datei' =>array('type'=>'date', 'label'=>'Datei', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>70),
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105,'showoncombobox'=>1),
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>110),
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>115),
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120),
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130),
'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
);
/**
* @var string ID to identify managed object
*/

View File

@@ -143,7 +143,7 @@ if ($resql)
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total ? 0 : 1);
$data = array('series'=>$dataseries);

View File

@@ -31,7 +31,7 @@
*/
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
if (! defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (! defined('EURO')) define('EURO', chr(128));

View File

@@ -809,16 +809,6 @@ if ($object->id > 0)
}
}
if ($user->rights->fournisseur->facture->creer)
{
$langs->load("bills");
if ($object->status == 1) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
} else {
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a>';
}
}
if ($user->rights->fournisseur->facture->creer)
{
if (!empty($orders2invoice) && $orders2invoice > 0)
@@ -836,6 +826,16 @@ if ($object->id > 0)
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice").' ('.$langs->trans("WithReceptionFinished").')').'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
}
if ($user->rights->fournisseur->facture->creer)
{
$langs->load("bills");
if ($object->status == 1) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
} else {
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a>';
}
}
// Add action
if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1)
{

View File

@@ -0,0 +1,19 @@
version: "2"
plugins:
duplication:
enabled: true
config:
languages:
- javascript
fixme:
enabled: true
exclude_patterns:
- "dist/"
- "docs/"
- "samples/"
- "scripts/"
- "test/"
- "*.js"
- "*.json"
- "*.md"
- ".*"

View File

@@ -0,0 +1,18 @@
# https://editorconfig.org
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[gulpfile.js]
indent_style = space
indent_size = 2
[*.yml]
indent_style = space
indent_size = 2

View File

@@ -0,0 +1 @@
**/*{.,-}min.js

View File

@@ -0,0 +1,7 @@
extends: chartjs
env:
browser: true
node: true
plugins: ['html']

17
htdocs/includes/chart/.gitignore vendored Normal file
View File

@@ -0,0 +1,17 @@
/_book
/coverage
/custom
/dist
/docs/index.md
/gh-pages
/jsdoc
/node_modules
.DS_Store
.idea
.project
.settings
.vscode
bower.json
*.log
*.swp
*.stackdump

View File

@@ -0,0 +1,19 @@
{
"indent-style": "tabs",
"line-end-style": false,
"attr-quote-style": "double",
"spec-char-escape": false,
"attr-bans": [
"align",
"background",
"bgcolor",
"border",
"frameborder",
"longdesc",
"marginwidth",
"marginheight",
"scrolling"
],
"tag-bans": [ "b", "i" ],
"id-class-style": false
}

View File

@@ -0,0 +1,55 @@
language: node_js
node_js:
- lts/*
before_install:
- "export CHROME_BIN=/usr/bin/google-chrome"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- gulp build
- gulp test --coverage
- gulp docs
- gulp package
- gulp bower
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls || true
sudo: required
dist: trusty
addons:
chrome: stable
firefox: latest
# IMPORTANT: scripts require GITHUB_AUTH_TOKEN and GITHUB_AUTH_EMAIL environment variables
# IMPORTANT: scripts has to be set executables in the Git repository (error 127)
# https://github.com/travis-ci/travis-ci/issues/5538#issuecomment-225025939
deploy:
- provider: script
script: ./scripts/deploy.sh
skip_cleanup: true
on:
all_branches: true
- provider: script
script: ./scripts/release.sh
skip_cleanup: true
on:
branch: release
- provider: releases
api_key: $GITHUB_AUTH_TOKEN
skip_cleanup: true
file_glob: true
file:
- ./dist/*.css
- ./dist/*.js
- ./dist/*.zip
on:
tags: true
- provider: npm
email: $NPM_AUTH_EMAIL
api_key: $NPM_AUTH_TOKEN
skip_cleanup: true
on:
tags: true

View File

@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2018 Chart.js Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,36 @@
# Maintaining
## Release Process
Chart.js relies on [Travis CI](https://travis-ci.org/) to automate the library [releases](https://github.com/chartjs/Chart.js/releases).
### Releasing a New Version
1. draft release notes on [GitHub](https://github.com/chartjs/Chart.js/releases/new) for the upcoming tag
1. update `master` `package.json` version using [semver](https://semver.org/) semantic
1. merge `master` into the `release` branch
1. follow the build process on [Travis CI](https://travis-ci.org/chartjs/Chart.js)
> **Note:** if `master` is merged in `release` with a `package.json` version that already exists, the tag
creation fails and the release process is aborted.
### Automated Tasks
Merging into the `release` branch kicks off the automated release process:
* build of the `dist/*.js` files
* `bower.json` is generated from `package.json`
* `dist/*.js` and `bower.json` are added to a detached branch
* a tag is created from the `package.json` version
* tag (with dist files) is pushed to GitHub
Creation of this tag triggers a new build:
* `Chart.js.zip` package is generated, containing dist files and examples
* `dist/*.js` and `Chart.js.zip` are attached to the GitHub release (downloads)
* a new npm package is published on [npmjs](https://www.npmjs.com/package/chart.js)
Finally, [cdnjs](https://cdnjs.com/libraries/Chart.js) is automatically updated from the npm release.
### Further Reading
* [Travis GitHub releases](https://github.com/chartjs/Chart.js/pull/2555)
* [Bower support and dist/* files](https://github.com/chartjs/Chart.js/issues/3033)
* [cdnjs npm auto update](https://github.com/cdnjs/cdnjs/pull/8401)

View File

@@ -0,0 +1,32 @@
<p align="center">
<img src="https://www.chartjs.org/media/logo-title.svg"><br/>
Simple yet flexible JavaScript charting for designers & developers
</p>
<p align="center">
<a href="https://www.chartjs.org/docs/latest/getting-started/installation.html"><img src="https://img.shields.io/github/release/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Downloads"></a>
<a href="https://travis-ci.org/chartjs/Chart.js"><img src="https://img.shields.io/travis/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Builds"></a>
<a href="https://coveralls.io/github/chartjs/Chart.js?branch=master"><img src="https://img.shields.io/coveralls/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Coverage"></a>
<a href="https://github.com/chartjs/awesome"><img src="https://awesome.re/badge-flat2.svg" alt="Awesome"></a>
<a href="https://chartjs-slack.herokuapp.com/"><img src="https://img.shields.io/badge/slack-chartjs-blue.svg?style=flat-square&maxAge=3600" alt="Slack"></a>
</p>
## Documentation
- [Introduction](https://www.chartjs.org/docs/latest/)
- [Getting Started](https://www.chartjs.org/docs/latest/getting-started/)
- [General](https://www.chartjs.org/docs/latest/general/)
- [Configuration](https://www.chartjs.org/docs/latest/configuration/)
- [Charts](https://www.chartjs.org/docs/latest/charts/)
- [Axes](https://www.chartjs.org/docs/latest/axes/)
- [Developers](https://www.chartjs.org/docs/latest/developers/)
- [Popular Extensions](https://github.com/chartjs/awesome)
- [Samples](https://www.chartjs.org/samples/)
## Contributing
Instructions on building and testing Chart.js can be found in [the documentation](https://github.com/chartjs/Chart.js/blob/master/docs/developers/contributing.md#building-and-testing). Before submitting an issue or a pull request, please take a moment to look over the [contributing guidelines](https://github.com/chartjs/Chart.js/blob/master/docs/developers/contributing.md) first. For support, please post questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/chartjs) with the `chartjs` tag.
## License
Chart.js is available under the [MIT license](https://opensource.org/licenses/MIT).

View File

@@ -0,0 +1,32 @@
{
"root": "./docs",
"title": "Chart.js documentation",
"author": "chartjs",
"gitbook": "3.2.2",
"plugins": [
"-lunr",
"-search",
"search-plus",
"anchorjs",
"chartjs",
"ga",
"redirect"
],
"pluginsConfig": {
"anchorjs": {
"icon": "#",
"placement": "left",
"visible": "always"
},
"ga": {
"token": "UA-28909194-3",
"configuration": "auto"
},
"theme-default": {
"showLevel": false,
"styles": {
"website": "style.css"
}
}
}
}

View File

@@ -0,0 +1,26 @@
{
"name": "nnnick/chartjs",
"type": "library",
"description": "Simple HTML5 charts using the canvas element.",
"keywords": [
"chart",
"js"
],
"homepage": "https://www.chartjs.org/",
"license": "MIT",
"authors": [
{
"name": "NICK DOWNIE",
"email": "hello@nickdownie.com"
}
],
"require": {
"php": ">=5.3.3"
},
"minimum-stability": "stable",
"extra": {
"branch-alias": {
"release/2.0": "v2.0-dev"
}
}
}

View File

@@ -0,0 +1,172 @@
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var file = require('gulp-file');
var replace = require('gulp-replace');
var size = require('gulp-size');
var streamify = require('gulp-streamify');
var terser = require('gulp-terser');
var zip = require('gulp-zip');
var exec = require('child_process').exec;
var karma = require('karma');
var merge = require('merge-stream');
var yargs = require('yargs');
var path = require('path');
var htmllint = require('gulp-htmllint');
var pkg = require('./package.json');
var argv = yargs
.option('verbose', {default: false})
.argv;
var srcDir = './src/';
var outDir = './dist/';
gulp.task('bower', bowerTask);
gulp.task('build', buildTask);
gulp.task('package', packageTask);
gulp.task('lint-html', lintHtmlTask);
gulp.task('lint-js', lintJsTask);
gulp.task('lint', gulp.parallel('lint-html', 'lint-js'));
gulp.task('docs', docsTask);
gulp.task('unittest', unittestTask);
gulp.task('test', gulp.parallel('lint', 'unittest'));
gulp.task('library-size', librarySizeTask);
gulp.task('module-sizes', moduleSizesTask);
gulp.task('size', gulp.parallel('library-size', 'module-sizes'));
gulp.task('default', gulp.parallel('build'));
function run(bin, args, done) {
return new Promise(function(resolve, reject) {
var exe = '"' + process.execPath + '"';
var src = require.resolve(bin);
var cmd = [exe, src].concat(args || []).join(' ');
var ps = exec(cmd);
ps.stdout.pipe(process.stdout);
ps.stderr.pipe(process.stderr);
ps.on('close', function(error) {
if (error) {
reject(error);
} else {
resolve();
}
});
});
}
/**
* Generates the bower.json manifest file which will be pushed along release tags.
* Specs: https://github.com/bower/spec/blob/master/json.md
*/
function bowerTask() {
var json = JSON.stringify({
name: pkg.name,
description: pkg.description,
homepage: pkg.homepage,
license: pkg.license,
version: pkg.version,
main: outDir + 'Chart.js',
ignore: [
'.github',
'.codeclimate.yml',
'.gitignore',
'.npmignore',
'.travis.yml',
'scripts'
]
}, null, 2);
return file('bower.json', json, { src: true })
.pipe(gulp.dest('./'));
}
function buildTask() {
return run('rollup/dist/bin/rollup', ['-c', argv.watch ? '--watch' : '']);
}
function packageTask() {
return merge(
// gather "regular" files landing in the package root
gulp.src([outDir + '*.js', outDir + '*.css', 'LICENSE.md']),
// since we moved the dist files one folder up (package root), we need to rewrite
// samples src="../dist/ to src="../ and then copy them in the /samples directory.
gulp.src('./samples/**/*', { base: '.' })
.pipe(streamify(replace(/src="((?:\.\.\/)+)dist\//g, 'src="$1')))
)
// finally, create the zip archive
.pipe(zip('Chart.js.zip'))
.pipe(gulp.dest(outDir));
}
function lintJsTask() {
var files = [
'samples/**/*.html',
'samples/**/*.js',
'src/**/*.js',
'test/**/*.js'
];
// NOTE(SB) codeclimate has 'complexity' and 'max-statements' eslint rules way too strict
// compare to what the current codebase can support, and since it's not straightforward
// to fix, let's turn them as warnings and rewrite code later progressively.
var options = {
rules: {
'complexity': [1, 10],
'max-statements': [1, 30]
}
};
return gulp.src(files)
.pipe(eslint(options))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
function lintHtmlTask() {
return gulp.src('samples/**/*.html')
.pipe(htmllint({
failOnError: true,
}));
}
function docsTask() {
var bin = 'gitbook-cli/bin/gitbook.js';
var cmd = argv.watch ? 'serve' : 'build';
return run(bin, ['install', './'])
.then(() => run(bin, [cmd, './', './dist/docs']));
}
function unittestTask(done) {
new karma.Server({
configFile: path.join(__dirname, 'karma.conf.js'),
singleRun: !argv.watch,
args: {
coverage: !!argv.coverage,
inputs: (argv.inputs || 'test/specs/**/*.js').split(';'),
watch: argv.watch
}
},
// https://github.com/karma-runner/gulp-karma/issues/18
function(error) {
error = error ? new Error('Karma returned with the error code: ' + error) : undefined;
done(error);
}).start();
}
function librarySizeTask() {
return gulp.src('dist/Chart.bundle.min.js')
.pipe(size({
gzip: true
}));
}
function moduleSizesTask() {
return gulp.src(srcDir + '**/*.js')
.pipe(terser())
.pipe(size({
showFiles: true,
gzip: true
}));
}

View File

@@ -0,0 +1,108 @@
/* eslint-env es6 */
const commonjs = require('rollup-plugin-commonjs');
const istanbul = require('rollup-plugin-istanbul');
const resolve = require('rollup-plugin-node-resolve');
const builds = require('./rollup.config');
module.exports = function(karma) {
const args = karma.args || {};
// Use the same rollup config as our dist files: when debugging (--watch),
// we will prefer the unminified build which is easier to browse and works
// better with source mapping. In other cases, pick the minified build to
// make sure that the minification process (terser) doesn't break anything.
const regex = args.watch ? /Chart\.js$/ : /Chart\.min\.js$/;
const build = builds.filter(v => v.output.file.match(regex))[0];
if (args.watch) {
build.output.sourcemap = 'inline';
}
karma.set({
frameworks: ['jasmine'],
reporters: ['progress', 'kjhtml'],
browsers: ['chrome', 'firefox'],
logLevel: karma.LOG_WARN,
// Explicitly disable hardware acceleration to make image
// diff more stable when ran on Travis and dev machine.
// https://github.com/chartjs/Chart.js/pull/5629
customLaunchers: {
chrome: {
base: 'Chrome',
flags: [
'--disable-accelerated-2d-canvas'
]
},
firefox: {
base: 'Firefox',
prefs: {
'layers.acceleration.disabled': true
}
}
},
files: [
{pattern: 'test/fixtures/**/*.js', included: false},
{pattern: 'test/fixtures/**/*.json', included: false},
{pattern: 'test/fixtures/**/*.png', included: false},
'node_modules/moment/min/moment.min.js',
'test/index.js',
'src/index.js'
].concat(args.inputs),
preprocessors: {
'test/index.js': ['rollup'],
'src/index.js': ['sources']
},
rollupPreprocessor: {
plugins: [
resolve(),
commonjs()
],
output: {
name: 'test',
format: 'umd'
}
},
customPreprocessors: {
sources: {
base: 'rollup',
options: build
}
},
// These settings deal with browser disconnects. We had seen test flakiness from Firefox
// [Firefox 56.0.0 (Linux 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
// https://github.com/jasmine/jasmine/issues/1327#issuecomment-332939551
browserDisconnectTolerance: 3
});
// https://swizec.com/blog/how-to-run-javascript-tests-in-chrome-on-travis/swizec/6647
if (process.env.TRAVIS) {
karma.customLaunchers.chrome.flags.push('--no-sandbox');
}
if (args.coverage) {
karma.reporters.push('coverage');
karma.coverageReporter = {
dir: 'coverage/',
reporters: [
{type: 'html', subdir: 'html'},
{type: 'lcovonly', subdir: '.'}
]
};
[
karma.rollupPreprocessor,
karma.customPreprocessors.sources.options
].forEach(v => {
(v.plugins || (v.plugins = [])).unshift(
istanbul({
include: 'src/**/*.js'
}));
});
}
};

12752
htdocs/includes/chart/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,69 @@
{
"name": "chart.js",
"homepage": "https://www.chartjs.org",
"description": "Simple HTML5 charts using the canvas element.",
"version": "2.9.3",
"license": "MIT",
"jsdelivr": "dist/Chart.min.js",
"unpkg": "dist/Chart.min.js",
"main": "dist/Chart.js",
"keywords": [
"canvas",
"charts",
"data",
"graphs",
"html5",
"responsive"
],
"repository": {
"type": "git",
"url": "https://github.com/chartjs/Chart.js.git"
},
"bugs": {
"url": "https://github.com/chartjs/Chart.js/issues"
},
"files": [
"bower.json",
"composer.json",
"dist/*.css",
"dist/*.js"
],
"devDependencies": {
"clean-css": "^4.2.1",
"coveralls": "^3.0.0",
"eslint": "^5.9.0",
"eslint-config-chartjs": "^0.1.0",
"eslint-plugin-html": "^5.0.0",
"gitbook-cli": "^2.3.2",
"gulp": "^4.0.0",
"gulp-eslint": "^5.0.0",
"gulp-file": "^0.4.0",
"gulp-htmllint": "^0.0.16",
"gulp-replace": "^1.0.0",
"gulp-size": "^3.0.0",
"gulp-streamify": "^1.0.2",
"gulp-terser": "^1.1.6",
"gulp-zip": "^4.2.0",
"jasmine": "^3.3.0",
"jasmine-core": "^3.3.0",
"karma": "^4.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"karma-rollup-preprocessor": "^7.0.0",
"merge-stream": "^1.0.1",
"pixelmatch": "^4.0.2",
"rollup": "^1.0.0",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-istanbul": "^2.0.1",
"rollup-plugin-node-resolve": "^5.0.0",
"rollup-plugin-terser": "^5.0.0",
"yargs": "^12.0.5"
},
"dependencies": {
"chartjs-color": "^2.1.0",
"moment": "^2.10.2"
}
}

View File

@@ -0,0 +1,119 @@
/* eslint-env es6 */
const commonjs = require('rollup-plugin-commonjs');
const resolve = require('rollup-plugin-node-resolve');
const terser = require('rollup-plugin-terser').terser;
const optional = require('./rollup.plugins').optional;
const stylesheet = require('./rollup.plugins').stylesheet;
const pkg = require('./package.json');
const input = 'src/index.js';
const banner = `/*!
* Chart.js v${pkg.version}
* ${pkg.homepage}
* (c) ${new Date().getFullYear()} Chart.js Contributors
* Released under the MIT License
*/`;
module.exports = [
// UMD builds (excluding moment)
// dist/Chart.min.js
// dist/Chart.js
{
input: input,
plugins: [
resolve(),
commonjs(),
stylesheet({
extract: true
}),
optional({
include: ['moment']
})
],
output: {
name: 'Chart',
file: 'dist/Chart.js',
banner: banner,
format: 'umd',
indent: false,
globals: {
moment: 'moment'
}
},
external: [
'moment'
]
},
{
input: input,
plugins: [
resolve(),
commonjs(),
optional({
include: ['moment']
}),
stylesheet({
extract: true,
minify: true
}),
terser({
output: {
preamble: banner
}
})
],
output: {
name: 'Chart',
file: 'dist/Chart.min.js',
format: 'umd',
indent: false,
globals: {
moment: 'moment'
}
},
external: [
'moment'
]
},
// UMD builds (including moment)
// dist/Chart.bundle.min.js
// dist/Chart.bundle.js
{
input: input,
plugins: [
resolve(),
commonjs(),
stylesheet()
],
output: {
name: 'Chart',
file: 'dist/Chart.bundle.js',
banner: banner,
format: 'umd',
indent: false
}
},
{
input: input,
plugins: [
resolve(),
commonjs(),
stylesheet({
minify: true
}),
terser({
output: {
preamble: banner
}
})
],
output: {
name: 'Chart',
file: 'dist/Chart.bundle.min.js',
format: 'umd',
indent: false
}
}
];

View File

@@ -0,0 +1,110 @@
/* eslint-env es6 */
const cleancss = require('clean-css');
const path = require('path');
const UMD_WRAPPER_RE = /(\(function \(global, factory\) \{)((?:\s.*?)*)(\}\(this,)/;
const CJS_FACTORY_RE = /(module.exports = )(factory\(.*?\))( :)/;
const AMD_FACTORY_RE = /(define\()(.*?, factory)(\) :)/;
function optional(config = {}) {
return {
name: 'optional',
renderChunk(code, chunk, options) {
if (options.format !== 'umd') {
this.error('only UMD format is currently supported');
}
const wrapper = UMD_WRAPPER_RE.exec(code);
const include = config.include;
if (!wrapper) {
this.error('failed to parse the UMD wrapper');
}
let content = wrapper[2];
let factory = (CJS_FACTORY_RE.exec(content) || [])[2];
let updated = false;
for (let lib of chunk.imports) {
if (!include || include.indexOf(lib) !== -1) {
const regex = new RegExp(`require\\('${lib}'\\)`);
if (!regex.test(factory)) {
this.error(`failed to parse the CJS require for ${lib}`);
}
// We need to write inline try / catch with explicit require
// in order to enable statical extraction of dependencies:
// try { return require('moment'); } catch(e) {}
const loader = `function() { try { return require('${lib}'); } catch(e) { } }()`;
factory = factory.replace(regex, loader);
updated = true;
}
}
if (!updated) {
return;
}
// Replace the CJS factory by our updated one.
content = content.replace(CJS_FACTORY_RE, `$1${factory}$3`);
// Replace the AMD factory by our updated one: we need to use the
// following AMD form in order to be able to try/catch require:
// define(['require'], function(require) { ... require(...); ... })
// https://github.com/amdjs/amdjs-api/wiki/AMD#using-require-and-exports
content = content.replace(AMD_FACTORY_RE, `$1['require'], function(require) { return ${factory}; }$3`);
return code.replace(UMD_WRAPPER_RE, `$1${content}$3`);
}
};
}
// https://github.com/chartjs/Chart.js/issues/5208
function stylesheet(config = {}) {
const minifier = new cleancss();
const styles = [];
return {
name: 'stylesheet',
transform(code, id) {
// Note that 'id' can be mapped to a CJS proxy import, in which case
// 'id' will start with 'commonjs-proxy', so let's first check if we
// are importing an existing css file (i.e. startsWith()).
if (!id.startsWith(path.resolve('.')) || !id.endsWith('.css')) {
return;
}
if (config.minify) {
code = minifier.minify(code).styles;
}
// keep track of all imported stylesheets (already minified)
styles.push(code);
return {
code: 'export default ' + JSON.stringify(code)
};
},
generateBundle(opts, bundle) {
if (!config.extract) {
return;
}
const entry = Object.keys(bundle).find(v => bundle[v].isEntry);
const name = (entry || '').replace(/\.js$/i, '.css');
if (!name) {
this.error('failed to guess the output file name');
}
this.emitFile({
type: 'asset',
source: styles.filter(v => !!v).join(''),
fileName: name
});
}
};
}
module.exports = {
optional,
stylesheet
};

View File

@@ -257,6 +257,7 @@ InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on p
ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). Note: To generate invoice, go on tab 'Time spent' of the project and select lines to include.
ProjectFollowOpportunity=Follow opportunity
ProjectFollowTasks=Follow tasks
Usage=Usage
UsageOpportunity=Usage: Opportunity
UsageTasks=Usage: Tasks
UsageBillTimeShort=Usage: Bill time

View File

@@ -1382,6 +1382,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
}
// Flot
if (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'jflot')
{
if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT'))
{
if (constant('JS_JQUERY_FLOT'))
@@ -1408,6 +1410,13 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
*/
}
}
}
// Chart
if ($conf->global->MAIN_JS_GRAPH == 'chart')
{
print '<script src="'.DOL_URL_ROOT.'/includes/chart/dist/Chart.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
}
// jQuery jeditable
if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE'))
{

View File

@@ -104,8 +104,7 @@ if ($conf->use_javascript_ajax)
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->SetHeight(180);
$dolgraph->SetHeight(200);
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($totalnb?0:1);

View File

@@ -148,8 +148,8 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us
{
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
print '<tr><td class="center" colspan="2">';
print '<tr class="liste_titre"><th>'.$langs->trans("Statistics").'</th></tr>';
print '<tr><td class="center nopaddingleftimp nopaddingrightimp">';
$SommeA = $prodser[0]['sell'];
$SommeB = $prodser[0]['buy'];
@@ -183,7 +183,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(0);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total ? 0 : 1);

View File

@@ -19,7 +19,7 @@
/**
* \file htdocs/projet/contact.php
* \ingroup project
* \brief Onglet de gestion des contacts du projet
* \brief List of all contacts of a project
*/
require '../main.inc.php';
@@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.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';
if ($conf->categorie->enabled) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; }
// Load translation files required by the page
$langs->loadLangs(array('projects', 'companies'));

View File

@@ -75,7 +75,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
}
if ($conf->use_javascript_ajax)
{
print '<tr><td class="center" colspan="2">';
print '<tr><td class="center nopaddingleftimp nopaddingrightimp" colspan="2">';
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
@@ -83,8 +83,8 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->SetHeight(180);
//$dolgraph->setWidth('100%');
$dolgraph->SetHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($totaloppnb ? 0 : 1);

View File

@@ -115,7 +115,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphthirdparties');
print $dolgraph->show();
print '</td></tr>'."\n";

View File

@@ -147,7 +147,7 @@ if ($resql)
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->setHeight('200');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total ? 0 : 1);

View File

@@ -2347,7 +2347,8 @@ input.vmenusearchselectcombo[type=text] {
.searchform input { font-size: 16px; }
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu, span.vsmenu { white-space: nowrap; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; } /* bold = 600, 500 is ko with Edge on 1200x960 */
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu, span.vsmenu { white-space: nowrap; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; }
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-weight: bold; } /* bold = 600, 500 is ko with Edge on 1200x960 */
font.vmenudisabled { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; } /* bold = 600, 500 is ko with Edge on 1200x960 */
a.vmenu:link, a.vmenu:visited { color: var(--colortextbackvmenu); }
@@ -3403,7 +3404,7 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft
background: -o-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%);
background: -moz-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%);
background: -webkit-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%);
background: -ms-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%);
/* background: -ms-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); */
}
.noborder > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre),
.noborder .oddeven.tagtr:nth-child(even):not(:last-child) .tagtd:not(.liste_titre)
@@ -3419,7 +3420,7 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft
background: -o-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%);
background: -moz-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%);
background: -webkit-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%);
background: -ms-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%);
/* background: -ms-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); */
}
.noborder > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre),
.noborder .oddeven.tagtr:nth-child(odd):not(:last-child) .tagtd:not(.liste_titre)
@@ -3777,6 +3778,7 @@ span.widthpictotitle { font-size: 2.1em; };
.dolgraphtitle { margin-top: 6px; margin-bottom: 4px; }
.dolgraphtitlecssboxes { /* margin: 0px; */ }
.dolgraphchart canvas { width: calc(100% - 20px) !important; }
.legendColorBox, .legendLabel { border: none !important; }
div.dolgraph div.legend, div.dolgraph div.legend div { background-color: var(--dolgraphbg) !important; }
div.dolgraph div.legend table tbody tr { height: auto; }

View File

@@ -67,7 +67,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover
$colorbacklinepairchecked = '230,237,244'; // line checked
$colorbacklinebreak = '233,228,230'; // line break
$colorbackbody = '255,255,255';
$colortexttitlenotab = '90,50,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b
$colortexttitlenotab = '0,113,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120
$colortexttitle = '0,0,0';
$colortext = '0,0,0';
$colortextlink = '10, 20, 100';

View File

@@ -3771,6 +3771,7 @@ div.boximport {
.dolgraphtitle { margin-top: 6px; margin-bottom: 4px; }
.dolgraphtitlecssboxes { /* margin: 0px; */ }
.dolgraphchart canvas { width: calc(100% - 20px) !important; }
.legendColorBox, .legendLabel { border: none !important; }
div.dolgraph div.legend, div.dolgraph div.legend div { background-color: rgba(255,255,255,0) !important; }
div.dolgraph div.legend table tbody tr { height: auto; }

View File

@@ -110,7 +110,7 @@ if (empty($endyear)) {
$startyear = $endyear - 1;
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '100%' : '80%';
$HEIGHT = '228';
$HEIGHT = '200';
print '<div class="fichecenter"><div class="fichethirdleft">';
@@ -242,7 +242,7 @@ if (!empty($dataseries) && count($dataseries) > 1) {
$px1->SetType(array('pie'));
$px1->SetLegend($legend);
$px1->SetMaxValue($px1->GetCeilMaxValue());
$px1->SetWidth($WIDTH);
//$px1->SetWidth($WIDTH);
$px1->SetHeight($HEIGHT);
$px1->SetYLabel($langs->trans("TicketStatByStatus"));
$px1->SetShading(3);
@@ -327,7 +327,7 @@ if ($result) {
print '<tr class="oddeven">';
// Ref
print '<td class="nowrap">';
print '<td class="nowraponall">';
print $tickesupstatic->getNomUrl(1);
print "</td>\n";
@@ -356,7 +356,7 @@ if ($result) {
print $objp->severity_label;
print "</td>";
print '<td class="nowrap right">';
print '<td class="nowraponall right">';
print $tickesupstatic->getLibStatut(5);
print "</td>";