Merge and clean TakePOS CSS

This commit is contained in:
Laurent Destailleur 2019-03-15 00:49:44 +01:00
commit 0ef6fd36f9
5 changed files with 64 additions and 45 deletions

View File

@ -909,7 +909,7 @@ class Categorie extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return childs of a category
* Return direct childs of a category
*
* @return array|int <0 KO, array ok
*/
@ -922,7 +922,7 @@ class Categorie extends CommonObject
$res = $this->db->query($sql);
if ($res)
{
$cats = array ();
$cats = array();
while ($rec = $this->db->fetch_array($res))
{
$cat = new Categorie($this->db);
@ -940,7 +940,7 @@ class Categorie extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load this->motherof that is array(id_son=>id_parent, ...)
* Load the array this->motherof that is array(id_son=>id_parent, ...)
*
* @return int <0 if KO, >0 if OK
*/
@ -1007,9 +1007,9 @@ class Categorie extends CommonObject
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$this->db->escape($current_lang)."'";
$sql .= " WHERE c.entity IN (" . getEntity('category') . ")";
$sql .= " AND c.type = " . $type;
$sql .= " AND c.type = " . (int) $type;
dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@ -1421,7 +1421,6 @@ if ($action == 'create')
print '<!-- Show details of stock -->';
print '('.$stock.')';
}
else
{
@ -1522,7 +1521,6 @@ if ($action == 'create')
}
}
}
}
if ($subj == 0) // Line not shown yet, we show it
{

View File

@ -608,7 +608,7 @@ else
$reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action);
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
if (empty($reshook))
{
print '<tr class="oddeven">';
if ($object->lines[$i]->fk_product > 0)
@ -635,7 +635,7 @@ else
{
$label = (!empty($object->lines[$i]->label) ? $object->lines[$i]->label : $object->lines[$i]->product_label);
}
print '<td>';
// Affiche ligne produit

View File

@ -155,7 +155,11 @@ div.catwatermark{
text-align: center;
box-sizing: border-box;
overflow: auto;
background-color:white;
/* background-color:white; */
padding-top: 0;
padding-bottom: 10px;
padding-right: 5px;
padding-left: 5px;
}
.div2{
@ -163,8 +167,11 @@ div.catwatermark{
width: 33%;
font-size: 0;
float: left;
padding-left: 10px;
box-sizing: border-box;
padding-top: 0;
padding-bottom: 10px;
padding-right: 5px;
padding-left: 5px;
}
.div3{
@ -172,6 +179,10 @@ div.catwatermark{
width: 33%;
float: left;
box-sizing: border-box;
padding-top: 0;
padding-bottom: 10px;
padding-right: 5px;
padding-left: 5px;
}
.div4{
@ -180,7 +191,10 @@ div.catwatermark{
float: left;
box-sizing: border-box;
font-size: 6px;
padding:3px;
padding-top: 10px;
padding-bottom: 10px;
padding-right: 5px;
padding-left: 5px;
}
.div5{
@ -189,7 +203,10 @@ div.catwatermark{
float: left;
box-sizing: border-box;
font-size: 6px;
padding:10px;
padding-top:10px;
padding-bottom:10px;
padding-right: 5px;
padding-left: 5px;
}
p.description_content{

View File

@ -64,22 +64,21 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
$categorie = new Categorie($db);
$categories = $categorie->get_full_arbo('product');
$maincategories = array_filter($categories, function ($item) {
if (($item['level']==1) !== false && ($item['visible']==1) !== false) {
return true;
$maincategories = array();
$subcategories = array();
foreach($categories as $key => $categorycursor)
{
if ($categorycursor['level'] == 1)
{
$maincategories[$key] = $categorycursor;
}
return false;
});
else
{
$subcategories[$key] = $categorycursor;
}
}
sort($maincategories);
$subcategories = array_filter($categories, function ($item) {
if (($item['level']!=1) !== false && ($item['visible']==1) !== false) {
return true;
}
return false;
});
sort($subcategories);
?>
@ -487,6 +486,10 @@ if (!empty($reshook)) {
?>
<div class="div3">
<?php
$MAXCATEG = 16;
$MAXPRODUCT = 32;
$i = 0;
foreach($menus as $menu) {
$i++;
@ -501,15 +504,16 @@ foreach($menus as $menu) {
?>
</div>
</div>
<div class="row2">
<div class="div4">
<?php
$count=0;
while ($count<16)
while ($count < $MAXCATEG)
{
?>
<div class='wrapper' <?php if ($count==14) echo 'onclick="MoreCategories(\'less\');"'; elseif ($count==15) echo 'onclick="MoreCategories(\'more\');"'; else echo 'onclick="LoadProducts('.$count.');"';?> id='catdiv<?php echo $count;?>'>
<img class='imgwrapper' <?php if ($count==14) echo 'src="img/arrow-prev-top.png"'; if ($count==15) echo 'src="img/arrow-next-top.png"';?> width="100%" height="85%" id='catimg<?php echo $count;?>'/>
<div class='wrapper' <?php if ($count==($MAXCATEG-2)) echo 'onclick="MoreCategories(\'less\');"'; elseif ($count==($MAXCATEG-1)) echo 'onclick="MoreCategories(\'more\');"'; else echo 'onclick="LoadProducts('.$count.');"';?> id='catdiv<?php echo $count;?>'>
<img class='imgwrapper' <?php if ($count==($MAXCATEG-2)) echo 'src="img/arrow-prev-top.png"'; if ($count==($MAXCATEG-1)) echo 'src="img/arrow-next-top.png"';?> width="100%" height="100%" id="catimg<?php echo $count;?>" />
<div class='description'>
<div class='description_content' id='catdesc<?php echo $count;?>'></div>
</div>
@ -522,22 +526,22 @@ foreach($menus as $menu) {
</div>
<div class="div5">
<?php
$count=0;
while ($count<32)
{
?>
<div class='wrapper2' id='prodiv<?php echo $count;?>' <?php if ($count==30) {?> onclick="MoreProducts('less');" <?php } if ($count==31) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>>
<img class='imgwrapper' <?php if ($count==30) echo 'src="img/arrow-prev-top.png"'; if ($count==31) echo 'src="img/arrow-next-top.png"';?> width="100%" height="85%" id='proimg<?php echo $count;?>'/>
<div class='description'>
<div class='description_content' id='prodesc<?php echo $count;?>'></div>
</div>
<div class="catwatermark" id='prowatermark<?php echo $count;?>'>+</div>
</div>
<?php
$count++;
}
?>
<?php
$count=0;
while ($count < $MAXPRODUCT)
{
?>
<div class='wrapper2' id='prodiv<?php echo $count;?>' <?php if ($count==($MAXPRODUCT-2)) {?> onclick="MoreProducts('less');" <?php } if ($count==($MAXPRODUCT-1)) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>>
<img class='imgwrapper' <?php if ($count==($MAXPRODUCT-2)) echo 'src="img/arrow-prev-top.png"'; if ($count==($MAXPRODUCT-1)) echo 'src="img/arrow-next-top.png"';?> width="100%" height="100%" id="proimg<?php echo $count;?>" />
<div class='description'>
<div class='description_content' id='prodesc<?php echo $count;?>'></div>
</div>
<div class="catwatermark" id='prowatermark<?php echo $count;?>'>+</div>
</div>
<?php
$count++;
}
?>
</div>
</div>
</div>