2
0
forked from Wavyzz/dolibarr

Maxi debug for UTF8 support

This commit is contained in:
Laurent Destailleur
2008-10-28 23:36:36 +00:00
parent 3e8a91a1b1
commit 45d8c67e6c
14 changed files with 311 additions and 251 deletions

View File

@@ -102,7 +102,9 @@ if (($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes
$propal = new Propal($db);
$propal->fetch($_GET['propalid']);
$result = $propal->delete_product($_GET['lineid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -123,7 +125,8 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes' &
$result=$propal->valid($user);
if ($result >= 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -263,7 +266,8 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
$db->commit();
// Generation document PDF
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -521,8 +525,8 @@ if ($_GET['action'] == 'modif' && $user->rights->propale->creer)
$propal->fetch($_GET['propalid']);
$propal->set_draft($user);
//reg<65>n<EFBFBD>ration pdf
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -646,7 +650,8 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
if ($result > 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -704,7 +709,8 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
'HT',
$info_bits);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -725,7 +731,8 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
$propal->setDocModel($user, $_REQUEST['model']);
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -793,13 +800,16 @@ if ($_GET['action'] == 'up' && $user->rights->propale->creer)
$propal = new Propal($db, '', $_GET["propalid"]);
$propal->fetch($_GET['propalid']);
$propal->line_up($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs);
Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET["propalid"].'#'.$_GET['rowid']);
exit;
}
if ($_GET['action'] == 'down' && $user->rights->propale->creer)
@@ -807,7 +817,9 @@ if ($_GET['action'] == 'down' && $user->rights->propale->creer)
$propal = new Propal($db, '', $_GET["propalid"]);
$propal->fetch($_GET['propalid']);
$propal->line_down($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);

View File

@@ -95,7 +95,8 @@ if (($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes
$result = $commande->delete_line($_GET['lineid']);
if ($result > 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -401,7 +402,8 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
if ($result > 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -474,7 +476,8 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
if ($result >= 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -504,7 +507,8 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes' &
$result=$commande->valid($user);
if ($result >= 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -538,8 +542,9 @@ if ($_GET['action'] == 'modif' && $user->rights->commande->creer)
$result = $commande->set_draft($user);
if ($result >= 0)
{ //regeneration pdf
if ($_REQUEST['lang_id'])
{
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -557,7 +562,9 @@ if ($_GET['action'] == 'up' && $user->rights->commande->creer)
$commande = new Commande($db,'',$_GET['id']);
$commande->fetch($_GET['id']);
$commande->line_up($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -572,7 +579,9 @@ if ($_GET['action'] == 'down' && $user->rights->commande->creer)
$commande = new Commande($db,'',$_GET['id']);
$commande->fetch($_GET['id']);
$commande->line_down($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -597,12 +606,12 @@ if ($_REQUEST['action'] == 'builddoc') // In get or post
$commande->setDocModel($user, $_REQUEST['model']);
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
$result=commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs);
if ($result <= 0)
{

View File

@@ -121,12 +121,12 @@ if (($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'ye
$result = $fac->deleteline($_GET['rowid'], $user);
if ($result > 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
$result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs);
if ($result > 0)
{
@@ -263,7 +263,8 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $
$result = $fac->set_valid($user);
if ($result >= 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -311,8 +312,9 @@ if ($_GET['action'] == 'modif' && $user->rights->facture->modifier && $conf->glo
if ($resteapayer == $fac->total_ttc && $fac->paye == 0 && $ventilExportCompta == 0)
{
$fac->set_draft($user);
//reg<65>n<EFBFBD>ration PDF
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -900,7 +902,8 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
if ($result > 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -971,7 +974,8 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST
$info_bits
);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -998,7 +1002,9 @@ if ($_GET['action'] == 'up' && $user->rights->facture->creer)
$fac = new Facture($db,'',$_GET['facid']);
$fac->fetch($_GET['facid']);
$fac->line_up($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -1013,7 +1019,9 @@ if ($_GET['action'] == 'down' && $user->rights->facture->creer)
$fac = new Facture($db,'',$_GET['facid']);
$fac->fetch($_GET['facid']);
$fac->line_down($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -1238,12 +1246,12 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
$fac->setDocModel($user, $_REQUEST['model']);
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
$result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs);
if ($result <= 0)
{
@@ -3138,7 +3146,8 @@ else
// Construit PDF si non existant
if (! is_readable($file))
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -3204,7 +3213,8 @@ else
// Construit PDF si non existant
if (! is_readable($file))
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);

View File

@@ -79,7 +79,9 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user-
{
$fac = new Facture($db);
$fac->fetch($id);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);

View File

@@ -181,8 +181,8 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
$casenow = dolibarr_print_date(mktime(),"%Y-%m");
$case = dolibarr_print_date(mktime(1,1,1,$mois,1,$annee),"%Y-%m");
$caseprev = dolibarr_print_date(mktime(1,1,1,$mois,1,$annee-1),"%Y-%m");
$case = dolibarr_print_date(dolibarr_mktime(1,1,1,$mois,1,$annee),"%Y-%m");
$caseprev = dolibarr_print_date(dolibarr_mktime(1,1,1,$mois,1,$annee-1),"%Y-%m");
if ($annee == $year_current) {
$total_CA += $cum[$case];

View File

@@ -286,7 +286,8 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer)
if ($result > 0)
{
/*
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);

View File

@@ -173,7 +173,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
$expedition->setDocModel($user, $_REQUEST['model']);
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);

View File

@@ -78,12 +78,12 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes')
$result = $fichinter->valid($user, $conf->fichinter->outputdir);
if ($result >= 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
$result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs);
}
else
@@ -148,12 +148,12 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
$fichinter->fetch($_GET['id']);
$fichinter->fetch_lines();
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
$result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs);
if ($result <= 0)
{
@@ -214,7 +214,8 @@ if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer)
$duration
);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -248,7 +249,8 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P
$fichinterline->duration=$duration;
$result = $fichinterline->update();
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -275,7 +277,9 @@ if ($_GET['action'] == 'deleteline' && $user->rights->ficheinter->creer && !$con
dolibarr_print_error($db);
exit;
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -303,7 +307,9 @@ if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes'
dolibarr_print_error($db);
exit;
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -323,7 +329,9 @@ if ($_GET['action'] == 'up' && $user->rights->ficheinter->creer)
$fichinter = new Fichinter($db);
$fichinter->fetch($_GET['id']);
$fichinter->line_up($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -338,7 +346,9 @@ if ($_GET['action'] == 'down' && $user->rights->ficheinter->creer)
$fichinter = new Fichinter($db);
$fichinter->fetch($_GET['id']);
$fichinter->line_down($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);

View File

@@ -172,7 +172,8 @@ if ($_POST['action'] == 'addligne' && $user->rights->fournisseur->commande->cree
//print "xx".$tva_tx; exit;
if ($result > 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -204,7 +205,8 @@ if ($_POST['action'] == 'updateligne' && $user->rights->fournisseur->commande->c
if ($result >= 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -231,7 +233,9 @@ if ($_REQUEST['action'] == 'confirm_deleteproductline' && ($_POST['confirm'] ==
$commande = new CommandeFournisseur($db);
$commande->fetch($id);
$result = $commande->delete_line($_GET['lineid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -252,7 +256,8 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $
$result = $commande->valid($user);
if ($result >= 0)
{
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -338,7 +343,9 @@ if ($_GET['action'] == 'up' && $user->rights->fournisseur->commande->creer)
$commande = new CommandeFournisseur($db,'',$id);
$commande->fetch($id);
$commande->line_up($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -353,7 +360,9 @@ if ($_GET['action'] == 'down' && $user->rights->fournisseur->commande->creer)
$commande = new CommandeFournisseur($db,'',$id);
$commande->fetch($id);
$commande->line_down($_GET['rowid']);
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
@@ -379,7 +388,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
$commande->setDocModel($user, $_REQUEST['model']);
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);

View File

@@ -105,7 +105,7 @@ class pdf_crabe extends ModelePDFFactures
* \param outputlangs Lang object for output language
* \return int 1=ok, 0=ko
*/
function write_file($fac,$outputlangs='')
function write_file($fac,$outputlangs)
{
global $user,$langs,$conf;
@@ -292,7 +292,7 @@ class pdf_crabe extends ModelePDFFactures
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end)
{
// Affichage duree si il y en a une
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")",1);
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start,'',false,$outputlangs)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end,'',false,$outputlangs).")",1);
}
//if ($i==0) { print $libelleproduitservice; exit; }

View File

@@ -78,7 +78,7 @@ class pdf_soleil extends ModelePDFFicheinter
\param fichinter Object fichinter
\return int 1=ok, 0=ko
*/
function write_file($fichinter,$outputlangs='')
function write_file($fichinter,$outputlangs)
{
global $user,$langs,$conf,$mysoc;
@@ -243,7 +243,7 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->SetTextColor(0,0,100);
$pdf->SetFont('Arial','B',14);
$pdf->Text(11, 94, $langs->trans("InterventionCard")." : ".$fichinter->ref);
$pdf->Text(11, 94, $outputlangs->trans("InterventionCard")." : ".$fichinter->ref);
$pdf->SetFillColor(220,220,220);
$pdf->SetTextColor(0,0,0);
@@ -253,7 +253,7 @@ class pdf_soleil extends ModelePDFFicheinter
$tab_height = 16;
$pdf->SetXY (10, $tab_top);
$pdf->MultiCell(190,8,$langs->transnoentities("Description"),0,'L',0);
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
$pdf->line(10, $tab_top + 8, 200, $tab_top + 8 );
$pdf->Rect(10, $tab_top, 190, $tab_height);
@@ -279,7 +279,7 @@ class pdf_soleil extends ModelePDFFicheinter
{
$pdf->SetXY (10, $tab_top + 16 + $j * 20);
$pdf->writeHTMLCell(0, 4, 20, $tab_top + 16 + $j * 20,
dol_htmlentitiesbr($langs->transnoentities("Date")." : ".dolibarr_print_date($fichinterligne->datei)." - ".$langs->transnoentities("Duration")." : ".ConvertSecondToTime($fichinterligne->duration), 1), 0, 0, 0);
dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dolibarr_print_date($fichinterligne->datei,'',false,$outputlangs)." - ".$outputlangs->transnoentities("Duration")." : ".ConvertSecondToTime($fichinterligne->duration), 1), 0, 0, 0);
$pdf->SetXY (10, $tab_top + 22 + $j * 20);
$pdf->writeHTMLCell(0, 4, 20, $tab_top + 22 + $j * 20,
@@ -296,13 +296,13 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
$pdf->SetXY(20,220);
$pdf->MultiCell(66,5, $langs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
$pdf->SetXY(20,225);
$pdf->MultiCell(80,30, '', 1);
$pdf->SetXY(110,220);
$pdf->MultiCell(80,5, $langs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
$pdf->SetXY(110,225);
$pdf->MultiCell(80,30, '', 1);

View File

@@ -444,11 +444,11 @@ function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
* "%d/%m/%Y %H:%M:%S",
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext"
* \param to_gmt false=output string if for local server TZ users, true=output string is for GMT users
* \param convtooutput true=Output string is encoded into encoding defined into $langs->charset_output
* \param outputlangs Object lang that contains charset_output property to define output
* This means output is endoded in UTF-8 in default case.
* \return string Formated date or '' if time is null
*/
function dolibarr_print_date($time,$format='',$to_gmt=false,$convtooutput=true)
function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='')
{
global $conf,$langs;
@@ -496,7 +496,9 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$convtooutput=true)
$localtime=setlocale(LC_TIME,0);
if (eregi('UTF',$localtime)) $pagecodefrom='UTF-8';
return ($convtooutput?$langs->convToOuptutCharset($ret,$pagecodefrom):$ret);
if (! is_object($outputlangs)) $outputlangs=$langs;
return $outputlangs->convToOuptutCharset($ret,$pagecodefrom);
}
@@ -2873,21 +2875,23 @@ function make_substitutions($chaine,$substitutionarray)
* \remarks Updated by Matelli : added format paramter
* \remarks See http://matelli.fr/showcases/patchs-dolibarr/update-date-range-format.html for details
*/
function print_date_range($date_start,$date_end,$format = '')
function print_date_range($date_start,$date_end,$format = '',$outputlangs='')
{
global $langs;
if (! is_object($outputlangs)) $outputlangs=$langs;
if ($date_start && $date_end)
{
print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start, $format, false, false),dolibarr_print_date($date_end, $format, false, false)).')';
print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start, $format, false, $outputlangs),dolibarr_print_date($date_end, $format, false, $outputlangs)).')';
}
if ($date_start && ! $date_end)
{
print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start, $format, false, false)).')';
print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start, $format, false, $outputlangs)).')';
}
if (! $date_start && $date_end)
{
print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end, $format, false, false)).')';
print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end, $format, false, $outputlangs)).')';
}
}

View File

@@ -143,7 +143,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
$delivery->setDocModel($user, $_REQUEST['model']);
}
if ($_REQUEST['lang_id'])
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);