N'affiche pas onglet apercu propal si option MAIN_USE_PREVIEW_TABLE mis 0

This commit is contained in:
Laurent Destailleur 2005-09-16 01:23:29 +00:00
parent ed0b632eeb
commit d4f43f1fed
8 changed files with 86 additions and 69 deletions

View File

@ -382,10 +382,13 @@ if ($_GET['propalid'] > 0)
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;

View File

@ -20,7 +20,6 @@
*
* $Id$
* $Source$
*
*/
/**
@ -85,11 +84,14 @@ if ($_GET["propalid"] > 0) {
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$hselected=$h;
$h++;
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$hselected=$h;
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;

View File

@ -76,6 +76,7 @@ if ($propalid > 0)
{
$propref = sanitize_string($propal->ref);
$upload_dir = $conf->propal->dir_output.'/'.$propref;
if ( $error_msg )
{
echo '<B>'.$error_msg.'</B><BR><BR>';
@ -105,10 +106,13 @@ if ($propalid > 0)
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;
@ -126,6 +130,8 @@ if ($propalid > 0)
print_titre($langs->trans('AssociatedDocuments').' '.$propal->ref_url);
print '<table width="100%" class="noborder">';
print '<form name="userfile" action="document.php?propalid='.$propal->id.'" enctype="multipart/form-data" method="POST">';
print '<input type="hidden" name="max_file_size" value="2000000">';
print '<input type="file" name="userfile" size="40" maxlength="80" class="flat"><br>';
@ -135,51 +141,50 @@ if ($propalid > 0)
clearstatcache();
$errorlevel=error_reporting();
error_reporting(0);
$handle=opendir($upload_dir);
error_reporting($errorlevel);
if (is_dir($upload_dir))
{
$handle=opendir($upload_dir);
if ($handle)
{
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Document').'</td>';
print '<td align="right">'.$langs->trans('Size').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
$var=true;
while (($file = readdir($handle))!==false)
{
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>';
echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart=propal&file='.$propref.'/'.urlencode($file).'">'.$file.'</a>';
print "</td>\n";
print '<td align="right">'.filesize($upload_dir.'/'.$file). ' bytes</td>';
print '<td align="center">'.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).'</td>';
print '<td align="center">';
if ($file == $propref . '.pdf')
{
echo '-';
}
else
{
echo '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?propalid='.$propal->id.'&action=delete&urlfile='.urlencode($file).'">'.img_delete($langs->trans('Delete')).'</a>';
}
print "</td></tr>\n";
}
}
closedir($handle);
}
else
{
print '<div class="error">'.$langs->trans('ErrorCantOpenDir').'<b> '.$upload_dir.'</b></div>';
}
print '<table width="100%" class="noborder">';
if ($handle)
{
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Document').'</td>';
print '<td align="right">'.$langs->trans('Size').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
$var=true;
while (($file = readdir($handle))!==false)
{
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>';
echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart=propal&file='.$propref.'/'.urlencode($file).'">'.$file.'</a>';
print "</td>\n";
print '<td align="right">'.filesize($upload_dir.'/'.$file). ' bytes</td>';
print '<td align="center">'.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).'</td>';
print '<td align="center">';
if ($file == $propref . '.pdf')
{
echo '-';
}
else
{
echo '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?propalid='.$propal->id.'&action=delete&urlfile='.urlencode($file).'">'.$langs->trans('Delete').'</a>';
}
print "</td></tr>\n";
}
}
closedir($handle);
}
else
{
print '<div class="error">'.$langs->trans('ErrorCantOpenDir').'<b> '.$upload_dir.'</b></div>';
}
}
print '</table>';
print '</div>';

View File

@ -65,10 +65,13 @@ if ($_GET['propalid'])
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;

View File

@ -84,10 +84,13 @@ if ($_GET['propalid'])
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$hselected=$h;

View File

@ -109,10 +109,13 @@ if ($_GET["propalid"])
$hselected=$h;
$h++;
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;

View File

@ -115,10 +115,8 @@ if ($_POST["action"] == "set")
$db->query("DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED'");
// Si install non Français, on configure pour fonctionner en mode internationnal
if ($langs->defaultlang != "fr_FR") {
$db->query("INSERT INTO llx_const(name,value,type,visible) values ('COMPANY_CREATE_TWO_STEPS','1','yesno',0)");
if ($langs->defaultlang != "fr_FR")
{
$db->query("UPDATE llx_const set value='eldy.php' WHERE name='MAIN_MENU_BARRETOP';");
$db->query("UPDATE llx_const set value='eldy.php' WHERE name='MAIN_MENU_BARRELEFT';");
}

View File

@ -150,7 +150,7 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
if ($user->rights->societe->creer)
{
/*
* Fiche societe en mode création (Creation en 1 ou 2 temps selon COMPANY_CREATE_TWO_STEPS)
* Fiche societe en mode création
*/
$soc->fournisseur=0;
if ($_GET["type"]=='f') { $soc->fournisseur=1; }