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_')
{
$name = substr($file, 12, dol_strlen($file) - 24);
$classname = substr($file, 0, dol_strlen($file) -12);
// Activate $var=!$var;
print "<td align=\"center\">\n"; print "<tr ".$bc[$var].">\n <td>";
if (in_array($name, $def)) print $name;
{ print "</td>\n <td>\n";
if ($conf->global->PROPALE_ADDON_PDF != "$name") require_once($dir.$file);
{ $module = new $classname($db);
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">'; print $module->description;
print img_picto($langs->trans("Activated"),'on'); print '</td>';
print '</a>';
}
else
{
print img_picto($langs->trans("Activated"),'on');
}
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">';
print img_picto($langs->trans("Disabled"),'off');
print '</a>';
}
print "</td>";
// Default // Activate
print "<td align=\"center\">"; print '<td align="center">'."\n";
if ($conf->global->PROPALE_ADDON_PDF == "$name") if (in_array($name, $def))
{ {
print img_picto($langs->trans("Yes"),'on'); if ($conf->global->PROPALE_ADDON_PDF != "$name")
} {
else print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
{ print img_picto($langs->trans("Activated"),'on');
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'">'; print '</a>';
print img_picto($langs->trans("No"),'off'); }
print '</a>'; else
} {
print '</td>'; print img_picto($langs->trans("Activated"),'on');
}
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">';
print img_picto($langs->trans("Disabled"),'off');
print '</a>';
}
print "</td>";
// Info // Default
$htmltooltip = ''.$langs->trans("Name").': '.$module->name; print '<td align="center">';
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($conf->global->PROPALE_ADDON_PDF == "$name")
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; {
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; print img_picto($langs->trans("Yes"),'on');
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); }
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); else
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); {
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'">';
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); print img_picto($langs->trans("No"),'off');
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); print '</a>';
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1); }
print '</td>';
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1);
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 '<td align="center">'; print "</tr>\n";
print $html->textwithpicto('',$htmltooltip,1,0); }
print '</td>'; }
print '<td align="center">'; closedir($handle);
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>';