Fix: can use alertnative path

This commit is contained in:
Regis Houssin 2011-01-14 17:33:03 +00:00
parent 11da59feea
commit eb01c964d9

View File

@ -1,10 +1,10 @@
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -316,7 +316,6 @@ else
dol_print_error($db); dol_print_error($db);
} }
$dir = "../includes/modules/propale/";
print "<table class=\"noborder\" width=\"100%\">\n"; print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n"; print "<tr class=\"liste_titre\">\n";
@ -330,92 +329,98 @@ print "</tr>\n";
clearstatcache(); clearstatcache();
$handle=opendir($dir);
$var=true; $var=true;
if (is_resource($handle)) foreach ($conf->file->dol_document_root as $dirroot)
{ {
while (($file = readdir($handle))!==false) $dir = $dirroot . "/includes/modules/propale/";
{
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_propale_')
{
$name = substr($file, 12, dol_strlen($file) - 24);
$classname = substr($file, 0, dol_strlen($file) -12);
$var=!$var; if (is_dir($dir))
print "<tr ".$bc[$var].">\n <td>"; {
print $name; $handle=opendir($dir);
print "</td>\n <td>\n"; if (is_resource($handle))
require_once($dir.$file); {
$module = new $classname($db); while (($file = readdir($handle))!==false)
print $module->description; {
print '</td>'; if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_propale_')
{
// Activate $name = substr($file, 12, dol_strlen($file) - 24);
print "<td align=\"center\">\n"; $classname = substr($file, 0, dol_strlen($file) -12);
if (in_array($name, $def))
{ $var=!$var;
if ($conf->global->PROPALE_ADDON_PDF != "$name") print "<tr ".$bc[$var].">\n <td>";
{ print $name;
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">'; print "</td>\n <td>\n";
print img_picto($langs->trans("Activated"),'on'); require_once($dir.$file);
print '</a>'; $module = new $classname($db);
} print $module->description;
else print '</td>';
{
print img_picto($langs->trans("Activated"),'on'); // Activate
} print '<td align="center">'."\n";
} if (in_array($name, $def))
else {
{ if ($conf->global->PROPALE_ADDON_PDF != "$name")
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">'; {
print img_picto($langs->trans("Disabled"),'off'); print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
print '</a>'; print img_picto($langs->trans("Activated"),'on');
} print '</a>';
print "</td>"; }
else
// Default {
print "<td align=\"center\">"; print img_picto($langs->trans("Activated"),'on');
if ($conf->global->PROPALE_ADDON_PDF == "$name") }
{ }
print img_picto($langs->trans("Yes"),'on'); else
} {
else print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">';
{ print img_picto($langs->trans("Disabled"),'off');
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'">'; print '</a>';
print img_picto($langs->trans("No"),'off'); }
print '</a>'; print "</td>";
}
print '</td>'; // Default
print '<td align="center">';
// Info if ($conf->global->PROPALE_ADDON_PDF == "$name")
$htmltooltip = ''.$langs->trans("Name").': '.$module->name; {
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); print img_picto($langs->trans("Yes"),'on');
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; }
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; else
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); {
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'">';
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); print img_picto($langs->trans("No"),'off');
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); print '</a>';
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); }
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); print '</td>';
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1);
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
print '<td align="center">'; $htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
print $html->textwithpicto('',$htmltooltip,1,0); $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
print '</td>'; $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
print '<td align="center">'; $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'propal').'</a>'; $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
print '</td>'; $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
print "</tr>\n"; //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
} $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1);
}
closedir($handle); print '<td align="center">';
print $html->textwithpicto('',$htmltooltip,1,0);
print '</td>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'propal').'</a>';
print '</td>';
print "</tr>\n";
}
}
closedir($handle);
}
}
} }
print '</table>'; print '</table>';
print '<br>'; print '<br>';