Works on ODT import
This commit is contained in:
parent
eb3e50537b
commit
bdf4bbaa1f
@ -664,7 +664,7 @@ if (window.parent.frames[1]) {
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
$result=$formfile->show_documents('systemtools','backup',$conf->admin->dir_output.'/backup',$_SERVER['PHP_SELF'],0,1,'','',0,0,54,0,'',$langs->trans("PreviousDumpFiles"));
|
$result=$formfile->show_documents('systemtools','backup',$conf->admin->dir_output.'/backup',$_SERVER['PHP_SELF'],0,1,'',1,0,0,54,0,'',$langs->trans("PreviousDumpFiles"));
|
||||||
//if ($result) print '<br><br>';
|
//if ($result) print '<br><br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -296,7 +296,7 @@ if ($what)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result=$formfile->show_documents('systemtools','backup',$conf->admin->dir_output.'/backup',$_SERVER['PHP_SELF'],0,1,'',array(),0,0,54,0,'',$langs->trans("PreviousDumpFiles"));
|
$result=$formfile->show_documents('systemtools','backup',$conf->admin->dir_output.'/backup',$_SERVER['PHP_SELF'],0,1,'',1,0,0,54,0,'',$langs->trans("PreviousDumpFiles"));
|
||||||
|
|
||||||
if ($result == 0)
|
if ($result == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -319,7 +319,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
$filename=dol_sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -579,7 +579,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$obj->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$obj->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|||||||
@ -1955,7 +1955,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$propal->modelpdf,'',0,0,28,0,'',0,'',$societe->default_lang);
|
$somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$propal->modelpdf,1,0,0,28,0,'',0,'',$societe->default_lang);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2215,7 +2215,7 @@ else
|
|||||||
$filename=dol_sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
if ($objp->client == 1)
|
if ($objp->client == 1)
|
||||||
|
|||||||
@ -2188,7 +2188,7 @@ else
|
|||||||
$genallowed=$user->rights->commande->creer;
|
$genallowed=$user->rights->commande->creer;
|
||||||
$delallowed=$user->rights->commande->supprimer;
|
$delallowed=$user->rights->commande->supprimer;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf,'',0,0,28,0,'','','',$soc->default_lang);
|
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Liste des factures
|
* Liste des factures
|
||||||
|
|||||||
@ -173,7 +173,7 @@ if ($resql)
|
|||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -240,7 +240,7 @@ if ($conf->commande->enabled)
|
|||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -309,7 +309,7 @@ if ($conf->commande->enabled)
|
|||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -205,7 +205,7 @@ if ($resql)
|
|||||||
$filename=dol_sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -151,7 +151,7 @@ if ($resql)
|
|||||||
$filename=dol_sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -3502,7 +3502,7 @@ else
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$somethingshown=$formfile->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf,'',0,0,28,0,'','','',$soc->default_lang);
|
$somethingshown=$formfile->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Propales rattachees
|
* Propales rattachees
|
||||||
@ -3961,7 +3961,7 @@ else
|
|||||||
$filename=dol_sanitizeFileName($objp->facnumber);
|
$filename=dol_sanitizeFileName($objp->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
|
||||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
|
|
||||||
|
|||||||
@ -341,7 +341,7 @@ if ($result)
|
|||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=dol_sanitizeFileName($objp->facnumber);
|
$filename=dol_sanitizeFileName($objp->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
||||||
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1,$param);
|
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -403,7 +403,7 @@ if ($result)
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<input type="hidden" name="option" value="'.$option.'">';
|
print '<input type="hidden" name="option" value="'.$option.'">';
|
||||||
$formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'','',0,0,48,1,$param,'',$langs->trans("PDFMerge"));
|
$formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'',1,0,0,48,1,$param,'',$langs->trans("PDFMerge"));
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$db->free();
|
$db->free();
|
||||||
|
|||||||
@ -354,7 +354,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
|||||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
||||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -714,7 +714,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
|
|||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -809,7 +809,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
|||||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
||||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -724,7 +724,7 @@ else
|
|||||||
$filename=dol_sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
|||||||
@ -948,7 +948,7 @@ else
|
|||||||
//$genallowed=1;
|
//$genallowed=1;
|
||||||
//$delallowed=0;
|
//$delallowed=0;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('expedition',$expeditionref,$filedir,$urlsource,$genallowed,$delallowed,$expedition->modelpdf,'',0,0,28,0,'','','',$soc->default_lang);
|
$somethingshown=$formfile->show_documents('expedition',$expeditionref,$filedir,$urlsource,$genallowed,$delallowed,$expedition->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||||
if ($genallowed && ! $somethingshown) $somethingshown=1;
|
if ($genallowed && ! $somethingshown) $somethingshown=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -759,7 +759,7 @@ if ($step == 4 && $datatoexport)
|
|||||||
|
|
||||||
// Affiche liste des documents
|
// Affiche liste des documents
|
||||||
// NB: La fonction show_documents rescanne les modules qd genallowed=1, sinon prend $liste
|
// NB: La fonction show_documents rescanne les modules qd genallowed=1, sinon prend $liste
|
||||||
$formfile->show_documents('export','',$conf->export->dir_temp.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&datatoexport='.$datatoexport,$liste,1,(! empty($_POST['model'])?$_POST['model']:'csv'),'',1);
|
$formfile->show_documents('export','',$conf->export->dir_temp.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&datatoexport='.$datatoexport,$liste,1,(! empty($_POST['model'])?$_POST['model']:'csv'),1,1);
|
||||||
|
|
||||||
print '</td><td width="50%"> </td></tr>';
|
print '</td><td width="50%"> </td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -916,7 +916,7 @@ elseif ($fichinterid)
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$somethingshown=$formfile->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$fichinter->modelpdf,'',0,0,28,0,'','','',$societe->default_lang);
|
$somethingshown=$formfile->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$fichinter->modelpdf,1,0,0,28,0,'','','',$societe->default_lang);
|
||||||
|
|
||||||
print "</td><td>";
|
print "</td><td>";
|
||||||
print " </td>";
|
print " </td>";
|
||||||
|
|||||||
@ -129,7 +129,7 @@ class FormFile
|
|||||||
* \param genallowed Generation is allowed (1/0 or array of formats)
|
* \param genallowed Generation is allowed (1/0 or array of formats)
|
||||||
* \param delallowed Remove is allowed (1/0)
|
* \param delallowed Remove is allowed (1/0)
|
||||||
* \param modelselected Model to preselect by default
|
* \param modelselected Model to preselect by default
|
||||||
* \param modelliste Array of possible models. Use '' to hide this combo select list.
|
* \param showwarning Show warning if no model activated
|
||||||
* \param forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined)
|
* \param forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined)
|
||||||
* \param iconPDF Show only PDF icon with link (1/0)
|
* \param iconPDF Show only PDF icon with link (1/0)
|
||||||
* \param maxfilenamelength Max length for filename shown
|
* \param maxfilenamelength Max length for filename shown
|
||||||
@ -140,7 +140,7 @@ class FormFile
|
|||||||
* \param codelang Default language code to use on lang combo box if multilang is enabled
|
* \param codelang Default language code to use on lang combo box if multilang is enabled
|
||||||
* \return int <0 if KO, number of shown files if OK
|
* \return int <0 if KO, number of shown files if OK
|
||||||
*/
|
*/
|
||||||
function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
|
function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$showwarning=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
|
||||||
{
|
{
|
||||||
// filedir = conf->...dir_ouput."/".get_exdir(id)
|
// filedir = conf->...dir_ouput."/".get_exdir(id)
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||||
@ -153,7 +153,6 @@ class FormFile
|
|||||||
$genallowed = '';
|
$genallowed = '';
|
||||||
$delallowed = 0;
|
$delallowed = 0;
|
||||||
$modelselected = '';
|
$modelselected = '';
|
||||||
$modelliste = '';
|
|
||||||
$forcenomultilang=0;
|
$forcenomultilang=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +339,7 @@ class FormFile
|
|||||||
|
|
||||||
// Language code (if multilang)
|
// Language code (if multilang)
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if($conf->global->MAIN_MULTILANGS && ! $forcenomultilang)
|
if (($showwarning || (is_array($modellist) && sizeof($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang)
|
||||||
{
|
{
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/html.formadmin.class.php');
|
include_once(DOL_DOCUMENT_ROOT.'/html.formadmin.class.php');
|
||||||
$formadmin=new FormAdmin($this->db);
|
$formadmin=new FormAdmin($this->db);
|
||||||
@ -357,8 +356,10 @@ class FormFile
|
|||||||
print '<td align="center" colspan="'.($delallowed?'2':'1').'">';
|
print '<td align="center" colspan="'.($delallowed?'2':'1').'">';
|
||||||
print '<input class="button" ';
|
print '<input class="button" ';
|
||||||
//print ((is_array($modellist) && sizeof($modellist))?'':' disabled="true"') // Always allow button "Generate" (even if no model activated)
|
//print ((is_array($modellist) && sizeof($modellist))?'':' disabled="true"') // Always allow button "Generate" (even if no model activated)
|
||||||
print ' type="submit" value="'.$buttonlabel.'">';
|
print ' type="submit" value="'.$buttonlabel.'"';
|
||||||
if (is_array($modellist) && ! sizeof($modellist))
|
if (! $showwarning && ! is_array($modellist) && empty($modellist)) print ' disabled="true"';
|
||||||
|
print '>';
|
||||||
|
if ($showwarning && ! is_array($modellist) && empty($modellist))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print ' '.img_warning($langs->trans("WarningNoDocumentModelActivated"));
|
print ' '.img_warning($langs->trans("WarningNoDocumentModelActivated"));
|
||||||
|
|||||||
@ -1015,12 +1015,13 @@ function picto_from_langcode($codelang)
|
|||||||
* \brief Return list of activated modules usable for document generation.
|
* \brief Return list of activated modules usable for document generation.
|
||||||
* \param $db Database handler
|
* \param $db Database handler
|
||||||
* \param $type Type of models (company, invoice, ...)
|
* \param $type Type of models (company, invoice, ...)
|
||||||
* \return array array(key=>label). For modules that need directory scan, key is completed with ":filename".
|
* \return int or array 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename".
|
||||||
*/
|
*/
|
||||||
function getListOfModels($db,$type)
|
function getListOfModels($db,$type)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$liste=array();
|
$liste=array();
|
||||||
|
$found=0;
|
||||||
|
|
||||||
$dirtoscan='';
|
$dirtoscan='';
|
||||||
|
|
||||||
@ -1036,10 +1037,12 @@ function getListOfModels($db,$type)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
$found=1;
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
// If this generation module needs a directory scan, then description field is filled
|
// If this generation module needs a directory scan, then description field is filled
|
||||||
// with constant that constains list of directories.
|
// with the constant that contains list of directories to scan.
|
||||||
if (! empty($obj->description))
|
if (! empty($obj->description))
|
||||||
{
|
{
|
||||||
$const=$obj->description;
|
$const=$obj->description;
|
||||||
@ -1079,5 +1082,6 @@ function getListOfModels($db,$type)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $liste;
|
if ($found) return $liste;
|
||||||
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -608,7 +608,7 @@ else
|
|||||||
$genallowed=$user->rights->expedition->livraison->creer;
|
$genallowed=$user->rights->expedition->livraison->creer;
|
||||||
$delallowed=$user->rights->expedition->livraison->supprimer;
|
$delallowed=$user->rights->expedition->livraison->supprimer;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('livraison',$deliveryref,$filedir,$urlsource,$genallowed,$delallowed,$delivery->modelpdf,'',0,0,28,0,'','','',$soc->default_lang);
|
$somethingshown=$formfile->show_documents('livraison',$deliveryref,$filedir,$urlsource,$genallowed,$delallowed,$delivery->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||||
if ($genallowed && ! $somethingshown) $somethingshown=1;
|
if ($genallowed && ! $somethingshown) $somethingshown=1;
|
||||||
|
|
||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|||||||
@ -1451,7 +1451,7 @@ else
|
|||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('company',$soc->id,$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,0,28,0,'',0,'',$soc->default_lang);
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user