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 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return childs of a category * Return direct childs of a category
* *
* @return array|int <0 KO, array ok * @return array|int <0 KO, array ok
*/ */
@ -940,7 +940,7 @@ class Categorie extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // 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 * @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 $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"; 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"; $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 .= " 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); dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);

View File

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

View File

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

View File

@ -64,22 +64,21 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
$categorie = new Categorie($db); $categorie = new Categorie($db);
$categories = $categorie->get_full_arbo('product'); $categories = $categorie->get_full_arbo('product');
$maincategories = array_filter($categories, function ($item) { $maincategories = array();
if (($item['level']==1) !== false && ($item['visible']==1) !== false) { $subcategories = array();
return true; foreach($categories as $key => $categorycursor)
{
if ($categorycursor['level'] == 1)
{
$maincategories[$key] = $categorycursor;
}
else
{
$subcategories[$key] = $categorycursor;
}
} }
return false;
});
sort($maincategories); sort($maincategories);
$subcategories = array_filter($categories, function ($item) {
if (($item['level']!=1) !== false && ($item['visible']==1) !== false) {
return true;
}
return false;
});
sort($subcategories); sort($subcategories);
?> ?>
@ -487,6 +486,10 @@ if (!empty($reshook)) {
?> ?>
<div class="div3"> <div class="div3">
<?php <?php
$MAXCATEG = 16;
$MAXPRODUCT = 32;
$i = 0; $i = 0;
foreach($menus as $menu) { foreach($menus as $menu) {
$i++; $i++;
@ -501,15 +504,16 @@ foreach($menus as $menu) {
?> ?>
</div> </div>
</div> </div>
<div class="row2"> <div class="row2">
<div class="div4"> <div class="div4">
<?php <?php
$count=0; $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;?>'> <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==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;?>'/> <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'>
<div class='description_content' id='catdesc<?php echo $count;?>'></div> <div class='description_content' id='catdesc<?php echo $count;?>'></div>
</div> </div>
@ -524,11 +528,11 @@ foreach($menus as $menu) {
<div class="div5"> <div class="div5">
<?php <?php
$count=0; $count=0;
while ($count<32) while ($count < $MAXPRODUCT)
{ {
?> ?>
<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.');"';?>> <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==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;?>'/> <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'>
<div class='description_content' id='prodesc<?php echo $count;?>'></div> <div class='description_content' id='prodesc<?php echo $count;?>'></div>
</div> </div>