2
0
forked from Wavyzz/dolibarr

FIX Responsive errors due to boxes

This commit is contained in:
Laurent Destailleur
2016-06-22 15:09:27 +02:00
parent e29d46f421
commit f72ff5ac93
5 changed files with 46 additions and 17 deletions

View File

@@ -128,7 +128,7 @@ class box_services_contracts extends ModeleBoxes
}
}
$this->info_box_contents[$i][] = array('td' => 'align="left"',
$this->info_box_contents[$i][] = array('td' => 'class="tdoverflow maxwidth100onsmartphone" align="left"',
'text' => $contratlignestatic->getNomUrl(1),
'asis' => 1
);

View File

@@ -103,8 +103,8 @@ class box_services_expired extends ModeleBoxes
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->name,40),
$this->info_box_contents[$i][3] = array('td' => 'class="tdoverflow maxwidth100onsmartphone" align="left"',
'text' => $objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="center"',

View File

@@ -182,6 +182,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
global $langs, $user, $conf;
// Trick to get result into a var from a function that makes print instead of return
// TODO Replace ob_start with param nooutput=1 into showBox
ob_start();
$result = $this->showBox($head, $contents);
$output = ob_get_contents();
@@ -191,14 +192,14 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
}
/**
*Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
* Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
*
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
function showBox($head = null, $contents = null, $nooutput=0)
{
global $langs, $user, $conf;
@@ -242,7 +243,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$out.= '>';
if ($conf->use_javascript_ajax)
{
$out.= '<table summary="" class="nobordernopadding" width="100%"><tr><td>';
$out.= '<table summary="" class="nobordernopadding" width="100%"><tr><td class="tdoverflow maxwidth300onsmartphone">';
}
if (! empty($head['text']))
{
@@ -358,13 +359,16 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
}
} else {
dol_syslog(get_class($this).'::showBoxCached');
$out = dol_readcachefile($cachedir, $filename);
print "<!-- Box ".get_class($this)." from cache -->";
$out = "<!-- Box ".get_class($this)." from cache -->";
$out.= dol_readcachefile($cachedir, $filename);
}
print $out;
}
if ($nooutput) return $out;
else print $out;
return '';
}
}

View File

@@ -585,6 +585,7 @@ div.myavailability {
.clearboth { clear:both; }
.hideobject { display: none; }
.minwidth50 { min-width: 50px; }
.minwidth100 { min-width: 100px; }
.minwidth200 { min-width: 200px; }
.minwidth300 { min-width: 300px; }
@@ -617,6 +618,7 @@ div.myavailability {
.maxwidth100onsmartphone { max-width: 100px; }
.maxwidth200onsmartphone { max-width: 200px; }
.maxwidth300onsmartphone { max-width: 300px; }
.maxwidth400onsmartphone { max-width: 400px; }
.titlefield { width: auto; }
.titlefieldcreate { width: auto; }
}

View File

@@ -583,6 +583,7 @@ div.myavailability {
.clearboth { clear:both; }
.hideobject { display: none; }
.minwidth50 { min-width: 50px; }
.minwidth100 { min-width: 100px; }
.minwidth200 { min-width: 200px; }
.minwidth300 { min-width: 300px; }
@@ -615,6 +616,7 @@ div.myavailability {
.maxwidth100onsmartphone { max-width: 100px; }
.maxwidth200onsmartphone { max-width: 200px; }
.maxwidth300onsmartphone { max-width: 300px; }
.maxwidth400onsmartphone { max-width: 400px; }
.titlefield { width: auto; }
.titlefieldcreate { width: auto; }
}
@@ -683,9 +685,12 @@ td.showDragHandle {
display: block;
font-family: "RobotoDraft","Roboto",sans-serif;
left: 0;
<?php if ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
<?php } else { ?>
position: fixed;
top: 50px;
z-index: 4;
<?php } ?>
z-index: 200;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
@@ -709,9 +714,12 @@ td.showDragHandle {
-moz-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-overflow-scrolling: touch;
<?php if ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
<?php } else { ?>
overflow-x: hidden;
overflow-y: auto;
<?php } ?>
<?php } ?>
}
.side-nav-vert {
margin-left: 228px;
@@ -730,11 +738,16 @@ div.login_block {
top: inherit !important;
}
.side-nav {
/*top: inherit !important;*/
<?php if ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
<?php } else { ?>
overflow-x: initial !important;
overflow-y: scroll;
/*position: initial !important;*/
<?php } ?>
display: none;
position: auto;
top: auto;
z-index: 200;
}
div.login_block {
/* position: initial !important;*/
@@ -744,7 +757,13 @@ div.login_block {
padding-left: 0 ! important;
}
#id-left {
z-index: 201;
background: #FFF;
<?php if ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
top: 50px ! important;
<?php } else { ?>
top: 60px ! important;
<?php } ?>
}
<?php } ?>
@@ -1319,7 +1338,11 @@ div.login_block {
padding-bottom: 3px;
<?php print $left; ?>: 0;
top: 0px;
<?php if ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
position: absolute;
<?php } else { ?>
position: fixed;
<?php } ?>
font-weight: bold;
z-index: 10;
text-align: center;
@@ -1491,7 +1514,7 @@ div.blockvmenuhelp
text-align: center;
text-decoration: none;
padding-left: 0px;
padding-right: 3px;
padding-right: 8px;
padding-top: 3px;
padding-bottom: 3px;
margin: 4px 0px 0px 0px;