New: Enhance graphical boxes. Prepare to show filters form to modify
graph.
This commit is contained in:
parent
a386179f47
commit
99e5bf3120
@ -74,10 +74,10 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit'=> dol_strlen($text),
|
'limit'=> dol_strlen($text),
|
||||||
'graph'=> 1,
|
'graph'=> 1,
|
||||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
'sublink'=>'',
|
||||||
'subtext'=>$langs->trans("Refresh"),
|
'subtext'=>$langs->trans("Filter"),
|
||||||
'subpicto'=>'refresh.png',
|
'subpicto'=>'filter.png',
|
||||||
'target'=>'none'
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->facture->lire)
|
if ($user->rights->facture->lire)
|
||||||
@ -88,11 +88,11 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
$shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB));
|
$shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB));
|
||||||
$showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT));
|
$showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT));
|
||||||
$nowarray=dol_getdate(dol_now(),true);
|
$nowarray=dol_getdate(dol_now(),true);
|
||||||
$endyear=$nowarray['year'];
|
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||||
$startyear=$endyear-1;
|
$startyear=$endyear-1;
|
||||||
$mode='customer';
|
$mode='customer';
|
||||||
$userid=0;
|
$userid=0;
|
||||||
$WIDTH='256';
|
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||||
$HEIGHT='192';
|
$HEIGHT='192';
|
||||||
|
|
||||||
$stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
$stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||||
@ -175,9 +175,23 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
|
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
|
$stringtoshow='';
|
||||||
|
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||||
|
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||||
|
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||||
|
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||||
|
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||||
|
$stringtoshow.='</a>';
|
||||||
|
$stringtoshow.='</div>';
|
||||||
if ($shownb && $showtot)
|
if ($shownb && $showtot)
|
||||||
{
|
{
|
||||||
$stringtoshow ='<div class="fichecenter">';
|
$stringtoshow.='<div class="fichecenter">';
|
||||||
$stringtoshow.='<div class="fichehalfleft">';
|
$stringtoshow.='<div class="fichehalfleft">';
|
||||||
}
|
}
|
||||||
if ($shownb) $stringtoshow.=$px1->show();
|
if ($shownb) $stringtoshow.=$px1->show();
|
||||||
|
|||||||
@ -73,10 +73,10 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit'=> dol_strlen($text),
|
'limit'=> dol_strlen($text),
|
||||||
'graph'=> 1,
|
'graph'=> 1,
|
||||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
'sublink'=>'',
|
||||||
'subtext'=>$langs->trans("Refresh"),
|
'subtext'=>$langs->trans("Filter"),
|
||||||
'subpicto'=>'refresh.png',
|
'subpicto'=>'filter.png',
|
||||||
'target'=>'none'
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->lire)
|
if ($user->rights->fournisseur->facture->lire)
|
||||||
@ -87,11 +87,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
$shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB));
|
$shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB));
|
||||||
$showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT));
|
$showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT));
|
||||||
$nowarray=dol_getdate(dol_now(),true);
|
$nowarray=dol_getdate(dol_now(),true);
|
||||||
$endyear=$nowarray['year'];
|
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||||
$startyear=$endyear-1;
|
$startyear=$endyear-1;
|
||||||
$mode='supplier';
|
$mode='supplier';
|
||||||
$userid=0;
|
$userid=0;
|
||||||
$WIDTH='256';
|
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||||
$HEIGHT='192';
|
$HEIGHT='192';
|
||||||
|
|
||||||
$stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
$stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||||
@ -174,9 +174,23 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
|
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
|
$stringtoshow='';
|
||||||
|
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||||
|
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||||
|
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||||
|
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||||
|
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||||
|
$stringtoshow.='</a>';
|
||||||
|
$stringtoshow.='</div>';
|
||||||
if ($shownb && $showtot)
|
if ($shownb && $showtot)
|
||||||
{
|
{
|
||||||
$stringtoshow ='<div class="fichecenter">';
|
$stringtoshow.='<div class="fichecenter">';
|
||||||
$stringtoshow.='<div class="fichehalfleft">';
|
$stringtoshow.='<div class="fichehalfleft">';
|
||||||
}
|
}
|
||||||
if ($shownb) $stringtoshow.=$px1->show();
|
if ($shownb) $stringtoshow.=$px1->show();
|
||||||
|
|||||||
@ -74,10 +74,10 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit'=> dol_strlen($text),
|
'limit'=> dol_strlen($text),
|
||||||
'graph'=> 1,
|
'graph'=> 1,
|
||||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
'sublink'=>'',
|
||||||
'subtext'=>$langs->trans("Refresh"),
|
'subtext'=>$langs->trans("Filter"),
|
||||||
'subpicto'=>'refresh.png',
|
'subpicto'=>'filter.png',
|
||||||
'target'=>'none'
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->commande->lire)
|
if ($user->rights->commande->lire)
|
||||||
@ -88,11 +88,11 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
$shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB));
|
$shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB));
|
||||||
$showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT));
|
$showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT));
|
||||||
$nowarray=dol_getdate(dol_now(),true);
|
$nowarray=dol_getdate(dol_now(),true);
|
||||||
$endyear=$nowarray['year'];
|
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||||
$startyear=$endyear-1;
|
$startyear=$endyear-1;
|
||||||
$mode='customer';
|
$mode='customer';
|
||||||
$userid=0;
|
$userid=0;
|
||||||
$WIDTH='256';
|
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||||
$HEIGHT='192';
|
$HEIGHT='192';
|
||||||
|
|
||||||
$stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
$stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||||
@ -175,9 +175,23 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
|
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
|
$stringtoshow='';
|
||||||
|
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||||
|
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||||
|
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||||
|
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||||
|
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||||
|
$stringtoshow.='</a>';
|
||||||
|
$stringtoshow.='</div>';
|
||||||
if ($shownb && $showtot)
|
if ($shownb && $showtot)
|
||||||
{
|
{
|
||||||
$stringtoshow ='<div class="fichecenter">';
|
$stringtoshow.='<div class="fichecenter">';
|
||||||
$stringtoshow.='<div class="fichehalfleft">';
|
$stringtoshow.='<div class="fichehalfleft">';
|
||||||
}
|
}
|
||||||
if ($shownb) $stringtoshow.=$px1->show();
|
if ($shownb) $stringtoshow.=$px1->show();
|
||||||
|
|||||||
@ -73,10 +73,10 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit'=> dol_strlen($text),
|
'limit'=> dol_strlen($text),
|
||||||
'graph'=> 1,
|
'graph'=> 1,
|
||||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
'sublink'=>'',
|
||||||
'subtext'=>$langs->trans("Refresh"),
|
'subtext'=>$langs->trans("Filter"),
|
||||||
'subpicto'=>'refresh.png',
|
'subpicto'=>'filter.png',
|
||||||
'target'=>'none'
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->lire)
|
if ($user->rights->fournisseur->commande->lire)
|
||||||
@ -87,11 +87,11 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
$shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB));
|
$shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB));
|
||||||
$showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT));
|
$showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT));
|
||||||
$nowarray=dol_getdate(dol_now(),true);
|
$nowarray=dol_getdate(dol_now(),true);
|
||||||
$endyear=$nowarray['year'];
|
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||||
$startyear=$endyear-1;
|
$startyear=$endyear-1;
|
||||||
$mode='supplier';
|
$mode='supplier';
|
||||||
$userid=0;
|
$userid=0;
|
||||||
$WIDTH='256';
|
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||||
$HEIGHT='192';
|
$HEIGHT='192';
|
||||||
|
|
||||||
$stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
$stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||||
@ -174,9 +174,23 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
|
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
|
$stringtoshow='';
|
||||||
|
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||||
|
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||||
|
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||||
|
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||||
|
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||||
|
$stringtoshow.='</a>';
|
||||||
|
$stringtoshow.='</div>';
|
||||||
if ($shownb && $showtot)
|
if ($shownb && $showtot)
|
||||||
{
|
{
|
||||||
$stringtoshow ='<div class="fichecenter">';
|
$stringtoshow.='<div class="fichecenter">';
|
||||||
$stringtoshow.='<div class="fichehalfleft">';
|
$stringtoshow.='<div class="fichehalfleft">';
|
||||||
}
|
}
|
||||||
if ($shownb) $stringtoshow.=$px1->show();
|
if ($shownb) $stringtoshow.=$px1->show();
|
||||||
|
|||||||
@ -74,10 +74,10 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit'=> dol_strlen($text),
|
'limit'=> dol_strlen($text),
|
||||||
'graph'=> 1,
|
'graph'=> 1,
|
||||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
'sublink'=>'',
|
||||||
'subtext'=>$langs->trans("Refresh"),
|
'subtext'=>$langs->trans("Filter"),
|
||||||
'subpicto'=>'refresh.png',
|
'subpicto'=>'filter.png',
|
||||||
'target'=>'none'
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->commande->lire)
|
if ($user->rights->commande->lire)
|
||||||
@ -88,11 +88,11 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
$shownb=(! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_NB));
|
$shownb=(! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_NB));
|
||||||
$showtot=(! isset($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT));
|
$showtot=(! isset($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT));
|
||||||
$nowarray=dol_getdate(dol_now(),true);
|
$nowarray=dol_getdate(dol_now(),true);
|
||||||
$endyear=$nowarray['year'];
|
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||||
$startyear=$endyear-1;
|
$startyear=$endyear-1;
|
||||||
$mode='customer';
|
$mode='customer';
|
||||||
$userid=0;
|
$userid=0;
|
||||||
$WIDTH='256';
|
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||||
$HEIGHT='192';
|
$HEIGHT='192';
|
||||||
|
|
||||||
$stats = new PropaleStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
$stats = new PropaleStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||||
@ -101,6 +101,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
if ($shownb)
|
if ($shownb)
|
||||||
{
|
{
|
||||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||||
|
|
||||||
$filenamenb = $dir."/propalsnbinyear-".$year.".png";
|
$filenamenb = $dir."/propalsnbinyear-".$year.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsnbinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsnbinyear-'.$year.'.png';
|
||||||
@ -110,6 +111,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
$mesg = $px1->isGraphKo();
|
$mesg = $px1->isGraphKo();
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
|
$px1->SetType($datatype1);
|
||||||
$px1->SetData($data1);
|
$px1->SetData($data1);
|
||||||
unset($data1);
|
unset($data1);
|
||||||
$px1->SetPrecisionY(0);
|
$px1->SetPrecisionY(0);
|
||||||
@ -139,6 +141,8 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
if ($showtot)
|
if ($showtot)
|
||||||
{
|
{
|
||||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
$datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||||
|
//$datatype2 = array('lines','bars');
|
||||||
|
|
||||||
$filenamenb = $dir."/propalsamountinyear-".$year.".png";
|
$filenamenb = $dir."/propalsamountinyear-".$year.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$year.'.png';
|
||||||
@ -148,6 +152,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
$mesg = $px2->isGraphKo();
|
$mesg = $px2->isGraphKo();
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
|
$px2->SetType($datatype2);
|
||||||
$px2->SetData($data2);
|
$px2->SetData($data2);
|
||||||
unset($data2);
|
unset($data2);
|
||||||
$px2->SetPrecisionY(0);
|
$px2->SetPrecisionY(0);
|
||||||
@ -175,9 +180,23 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
|
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
|
$stringtoshow='';
|
||||||
|
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||||
|
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||||
|
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||||
|
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||||
|
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||||
|
$stringtoshow.='</a>';
|
||||||
|
$stringtoshow.='</div>';
|
||||||
if ($shownb && $showtot)
|
if ($shownb && $showtot)
|
||||||
{
|
{
|
||||||
$stringtoshow ='<div class="fichecenter">';
|
$stringtoshow.='<div class="fichecenter">';
|
||||||
$stringtoshow.='<div class="fichehalfleft">';
|
$stringtoshow.='<div class="fichehalfleft">';
|
||||||
}
|
}
|
||||||
if ($shownb) $stringtoshow.=$px1->show();
|
if ($shownb) $stringtoshow.=$px1->show();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -135,13 +135,13 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
|||||||
print "\n\n<!-- Box start -->\n";
|
print "\n\n<!-- Box start -->\n";
|
||||||
print '<div class="box" id="boxto_'.$this->box_id.'">'."\n";
|
print '<div class="box" id="boxto_'.$this->box_id.'">'."\n";
|
||||||
|
|
||||||
if (! empty($head['text']) || ! empty($head['sublink']) || $nblines)
|
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||||
{
|
{
|
||||||
print '<table summary="boxtable'.$this->box_id.'" width="100%" class="noborder boxtable">'."\n";
|
print '<table summary="boxtable'.$this->box_id.'" width="100%" class="noborder boxtable">'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show box title
|
// Show box title
|
||||||
if (! empty($head['text']) || ! empty($head['sublink']))
|
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']))
|
||||||
{
|
{
|
||||||
//print '<div id="boxto_'.$this->box_id.'_title">'."\n";
|
//print '<div id="boxto_'.$this->box_id.'_title">'."\n";
|
||||||
//print '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
|
//print '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
|
||||||
@ -158,10 +158,10 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
|||||||
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
|
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
|
||||||
print $s;
|
print $s;
|
||||||
}
|
}
|
||||||
if (! empty($head['sublink']))
|
print ' ';
|
||||||
{
|
if (! empty($head['sublink'])) print '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
|
||||||
print ' <a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>'.img_picto($head['subtext'],$head['subpicto']).'</a>';
|
if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="" id="idsubimg'.$this->boxcode.'"');
|
||||||
}
|
if (! empty($head['sublink'])) '</a>';
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '</td><td class="nocellnopadd boxclose nowrap">';
|
print '</td><td class="nocellnopadd boxclose nowrap">';
|
||||||
@ -175,8 +175,8 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
// print "</table>\n";
|
//print "</table>\n";
|
||||||
// print "</div>\n";
|
//print "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show box lines
|
// Show box lines
|
||||||
@ -251,13 +251,13 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($head['text']) || ! empty($head['sublink']) || $nblines)
|
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||||
{
|
{
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If invisible box with no contents
|
// If invisible box with no contents
|
||||||
if (empty($head['text']) && empty($head['sublink']) && ! $nblines) print "<br>\n";
|
if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && ! $nblines) print "<br>\n";
|
||||||
|
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
print "<!-- Box end -->\n\n";
|
print "<!-- Box end -->\n\n";
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
class DolGraph
|
class DolGraph
|
||||||
{
|
{
|
||||||
//! Type of graph
|
//! Type of graph
|
||||||
var $type=array('bars'); // bars, lines, ...
|
var $type=array(); // Array with type of each series. Example: array('bars', 'lines', ...)
|
||||||
var $mode='side'; // Mode bars graph: side, depth
|
var $mode='side'; // Mode bars graph: side, depth
|
||||||
private $_library='jflot'; // Graphic library to use (jflot, artichow)
|
private $_library='jflot'; // Graphic library to use (jflot, artichow)
|
||||||
|
|
||||||
@ -578,8 +578,9 @@ class DolGraph
|
|||||||
|
|
||||||
// Create graph
|
// Create graph
|
||||||
$classname='';
|
$classname='';
|
||||||
if ($this->type[0] == 'bars') $classname='BarPlot'; // Only first type of type is supported by artichow
|
if (! isset($this->type[0]) || $this->type[0] == 'bars') $classname='BarPlot'; // Only one type (first one) is supported by artichow
|
||||||
if ($this->type[0] == 'lines') $classname='LinePlot';
|
else if ($this->type[0] == 'lines') $classname='LinePlot';
|
||||||
|
else $classname='TypeUnknown';
|
||||||
include_once ARTICHOW_PATH.$classname.'.class.php';
|
include_once ARTICHOW_PATH.$classname.'.class.php';
|
||||||
|
|
||||||
// Definition de couleurs
|
// Definition de couleurs
|
||||||
|
|||||||
@ -184,14 +184,14 @@ abstract class Stats
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
// $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...)
|
||||||
for ($i = 0 ; $i < 12 ; $i++)
|
for ($i = 0 ; $i < 12 ; $i++)
|
||||||
{
|
{
|
||||||
$data[$i][]=$datay[$endyear][$i][0];
|
$data[$i][]=$datay[$endyear][$i][0]; // set label
|
||||||
$year=$startyear;
|
$year=$startyear;
|
||||||
while($year <= $endyear)
|
while($year <= $endyear)
|
||||||
{
|
{
|
||||||
$data[$i][]=$datay[$year][$i][1];
|
$data[$i][]=$datay[$year][$i][1]; // set yval for x=i
|
||||||
$year++;
|
$year++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user