Fix look and feel v7 for popup on ref of social contributions payments

This commit is contained in:
Laurent Destailleur 2018-05-27 17:58:32 +02:00
parent 894f16c5ee
commit 3f489ee3c6
3 changed files with 56 additions and 19 deletions

View File

@ -1152,7 +1152,7 @@ class Facture extends CommonInvoice
{
global $langs, $conf, $user, $form;
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
$result='';

View File

@ -464,21 +464,58 @@ class ChargeSociales extends CommonObject
/**
* Return a link to the object card (with optionaly the picto)
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param int $maxlen Max length of label
* @param int $notooltip 1=Disable tooltip
* @return string String with link
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param int $maxlen Max length of label
* @param int $notooltip 1=Disable tooltip
* @param int $short 1=Return just URL
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with link
*/
function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0, $short=0, $save_lastsearch_value=-1)
{
global $langs;
global $langs, $conf, $user, $form;
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
$result='';
if (empty($this->ref)) $this->ref=$this->lib;
$label = $langs->trans("ShowSocialContribution").': '.$this->ref;
$url = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$this->id;
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($short) return $url;
if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
if (empty($this->ref)) $this->ref=$this->lib;
$label = '<u>'.$langs->trans("ShowSocialContribution").'</u>';
if (! empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->lib))
$label .= '<br><b>'.$langs->trans('Label') . ':</b> ' . $this->lib;
if (! empty($this->type_libelle))
$label .= '<br><b>'.$langs->trans('Type') . ':</b> ' . $this->type_libelle;
$linkclose='';
if (empty($notooltip) && $user->rights->facture->lire)
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowSocialContribution");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip"';
}
$linkstart='<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend='</a>';
$result .= $linkstart;

View File

@ -28,9 +28,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
$langs->load("compta");
$langs->load("banks");
$langs->load("bills");
$langs->loadLangs(array("compta","banks","bills"));
// Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
@ -189,10 +187,10 @@ if ($resql)
print '<tr class="liste_titre_filter">';
// Ref
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="3" name="search_ref" value="'.$search_ref.'">';
print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
// Label
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.$search_label.'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
// Type
print '<td class="liste_titre" align="left">';
$formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone');
@ -201,7 +199,7 @@ if ($resql)
print '<td class="liste_titre">&nbsp;</td>';
// Amount
print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="6" name="search_amount" value="'.$search_amount.'">';
print '<input class="flat" type="text" size="6" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
// Status
@ -233,13 +231,15 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
$chargesociale_static->id=$obj->id;
$chargesociale_static->ref=$obj->id;
$chargesociale_static->lib=$obj->libelle;
$chargesociale_static->type_libelle=$obj->type_lib;
print '<tr class="oddeven">';
// Ref
print '<td width="60">';
$chargesociale_static->id=$obj->id;
$chargesociale_static->lib=$obj->id;
$chargesociale_static->ref=$obj->id;
print $chargesociale_static->getNomUrl(1,'20');
print '</td>';