Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Jan 16, 2020
2 parents c556f60 + 924fd4a commit 908a012
Show file tree
Hide file tree
Showing 9 changed files with 434 additions and 434 deletions.
8 changes: 4 additions & 4 deletions htdocs/admin/company.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,17 @@

// Name
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
print '<input name="nom" id="name" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom", 'nohtml')) . '"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";

// Address
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml')) . '</textarea></td></tr>'."\n";
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.($conf->global->MAIN_INFO_SOCIETE_ADDRESS ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS : GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml')).'</textarea></td></tr>'."\n";

print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha')) . '"></td></tr>'."\n";
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP ? $conf->global->MAIN_INFO_SOCIETE_ZIP : GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha')).'"></td></tr>'."\n";

print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml')) . '"></td></tr>'."\n";
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN ? $conf->global->MAIN_INFO_SOCIETE_TOWN : GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml')).'"></td></tr>'."\n";

// Country
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
Expand Down
70 changes: 35 additions & 35 deletions htdocs/core/class/dolgraph.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -898,90 +898,90 @@ private function draw_jflot($file, $fileurl)
return;
}

$legends=array();
$nblot=0;
$legends = array();
$nblot = 0;
if (is_array($this->data) && is_array($this->data[0])) {
$nblot=count($this->data[0])-1; // -1 to remove legend
$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;
$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();
$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]="var d".$i." = [];\n";
$values = array(); // Array with horizontal y values (specific values of a serie) for each abscisse x
$serie[$i] = "var d".$i." = [];\n";

// Fill array $values
$x=0;
foreach($this->data as $valarray) // Loop on each x
$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);
$values[$x] = (is_numeric($valarray[$i + 1]) ? $valarray[$i + 1] : null);
$x++;
}

// TODO Avoid push by adding generated long array...
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie')
{
foreach($values as $x => $y) {
if (isset($y)) $serie[$i].='d'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n";
foreach ($values as $x => $y) {
if (isset($y)) $serie[$i] .= 'd'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n";
}
}
else
{
foreach($values as $x => $y) {
if (isset($y)) $serie[$i].='d'.$i.'.push(['.$x.', '.$y.']);'."\n";
foreach ($values as $x => $y) {
if (isset($y)) $serie[$i] .= 'd'.$i.'.push(['.$x.', '.$y.']);'."\n";
}
}

unset($values);
$i++;
}
$tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-','.'))));
$tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));

$this->stringtoshow ='<!-- Build using '.$this->_library.' -->'."\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 = '<!-- Build using '.$this->_library.' -->'."\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.'px;height:'.$this->height.'px;" class="nographyet"></div>';
$this->stringtoshow.='<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
$this->stringtoshow .= '<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>';
$this->stringtoshow .= '<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
return;
}
$this->stringtoshow.='<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix)?'':' dolgraph'.$this->cssprefix).' center"></div>'."\n";
$this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center"></div>'."\n";

$this->stringtoshow.='<script id="'.$tag.'">'."\n";
$this->stringtoshow.='$(function () {'."\n";
$i=$firstlot;
$this->stringtoshow .= '<script id="'.$tag.'">'."\n";
$this->stringtoshow .= '$(function () {'."\n";
$i = $firstlot;
if ($nblot < 0)
{
$this->stringtoshow.='<!-- No series of data -->';
$this->stringtoshow .= '<!-- No series of data -->';
}
else
{
while ($i < $nblot)
{
$this->stringtoshow.=$serie[$i];
$this->stringtoshow .= $serie[$i];
$i++;
}
}
$this->stringtoshow.="\n";
$this->stringtoshow .= "\n";

// Special case for Graph of type 'pie'
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie')
{
$datacolor=array();
foreach($this->datacolor as $val) $datacolor[]="#".sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]);
$datacolor = array();
foreach ($this->datacolor as $val) $datacolor[] = "#".sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]);

$urltemp=''; // TODO Add support for url link into labels
$showlegend=$this->showlegend;
$showpointvalue=$this->showpointvalue;
$showpercent=$this->showpercent;
$urltemp = ''; // TODO Add support for url link into labels
$showlegend = $this->showlegend;
$showpointvalue = $this->showpointvalue;
$showpercent = $this->showpercent;

$this->stringtoshow.= '
$this->stringtoshow .= '
function plotWithOptions_'.$tag.'() {
$.plot($("#placeholder_'.$tag.'"), d0,
{
Expand Down
Loading

0 comments on commit 908a012

Please sign in to comment.