Fix: Pb with cache files for graphical boxes:
Missing year into cache id. User with restrcited permission on thirdparty must not share same cache files that "see all" users.
This commit is contained in:
parent
40a53d4b57
commit
9aaafde6d5
@ -196,8 +196,8 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print '<td class="liste_titre" width="1%"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,12 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
'target'=>'none' // Set '' to get target="_blank"
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$dir=''; // We don't need a path because image file will not be saved into disk
|
||||||
|
$prefix='';
|
||||||
|
$socid=0;
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
||||||
|
|
||||||
if ($user->rights->facture->lire)
|
if ($user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||||
@ -119,9 +125,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/invoicesnbinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px1 = new DolGraph();
|
$px1 = new DolGraph();
|
||||||
$mesg = $px1->isGraphKo();
|
$mesg = $px1->isGraphKo();
|
||||||
@ -157,9 +163,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/invoicesamountinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px2 = new DolGraph();
|
$px2 = new DolGraph();
|
||||||
$mesg = $px2->isGraphKo();
|
$mesg = $px2->isGraphKo();
|
||||||
|
|||||||
@ -80,6 +80,12 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
'target'=>'none' // Set '' to get target="_blank"
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$dir=''; // We don't need a path because image file will not be saved into disk
|
||||||
|
$prefix='';
|
||||||
|
$socid=0;
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->lire)
|
if ($user->rights->fournisseur->facture->lire)
|
||||||
{
|
{
|
||||||
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||||
@ -118,7 +124,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/invoicessuppliernbinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png';
|
||||||
|
|
||||||
@ -156,7 +162,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/invoicessupplieramountinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png';
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,12 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
'target'=>'none' // Set '' to get target="_blank"
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$dir=''; // We don't need a path because image file will not be saved into disk
|
||||||
|
$prefix='';
|
||||||
|
$socid=0;
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
||||||
|
|
||||||
if ($user->rights->commande->lire)
|
if ($user->rights->commande->lire)
|
||||||
{
|
{
|
||||||
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||||
@ -119,9 +125,9 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/ordersnbinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px1 = new DolGraph();
|
$px1 = new DolGraph();
|
||||||
$mesg = $px1->isGraphKo();
|
$mesg = $px1->isGraphKo();
|
||||||
@ -157,9 +163,9 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/ordersamountinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px2 = new DolGraph();
|
$px2 = new DolGraph();
|
||||||
$mesg = $px2->isGraphKo();
|
$mesg = $px2->isGraphKo();
|
||||||
|
|||||||
@ -80,6 +80,12 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
'target'=>'none' // Set '' to get target="_blank"
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$dir=''; // We don't need a path because image file will not be saved into disk
|
||||||
|
$prefix='';
|
||||||
|
$socid=0;
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->lire)
|
if ($user->rights->fournisseur->commande->lire)
|
||||||
{
|
{
|
||||||
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||||
@ -118,9 +124,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/orderssuppliernbinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px1 = new DolGraph();
|
$px1 = new DolGraph();
|
||||||
$mesg = $px1->isGraphKo();
|
$mesg = $px1->isGraphKo();
|
||||||
@ -156,9 +162,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||||
|
|
||||||
$filenamenb = $dir."/orderssupplieramountinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px2 = new DolGraph();
|
$px2 = new DolGraph();
|
||||||
$mesg = $px2->isGraphKo();
|
$mesg = $px2->isGraphKo();
|
||||||
|
|||||||
@ -81,6 +81,12 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
'target'=>'none' // Set '' to get target="_blank"
|
'target'=>'none' // Set '' to get target="_blank"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$dir=''; // We don't need a path because image file will not be saved into disk
|
||||||
|
$prefix='';
|
||||||
|
$socid=0;
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
||||||
|
|
||||||
if ($user->rights->propal->lire)
|
if ($user->rights->propal->lire)
|
||||||
{
|
{
|
||||||
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||||
@ -120,9 +126,9 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
$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');
|
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||||
|
|
||||||
$filenamenb = $dir."/propalsnbinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".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-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsnbinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsnbinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px1 = new DolGraph();
|
$px1 = new DolGraph();
|
||||||
$mesg = $px1->isGraphKo();
|
$mesg = $px1->isGraphKo();
|
||||||
@ -161,9 +167,9 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
$datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
$datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||||
//$datatype2 = array('lines','bars');
|
//$datatype2 = array('lines','bars');
|
||||||
|
|
||||||
$filenamenb = $dir."/propalsamountinyear-".$year.".png";
|
$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".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-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png';
|
||||||
|
|
||||||
$px2 = new DolGraph();
|
$px2 = new DolGraph();
|
||||||
$mesg = $px2->isGraphKo();
|
$mesg = $px2->isGraphKo();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user