Todo: using div instead of tables
This commit is contained in:
parent
edf0e95424
commit
f9b14626e3
@ -1425,11 +1425,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO test using div instead of tables
|
// TODO test using div instead of tables
|
||||||
//print '<div class="table">';
|
//print '<div class="table" id="tablelines">';
|
||||||
print '<table id="tablelines" class="noborder" width="100%">';
|
print '<table id="tablelines" class="noborder" width="100%">';
|
||||||
|
|
||||||
// Show object lines
|
// Show object lines
|
||||||
if (! empty($object->lines)) $object->printObjectLines(0,$mysoc,$soc);
|
if (! empty($object->lines)) $object->printObjectLines(0,$mysoc,$soc);
|
||||||
|
|
||||||
|
//print '<table id="tablelines" class="noborder" width="100%">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Form to add new line
|
* Form to add new line
|
||||||
@ -1463,8 +1465,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO test using div instead of tables
|
// TODO test using div instead of tables
|
||||||
//print '</div>';
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
//print '</div>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|||||||
@ -1466,16 +1466,17 @@ class CommonObject
|
|||||||
|
|
||||||
// TODO test using div instead of tables
|
// TODO test using div instead of tables
|
||||||
/*
|
/*
|
||||||
|
print '<div class="table" id="tablelines">';
|
||||||
print '<div class="thead">';
|
print '<div class="thead">';
|
||||||
print '<div class="tr">';
|
print '<div class="tr">';
|
||||||
print '<div class="td desc">'.$langs->trans('Description').'</div>';
|
print '<div class="td firstcol">'.$langs->trans('Description').'</div>';
|
||||||
print '<div class="td">'.$langs->trans('VAT').'</div>';
|
print '<div class="td">'.$langs->trans('VAT').'</div>';
|
||||||
print '<div class="td">'.$langs->trans('PriceUHT').'</div>';
|
print '<div class="td">'.$langs->trans('PriceUHT').'</div>';
|
||||||
print '<div class="td">'.$langs->trans('Qty').'</div>';
|
print '<div class="td">'.$langs->trans('Qty').'</div>';
|
||||||
print '<div class="td">'.$langs->trans('ReductionShort').'</div>';
|
print '<div class="td">'.$langs->trans('ReductionShort').'</div>';
|
||||||
print '<div class="td">'.$langs->trans('TotalHTShort').'</div>';
|
print '<div class="td">'.$langs->trans('TotalHTShort').'</div>';
|
||||||
print '<div class="td ten"> </div>';
|
print '<div class="td endcol"> </div>';
|
||||||
print '<div class="td ten"> </div>';
|
print '<div class="td endcol"> </div>';
|
||||||
print '<div class="td end"> </div>';
|
print '<div class="td end"> </div>';
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
*/
|
*/
|
||||||
@ -1495,7 +1496,9 @@ class CommonObject
|
|||||||
$num = count($this->lines);
|
$num = count($this->lines);
|
||||||
$var = true;
|
$var = true;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
//print '<div class="tbody">';
|
||||||
|
|
||||||
foreach ($this->lines as $line)
|
foreach ($this->lines as $line)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -1511,6 +1514,8 @@ class CommonObject
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//print '</div></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1561,6 +1566,7 @@ class CommonObject
|
|||||||
|
|
||||||
// Use global variables + $seller and $buyer
|
// Use global variables + $seller and $buyer
|
||||||
include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_view.tpl.php');
|
include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_view.tpl.php');
|
||||||
|
//include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductlinediv_view.tpl.php');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
106
htdocs/core/tpl/predefinedproductlinediv_view.tpl.php
Normal file
106
htdocs/core/tpl/predefinedproductlinediv_view.tpl.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- BEGIN PHP TEMPLATE predefinedproductline_view.tpl.php -->
|
||||||
|
|
||||||
|
<div class="tr pair" <?php echo 'id="row-'.$line->id.'"'; ?>>
|
||||||
|
<div class="td firstcol">
|
||||||
|
<a name="<?php echo $line->id; ?>"></a>
|
||||||
|
<?php
|
||||||
|
echo $html->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
|
||||||
|
|
||||||
|
// Show range
|
||||||
|
print_date_range($line->date_start, $line->date_end);
|
||||||
|
|
||||||
|
// Add description in form
|
||||||
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
|
{
|
||||||
|
print ($line->description && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="td"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></div>
|
||||||
|
|
||||||
|
<div class="td"><?php echo price($line->subprice); ?></div>
|
||||||
|
|
||||||
|
<div class="td">
|
||||||
|
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty;
|
||||||
|
else echo ' '; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="td">
|
||||||
|
<?php if (!empty($line->remise_percent) && $line->special_code != 3) {
|
||||||
|
echo dol_print_reduction($line->remise_percent,$langs);
|
||||||
|
} else {
|
||||||
|
echo ' ';
|
||||||
|
} ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="td">
|
||||||
|
<?php if ($line->special_code == 3) {
|
||||||
|
echo $langs->trans('Option');
|
||||||
|
} else {
|
||||||
|
echo price($line->total_ht);
|
||||||
|
} ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($this->statut == 0 && $user->rights->$element->creer) { ?>
|
||||||
|
<div class="td endcol">
|
||||||
|
<?php if (($line->info_bits & 2) == 2) { ?>
|
||||||
|
<?php } else { ?>
|
||||||
|
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#'.$line->id; ?>">
|
||||||
|
<?php echo img_edit(); ?>
|
||||||
|
</a>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="td endcol">
|
||||||
|
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&lineid='.$line->id; ?>">
|
||||||
|
<?php echo img_delete(); ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($num > 1) { ?>
|
||||||
|
<div class="td end tdlineupdown">
|
||||||
|
<?php if ($i > 0) { ?>
|
||||||
|
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
||||||
|
<?php echo img_up(); ?>
|
||||||
|
</a>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ($i < $num-1) { ?>
|
||||||
|
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
||||||
|
<?php echo img_down(); ?>
|
||||||
|
</a>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
<?php } else { ?>
|
||||||
|
<div class="td endcol tdlineupdown"> </div>
|
||||||
|
<?php } ?>
|
||||||
|
<?php } else { ?>
|
||||||
|
<div class="td endcol"> </div>
|
||||||
|
<div class="td endcol"> </div>
|
||||||
|
<div class="td end"> </div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- END PHP TEMPLATE predefinedproductline_view.tpl.php -->
|
||||||
@ -1868,12 +1868,12 @@ A.none, A.none:active, A.none:visited, A.none:hover {
|
|||||||
/* Test using div instead of tables */
|
/* Test using div instead of tables */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
div.table {
|
div.tablelines {
|
||||||
display:table;
|
display: table;
|
||||||
/* Joindre les bords des cellules */
|
/* Joindre les bords des cellules */
|
||||||
border-collapse:collapse;
|
border-collapse: collapse;
|
||||||
/* Forcer le tableau à prendre la largeur écran */
|
/* Forcer le tableau à prendre la largeur écran */
|
||||||
width:100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
div.thead {
|
div.thead {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
@ -1884,30 +1884,44 @@ div.thead {
|
|||||||
font-family: <?php print $fontlist ?>;
|
font-family: <?php print $fontlist ?>;
|
||||||
/* border-bottom: 1px solid #FDFFFF; */
|
/* border-bottom: 1px solid #FDFFFF; */
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display:table-row-group;
|
display: table-row-group;
|
||||||
}
|
}
|
||||||
div.tfoot {
|
div.tfoot {
|
||||||
display:table-row-group;
|
display: table-row-group;
|
||||||
}
|
}
|
||||||
div.tbody {
|
div.tbody {
|
||||||
display:table-row-group;
|
display: table-row-group;
|
||||||
}
|
}
|
||||||
div.tr {
|
div.tr {
|
||||||
display:table-row;
|
display: table-row;
|
||||||
}
|
}
|
||||||
div.td {
|
div.td {
|
||||||
display:table-cell;
|
display: table-cell;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding:5px;
|
padding: 5px;
|
||||||
width:auto;
|
width: 10%;
|
||||||
}
|
}
|
||||||
div.td.desc {
|
div.td.firstcol {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
width: 70%;
|
width: 65%;
|
||||||
}
|
}
|
||||||
div.td.ten {
|
div.td.endcol {
|
||||||
width: 10px;
|
width: 5px;
|
||||||
}
|
}
|
||||||
div.end {
|
div.end {
|
||||||
width:auto;
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.dragClass {
|
||||||
|
color: #002255;
|
||||||
|
}
|
||||||
|
div.showDragHandle {
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
div.tdlineupdown {
|
||||||
|
background-image: url(<?php echo DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/grip.png' ?>);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center center;
|
||||||
|
cursor: move;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user