Fix: utf-8

Todo: Monaco, Norway and Switzerland used vat rules of EEE ?
This commit is contained in:
Regis Houssin
2009-07-30 22:38:07 +00:00
parent 1305216a53
commit 3cd1870ffb
9 changed files with 136 additions and 148 deletions

View File

@@ -230,111 +230,106 @@ $constantes=array(
'ADHERENT_CARD_FOOTER_TEXT',
'ADHERENT_ETIQUETTE_TYPE'
);
print_fiche_titre($langs->trans("Other"),'','');
print_fiche_titre($langs->trans("Other"),'','');
print $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
print '%DOL_MAIN_URL_ROOT%, %ID%, %PRENOM%, %NOM%, %LOGIN%, %PASSWORD%,';
print '%SOCIETE%, %ADRESSE%, %CP%, %VILLE%, %PAYS%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%,';
//print '%INFOS%'; Deprecated
print '<br>';
print $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
print '%DOL_MAIN_URL_ROOT%, %ID%, %PRENOM%, %NOM%, %LOGIN%, %PASSWORD%,';
print '%SOCIETE%, %ADRESSE%, %CP%, %VILLE%, %PAYS%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%,';
//print '%INFOS%'; Deprecated
print '<br>';
form_constantes($constantes);
form_constantes($constantes);
$db->close();
$db->close();
print '<br>';
print '<br>';
llxFooter('$Date$ - $Revision$');
function form_constantes($tableau)
{
global $db,$bc,$langs;
$form = new Form($db);
llxFooter('$Date$ - $Revision$');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="center" width="80">'.$langs->trans("Action").'</td>';
print "</tr>\n";
$var=true;
function form_constantes($tableau)
foreach($tableau as $const)
{
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='".$const."'";
$result = $db->query($sql);
if ($result)
{
// Variables globales
global $db,$bc,$langs;
$form = new Form($db);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="center" width="80">'.$langs->trans("Action").'</td>';
print "</tr>\n";
$var=true;
$obj = $db->fetch_object($result);
$var=!$var;
print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="'.$obj->name.'">';
print '<input type="hidden" name="constnote" value="'.nl2br($obj->note).'">';
foreach($tableau as $const)
print "<tr $bc[$var]>";
// Affiche nom constante
print '<td>';
print $langs->trans("Desc".$const) != ("Desc".$const) ? $langs->trans("Desc".$const) : $obj->note;
print "</td>\n";
if ($const == 'ADHERENT_ETIQUETTE_TYPE')
{
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='".$const."'";
$result = $db->query($sql);
if ($result)
{
$obj = $db->fetch_object($result);
$var=!$var;
print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="'.$obj->name.'">';
print '<input type="hidden" name="constnote" value="'.nl2br($obj->note).'">';
print '<td>';
// List of possible labels. Values must exists in
// file htdocs/adherents/PDF_Card.class.php
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/member/PDF_card.class.php');
$pdfcardstatic=new PDF_card('5160',1,1,'mm');
$arrayoflabels=array_keys($pdfcardstatic->_Avery_Labels);
print "<tr $bc[$var]>";
// Affiche nom constante
print '<td>';
print $langs->trans("Desc".$const) != ("Desc".$const) ? $langs->trans("Desc".$const) : $obj->note;
print "</td>\n";
if ($const == 'ADHERENT_ETIQUETTE_TYPE')
{
print '<td>';
// List of possible labels. Values must exists in
// file htdocs/adherents/PDF_Card.class.php
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/member/PDF_card.class.php');
$pdfcardstatic=new PDF_card('5160',1,1,'mm');
$arrayoflabels=array_keys($pdfcardstatic->_Avery_Labels);
$form->select_array('constvalue',$arrayoflabels,$obj->value,1,0,1);
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),1);
}
else
{
print '<td>';
if ($obj->type == 'yesno')
{
print $form->selectyesno('constvalue',$obj->value,1);
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),0);
}
elseif ($obj->type == 'texte')
{
print '<textarea class="flat" name="constvalue" cols="35" rows="5" wrap="soft">';
print $obj->value;
print "</textarea>\n";
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),1);
}
else
{
print '<input type="text" class="flat" size="30" name="constvalue" value="'.$obj->value.'">';
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),2);
}
print '</td>';
}
print '<td align="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button"> &nbsp;';
// print '<a href="adherent.php?name='.$const.'&action=unset">'.img_delete().'</a>';
print "</td></tr>\n";
print '</form>';
$i++;
}
$form->select_array('constvalue',$arrayoflabels,$obj->value,1,0,1);
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),1);
}
print '</table>';
else
{
print '<td>';
if ($obj->type == 'yesno')
{
print $form->selectyesno('constvalue',$obj->value,1);
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),0);
}
else if ($obj->type == 'texte')
{
print '<textarea class="flat" name="constvalue" cols="35" rows="5" wrap="soft">';
print $obj->value;
print "</textarea>\n";
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),1);
}
else
{
print '<input type="text" class="flat" size="30" name="constvalue" value="'.$obj->value.'">';
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),2);
}
print '</td>';
}
print '<td align="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button"> &nbsp;';
// print '<a href="adherent.php?name='.$const.'&action=unset">'.img_delete().'</a>';
print "</td></tr>\n";
print '</form>';
$i++;
}
}
print '</table>';
}
?>
?>

View File

@@ -84,7 +84,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
}
else dol_syslog($imgThumbSmall);
// Cr<EFBFBD>ation de la vignette de la page "Soci<EFBFBD>t<EFBFBD>/Institution"
// Creation de la vignette de la page "Societe/Institution"
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, 100, 30, '_mini', $quality);
if (eregi('([^\\\/:]+)$',$imgThumbMini,$reg))
{
@@ -135,7 +135,7 @@ if ($_GET["action"] == 'addthumb')
// Create thumbs of logo
if ($isimage > 0)
{
// Cr<EFBFBD>ation de la vignette de la page login
// Creation de la vignette de la page login
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 200, 100, '_small',80);
if (image_format_supported($imgThumbSmall) >= 0 && eregi('([^\\\/:]+)$',$imgThumbSmall,$reg))
{
@@ -144,7 +144,7 @@ if ($_GET["action"] == 'addthumb')
}
else dol_syslog($imgThumbSmall);
// Cr<EFBFBD>ation de la vignette de la page "Soci<EFBFBD>t<EFBFBD>/Institution"
// Creation de la vignette de la page "Societe/Institution"
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 100, 30, '_mini',80);
if (image_format_supported($imgThumbSmall) >= 0 && eregi('([^\\\/:]+)$',$imgThumbMini,$reg))
{
@@ -207,7 +207,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|| (isset($_POST["action"]) && $_POST["action"] == 'updateedit') )
{
/**
* Edition des param<EFBFBD>tres
* Edition des parametres
*/
print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
@@ -306,7 +306,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
print '<br>';
// Identifiants de la soci<EFBFBD>t<EFBFBD> (propre au pays)
// Identifiants de la societe (propre au pays)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
$var=true;
@@ -421,7 +421,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
/*
* D<EFBFBD>but d'ann<EFBFBD>e fiscale
* Debut d'annee fiscale
*/
print '<br>';
print '<table class="noborder" width="100%">';
@@ -457,12 +457,12 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
print "</table>";
print "</td></tr>\n";
/* Je d<EFBFBD>sactive cette option "facturation" car ce statut fiscal n'existe pas. Seul le r<EFBFBD>el et franchise existe.
/* Je desactive cette option "facturation" car ce statut fiscal n'existe pas. Seul le reel et franchise existe.
Cette option ne doit donc pas etre en "exclusif" avec l'option fiscale de gestion de tva. Peut etre faut-il
une option a part qui n'entre pas en conflit avec les choix "assuj<EFBFBD>ti TVA" ou "non".
une option a part qui n'entre pas en conflit avec les choix "assujeti TVA" ou "non".
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" value=\"facturation\"".($conf->global->FACTURE_TVAOPTION == "facturation"?" checked":"")."> Option facturation</label></td>";
print "<td colspan=\"2\">L'option 'facturation' est utilis<EFBFBD>e par les entreprises qui payent la TVA <EFBFBD> facturation (vente de mat<EFBFBD>riel).</td></tr>\n";
print "<td colspan=\"2\">L'option 'facturation' est utilisee par les entreprises qui payent la TVA a facturation (vente de materiel).</td></tr>\n";
*/
$var=!$var;
@@ -486,7 +486,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
else
{
/*
* Affichage des param<EFBFBD>tres
* Affichage des parametres
*/
if ($message) print $message.'<br>';
@@ -549,7 +549,7 @@ else
print $mysoc->logo;
print '</td><td valign="center" align="right">';
// On propose la g<EFBFBD>n<EFBFBD>ration de la vignette si elle n'existe pas
// On propose la generation de la vignette si elle n'existe pas
if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && eregi('(\.jpg|\.jpeg|\.png)$',$mysoc->logo))
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=addthumb&amp;file='.urlencode($mysoc->logo).'">'.img_refresh($langs->trans('GenerateThumb')).'&nbsp;&nbsp;</a>';
@@ -575,7 +575,7 @@ else
print '<br>';
// Identifiants de la soci<EFBFBD>t<EFBFBD> (propre au pays)
// Identifiants de la societe (propre au pays)
print '<form name="formsoc" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" width="100%">';
@@ -702,7 +702,7 @@ else
print '</form>';
/*
* D<EFBFBD>but d'ann<EFBFBD>e fiscale
* Debut d'annee fiscale
*/
print '<br>';
print '<table class="noborder" width="100%">';
@@ -769,18 +769,19 @@ llxFooter('$Date$ - $Revision$');
* \param code_iso Code iso de la devise
* \param withcode 1=affiche code + nom
* \return string Nom traduit de la devise
* TODO deplacer dans une classe
*/
function currency_name($code_iso,$withcode=0)
{
global $langs,$db;
// Si il existe une traduction, on peut renvoyer de suite le libell<EFBFBD>
// Si il existe une traduction, on peut renvoyer de suite le libelle
if ($langs->trans("Currency".$code_iso)!="Currency".$code_iso)
{
return $langs->trans("Currency".$code_iso);
}
// Si pas de traduction, on consulte le libell<EFBFBD> par d<EFBFBD>faut en table
// Si pas de traduction, on consulte le libelle par defaut en table
$sql = "SELECT label FROM ".MAIN_DB_PREFIX."c_currencies";
$sql.= " WHERE code_iso='".$code_iso."'";
@@ -804,4 +805,4 @@ function currency_name($code_iso,$withcode=0)
}
}
?>
?>

View File

@@ -44,7 +44,7 @@ $modules = array(
'MAILING' => 'FCKeditorForMailing',
'DETAILS' => 'FCKeditorForProductDetails',
);
// Conditions pour que l'option soit propos<EFBFBD>e
// Conditions pour que l'option soit proposee
$conditions = array(
'USER' => 1,
'SOCIETE' => $conf->societe->enabled,
@@ -69,7 +69,7 @@ foreach($modules as $const => $desc)
if ($_GET["action"] == 'activate_'.strtolower($const))
{
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity);
// Si fckeditor est activ<EFBFBD> dans la description produit/service, on l'active dans les formulaires
// Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM)
{
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity);
@@ -96,7 +96,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("FCKEditor"),$linkback,'setup');
print '<br>';
/*
* Activation/d<EFBFBD>sactivation de FCKeditor
* Activation/desactivation de FCKeditor
*/
$var=true;
@@ -147,4 +147,4 @@ print '</table>';
$db->close();
llxFooter('$Date$ - $Revision$');
?>
?>