Tooltip and cache for boxes
This commit is contained in:
parent
6bda61436b
commit
925aa2039b
@ -500,7 +500,7 @@ if ($id > 0)
|
||||
{
|
||||
$propal_static = new Propal($db);
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
|
||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.ref_client, p.remise, ";
|
||||
$sql.= " p.datep as dp, p.fin_validite as datelimite";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
@ -534,6 +534,7 @@ if ($id > 0)
|
||||
print '<td class="nowrap">';
|
||||
$propal_static->id=$objp->propalid;
|
||||
$propal_static->ref=$objp->ref;
|
||||
$propal_static->ref_client=$objp->ref_client;
|
||||
print $propal_static->getNomUrl(1);
|
||||
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) {
|
||||
print " ".img_warning();
|
||||
@ -561,7 +562,7 @@ if ($id > 0)
|
||||
$commande_static=new Commande($db);
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid,";
|
||||
$sql.= " c.rowid as cid, c.total_ht, c.ref, c.fk_statut, c.facture,";
|
||||
$sql.= " c.rowid as cid, c.total_ht, c.ref, c.ref_client, c.fk_statut, c.facture,";
|
||||
$sql.= " c.date_commande as dc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql.= " WHERE c.fk_soc = s.rowid ";
|
||||
@ -611,6 +612,7 @@ if ($id > 0)
|
||||
print '<td class="nowrap">';
|
||||
$commande_static->id=$objp->cid;
|
||||
$commande_static->ref=$objp->ref;
|
||||
$commande_static->ref_client=$objp->ref_client;
|
||||
print $commande_static->getNomUrl(1);
|
||||
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
|
||||
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
|
||||
|
||||
@ -94,7 +94,7 @@ class box_activity extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$facturestatic=new Facture($db);
|
||||
|
||||
$cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice'.$fileid;
|
||||
$cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-invoice'.$fileid;
|
||||
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
|
||||
$data = array();
|
||||
if ($refresh) {
|
||||
@ -173,7 +173,7 @@ class box_activity extends ModeleBoxes
|
||||
);
|
||||
}
|
||||
|
||||
$cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice2'.$fileid;
|
||||
$cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-invoice2'.$fileid;
|
||||
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
|
||||
|
||||
if ($refresh) {
|
||||
@ -255,7 +255,7 @@ class box_activity extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$commandestatic=new Commande($db);
|
||||
|
||||
$cachefile = DOL_DATA_ROOT.'/commande/temp/boxactivity-order'.$fileid;
|
||||
$cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-order'.$fileid;
|
||||
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
|
||||
$data = array();
|
||||
if ($refresh) {
|
||||
@ -334,7 +334,7 @@ class box_activity extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
$propalstatic=new Propal($db);
|
||||
|
||||
$cachefile = DOL_DATA_ROOT.'/propale/temp/boxactivity-propal'.$fileid;
|
||||
$cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-propal'.$fileid;
|
||||
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
|
||||
$data = array();
|
||||
if ($refresh) {
|
||||
|
||||
@ -127,7 +127,7 @@ class box_comptes extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$i][3] = array(
|
||||
'td' => 'align="right"',
|
||||
'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code)
|
||||
'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)
|
||||
);
|
||||
|
||||
$i++;
|
||||
@ -148,10 +148,10 @@ class box_comptes extends ModeleBoxes
|
||||
'td' => 'align="right" class="liste_total"',
|
||||
'text' => ' '
|
||||
);
|
||||
$totalamount=price($solde,0,$langs,0,0,-1,$key);
|
||||
|
||||
$this->info_box_contents[$i][3] = array(
|
||||
'td' => 'align="right" class="liste_total"',
|
||||
'text' => $totalamount
|
||||
'text' => price($solde, 0, $langs, 0, 0, -1, $key)
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -113,39 +113,55 @@ class box_members extends ModeleBoxes
|
||||
$memberstatic->name=$objp->company;
|
||||
}
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid);
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
'tooltip' => $memberstatic->getFullName($langs),
|
||||
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
'text' => $memberstatic->getFullName($langs),
|
||||
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid);
|
||||
$this->info_box_contents[$i][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'text' => $memberstatic->getFullName($langs),
|
||||
'tooltip' => $memberstatic->getFullName($langs),
|
||||
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
||||
'text' => dol_print_date($datem, "day"));
|
||||
$this->info_box_contents[$i][2] = array(
|
||||
'td' => 'align="right"',
|
||||
'text' => dol_print_date($datem, "day"),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
|
||||
'text' => $memberstatic->LibStatut($objp->status,$objp->cotisation,$db->jdate($objp->date_end_subscription),3));
|
||||
$this->info_box_contents[$i][3] = array(
|
||||
'td' => 'align="right" width="18"',
|
||||
'text' => $memberstatic->LibStatut($objp->status,$objp->cotisation,$db->jdate($objp->date_end_subscription),3),
|
||||
);
|
||||
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers"));
|
||||
if ($num==0)
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => 'align="center"',
|
||||
'text'=>$langs->trans("NoRecordedCustomers"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
|
||||
@ -99,13 +99,19 @@ class box_produits extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => ($objp->fk_product_type==1?'object_service':'object_product'),
|
||||
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid);
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => 'align="left" width="16"',
|
||||
'logo' => ($objp->fk_product_type==1?'object_service':'object_product'),
|
||||
'tooltip' => $objp->label,
|
||||
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
'text' => $objp->label,
|
||||
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid);
|
||||
$this->info_box_contents[$i][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'text' => $objp->label,
|
||||
'tooltip' => $objp->label,
|
||||
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
|
||||
);
|
||||
|
||||
if ($objp->price_base_type == 'HT')
|
||||
{
|
||||
@ -117,39 +123,54 @@ class box_produits extends ModeleBoxes
|
||||
$price=price($objp->price_ttc);
|
||||
$price_base_type=$langs->trans("TTC");
|
||||
}
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
||||
'text' => $price);
|
||||
$this->info_box_contents[$i][2] = array(
|
||||
'td' => 'align="right"',
|
||||
'text' => $price,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="left" class="nowrap"',
|
||||
'text' => $price_base_type);
|
||||
$this->info_box_contents[$i][3] = array(
|
||||
'td' => 'align="left" class="nowrap"',
|
||||
'text' => $price_base_type,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
||||
'text' => dol_print_date($datem,'day'));
|
||||
$this->info_box_contents[$i][4] = array(
|
||||
'td' => 'align="right"',
|
||||
'text' => dol_print_date($datem,'day'),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
|
||||
'text' => $productstatic->LibStatut($objp->tosell,3,0));
|
||||
$this->info_box_contents[$i][5] = array(
|
||||
'td' => 'align="right" width="18"',
|
||||
'text' => $productstatic->LibStatut($objp->tosell,3,0),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
|
||||
'text' => $productstatic->LibStatut($objp->tobuy,3,1));
|
||||
$this->info_box_contents[$i][6] = array(
|
||||
'td' => 'align="right" width="18"',
|
||||
'text' => $productstatic->LibStatut($objp->tobuy,3,1),
|
||||
);
|
||||
|
||||
$i++;
|
||||
}
|
||||
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProducts"));
|
||||
}
|
||||
if ($num==0)
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => 'align="center"',
|
||||
'text'=>$langs->trans("NoRecordedProducts"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
|
||||
@ -178,153 +178,172 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
|
||||
*/
|
||||
function showBox($head, $contents)
|
||||
{
|
||||
global $langs,$conf;
|
||||
global $langs, $user, $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||
|
||||
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
|
||||
$bcx=array();
|
||||
$bcx[0] = 'class="box_pair"';
|
||||
$bcx[1] = 'class="box_impair"';
|
||||
$var = false;
|
||||
$now = dol_now();
|
||||
$cachetime = 900; // 900 : 15mn
|
||||
$fileid = get_class($this).'id-'.$this->box_id.'-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'.cache';
|
||||
$cachedir = DOL_DATA_ROOT.'/cache/boxes';
|
||||
if (! dol_is_dir($cachedir)) dol_mkdir($cachedir);
|
||||
$cachefile = $cachedir.'/box-'.$fileid;
|
||||
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
|
||||
$out = '';
|
||||
|
||||
dol_syslog(get_class($this).'::showBox');
|
||||
if ($refresh) {
|
||||
dol_syslog(get_class($this).'::showBox');
|
||||
|
||||
// Define nbcol and nblines of the box to show
|
||||
$nbcol=0;
|
||||
if (isset($contents[0])) $nbcol=count($contents[0]);
|
||||
$nblines=count($contents);
|
||||
// Define nbcol and nblines of the box to show
|
||||
$nbcol=0;
|
||||
if (isset($contents[0])) $nbcol=count($contents[0]);
|
||||
$nblines=count($contents);
|
||||
|
||||
print "\n\n<!-- Box start -->\n";
|
||||
print '<div class="box" id="boxto_'.$this->box_id.'">'."\n";
|
||||
$out.= "\n<!-- Box ".get_class($this)." start -->\n";
|
||||
$out.= '<div class="box" id="boxto_'.$this->box_id.'">'."\n";
|
||||
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||
{
|
||||
print '<table summary="boxtable'.$this->box_id.'" width="100%" class="noborder boxtable">'."\n";
|
||||
}
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||
{
|
||||
$out.= '<table summary="boxtable'.$this->box_id.'" width="100%" class="noborder boxtable">'."\n";
|
||||
}
|
||||
|
||||
// Show box title
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']))
|
||||
{
|
||||
//print '<div id="boxto_'.$this->box_id.'_title">'."\n";
|
||||
//print '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
|
||||
print '<tr class="box_titre">';
|
||||
print '<td';
|
||||
if ($nbcol > 0) { print ' colspan="'.$nbcol.'"'; }
|
||||
print '>';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<table summary="" class="nobordernopadding" width="100%"><tr><td>';
|
||||
}
|
||||
if (! empty($head['text']))
|
||||
{
|
||||
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
|
||||
print $s;
|
||||
}
|
||||
print ' ';
|
||||
if (! empty($head['sublink'])) print '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
|
||||
if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
|
||||
if (! empty($head['sublink'])) '</a>';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '</td><td class="nocellnopadd boxclose nowrap">';
|
||||
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
|
||||
print img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"');
|
||||
print img_picto($langs->trans("Close2",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
|
||||
$label=$head['text'];
|
||||
if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
|
||||
print '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';
|
||||
print '</td></tr></table>';
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
//print "</table>\n";
|
||||
//print "</div>\n";
|
||||
}
|
||||
// Show box title
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']))
|
||||
{
|
||||
//$out.= '<div id="boxto_'.$this->box_id.'_title">'."\n";
|
||||
//$out.= '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
|
||||
$out.= '<tr class="box_titre">';
|
||||
$out.= '<td';
|
||||
if ($nbcol > 0) { $out.= ' colspan="'.$nbcol.'"'; }
|
||||
$out.= '>';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
$out.= '<table summary="" class="nobordernopadding" width="100%"><tr><td>';
|
||||
}
|
||||
if (! empty($head['text']))
|
||||
{
|
||||
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
|
||||
$out.= $s;
|
||||
}
|
||||
$out.= ' ';
|
||||
if (! empty($head['sublink'])) $out.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
|
||||
if (! empty($head['subpicto'])) $out.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
|
||||
if (! empty($head['sublink'])) '</a>';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
$out.= '</td><td class="nocellnopadd boxclose nowrap">';
|
||||
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
|
||||
$out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"');
|
||||
$out.= img_picto($langs->trans("Close2",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
|
||||
$label=$head['text'];
|
||||
if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
|
||||
$out.= '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';
|
||||
$out.= '</td></tr></table>';
|
||||
}
|
||||
$out.= '</td>';
|
||||
$out.= "</tr>\n";
|
||||
//$out.= "</table>\n";
|
||||
//$out.= "</div>\n";
|
||||
}
|
||||
|
||||
// Show box lines
|
||||
if ($nblines)
|
||||
{
|
||||
//print '<table summary="boxtablelines'.$this->box_id.'" width="100%" class="noborder">'."\n";
|
||||
// Loop on each record
|
||||
for ($i=0, $n=$nblines; $i < $n; $i++)
|
||||
{
|
||||
if (isset($contents[$i]))
|
||||
{
|
||||
$var=!$var;
|
||||
// Show box lines
|
||||
if ($nblines)
|
||||
{
|
||||
//$out.= '<table summary="boxtablelines'.$this->box_id.'" width="100%" class="noborder">'."\n";
|
||||
// Loop on each record
|
||||
for ($i=0, $n=$nblines; $i < $n; $i++)
|
||||
{
|
||||
if (isset($contents[$i]))
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
// TR
|
||||
if (isset($contents[$i][0]['tr'])) print '<tr valign="top" '.$contents[$i][0]['tr'].'>';
|
||||
else print '<tr valign="top" '.$bcx[$var].'>';
|
||||
// TR
|
||||
if (isset($contents[$i][0]['tr'])) $out.= '<tr valign="top" '.$contents[$i][0]['tr'].'>';
|
||||
else $out.= '<tr valign="top" '.$bcx[$var].'>';
|
||||
|
||||
// Loop on each TD
|
||||
$nbcolthisline=count($contents[$i]);
|
||||
for ($j=0; $j < $nbcolthisline; $j++) {
|
||||
// Define tdparam
|
||||
$tdparam='';
|
||||
if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
|
||||
// Loop on each TD
|
||||
$nbcolthisline=count($contents[$i]);
|
||||
for ($j=0; $j < $nbcolthisline; $j++) {
|
||||
// Define tdparam
|
||||
$tdparam='';
|
||||
if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
|
||||
|
||||
if (empty($contents[$i][$j]['text'])) $contents[$i][$j]['text']="";
|
||||
$text=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:'';
|
||||
$textwithnotags=preg_replace('/<([^>]+)>/i','',$text);
|
||||
$text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:'';
|
||||
$text2withnotags=preg_replace('/<([^>]+)>/i','',$text2);
|
||||
$textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:'';
|
||||
//print "xxx $textwithnotags y";
|
||||
if (empty($contents[$i][$j]['tooltip'])) $contents[$i][$j]['tooltip']="";
|
||||
$tooltip=isset($contents[$i][$j]['tooltip'])?$contents[$i][$j]['tooltip']:'';
|
||||
if (empty($contents[$i][$j]['text'])) $contents[$i][$j]['text']="";
|
||||
$text=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:'';
|
||||
$textwithnotags=preg_replace('/<([^>]+)>/i','',$text);
|
||||
$text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:'';
|
||||
$text2withnotags=preg_replace('/<([^>]+)>/i','',$text2);
|
||||
$textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:'';
|
||||
//$out.= "xxx $textwithnotags y";
|
||||
if (empty($contents[$i][$j]['tooltip'])) $contents[$i][$j]['tooltip']="";
|
||||
$tooltip=isset($contents[$i][$j]['tooltip'])?$contents[$i][$j]['tooltip']:'';
|
||||
|
||||
print '<td'.$tdparam.'>'."\n";
|
||||
$out.= '<td'.$tdparam.'>'."\n";
|
||||
|
||||
// Url
|
||||
if (! empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo']))
|
||||
{
|
||||
print '<a href="'.$contents[$i][$j]['url'].'" title="'.dol_escape_htmltag($langs->trans("Show").' '.$tooltip, 1).'" class="classfortooltip"';
|
||||
//print ' alt="'.$textwithnotags.'"'; // Pas de alt sur un "<a href>"
|
||||
print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
|
||||
print '>';
|
||||
}
|
||||
// Url
|
||||
if (! empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo']))
|
||||
{
|
||||
$out.= '<a href="'.$contents[$i][$j]['url'].'" title="'.dol_escape_htmltag($langs->trans("Show").' '.$tooltip, 1).'" class="classfortooltip"';
|
||||
//$out.= ' alt="'.$textwithnotags.'"'; // Pas de alt sur un "<a href>"
|
||||
$out.= isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
|
||||
$out.= '>';
|
||||
}
|
||||
|
||||
// Logo
|
||||
if (! empty($contents[$i][$j]['logo']))
|
||||
{
|
||||
$logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']);
|
||||
print '<a href="'.$contents[$i][$j]['url'].'">';
|
||||
print img_object($langs->trans("Show").' '.$tooltip, $logo, 'class="classfortooltip"');
|
||||
}
|
||||
// Logo
|
||||
if (! empty($contents[$i][$j]['logo']))
|
||||
{
|
||||
$logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']);
|
||||
$out.= '<a href="'.$contents[$i][$j]['url'].'">';
|
||||
$out.= img_object($langs->trans("Show").' '.$tooltip, $logo, 'class="classfortooltip"');
|
||||
}
|
||||
|
||||
$maxlength=$MAXLENGTHBOX;
|
||||
if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength'];
|
||||
$maxlength=$MAXLENGTHBOX;
|
||||
if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength'];
|
||||
|
||||
if ($maxlength) $textwithnotags=dol_trunc($textwithnotags,$maxlength);
|
||||
if (preg_match('/^<img/i',$text) || ! empty($contents[$i][$j]['asis'])) print $text; // show text with no html cleaning
|
||||
else print $textwithnotags; // show text with html cleaning
|
||||
if ($maxlength) $textwithnotags=dol_trunc($textwithnotags,$maxlength);
|
||||
if (preg_match('/^<img/i',$text) || ! empty($contents[$i][$j]['asis'])) $out.= $text; // show text with no html cleaning
|
||||
else $out.= $textwithnotags; // show text with html cleaning
|
||||
|
||||
// End Url
|
||||
if (! empty($contents[$i][$j]['url'])) print '</a>';
|
||||
// End Url
|
||||
if (! empty($contents[$i][$j]['url'])) $out.= '</a>';
|
||||
|
||||
if (preg_match('/^<img/i',$text2) || ! empty($contents[$i][$j]['asis2'])) print $text2; // show text with no html cleaning
|
||||
else print $text2withnotags; // show text with html cleaning
|
||||
if (preg_match('/^<img/i',$text2) || ! empty($contents[$i][$j]['asis2'])) $out.= $text2; // show text with no html cleaning
|
||||
else $out.= $text2withnotags; // show text with html cleaning
|
||||
|
||||
if (! empty($textnoformat)) print "\n".$textnoformat."\n";
|
||||
if (! empty($textnoformat)) $out.= "\n".$textnoformat."\n";
|
||||
|
||||
print "</td>\n";
|
||||
}
|
||||
$out.= "</td>\n";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$out.= "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||
{
|
||||
print "</table>\n";
|
||||
}
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||
{
|
||||
$out.= "</table>\n";
|
||||
}
|
||||
|
||||
// If invisible box with no contents
|
||||
if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && ! $nblines) print "<br>\n";
|
||||
// If invisible box with no contents
|
||||
if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && ! $nblines) $out.= "<br>\n";
|
||||
|
||||
print "</div>\n";
|
||||
print "<!-- Box end -->\n\n";
|
||||
}
|
||||
$out.= "</div>\n";
|
||||
$out.= "<!-- Box ".get_class($this)." end -->\n\n";
|
||||
file_put_contents($cachefile,serialize($out),LOCK_EX);
|
||||
} else {
|
||||
dol_syslog(get_class($this).'::showBoxCached');
|
||||
$out = unserialize(file_get_contents($cachefile));
|
||||
print "<!-- Box ".get_class($this)." from cache -->";
|
||||
|
||||
}
|
||||
print $out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ require '../../main.inc.php';
|
||||
|
||||
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
|
||||
{
|
||||
print "Page available only frome remote address 127.0.0.1";
|
||||
print "Page available only from remote address 127.0.0.1";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
|
||||
{
|
||||
print "Page available only frome remote address 127.0.0.1";
|
||||
print "Page available only from remote address 127.0.0.1";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -1748,11 +1748,13 @@ class Societe extends CommonObject
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id;
|
||||
}
|
||||
|
||||
$label = $langs->trans("ShowCompany").': '.$name;
|
||||
|
||||
// Add type of canvas
|
||||
$lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($name, 1).'" class="classfortooltip">';
|
||||
$lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$lienfin='</a>';
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name, 'company', 'class="classfortooltip"').$lienfin);
|
||||
if ($withpicto) $result.=($lien.img_object($label, 'company', 'class="classfortooltip"').$lienfin);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
$result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin;
|
||||
|
||||
|
||||
@ -1181,8 +1181,8 @@ else
|
||||
$object->idprof2 = GETPOST('idprof2', 'alpha');
|
||||
$object->idprof3 = GETPOST('idprof3', 'alpha');
|
||||
$object->idprof4 = GETPOST('idprof4', 'alpha');
|
||||
$object->idprof5 = GETPOST('idprof5', 'alpha');
|
||||
$object->idprof6 = GETPOST('idprof6', 'alpha');
|
||||
$object->idprof5 = GETPOST('idprof5', 'alpha');
|
||||
$object->idprof6 = GETPOST('idprof6', 'alpha');
|
||||
$object->typent_id = GETPOST('typent_id', 'int');
|
||||
$object->effectif_id = GETPOST('effectif_id', 'int');
|
||||
$object->barcode = GETPOST('barcode', 'alpha');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user