Mutualize code to show files generated for mass actions
This commit is contained in:
parent
54bd355800
commit
6938b05219
@ -530,11 +530,7 @@ if ($resql)
|
|||||||
$genallowed=$user->rights->facture->lire;
|
$genallowed=$user->rights->facture->lire;
|
||||||
$delallowed=$user->rights->facture->lire;
|
$delallowed=$user->rights->facture->lire;
|
||||||
|
|
||||||
print '<br><a name="show_files"></a>';
|
print $formfile->showdocuments('massfilesarea_mymodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
|
||||||
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1016,11 +1016,7 @@ if ($resql)
|
|||||||
$genallowed=$user->rights->propal->lire;
|
$genallowed=$user->rights->propal->lire;
|
||||||
$delallowed=$user->rights->propal->lire;
|
$delallowed=$user->rights->propal->lire;
|
||||||
|
|
||||||
print '<br><a name="show_files"></a>';
|
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
|
||||||
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
|
||||||
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1438,10 +1438,6 @@ if ($resql)
|
|||||||
$genallowed=$user->rights->commande->lire;
|
$genallowed=$user->rights->commande->lire;
|
||||||
$delallowed=$user->rights->commande->lire;
|
$delallowed=$user->rights->commande->lire;
|
||||||
|
|
||||||
print '<br><a name="show_files"></a>';
|
|
||||||
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
|
||||||
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1155,10 +1155,6 @@ if ($resql)
|
|||||||
$genallowed=$user->rights->facture->lire;
|
$genallowed=$user->rights->facture->lire;
|
||||||
$delallowed=$user->rights->facture->lire;
|
$delallowed=$user->rights->facture->lire;
|
||||||
|
|
||||||
print '<br><a name="show_files"></a>';
|
|
||||||
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
|
||||||
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -305,12 +305,37 @@ class FormFile
|
|||||||
$showempty=0;
|
$showempty=0;
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
$titletoshow=$langs->trans("Documents");
|
|
||||||
if (! empty($title)) $titletoshow=$title;
|
|
||||||
|
|
||||||
$out.= "\n".'<!-- Start show_document -->'."\n";
|
$out.= "\n".'<!-- Start show_document -->'."\n";
|
||||||
//print 'filedir='.$filedir;
|
//print 'filedir='.$filedir;
|
||||||
|
|
||||||
|
if (preg_match('/massfilesarea_/', $modulepart))
|
||||||
|
{
|
||||||
|
$out.='<br><a name="show_files"></a>';
|
||||||
|
$title=$langs->trans("MassFilesArea").' <a href="" id="togglemassfilesarea" ref="shown">('.$langs->trans("Hide").')</a>';
|
||||||
|
$title.='<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery(\'#togglemassfilesarea\').click(function() {
|
||||||
|
if (jQuery(\'#togglemassfilesarea\').attr(\'ref\') == "shown")
|
||||||
|
{
|
||||||
|
jQuery(\'#'.$modulepart.'_table\').hide();
|
||||||
|
jQuery(\'#togglemassfilesarea\').attr("ref", "hidden");
|
||||||
|
jQuery(\'#togglemassfilesarea\').text("('.dol_escape_js($langs->trans("Show")).')");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jQuery(\'#'.$modulepart.'_table\').show();
|
||||||
|
jQuery(\'#togglemassfilesarea\').attr("ref","shown");
|
||||||
|
jQuery(\'#togglemassfilesarea\').text("('.dol_escape_js($langs->trans("Hide")).')");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$titletoshow=$langs->trans("Documents");
|
||||||
|
if (! empty($title)) $titletoshow=$title;
|
||||||
|
|
||||||
// Show table
|
// Show table
|
||||||
if ($genallowed)
|
if ($genallowed)
|
||||||
{
|
{
|
||||||
@ -518,6 +543,7 @@ class FormFile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set headershown to avoit to have table opened a second time later
|
||||||
$headershown=1;
|
$headershown=1;
|
||||||
|
|
||||||
$buttonlabeltoshow=$buttonlabel;
|
$buttonlabeltoshow=$buttonlabel;
|
||||||
@ -622,7 +648,7 @@ class FormFile
|
|||||||
{
|
{
|
||||||
$headershown=1;
|
$headershown=1;
|
||||||
$out.= '<div class="titre">'.$titletoshow.'</div>'."\n";
|
$out.= '<div class="titre">'.$titletoshow.'</div>'."\n";
|
||||||
$out.= '<table class="border" summary="listofdocumentstable" width="100%">'."\n";
|
$out.= '<table class="border" summary="listofdocumentstable" id="'.$modulepart.'_table" width="100%">'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop on each file found
|
// Loop on each file found
|
||||||
|
|||||||
@ -677,10 +677,6 @@ if ($resql)
|
|||||||
$genallowed=$user->rights->expensereport->lire;
|
$genallowed=$user->rights->expensereport->lire;
|
||||||
$delallowed=$user->rights->expensereport->lire;
|
$delallowed=$user->rights->expensereport->lire;
|
||||||
|
|
||||||
print '<br><a name="show_files"></a>';
|
|
||||||
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
|
||||||
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -162,6 +162,7 @@ Go=Go
|
|||||||
Run=Run
|
Run=Run
|
||||||
CopyOf=Copy of
|
CopyOf=Copy of
|
||||||
Show=Show
|
Show=Show
|
||||||
|
Hide=Hide
|
||||||
ShowCardHere=Show card
|
ShowCardHere=Show card
|
||||||
Search=Search
|
Search=Search
|
||||||
SearchOf=Search
|
SearchOf=Search
|
||||||
|
|||||||
@ -601,10 +601,6 @@ if ($resql)
|
|||||||
$genallowed=$user->rights->facture->lire;
|
$genallowed=$user->rights->facture->lire;
|
||||||
$delallowed=$user->rights->facture->lire;
|
$delallowed=$user->rights->facture->lire;
|
||||||
|
|
||||||
print '<br><a name="show_files"></a>';
|
|
||||||
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
|
||||||
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user