Work on dol_banner for proposals.
This commit is contained in:
parent
46ce1d3a69
commit
c8b8e13014
@ -1660,23 +1660,86 @@ if ($action == 'create')
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
// Ref
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
|
||||
// Ref customer
|
||||
$morehtmlref.=$langs->trans('RefCustomer').' ';
|
||||
if ($action != 'refclient' && ! empty($object->brouillon))
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=refclient&id=' . $object->id . '">' . img_edit($langs->trans('Modify')) . '</a> : ';
|
||||
if ($user->rights->propal->creer && $action == 'refclient') {
|
||||
$morehtmlref.='<form action="'.$_SERVER["PHP_SELF"].'?id=' . $object->id . '" method="post">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="set_ref_client">';
|
||||
$morehtmlref.='<input type="text" class="flat" size="20" name="ref_client" value="' . $object->ref_client . '">';
|
||||
$morehtmlref.=' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$object->ref_client;
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('Company') . ' : ' . $soc->getNomUrl(1);
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->propal->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} 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.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref.=$proj->ref;
|
||||
$morehtmlref.='</a>';
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
// Ref customer
|
||||
/*
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans('RefCustomer') . '</td>';
|
||||
if ($action != 'refclient' && ! empty($object->brouillon))
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=refclient&id=' . $object->id . '">' . img_edit($langs->trans('Modify')) . '</a></td>';
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr></table>';
|
||||
print '</td><td colspan="5">';
|
||||
if ($user->rights->propal->creer && $action == 'refclient') {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id=' . $object->id . '" method="post">';
|
||||
@ -1690,10 +1753,12 @@ if ($action == 'create')
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
*/
|
||||
|
||||
// Company
|
||||
/*
|
||||
print '<tr><td>' . $langs->trans('Company') . '</td><td colspan="5">' . $soc->getNomUrl(1) . '</td>';
|
||||
print '</tr>';
|
||||
print '</tr>';*/
|
||||
|
||||
// Lin for thirdparty discounts
|
||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="5">';
|
||||
@ -1916,6 +1981,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Project
|
||||
/*
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
@ -1949,7 +2015,7 @@ if ($action == 'create')
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
}*/
|
||||
|
||||
if ($soc->outstanding_limit)
|
||||
{
|
||||
@ -2069,7 +2135,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Statut
|
||||
print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left" colspan="2">' . $object->getLibStatut(4) . '</td></tr>';
|
||||
//print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left" colspan="2">' . $object->getLibStatut(4) . '</td></tr>';
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
@ -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 '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut_short[$statut],$statuttrans);
|
||||
}
|
||||
if ($mode == 5) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
||||
if ($mode == 6) return '<span class="hideonsmartphone">'.$this->labelstatut[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -3232,11 +3234,8 @@ class Propal extends CommonObject
|
||||
}
|
||||
$linkend='</a>';
|
||||
|
||||
$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;
|
||||
|
||||
@ -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 '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans('BackToList').'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
|
||||
print '</td></tr>';
|
||||
|
||||
@ -138,7 +142,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br>';
|
||||
//print '<br>';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
|
||||
@ -646,7 +646,7 @@ else
|
||||
{
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top" class="titlefield">'.$langs->trans("BankName").'</td>';
|
||||
print '<tr class="liste_titre_add"><td valign="top" class="titlefield">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3">'.$account->bank.'</td></tr>';
|
||||
|
||||
// Show fields of bank account
|
||||
@ -710,7 +710,7 @@ else
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
// Accountancy code
|
||||
print '<tr><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3">';
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
print length_accountg($account->account_number).'</td></tr>';
|
||||
@ -908,7 +908,7 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// If bank account
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("BankName").'</td>';
|
||||
print '<tr class="liste_titre_add"><td class="titlefieldcreate">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$account->bank.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -975,7 +975,7 @@ else
|
||||
$tdextra = ' class="fieldrequired titlefieldcreate"';
|
||||
}
|
||||
|
||||
print '<tr><td'.$tdextra.'>'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<tr class="liste_titre_add"><td'.$tdextra.'>'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3">';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
||||
|
||||
@ -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.='</a> ';
|
||||
}
|
||||
$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++;
|
||||
}
|
||||
|
||||
|
||||
@ -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 '<form method="post" action="'.$page.'">';
|
||||
print '<input type="hidden" name="action" value="classin">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td>';
|
||||
$formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus);
|
||||
print '</td>';
|
||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr></table></form>';
|
||||
$out.="\n";
|
||||
$out.='<form method="post" action="'.$page.'">';
|
||||
$out.='<input type="hidden" name="action" value="classin">';
|
||||
$out.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$out.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
$out.='<tr><td>';
|
||||
$out.=$formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1);
|
||||
$out.='</td>';
|
||||
$out.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
$out.='</tr></table></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3572,13 +3575,20 @@ class Form
|
||||
$projet = new Project($this->db);
|
||||
$projet->fetch($selected);
|
||||
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$selected.'">'.$projet->title.'</a>';
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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 '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
$out.='<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
}
|
||||
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.= '</select>';
|
||||
if (empty($option_only)) $out.= '</select>';
|
||||
if (empty($nooutput))
|
||||
{
|
||||
print $out;
|
||||
return '';
|
||||
}
|
||||
print $out;
|
||||
else return $out;
|
||||
} else {
|
||||
return $outarray;
|
||||
}
|
||||
|
||||
@ -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 '<div class="arearef heightref valignmiddle" width="100%">';
|
||||
@ -947,7 +947,18 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
|
||||
if ($showimage)
|
||||
{
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
|
||||
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.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.$nophoto.'"></div></div>';
|
||||
}
|
||||
$morehtmlleft.='</div>';
|
||||
}
|
||||
}
|
||||
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
|
||||
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.='<div class="refidno">'.$object->name_alias.'</div>'; // For thirdparty
|
||||
if (! empty($object->label)) $morehtmlref.='<div class="refidno">'.$object->label.'</div>'; // 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
|
||||
|
||||
@ -93,23 +93,20 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
dol_fiche_head($head, 'note', $titre, 0, $picto);
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
$cssclass='titlefield';
|
||||
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
|
||||
//if ($action == 'editnote_private') $cssclass='titlefieldcreate';
|
||||
|
||||
//print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
$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();
|
||||
}
|
||||
|
||||
|
||||
@ -73,10 +73,6 @@ if ($id > 0)
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company');
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
$cssclass='titlefield';
|
||||
@ -120,7 +116,6 @@ if ($id > 0)
|
||||
//print '<div class="underbanner clearboth"></div>';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
@ -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: <?php print $fontsize ?>px;
|
||||
line-height: 21px;
|
||||
}
|
||||
|
||||
div.pagination {
|
||||
|
||||
@ -2340,6 +2340,7 @@ div.refidno {
|
||||
font-weight: normal;
|
||||
color: #444;
|
||||
font-size: <?php print $fontsize ?>px;
|
||||
line-height: 21px;
|
||||
}
|
||||
|
||||
div.pagination {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user