Fix translation

This commit is contained in:
Laurent Destailleur 2015-08-17 19:42:19 +02:00
parent 7ff149e876
commit 76ce98630f
2 changed files with 213 additions and 229 deletions

View File

@ -111,7 +111,7 @@ class pdf_beluga extends ModelePDFProjects
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
$formproject=new FormProjets($this->db); $formproject=new FormProjets($this->db);
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@ -223,233 +223,216 @@ $formproject=new FormProjets($this->db);
$iniY = $tab_top + 7; $iniY = $tab_top + 7;
$curY = $tab_top + 7; $curY = $tab_top + 7;
$nexY = $tab_top + 7; $nexY = $tab_top + 7;
$listofreferent=array( $listofreferent=array(
'propal'=>array( 'propal'=>array(
'name'=>"Proposals", 'name'=>"Proposals",
'title'=>"ListProposalsAssociatedProject", 'title'=>"ListProposalsAssociatedProject",
'class'=>'Propal', 'class'=>'Propal',
'table'=>'propal', 'table'=>'propal',
'datefieldname'=>'datep', 'datefieldname'=>'datep',
'test'=>$conf->propal->enabled && $user->rights->propale->lire), 'test'=>$conf->propal->enabled && $user->rights->propale->lire),
'order'=>array( 'order'=>array(
'name'=>"CustomersOrders", 'name'=>"CustomersOrders",
'title'=>"ListOrdersAssociatedProject", 'title'=>"ListOrdersAssociatedProject",
'class'=>'Commande', 'class'=>'Commande',
'table'=>'commande', 'table'=>'commande',
'datefieldname'=>'date_commande', 'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire), 'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'invoice'=>array( 'invoice'=>array(
'name'=>"CustomersInvoices", 'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject", 'title'=>"ListInvoicesAssociatedProject",
'class'=>'Facture', 'class'=>'Facture',
'margin'=>'add', 'margin'=>'add',
'table'=>'facture', 'table'=>'facture',
'datefieldname'=>'datef', 'datefieldname'=>'datef',
'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'invoice_predefined'=>array( 'invoice_predefined'=>array(
'name'=>"PredefinedInvoices", 'name'=>"PredefinedInvoices",
'title'=>"ListPredefinedInvoicesAssociatedProject", 'title'=>"ListPredefinedInvoicesAssociatedProject",
'class'=>'FactureRec', 'class'=>'FactureRec',
'table'=>'facture_rec', 'table'=>'facture_rec',
'datefieldname'=>'datec', 'datefieldname'=>'datec',
'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'order_supplier'=>array( 'order_supplier'=>array(
'name'=>"SuppliersOrders", 'name'=>"SuppliersOrders",
'title'=>"ListSupplierOrdersAssociatedProject", 'title'=>"ListSupplierOrdersAssociatedProject",
'class'=>'CommandeFournisseur', 'class'=>'CommandeFournisseur',
'table'=>'commande_fournisseur', 'table'=>'commande_fournisseur',
'datefieldname'=>'date_commande', 'datefieldname'=>'date_commande',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire), 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire),
'invoice_supplier'=>array( 'invoice_supplier'=>array(
'name'=>"BillsSuppliers", 'name'=>"BillsSuppliers",
'title'=>"ListSupplierInvoicesAssociatedProject", 'title'=>"ListSupplierInvoicesAssociatedProject",
'class'=>'FactureFournisseur', 'class'=>'FactureFournisseur',
'margin'=>'minus', 'margin'=>'minus',
'table'=>'facture_fourn', 'table'=>'facture_fourn',
'datefieldname'=>'datef', 'datefieldname'=>'datef',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire), 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire),
'contract'=>array( 'contract'=>array(
'name'=>"Contracts", 'name'=>"Contracts",
'title'=>"ListContractAssociatedProject", 'title'=>"ListContractAssociatedProject",
'class'=>'Contrat', 'class'=>'Contrat',
'table'=>'contrat', 'table'=>'contrat',
'datefieldname'=>'date_contrat', 'datefieldname'=>'date_contrat',
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire), 'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
'intervention'=>array( 'intervention'=>array(
'name'=>"Interventions", 'name'=>"Interventions",
'title'=>"ListFichinterAssociatedProject", 'title'=>"ListFichinterAssociatedProject",
'class'=>'Fichinter', 'class'=>'Fichinter',
'table'=>'fichinter', 'table'=>'fichinter',
'datefieldname'=>'date_valid', 'datefieldname'=>'date_valid',
'disableamount'=>1, 'disableamount'=>1,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire), 'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'trip'=>array( 'trip'=>array(
'name'=>"TripsAndExpenses", 'name'=>"TripsAndExpenses",
'title'=>"ListTripAssociatedProject", 'title'=>"ListTripAssociatedProject",
'class'=>'Deplacement', 'class'=>'Deplacement',
'table'=>'deplacement', 'table'=>'deplacement',
'datefieldname'=>'dated', 'datefieldname'=>'dated',
'margin'=>'minus', 'margin'=>'minus',
'disableamount'=>1, 'disableamount'=>1,
'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire), 'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
'agenda'=>array( 'agenda'=>array(
'name'=>"Agenda", 'name'=>"Agenda",
'title'=>"ListActionsAssociatedProject", 'title'=>"ListActionsAssociatedProject",
'class'=>'ActionComm', 'class'=>'ActionComm',
'table'=>'actioncomm', 'table'=>'actioncomm',
'datefieldname'=>'datep', 'datefieldname'=>'datep',
'disableamount'=>1, 'disableamount'=>1,
'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire) 'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire)
); );
foreach ($listofreferent as $key => $value) foreach ($listofreferent as $key => $value)
{ {
$title=$value['title']; $title=$value['title'];
$classname=$value['class']; $classname=$value['class'];
$tablename=$value['table']; $tablename=$value['table'];
$datefieldname=$value['datefieldname']; $datefieldname=$value['datefieldname'];
$qualified=$value['test']; $qualified=$value['test'];
if ($qualified) if ($qualified)
{ {
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
$num=count($elementarray); $num = count($elementarray);
if ($num> 0) if ($num > 0)
{ {
$nexY = $pdf->GetY()+5; $nexY = $pdf->GetY() + 5;
$curY = $nexY; $curY = $nexY;
$pdf->SetXY($this->posxref, $curY); $pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
$selectList = $formproject->select_element($tablename, $project->thirdparty->id);
$selectList=$formproject->select_element($tablename,$project->thirdparty->id); $nexY = $pdf->GetY() + 1;
$nexY = $pdf->GetY()+1; $curY = $nexY;
$curY = $nexY; $pdf->SetXY($this->posxref, $curY);
$pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxdate - $this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L');
$pdf->MultiCell($this->posxdate-$this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L'); $pdf->SetXY($this->posxdate, $curY);
$pdf->SetXY($this->posxdate, $curY); $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C');
$pdf->MultiCell($this->posxsociety-$this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C'); $pdf->SetXY($this->posxsociety, $curY);
$pdf->SetXY($this->posxsociety, $curY); $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L');
$pdf->MultiCell($this->posxamountht-$this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L'); if (empty($value['disableamount'])) {
if (empty($value['disableamount'])) $pdf->SetXY($this->posxamountht, $curY);
{ $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R');
$pdf->SetXY($this->posxamountht, $curY); $pdf->SetXY($this->posxamountttc, $curY);
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R'); $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R');
$pdf->SetXY($this->posxamountttc, $curY); } else {
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R'); $pdf->SetXY($this->posxamountht, $curY);
} $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
else }
{ $pdf->SetXY($this->posxstatut, $curY);
$pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R');
$pdf->MultiCell($this->posxstatut-$this->posxamountht, 3, "", 1, 'R');
} if (is_array($elementarray) && count($elementarray) > 0)
$pdf->SetXY($this->posxstatut, $curY); {
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R'); $nexY = $pdf->GetY();
$curY = $nexY;
if (is_array($elementarray) && count($elementarray)>0) $total_ht = 0;
{ $total_ttc = 0;
$nexY = $pdf->GetY(); $num = count($elementarray);
$curY = $nexY; for ($i = 0; $i < $num; $i ++) {
$element = new $classname($this->db);
$total_ht = 0; $element->fetch($elementarray[$i]);
$total_ttc = 0; $element->fetch_thirdparty();
$num=count($elementarray); // print $classname;
for ($i = 0; $i < $num; $i++)
{ $qualifiedfortotal = true;
$element = new $classname($this->db); if ($key == 'invoice') {
$element->fetch($elementarray[$i]); if ($element->close_code == 'replaced')
$element->fetch_thirdparty(); $qualifiedfortotal = false; // Replacement invoice
//print $classname; }
$qualifiedfortotal=true; $pdf->SetXY($this->posxref, $curY);
if ($key == 'invoice') $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
{
if ($element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice // Date
} if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
$date = $element->date_commande;
$pdf->SetXY($this->posxref, $curY); else {
$pdf->MultiCell($this->posxdate-$this->posxref, 3, $element->ref, 1, 'L'); $date = $element->date;
if (empty($date))
$date = $element->datep;
// Date if (empty($date))
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') $date=$element->date_commande; $date = $element->date_contrat;
else if (empty($date))
{ $date = $element->datev; // Fiche inter
$date=$element->date; }
if (empty($date)) $date=$element->datep;
if (empty($date)) $date=$element->date_contrat; $pdf->SetXY($this->posxdate, $curY);
if (empty($date)) $date=$element->datev; //Fiche inter $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C');
}
$pdf->SetXY($this->posxsociety, $curY);
$pdf->SetXY($this->posxdate, $curY); if (is_object($element->thirdparty))
$pdf->MultiCell($this->posxsociety-$this->posxdate, 3, dol_print_date($date,'day'), 1, 'C'); $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $element->thirdparty->name, 1, 'L');
$pdf->SetXY($this->posxsociety, $curY); // Amount without tax
if (is_object($element->thirdparty)) if (empty($value['disableamount'])) {
$pdf->MultiCell($this->posxamountht-$this->posxsociety, 3, $element->thirdparty->name, 1, 'L'); $pdf->SetXY($this->posxamountht, $curY);
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : '&nbsp;'), 1, 'R');
$pdf->SetXY($this->posxamountttc, $curY);
// Amount without tax $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : '&nbsp;'), 1, 'R');
if (empty($value['disableamount'])) } else {
{ $pdf->SetXY($this->posxamountht, $curY);
$pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3, }
(isset($element->total_ht)?price($element->total_ht):'&nbsp;'), 1, 'R');
$pdf->SetXY($this->posxamountttc, $curY); // Status
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3, if ($element instanceof CommonInvoice) {
(isset($element->total_ttc)?price($element->total_ttc):'&nbsp;'), 1, 'R'); // This applies for Facture and FactureFournisseur
} $outputstatut = $element->getLibStatut(1, $element->getSommePaiement());
else } else {
{ $outputstatut = $element->getLibStatut(1);
$pdf->SetXY($this->posxamountht, $curY); }
$pdf->MultiCell($this->posxstatut-$this->posxamountht, 3, "", 1, 'R'); $pdf->SetXY($this->posxstatut, $curY);
} $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1, 'R', false, 1, '', '', true, 0, true);
// Status if ($qualifiedfortotal) {
if ($element instanceof CommonInvoice) { $total_ht = $total_ht + $element->total_ht;
//This applies for Facture and FactureFournisseur $total_ttc = $total_ttc + $element->total_ttc;
$outputstatut= $element->getLibStatut(1, $element->getSommePaiement()); }
} else { $nexY = $pdf->GetY();
$outputstatut = $element->getLibStatut(1); $curY = $nexY;
} }
$pdf->SetXY($this->posxstatut, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3, if (empty($value['disableamount'])) {
$outputstatut, 1, 'R',false, 1, '', '', true, 0, true); $curY = $nexY;
$pdf->SetXY($this->posxref, $curY);
if ($qualifiedfortotal) $pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L');
{ $pdf->SetXY($this->posxamountht, $curY);
$total_ht = $total_ht + $element->total_ht; $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : '&nbsp;'), 1, 'R');
$total_ttc = $total_ttc + $element->total_ttc; $pdf->SetXY($this->posxamountttc, $curY);
} $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : '&nbsp;'), 1, 'R');
$nexY = $pdf->GetY(); $pdf->SetXY($this->posxstatut, $curY);
$curY = $nexY; $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L');
} }
$nexY = $pdf->GetY() + 5;
$curY = $nexY;
if (empty($value['disableamount'])) }
{ }
$curY = $nexY; }
$pdf->SetXY($this->posxref, $curY); }
$pdf->MultiCell($this->posxamountttc-$this->posxref, 3, "TOTAL", 1, 'L');
$pdf->SetXY($this->posxamountht, $curY);
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3,
(isset($element->total_ht)?price($total_ht):'&nbsp;'), 1, 'R');
$pdf->SetXY($this->posxamountttc, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3,
(isset($element->total_ttc)?price($total_ttc):'&nbsp;'), 1, 'R');
$pdf->SetXY($this->posxstatut, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3,
$outputlangs->transnoentities("Nb")." ".$num, 1, 'L');
}
$nexY = $pdf->GetY()+5;
$curY = $nexY;
}
}
}
}

View File

@ -143,7 +143,8 @@ SelectElement=Select element
AddElement=Link to element AddElement=Link to element
UnlinkElement=Unlink element UnlinkElement=Unlink element
# Documents models # Documents models
DocumentModelBaleine=A complete project's report model (logo...) DocumentModelBeluga=Project template for linked objects overview
DocumentModelBaleine=Project report template for tasks
PlannedWorkload=Planned workload PlannedWorkload=Planned workload
PlannedWorkloadShort=Workload PlannedWorkloadShort=Workload
WorkloadOccupation=Workload assignation WorkloadOccupation=Workload assignation