clean and update code

This commit is contained in:
Philippe GRAND 2018-06-04 17:37:17 +02:00
parent 7a8fac4198
commit 909fa496e5
5 changed files with 9 additions and 15 deletions

View File

@ -176,7 +176,6 @@ class printing_printgcp extends PrintingDriver
global $bc, $conf, $langs; global $bc, $conf, $langs;
$error = 0; $error = 0;
$langs->load('printing'); $langs->load('printing');
$var=true;
$html = '<tr class="liste_titre">'; $html = '<tr class="liste_titre">';
$html.= '<td>'.$langs->trans('GCP_Name').'</td>'; $html.= '<td>'.$langs->trans('GCP_Name').'</td>';
@ -190,11 +189,9 @@ class printing_printgcp extends PrintingDriver
$html.= '</tr>'."\n"; $html.= '</tr>'."\n";
$list = $this->getlist_available_printers(); $list = $this->getlist_available_printers();
//$html.= '<td><pre>'.print_r($list,true).'</pre></td>'; //$html.= '<td><pre>'.print_r($list,true).'</pre></td>';
$var = true;
foreach ($list['available'] as $printer_det) foreach ($list['available'] as $printer_det)
{ {
$var = !$var; $html.= '<tr class="oddeven">';
$html.= "<tr ".$bc[$var].">";
$html.= '<td>'.$printer_det['name'].'</td>'; $html.= '<td>'.$printer_det['name'].'</td>';
$html.= '<td>'.$printer_det['displayName'].'</td>'; $html.= '<td>'.$printer_det['displayName'].'</td>';
$html.= '<td>'.$printer_det['id'].'</td>'; // id to identify printer to use $html.= '<td>'.$printer_det['id'].'</td>'; // id to identify printer to use

View File

@ -144,7 +144,6 @@ class printing_printipp extends PrintingDriver
{ {
global $bc, $conf, $langs; global $bc, $conf, $langs;
$error = 0; $error = 0;
$var=true;
$html = '<tr class="liste_titre">'; $html = '<tr class="liste_titre">';
$html.= '<td>'.$langs->trans('IPP_Uri').'</td>'; $html.= '<td>'.$langs->trans('IPP_Uri').'</td>';
@ -160,12 +159,11 @@ class printing_printipp extends PrintingDriver
$html.= '<td align="center">'.$langs->trans("Select").'</td>'; $html.= '<td align="center">'.$langs->trans("Select").'</td>';
$html.= "</tr>\n"; $html.= "</tr>\n";
$list = $this->getlist_available_printers(); $list = $this->getlist_available_printers();
$var = true;
foreach ($list as $value) foreach ($list as $value)
{ {
$printer_det = $this->get_printer_detail($value); $printer_det = $this->get_printer_detail($value);
$html.= "<tr ".$bc[$var].">"; $html.= '<tr class="oddeven">';
$html.= '<td>'.$value.'</td>'; $html.= '<td>'.$value.'</td>';
//$html.= '<td><pre>'.print_r($printer_det,true).'</pre></td>'; //$html.= '<td><pre>'.print_r($printer_det,true).'</pre></td>';
$html.= '<td>'.$printer_det->printer_name->_value0.'</td>'; $html.= '<td>'.$printer_det->printer_name->_value0.'</td>';

View File

@ -67,9 +67,9 @@ class doc_generic_project_odt extends ModelePDFProjects
function __construct($db) function __construct($db)
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
$langs->load("main"); // Load traductions files requiredby by page
$langs->load("companies"); $langs->loadLangs(array("companies", "main"));
$this->db = $db; $this->db = $db;
$this->name = "ODT templates"; $this->name = "ODT templates";
@ -951,7 +951,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$elementarray = $object->get_element_list($keyref, $tablename); $elementarray = $object->get_element_list($keyref, $tablename);
if (count($elementarray)>0 && is_array($elementarray)) if (count($elementarray)>0 && is_array($elementarray))
{ {
$var=true; $var=true;
$total_ht = 0; $total_ht = 0;
$total_ttc = 0; $total_ttc = 0;
$num=count($elementarray); $num=count($elementarray);

View File

@ -83,9 +83,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
function info($langs) function info($langs)
{ {
global $conf,$langs; global $conf,$langs;
$langs->load("companies"); // Load traductions files requiredby by page
$langs->load("errors"); $langs->loadLangs(array("companies", "errors"));
$form = new Form($this->db); $form = new Form($this->db);

View File

@ -419,7 +419,6 @@ if ($num > 0)
$style='pair'; $style='pair';
$now = dol_now(); $now = dol_now();
$i=0; $i=0;
$var=true;
$totalarray=array(); $totalarray=array();
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {