@@ -122,4 +122,14 @@ function getEditableLink($elementId, $type, $pk, $title, $value, $class = '') {
return $link;
}
+function getExcerptFromString($string, $count = 50) {
+ if(strlen($string) > $count) {
+ $string = substr($string, 0, $count);
+ $string = substr($string, 0, strrpos($string, " "));
+ $string = $string . " ...";
+ }
+
+ return $string;
+}
?>
@@ -13,7 +13,7 @@ foreach($this->_['calls'] as $call) {
echo '<tr>';
echo '<td>' . $call->getCallDate() . '</td>';
echo '<td>' . $call->getCallerTelNr() . '</td>';
- echo '<td>' . $call->getNotes() . '</td>';
+ echo '<td>' . getExcerptFromString($call->getNotes()) . '</td>';
echo '<td><i class="fa fa-clock-o"></i></td>';
echo '<td><a class="edit-call fancybox.ajax" href="ajax.php?action=editCall&callID=' . $call->getID() . '"><i class="fa fa-wrench"></i></a></td>';
echo '</tr>';