Work on generic odt generation

This commit is contained in:
Laurent Destailleur 2010-02-28 18:59:35 +00:00
parent 0f1d95d7fa
commit f49d0eed46
3 changed files with 15 additions and 3 deletions

View File

@ -105,7 +105,19 @@ if ($modulepart)
{
// On fait une verification des droits et on definit le repertoire concerne
// Wrapping pour les factures
// Wrapping for third parties
if ($modulepart == 'company')
{
$user->getrights('companies');
if ($user->rights->societe->lire || preg_match('/^specimen/i',$original_file))
{
$accessallowed=1;
}
$original_file=$conf->societe->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid='$refname'";
}
// Wrapping for invoices
if ($modulepart == 'facture')
{
$user->getrights('facture');

View File

@ -123,7 +123,7 @@ class FormFile
/**
* \brief Show the box with list of available documents for object
* \param modulepart propal=propal, facture=facture, ...
* \param filename Sub dir to scan (use '' if filedir already complete)
* \param filename Sub dir to scan (Example: '9/9', 'FA9999'). Use '' if filedir already complete)
* \param filedir Dir to scan
* \param urlsource Url of origin page (for return)
* \param genallowed Generation is allowed (1/0 or array of formats)

View File

@ -1403,7 +1403,7 @@ else
$var=true;
$somethingshown=$formfile->show_documents('company','',$filedir,$urlsource,$genallowed,$delallowed,'','',0,0,28,0,'',0,'',$soc->default_lang);
$somethingshown=$formfile->show_documents('company',$soc->id,$filedir,$urlsource,$genallowed,$delallowed,'','',0,0,28,0,'',0,'',$soc->default_lang);
print '</td>';
print '<td>';