Files
crm.twinpol.com/modules/EcmDocs/row_template.php

100 lines
3.5 KiB
PHP
Raw Normal View History

2025-05-12 15:44:39 +00:00
<?
function RowTemplate($r)
{
global $timedate;
$template=' <!-- BEGIN: row -->
<tr height="20">
<td scope=\'row\' valign=TOP class="oddListRowS1" bgcolor="#ffffff"><slot>
<div style="display:inline;" id="show_related_ecm'.$r['id'].'">'.show_related_ecm("ecmdocuments_ecmdocs","ecmdoc_id",$r['id'],"EcmDocs").'</div></td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>
<a onmouseover="showdescription(\'EcmDoc_'.$r['id'].'\',\''.namejs($r['name']).'\',\''.namejs($r['description']).'\');" onmouseout="hidedescription();" id="link-EcmDoc_'.$r['id'].'" href="index.php?action=DetailView&module=EcmDocs&record='.$r['id'].'&offset=&stamp=" class="listViewTdLinkS1">
';
$text="";
$t="";
$i=0;
$t=$r['name'];
$num=20;
for($i=0;$i<20;$i++)
{
if($t[$i]=="Ă")$num++;
if($t[$i]=="Å")$num+2;
}
if(strlen($t)>$num-1)
{
for($i=0;$i<=$num;$i++)
{
$text.=$t[$i];
}
$text=$text."...";
}
else
{
$text=$t;
}
$template.=$text.'
</a> </slot>
</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a onmouseover="
var t=\''.$r['account_name'].'\';
if(t.length>20)
{
showdescription(\'EcmDoc_'.$r['id'].'_name\',\''.namejs($r['account_name']).'\',\'\');
}
"
onmouseout="
var t=\''.$r['account_name'].'\';
if(t.length>20)
{
hidedescription();
}
" id="link-EcmDoc_'.$r['id'].'_name" href="index.php?action=DetailView&module=Accounts&record='.$r['account_id'].'&offset=&stamp=" class="listViewTdLinkS1">';
$text="";
$t="";
$i=0;
$t=$r['account_name'];
$num=20;
for($i=0;$i<20;$i++)
{
if($t[$i]=="Ă" || $t[$i]=="Å")$num++;
}
if(strlen($t)>$num-1)
{
for($i=0;$i<=$num;$i++)
{
$text.=$t[$i];
}
$text=$text."...";
}
else
{
$text=$t;
}
$template.=$text.'
</a></td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>';
$date=$r['date_entered'];
$template.=$timedate->to_display(gmdate("Y-m-d",mktime(0, 0, 0, $date[5].$date[6], $date[8].$date[9], $date[0].$date[1].$date[2].$date[3])+86400),"Y-m-d",$timedate->get_date_format());
$template.='</td>';
$za="select version from ecmfiles_versions where file_id='".$r['file_id']."' order by version desc limit 1";
$ro=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($za));
$template.='<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>'.$ro['version'].'</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><slot>'.$r['assigned_user_name'].'</slot></td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>';
if($r['file_id'])$template.='<a title="PDF" href="DownloadEcmFile.php?file_id='.$r['file_id'].'"><img title="PDF" src="modules/EcmDocuments/images/pdf.gif" width="14" height="14" border="0"></a>';
else $template.='<img src="modules/EcmDocuments/images/pdf-off.gif" width="14" height="14" border="0" />';
$template.='</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>';
if($r['file_id'])$template.='<a title="E-mail" href="index.php?module=Emails&action=EditView&type=out&file_id='.$r['file_id'].'"><img title="E-mail" src="modules/EcmDocuments/images/email.jpg" border="0"></a>';
else $template.='<img src="modules/EcmDocuments/images/email-off.jpg" border="0" />';
$template.='</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a title="Edit" href="index.php?module=EcmDocs&action=EditView&record='.$r['id'].'"><img title="Edit" src="themes/Sugar/images/edit_inline.gif" border="0"></a></td>
</tr>
<tr>
<td colspan="24" class="listViewHRS1"></td>
</tr>
<!-- END: row -->';
return $template;
}
?>