Fix css and fix navigation on resource tab.

This commit is contained in:
Laurent Destailleur 2016-12-23 13:04:46 +01:00
parent b777ec79f2
commit 43942e6ea2
12 changed files with 100 additions and 98 deletions

View File

@ -5633,18 +5633,18 @@ class Form
* Return a HTML area with the reference of object and a navigation bar for a business object
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
*
* @param object $object Object to show
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link
* @param string $morehtml More html content to output just before the nav bar
* @param int $shownav Show Condition (navigation is shown if value is 1)
* @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field)
* @param object $object Object to show.
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link.
* @param string $morehtml More html content to output just before the nav bar.
* @param int $shownav Show Condition (navigation is shown if value is 1).
* @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field).
* @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref.
* @param string $morehtmlref More html to show after ref
* @param string $moreparam More param to add in nav link url.
* @param int $nodbprefix Do not include DB prefix to forge table name
* @param string $morehtmlleft More html code to show before ref
* @param string $morehtmlstatus More html code to show under navigation arrows (status place)
* @param string $morehtmlright More html code to show after ref
* @param string $morehtmlref More html to show after ref.
* @param string $moreparam More param to add in nav link url. Must start with '&...'.
* @param int $nodbprefix Do not include DB prefix to forge table name.
* @param string $morehtmlleft More html code to show before ref.
* @param string $morehtmlstatus More html code to show under navigation arrows (status place).
* @param string $morehtmlright More html code to show after ref.
* @return string Portion HTML with ref + navigation buttons
*/
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
@ -5657,7 +5657,7 @@ class Form
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);
//$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):'&nbsp;').'</a>':'';
//$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):'&nbsp;').'</a>':'';
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'&lt;':'&nbsp;').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'&lt;':'&nbsp;').'</span>';

View File

@ -1103,7 +1103,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$morehtmlref.='</div>';
}
print '<div class="'.($onlybanner?'':'arearef ').'heightref valignmiddle" width="100%">';
print '<div class="'.($onlybanner?'arearefnobottom ':'arearef ').'heightref valignmiddle" width="100%">';
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
print '</div>';
print '<div class="underrefbanner clearboth"></div>';

View File

@ -2007,13 +2007,14 @@ function getElementProperties($element_type)
/**
* Fetch an object from its id and element_type
* Inclusion classes is automatic
* Inclusion of classes is automatic
*
* @param int $element_id Element id
* @param string $element_type Element type
* @param ref $element_ref Element ref (Use this if element_id but not both)
* @return int|object object || 0 || -1 if error
*/
function fetchObjectByElement($element_id, $element_type)
function fetchObjectByElement($element_id, $element_type, $element_ref='')
{
global $conf;
global $db,$conf;
@ -2023,11 +2024,11 @@ function fetchObjectByElement($element_id, $element_type)
{
dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');
$objectstat = new $element_prop['classname']($db);
$ret = $objectstat->fetch($element_id);
$objecttmp = new $element_prop['classname']($db);
$ret = $objecttmp->fetch($element_id, $element_ref);
if ($ret >= 0)
{
return $objectstat;
return $objecttmp;
}
}
return 0;

View File

@ -22,6 +22,9 @@
*
* $cols
*/
?>
<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
<?php
//$res = $object->fetch_optionals($object->id, $extralabels);
$parameters = array('colspan' => ' colspan="'.$cols.'"', 'cols' => $cols, 'socid' => $object->fk_soc);
@ -47,7 +50,9 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
{
if (!empty($extrafields->attribute_hidden[$key])) print '<tr class="hideobject"><td>';
else print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td';
print '<table width="100%" class="nobordernopadding">';
print '<tr>';
print '<td';
//var_dump($action);exit;
if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>' . $langs->trans($label) . '</td>';
@ -100,3 +105,5 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
}
}
}
?>
<!-- END PHP TEMPLATE admin_extrafields_view.tpl.php -->

View File

@ -10,21 +10,21 @@ print '<div class="tagtable centpercent noborder allwidth">';
if($mode == 'edit' )
{
print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>';
print '<div class="tagtd liste_titre">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd liste_titre">'.$langs->trans('Type').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd liste_titre"></div>';
print '</form>';
}
else
{
print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>';
print '<div class="tagtd liste_titre">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd liste_titre">'.$langs->trans('Type').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd liste_titre"></div>';
print '</form>';
}
@ -66,7 +66,7 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '<div class="tagtd">';
print $object_resource->getNomUrl(1);
print '</div class="tagtd">';
print '</div>';
print '<div class="tagtd">';
print $object_resource->type_label;

View File

@ -1395,10 +1395,12 @@ else if ($id > 0 || ! empty($ref))
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Description').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
print '<td width="48" colspan="3">&nbsp;</td>';
print '<td class="liste_titre">'.$langs->trans('Description').'</td>';
print '<td class="liste_titre" align="center">'.$langs->trans('Date').'</td>';
print '<td class="liste_titre" align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n";
}
$var=true;

View File

@ -383,7 +383,7 @@ class Fichinter extends CommonObject
}
else
{
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}

View File

@ -45,7 +45,11 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db);
$result = $object->fetch($id,$ref);
if (! $result)
{
print 'Record not found';
exit;
}
/*
* Adding a new contact
@ -166,7 +170,7 @@ if ($id > 0 || ! empty($ref))
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, 0, 0, '', '', 1);
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
dol_fiche_end();

View File

@ -253,7 +253,7 @@ if ($result)
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
print '<tr class="liste_titre">';
if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$param,'width="15%"',$sortfield,$sortorder);
if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['f.description']['checked'])) print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['fd.description']['checked'])) print_liste_field_titre('',$_SERVER["PHP_SELF"],'');

View File

@ -51,13 +51,13 @@ $hookmanager->initHooks(array('element_resource'));
$object->available_resources = array('dolresource');
// Get parameters
$id = GETPOST('id','int');
$ref = GETPOST('ref','alpha');
$id = GETPOST('id','int'); // resource id
$element_id = GETPOST('element_id','int'); // element_id
$element_ref = GETPOST('ref','alpha'); // element ref
$element = GETPOST('element','alpha'); // element_type
$action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha');
$lineid = GETPOST('lineid','int');
$element = GETPOST('element','alpha'); // element_type
$element_id = GETPOST('element_id','int');
$resource_id = GETPOST('fk_resource','int');
$resource_type = GETPOST('resource_type','alpha');
$busy = GETPOST('busy','int');
@ -66,7 +66,7 @@ $cancel = GETPOST('cancel','alpha');
$confirm = GETPOST('confirm','alpha');
$socid = GETPOST('socid','int');
if ($socid > 0)
if ($socid > 0) // Special for thirdparty
{
$element_id = $socid;
$element = 'societe';
@ -183,11 +183,11 @@ else
// Specific to agenda module
if ($element_id && $element == 'action')
if (($element_id || $element_ref) && $element == 'action')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
$act = fetchObjectByElement($element_id,$element);
$act = fetchObjectByElement($element_id,$element, $element_ref);
if (is_object($act))
{
@ -212,16 +212,10 @@ else
$linkback.=$out;
dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '', "&element=".$element);
dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '', '&element='.$element, 0, '', '');
print '<div class="underbanner clearboth"></div>';
// Ref
/*print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';*/
// Affichage fiche action en mode visu
print '<table class="border" width="100%">';
// Type
@ -248,11 +242,6 @@ else
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>';
// Status
/*print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4);
print '</td></tr>';*/
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{
@ -301,9 +290,9 @@ else
}
// Specific to thirdparty module
if ($element_id && $element == 'societe')
if (($element_id || $element_ref) && $element == 'societe')
{
$socstatic = fetchObjectByElement($element_id, $element);
$socstatic = fetchObjectByElement($element_id, $element, $element_ref);
if (is_object($socstatic)) {
$savobject = $object;
@ -314,7 +303,7 @@ else
dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', '&element='.$element);
print '<div class="fichecenter">';
@ -337,12 +326,12 @@ else
}
// Specific to fichinter module
if ($element_id && $element == 'fichinter')
if (($element_id || $element_ref) && $element == 'fichinter')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
$fichinter = new Fichinter($db);
$fichinter->fetch($element_id);
$fichinter->fetch($element_id, $element_ref);
$fichinter->fetch_thirdparty();
if (is_object($fichinter))
@ -395,7 +384,7 @@ else
}
$morehtmlref.='</div>';
dol_banner_tab($fichinter, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
dol_banner_tab($fichinter, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '&element='.$element, 0, '', '', 1);
dol_fiche_end();
}
@ -403,7 +392,7 @@ else
// hook for other elements linked
$parameters=array('element'=>$element, 'element_id'=>$element_id );
$parameters=array('element'=>$element, 'element_id'=>$element_id, 'element_ref'=>$element_ref);
$reshook=$hookmanager->executeHooks('printElementTab',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -967,12 +967,13 @@ div.attacharea {
}
div.arearef {
/*border-bottom: 1px solid #bbb;*/
padding-top: 2px;
padding-bottom: 5px;
/*padding-right: 3px;
padding-left: 2px;*/
margin-bottom: 10px;
padding-bottom: 7px;
}
div.arearefnobottom {
padding-top: 2px;
padding-bottom: 4px;
}
div.heightref {
min-height: 80px;
@ -1961,15 +1962,8 @@ div.tabBar {
color: #<?php echo $colortextbacktab; ?>;
padding-top: 16px;
padding-left: 0px; padding-right: 0px;
/*padding-left: 18px;
padding-right: 18px;*/
padding-bottom: 14px;
margin: 0px 0px 14px 0px;
/*-moz-border-radius:4px;
-webkit-border-radius: 4px;
border-radius: 4px;
border-right: 1px solid #AAA;
border-left: 1px solid #AAA; */
border-top: 1px solid #BBB;
border-bottom: 1px solid #AAA;
width: auto;
@ -2456,11 +2450,16 @@ table.liste tr, table.noborder tr, div.noborder form {
table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.noborder tr.box_titre td {
padding: 8px 2px 8px 3px; /* t r b l */
}
tr.box_titre .nobordernopadding td { padding: 0px ! important; }
table.liste td, table.noborder td, div.noborder form, div.noborder form div {
padding: 5px 2px 5px 3px; /* t r b l */
table.liste td, table.noborder td, div.noborder form div {
padding: 8px 2px 8px 3px; /* t r b l */
}
div.liste_titre_bydiv .divsearchfield {
padding: 2px 1px 2px 0px; /* t r b l */
}
tr.box_titre .nobordernopadding td {
padding: 0px ! important;
}
table.nobordernopadding {
border-collapse: collapse !important;
border: 0px;
@ -2725,7 +2724,7 @@ tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair
padding: 5px 2px 5px 3px;
border-bottom: 1px solid #ddd;
}
tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
form.tagtr:last-of-type div.tagtd, tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
border-bottom: 0px !important;
}
tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td {
@ -2737,26 +2736,18 @@ td.nobottom, td.nobottom {
div.liste_titre .tagtd {
vertical-align: middle;
}
div.liste_titre {
/*div.liste_titre {
box-shadow: 2px 2px 4px #CCC;
}
}*/
div.liste_titre {
min-height: 26px !important; /* We cant use height because it's a div and it should be higher if content is more. but min-height does not work either for div */
padding-top: 2px;
padding-bottom: 2px;
/*border-right-width: 1px;
border-right-color: #BBB;
border-right-style: solid;
border-left-width: 1px;
border-left-color: #BBB;
border-left-style: solid;*/
border-top-width: 1px;
/* border-top-width: 1px;
border-top-color: #BBB;
border-top-style: solid;
border-top-style: solid;*/
}
div.liste_titre_bydiv {
border-top-width: <?php echo $borderwith ?>px;
@ -2773,7 +2764,7 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl
{
height: 26px !important;
}
div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
{
<?php if ($usegradienttitle) { ?>
background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.4) 100%);
@ -2791,11 +2782,11 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list
border-bottom: 1px solid #FDFFFF;
text-align: <?php echo $left; ?>;
}
tr.liste_titre th, tr.liste_titre td, th.liste_titre, form.liste_titre div, div.liste_titre
tr.liste_titre th, tr.liste_titre td, th.liste_titre
{
border-bottom: 1px solid #<?php echo ($colorbacktitle1 == '255,255,255'?'BBBBBB':'FDFFFF'); ?>;
}
tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div, div.liste_titre
tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div
{
font-family: <?php print $fontlist ?>;
font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
@ -2819,7 +2810,7 @@ tr.liste_titre_topborder td {
.liste_titre td a.notasortlink:hover {
background: transparent;
}
tr.liste_titre td.liste_titre { /* For last line of table headers only */
tr.liste_titre td.liste_titre, form.liste_titre div.tagtd { /* For last line of table headers only */
border-bottom: 1px solid rgb(<?php echo $colortopbordertitle1 ?>);
}

View File

@ -1016,13 +1016,14 @@ div.attacharea {
padding-bottom: 10px;
}
div.arearef {
/*border-bottom: 1px solid #bbb;*/
padding-top: 2px;
padding-bottom: 5px;
/*padding-right: 3px;
padding-left: 2px;*/
margin-bottom: 10px;
}
div.arearefnobottom {
padding-top: 2px;
padding-bottom: 4px;
}
div.heightref {
min-height: 80px;
}
@ -2379,6 +2380,13 @@ table.noborder td, div.noborder form, div.noborder form div {
padding: 4px 2px 4px 3px; /* t r b l */
}
table.liste td, table.noborder td, div.noborder form div {
padding: 8px 2px 8px 3px; /* t r b l */
}
div.liste_titre_bydiv .divsearchfield {
padding: 2px 1px 2px 0px; /* t r b l */
}
table.nobordernopadding {
border-collapse: collapse !important;
border: 0px;