diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d045c5f0ea7..90fdc246be6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1660,23 +1660,86 @@ if ($action == 'create') // Print form confirm print $formconfirm; - print ''; $linkback = '' . $langs->trans("BackToList") . ''; - // Ref + + $morehtmlref='
'; + + // Ref customer + $morehtmlref.=$langs->trans('RefCustomer').' '; + if ($action != 'refclient' && ! empty($object->brouillon)) + $morehtmlref.='' . img_edit($langs->trans('Modify')) . ' : '; + if ($user->rights->propal->creer && $action == 'refclient') { + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=' '; + $morehtmlref.=''; + } else { + $morehtmlref.=$object->ref_client; + } + + // Thirdparty + $morehtmlref.='
'.$langs->trans('Company') . ' : ' . $soc->getNomUrl(1); + + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->propal->creer) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.=''; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + + $morehtmlref.='
'; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
'; + + print '
'; + + // Ref + /* print ''; + */ // Ref customer + /* print '
' . $langs->trans('Ref') . ''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
'; print ''; if ($action != 'refclient' && ! empty($object->brouillon)) print ''; - print ''; - print '
'; print $langs->trans('RefCustomer') . '' . img_edit($langs->trans('Modify')) . '
'; + print '
'; print ''; if ($user->rights->propal->creer && $action == 'refclient') { print '
'; @@ -1690,10 +1753,12 @@ if ($action == 'create') } print ''; print ''; - + */ + // Company + /* print '' . $langs->trans('Company') . '' . $soc->getNomUrl(1) . ''; - print ''; + print '';*/ // Lin for thirdparty discounts print '' . $langs->trans('Discounts') . ''; @@ -1916,6 +1981,7 @@ if ($action == 'create') } // Project + /* if (! empty($conf->projet->enabled)) { $langs->load("projects"); @@ -1949,7 +2015,7 @@ if ($action == 'create') } } print ''; - } + }*/ if ($soc->outstanding_limit) { @@ -2069,7 +2135,7 @@ if ($action == 'create') } // Statut - print '' . $langs->trans('Status') . '' . $object->getLibStatut(4) . ''; + //print '' . $langs->trans('Status') . '' . $object->getLibStatut(4) . ''; print '
'; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6523688fd8d..fb24e82f68d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -49,7 +49,8 @@ class Propal extends CommonObject public $table_element_line='propaldet'; public $fk_element='fk_propal'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - + public $picto='propal'; + /** * {@inheritdoc} */ @@ -2890,19 +2891,19 @@ class Propal extends CommonObject /** * Return label of status of proposal (draft, validated, ...) * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto * @return string Label */ function getLibStatut($mode=0) { - return $this->LibStatut($this->statut,$mode); + return $this->LibStatut($this->statut, $mode); } /** * Return label of a status (draft, validated, ...) * * @param int $statut id statut - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label */ function LibStatut($statut,$mode=1) @@ -2921,8 +2922,9 @@ class Propal extends CommonObject if ($mode == 2) return img_picto($this->labelstatut_short[$statut], $statuttrans).' '.$this->labelstatut_short[$statut]; if ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans); if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut]; - if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut_short[$statut],$statuttrans); - } + if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + if ($mode == 6) return ''.$this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + } /** @@ -3232,11 +3234,8 @@ class Propal extends CommonObject } $linkend=''; - $picto='propal'; - - if ($withpicto) - $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend); + $result.=($link.img_object($label, $this->picto, 'class="classfortooltip"').$linkend); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$link.$this->ref.$linkend; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 91972673201..89f31256717 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -75,15 +75,19 @@ if ($id > 0 || ! empty($ref)) $societe = new Societe($db); if ( $societe->fetch($object->socid) ) { - $head = propal_prepare_head($object); + $head = propal_prepare_head($object); dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal'); + $cssclass='titlefield'; + //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; + //if ($action == 'editnote_private') $cssclass='titlefieldcreate'; + print ''; $linkback = ''.$langs->trans('BackToList').''; // Ref - print ''; @@ -138,7 +142,7 @@ if ($id > 0 || ! empty($ref)) print "
'.$langs->trans('Ref').''; + print '
'.$langs->trans('Ref').''; print $form->showrefnav($object,'ref',$linkback,1,'ref','ref',''); print '
"; - print '
'; + //print '
'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 5f075ebf821..8cbf532c89a 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -646,7 +646,7 @@ else { print ''; - print ''; + print ''; print ''; // Show fields of bank account @@ -710,7 +710,7 @@ else print '
'.$langs->trans("BankName").'
'.$langs->trans("BankName").''.$account->bank.'
'; // Accountancy code - print ''; + print ''; print ''; @@ -908,7 +908,7 @@ else print '
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").''; if (! empty($conf->accounting->enabled)) { print length_accountg($account->account_number).'
'; // If bank account - print ''; + print ''; print ''; print ''; @@ -975,7 +975,7 @@ else $tdextra = ' class="fieldrequired titlefieldcreate"'; } - print ''.$langs->trans("AccountancyCode").''; + print ''.$langs->trans("AccountancyCode").''; print '
'.$langs->trans("BankName").'
'.$langs->trans("BankName").'
'; if (!empty($conf->accounting->enabled)) { print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4e4f027ae12..8f1e40db48f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -433,7 +433,7 @@ abstract class CommonObject /** - * Return full address of contact + * Return full address for banner * * @param string $htmlkey HTML id to make banner content unique * @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member) @@ -476,7 +476,7 @@ abstract class CommonObject $out.=img_picto($langs->trans("Address"), 'object_address.png'); $out.=' '; } - $out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1); $outdone++; + $out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', '); $outdone++; $outdone++; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0369bd76789..c8ae8dd8b6b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3540,30 +3540,33 @@ class Form * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely except $selected,2=Disable) * @param int $maxlength Max length * @param int $forcefocus Force focus on field (works with javascript only) - * @return void + * @param int $nooutput No print is done. String is returned. + * @return string Return html content */ - function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0) + function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0) { global $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + $out=''; + $formproject=new FormProjets($this->db); $langs->load("project"); if ($htmlname != "none") { - print "\n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus); - print '
'; + $out.="\n"; + $out.='
'; + $out.=''; + $out.=''; + $out.=''; + $out.=''; + $out.=''; + $out.='
'; + $out.=$formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1); + $out.='
'; } else { @@ -3572,13 +3575,20 @@ class Form $projet = new Project($this->db); $projet->fetch($selected); //print ''.$projet->title.''; - print $projet->getNomUrl(0,'',1); + $out.=$projet->getNomUrl(0,'',1); } else { - print " "; + $out.=" "; } } + + if (empty($nooutput)) + { + print $out; + return ''; + } + return $out; } /** @@ -5738,7 +5748,7 @@ class Form } } - else dol_print_error('','Call of showphoto with wrong parameters'); + else dol_print_error('','Call of showphoto with wrong parameters modulepart='.$modulepart); return $ret; } diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 4c4c1486d51..f1ec7edae73 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -48,7 +48,7 @@ class FormProjets * * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) * @param int $selected Id project preselected - * @param string $htmlname Nom de la zone html + * @param string $htmlname Name of HTML field * @param int $maxlength Maximum length of label * @param int $option_only Return only html options lines without the select tag * @param int $show_empty Add an empty line @@ -57,12 +57,15 @@ class FormProjets * @param int $disabled Disabled * @param int $mode 0 for HTML mode and 1 for JSON mode * @param string $filterkey Key to filter - * @return int Nber of project if OK, <0 if KO + * @param int $nooutput No print output. Return it only. + * @return string Return html content */ - function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '') + function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0) { global $langs,$conf,$form; + $out=''; + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) { $placeholder=''; @@ -75,26 +78,33 @@ class FormProjets $selected_input_value=$project->ref; } $urloption='socid='.$socid.'&htmlname='.$htmlname; - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array( + $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array( // 'update' => array( // 'projectid' => 'id' // ) )); - print ''; + $out.=''; } else { - print $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey); + $out.=$this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey, 1); if ($discard_closed) { if (class_exists('Form')) { if (empty($form)) $form=new Form($this->db); - print $form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden")); + $out.=$form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden")); } } } + + if (empty($nooutput)) + { + print $out; + return ''; + } + else return $out; } /** @@ -111,9 +121,10 @@ class FormProjets * @param int $disabled Disabled * @param int $mode 0 for HTML mode and 1 for array return (to be used by json_encode for example) * @param string $filterkey Key to filter + * @param int $nooutput No print output. Return it only. * @return int Nb of project if OK, <0 if KO */ - function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '') + function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0) { global $user,$conf,$langs; @@ -250,10 +261,13 @@ class FormProjets $this->db->free($resql); if (!$mode) { - if (empty($option_only)) { - $out.= ''; + if (empty($option_only)) $out.= ''; + if (empty($nooutput)) + { + print $out; + return ''; } - print $out; + else return $out; } else { return $outarray; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 88423aac279..8159c0b86a5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -920,8 +920,8 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $modulepart='unknown'; if ($object->element == 'societe') $modulepart='societe'; if ($object->element == 'contact') $modulepart='contact'; - if ($object->element == 'member') $modulepart='memberphoto'; - if ($object->element == 'user') $modulepart='userphoto'; + if ($object->element == 'member') $modulepart='memberphoto'; + if ($object->element == 'user') $modulepart='userphoto'; if ($object->element == 'product') $modulepart='product'; print '
'; @@ -947,7 +947,18 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } else { - if ($showimage) $morehtmlleft.='
'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'
'; + if ($showimage) + { + $morehtmlleft.='
'; + if ($modulepart != 'unknown') $morehtmlleft.=$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos); + else + { + $width=14; $cssclass='photorefcenter'; + $nophoto=img_picto('', 'object_'.$object->picto, '', false, 1); + $morehtmlleft.='
No photo
'; + } + $morehtmlleft.='
'; + } } if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { @@ -970,7 +981,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } } else { - $morehtmlright.=$object->getLibStatut(5); + $tmptxt=$object->getLibStatut(6); + if (empty($tmptxt)) $tmptxt=$object->getLibStatut(5); + $morehtmlright.=$tmptxt; } if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; // For thirdparty if (! empty($object->label)) $morehtmlref.='
'.$object->label.'
'; // For product @@ -1793,10 +1806,11 @@ function dol_user_country() * @param int $mode thirdparty|contact|member|other * @param int $id Id of object * @param int $noprint No output. Result is the function return + * @param string $charfornl Char to use instead of nl2br. '' means we use a standad nl2br. * @return string|void Nothing if noprint is 0, formatted address if noprint is 1 * @see dol_format_address */ -function dol_print_address($address, $htmlid, $mode, $id, $noprint=0) +function dol_print_address($address, $htmlid, $mode, $id, $noprint=0, $charfornl='') { global $conf, $user, $langs, $hookmanager; @@ -1811,7 +1825,9 @@ function dol_print_address($address, $htmlid, $mode, $id, $noprint=0) } if (empty($reshook)) { - $out.=nl2br($address); + if (empty($charfornl)) $out.=nl2br($address); + else $out.=preg_replace('/[\r\n]+/', $charfornl, $address); + $showgmap=$showomap=0; // TODO Add a hook here diff --git a/htdocs/product/note.php b/htdocs/product/note.php index b3f2fa1c01c..9a914527a83 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -93,23 +93,20 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'note', $titre, 0, $picto); - - print '
'; - print ''; - $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - - print '
'; + + $cssclass='titlefield'; + //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; + //if ($action == 'editnote_private') $cssclass='titlefieldcreate'; + + //print '
'; print '
'; - $cssclass='titlefield'; - if ($action == 'editnote') $cssclass='titlefieldcreate'; - if ($action == 'editnote_private') $cssclass='titlefieldcreate'; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - dol_fiche_end(); } diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index ac441f52938..27eb643bc16 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -73,10 +73,6 @@ if ($id > 0) dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company'); - - print ''; - print ''; - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); $cssclass='titlefield'; @@ -120,7 +116,6 @@ if ($id > 0) //print '
'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - dol_fiche_end(); } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index bf5a0e66085..3d39cea9f62 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -913,7 +913,7 @@ div.statusref { margin-bottom: 10px; clear: both; } -img.photoref { +img.photoref, div.photoref { border: 1px solid #CCC; -moz-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD; @@ -923,6 +923,12 @@ img.photoref { width: 80px; object-fit: contain; } +div.photoref { + display:table-cell; + vertical-align:middle; + text-align:center; +} + img.photorefnoborder { padding: 2px; height: 48px; @@ -2444,6 +2450,7 @@ div.refidno { font-weight: normal; color: #444; font-size: px; + line-height: 21px; } div.pagination { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 4c790b20d44..3b8c7f38097 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2340,6 +2340,7 @@ div.refidno { font-weight: normal; color: #444; font-size: px; + line-height: 21px; } div.pagination {