diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8abe3f271f7..ad968de506a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':''; //$next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':''; $previous_ref = $object->ref_previous?''.(($conf->dol_use_jmobile != 4)?'<':' ').'':''.(($conf->dol_use_jmobile != 4)?'<':' ').''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 98dc7f14fd4..bb268ffa2d0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1103,7 +1103,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $morehtmlref.=''; } - print '
'; + print '
'; print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); print '
'; print '
'; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index a07c506d758..a09b962ee26 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -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; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 4cfc4a20afb..fcb92f1b525 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -22,6 +22,9 @@ * * $cols */ +?> + +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 ''; else print ''; - print ''; + print ''; + print 'attribute_required[$key])) print ' class="fieldrequired"'; print '>' . $langs->trans($label) . ''; @@ -100,3 +105,5 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) } } } +?> + \ No newline at end of file diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index 6f88d8bb5f8..ecc9f32d837 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -10,21 +10,21 @@ print '
'; if($mode == 'edit' ) { print '
'; - print '
'.$langs->trans('Resource').'
'; - print '
'.$langs->trans('Type').'
'; - print '
'.$langs->trans('Busy').'
'; - print '
'.$langs->trans('Mandatory').'
'; - print '
'; + print '
'.$langs->trans('Resource').'
'; + print '
'.$langs->trans('Type').'
'; + print '
'.$langs->trans('Busy').'
'; + print '
'.$langs->trans('Mandatory').'
'; + print '
'; print ''; } else { print '
'; - print '
'.$langs->trans('Resource').'
'; - print '
'.$langs->trans('Type').'
'; - print '
'.$langs->trans('Busy').'
'; - print '
'.$langs->trans('Mandatory').'
'; - print '
'; + print '
'.$langs->trans('Resource').'
'; + print '
'.$langs->trans('Type').'
'; + print '
'.$langs->trans('Busy').'
'; + print '
'.$langs->trans('Mandatory').'
'; + print '
'; print ''; } @@ -66,7 +66,7 @@ if( (array) $linked_resources && count($linked_resources) > 0) print '
'; print $object_resource->getNomUrl(1); - print '
'; + print '
'; print '
'; print $object_resource->type_label; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index fb37a235b37..9b0bb737128 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1395,10 +1395,12 @@ else if ($id > 0 || ! empty($ref)) print '
'; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; } $var=true; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index a320c4ff7c7..2942a8903ab 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -383,7 +383,7 @@ class Fichinter extends CommonObject } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); return -1; } } diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index ca1813ce3e2..83825b08a90 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -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.=''; - 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(); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index e350250a638..5126768c083 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -253,7 +253,7 @@ if ($result) print '
'.$langs->trans('Description').''.$langs->trans('Date').''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').' '.$langs->trans('Description').''.$langs->trans('Date').''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'   
'; print ''; - 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"],''); diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 87354c6fd9d..14475c58203 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -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 '
'; - // Ref - /*print '';*/ - - // Affichage fiche action en mode visu print '
'.$langs->trans("Ref").''; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '
'; // 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 ''; - // Status - /*print '';*/ - // 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 '
'; @@ -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.='
'; - 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'); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c5d9dd13189..ec4ccdd2b38 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -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: #; 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: 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 { background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(,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: ; } -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 #; } -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: ; font-weight: ; @@ -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(); } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fd22ef5520d..17eec130377 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -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;
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); - print '