function workspaces_render_widget_member_information(Member $member, &$prop_html = "") { $ws_ot = ObjectTypes::findByName('workspace'); if ($member->getObjectTypeId() == $ws_ot->getId()) { $ws = Workspaces::getWorkspaceById($member->getObjectId()); if ($ws instanceof Workspace && trim($member->getDescription()) != "" && $ws->getColumnValue('show_description_in_overview')) { $prop_html .= '<div style="margin-bottom:5px;">' . escape_html_whitespace(convert_to_links(clean($member->getDescription()))) . '</div>'; } } }
private function get_comments($request) { try { $object = Objects::findObject($request['oid']); $comments = $object->getComments(); $clean_comments = array(); foreach ($comments as $comment) { $user_name = $comment->getCreatedByDisplayName(); $updated_on = format_datetime($comment->getUpdatedOn()); $text = escape_html_whitespace(convert_to_links(clean($comment->getText()))); $clean_comment = array("author" => $user_name, "date" => $updated_on, "text" => $text); $clean_comments[] = $clean_comment; } return $this->response('json', $clean_comments); } catch (Exception $exception) { throw $exception; } }
<?php /* @var $workspace Workspace */ if ( $workspace->getColumnValue('show_description_in_overview') ) : ?> <div class="widget-persons widget"> <div class="widget-header" onclick="og.dashExpand('<?php echo $genid?>');"> <?php echo (isset($widget_title)) ? $widget_title : lang("workspace description");?> <div class="dash-expander ico-dash-expanded" id="<?php echo $genid; ?>expander"></div> </div> <div class="widget-body" id="<?php echo $genid; ?>_widget_body"> <?php echo escape_html_whitespace(convert_to_links(clean($workspace->getDescription()))); ?> </div> </div> <?php endif ;?>
} if ($message->canDelete(logged_user())) { if ($message->isTrashed()) { add_page_action(lang('restore from trash'), "javascript:if(confirm(lang('confirm restore objects'))) og.openLink('" . $message->getUntrashUrl() . "');", 'ico-restore', null, null, true); add_page_action(lang('delete permanently'), "javascript:if(confirm(lang('confirm delete permanently'))) og.openLink('" . $message->getDeletePermanentlyUrl() . "');", 'ico-delete', null, null, true); } else { add_page_action(lang('move to trash'), "javascript:if(confirm(lang('confirm move to trash'))) og.openLink('" . $message->getTrashUrl() . "');", 'ico-trash', null, null, true); } } // if add_page_action(lang('print view'), $message->getPrintViewUrl(), "ico-print", "_blank"); ?> <div style="padding:7px"> <div class="message"> <?php if ($message->getTypeContent() == "text") { $content = escape_html_whitespace(convert_to_links(clean($message->getText()))); } else { $content = '<div class="wysiwyg-description">' . convert_to_links(purify_html(nl2br($message->getText()))) . '</div>'; } tpl_assign("content", $content); tpl_assign("object", $message); tpl_assign('iconclass', $message->isTrashed() ? 'ico-large-message-trashed' : ($message->isArchived() ? 'ico-large-message-archived' : 'ico-large-message')); $this->includeTemplate(get_template_path('view', 'co')); ?> </div> </div> <?php } //if isset
<div class="contact-picture-container"> <img class="commentUserAvatar" src="<?php echo $comment->getCreatedBy()->getPictureUrl(); ?> " alt="<?php echo clean($comment->getCreatedBy()->getObjectName()); ?> " /> </div> <?php } // if ?> <div class="commentText"><?php echo escape_html_whitespace(convert_to_links(clean($comment->getText()))); ?> </div> <div class="clear"></div> <?php $object_links_render = render_object_links($comment, $comment->canEdit(logged_user()) && !$__comments_object->isTrashed(), true, false); if ($object_links_render != '') { echo '<div>' . $object_links_render . '</div>'; } ?> </div> </div> <?php } // foreach } else {
add_page_action(lang('move to trash'), "javascript:if(confirm(lang('confirm move to trash'))) og.openLink('" . $event->getTrashUrl() . "');", 'ico-trash', null, null, true); } } // if $modified = ""; $error = ""; // Do this if we are MODIFYING a form. $id = $_GET['id']; if (!is_numeric($id)) { $error = lang('CAL_NO_EVENT_SELECTED'); } // get user who submitted the event, subject, event description, etc. $username = clean($event->getCreatedByDisplayName()); $subject = clean($event->getObjectName()); $alias = clean($event->getCreatedByDisplayName()); $desc = escape_html_whitespace(convert_to_links(clean($event->getDescription()))); $start_time = $event->getStart(); $mod_username = clean($event->getUpdatedByDisplayName()); $mod_stamp = $event->getUpdatedOn(); // check username to see if it's anonymous or not if ($username == "") { $username = lang('CAL_ANONYMOUS'); } if ($mod_username == "") { $mod_username = lang('CAL_ANONYMOUS'); } // if the event is private and the user is anonymous, return that the event does not exist. if ($error == "") { $error = lang('CAL_DOESNT_EXIST'); } $durtime = $event->getDuration()->getTimestamp() - $start_time->getTimestamp();
} $content .= ' <input type="hidden" id="'.$genid.'viewingImages" value="'.($remove_images?'no':'yes').'" /> <input type="hidden" id="'.$genid.'viewingQuoted" value="'.($remove_quoted?'no':'yes').'" /> '; } else { if ($email->getBodyPlain() != '') { $remove_quoted = MailUtilities::hasQuotedText($email->getBodyPlain()) && $hide_quoted_text_in_emails; $content = ""; if ($remove_quoted) { $content = MailUtilities::replaceQuotedText($email->getBodyPlain(), '-----'.lang('hidden quoted text').'-----'); $content = '<div id="'.$genid.'noQuoteMail">' . escape_html_whitespace(convert_to_links(clean($content))) . '</div>'; $content = str_replace('-----'.lang('hidden quoted text')."-----", '<span style="color: #777;font-style:italic;padding: 5px 20px"><'.lang('hidden quoted text').'></span>', $content); $content .= '<a class="internalLink" style="padding-left:10px;" id="'.$genid.'quotedLink" href="#" onclick="og.showQuotedText(\''.$genid.'\')">:: '.lang('show quoted text').' ::</a>'; } $content .= '<div id="'.$genid.'completeMail"'.($remove_quoted ? ' style="display:none"' : '').'>' . escape_html_whitespace(convert_to_links(clean($email->getBodyPlain()))) . '</div>'; $content = '<div style="max-height: 600px; overflow: auto;">' . $content . '</div>'; } else $content = '<div></div>'; } $strDraft = ''; if ($email->getIsDraft()) { $strDraft = "<span style='font-size:80%;color:red'> ".lang('draft')."</style>"; } tpl_assign("title", lang('email') . ': ' . clean($email->getSubject()).$strDraft); tpl_assign('iconclass', $email->isTrashed()? 'ico-large-email-trashed' : ($email->isArchived() ? 'ico-large-email-archived' : 'ico-large-email')); tpl_assign("mail_conversation_block" , $conversation_block); tpl_assign("content", $content); tpl_assign("object", $email); tpl_assign("description", $description);
</div> </fieldset> <?php } // if ?> <?php if ($file->getDescription()) { ?> <fieldset><legend><?php echo lang('description'); ?> </legend> <?php echo escape_html_whitespace(convert_to_links(clean($file->getDescription()))); ?> </fieldset> <?php } // if ?> <?php if (($ftype = $file->getFileType()) instanceof FileType && $ftype->getIsImage()) { ?> <script> function resizeImage(genid){ var image = document.getElementById(genid + 'Image'); if (image){ var width = (Ext.isIE)? image.parentNode.parentNode.offsetWidth : image.parentNode.parentNode.clientWidth;
echo '<div style="margin:20px 0;'.$back_color.'">'; echo render_custom_properties($contact); echo '</div>'; $back_color = $back_color == '' ? $bc : ''; } if (!$contact->isUser() && $contact->isCommentable()) { echo '<div style="margin:20px 0;">'; echo render_object_comments($contact, $contact->getViewUrl()); echo '</div>'; $back_color = $back_color == '' ? $bc : ''; } if ($contact->getCommentsField()) { echo '<div class="commentsTitle">'.lang('notes').'</div>'; echo escape_html_whitespace(convert_to_links(clean($contact->getCommentsField()))); } ?></div> <div class="clear"></div> <?php Hook::fire('after_contact_view', $contact, $null); ?> </div> <?php if ( isset($show_person_activity) ): ?> <div class="person-activity"> <h2><?php echo lang('related to') ?></h2> <ul> <?php foreach($feeds as $feed): ?> <?php if ( array_var($feed, 'object_id') != $contact->getId() ) :?> <li class="<?php echo array_var($feed, 'icon') ?>"> <em class="feed-date"><?php echo ucfirst (array_var($feed, 'type')); ?> - <?php echo array_var($feed, 'dateUpdated');?></em> - <a href="Javascript:;" onclick="og.openLink('<?php echo array_var($feed, 'url') ?>');"><?php echo array_var($feed, 'name') ?></a>
<?php } // if ?> </td></tr></table> </div> <?php } else { ?> <div class="commentHead"><span> <a class="internalLink" href="<?php echo $comment->getViewUrl() ?>" title="<?php echo lang('permalink') ?>">#<?php echo $counter ?></a>: </span> <?php echo lang('comment posted on', format_datetime($comment->getUpdatedOn())) ?> </div> <?php } // if ?> <div class="commentBody"> <table style="width:100%"><tr> <?php if(($comment->getCreatedBy() instanceof Contact) && ($comment->getCreatedBy()->hasAvatar())) { ?> <td style="vertical-align:top;width:60px"><div class="commentUserAvatar"><img src="<?php echo $comment->getCreatedBy()->getAvatarUrl() ?>" alt="<?php echo clean($comment->getCreatedBy()->getObjectName()) ?>" /></div></td> <?php } // if ?> <td style="text-align:left"><?php echo escape_html_whitespace(convert_to_links(clean($comment->getText()))) ?></td> <?php $object_links_render = render_object_links($comment, ($comment->canEdit(logged_user()) && !$__comments_object->isTrashed()), true, false); if ($object_links_render != '') { echo '<td style="width:200px">'. $object_links_render .'</td>'; } ?></tr></table> </div> </div> <?php } // foreach ?> <?php } else { ?> <p><?php echo lang('no comments associated with object') ?></p> <?php } // if ?> </div> <?php } ?> <?php if(!$__comments_object->isTrashed()) {?>
</td></tr> <?php } //if ?> <?php if ($contact->getNotes()) { ?> <tr><td colspan=2><div style="font-weight:bold; font-size:120%; color:#888; border-bottom:1px solid #DDD;width:100%; padding-top:14px"> <?php echo lang('notes'); ?> </div></td></tr><tr><td colspan=2> <div style="padding-left:10px"><?php echo escape_html_whitespace(convert_to_links(clean($contact->getNotes()))); ?> </div> </td></tr> <?php } ?> <?php if ($contact->hasUser()) { ?> <tr><td colspan=2><div style="font-weight:bold; font-size:120%; color:#888; border-bottom:1px solid #DDD;width:100%; padding-top:14px"> <?php echo lang('assigned user'); ?>
static function objectNotification($object, $people, $sender, $notification, $description = null, $descArgs = null, $properties = array(), $links = array()) { if (!is_array($people) || !count($people)) { return; // nothing here... } // if if ($sender instanceof User) { $sendername = $sender->getDisplayName(); $senderemail = $sender->getEmail(); $senderid = $sender->getId(); } else { $sendername = owner_company()->getName(); $senderemail = owner_company()->getEmail(); if (!is_valid_email($senderemail)) { $senderemail = '*****@*****.**'; } $senderid = 0; } $type = $object->getObjectTypeName(); $typename = lang($object->getObjectTypeName()); $uid = $object->getUniqueObjectId(); $name = $object instanceof Comment ? $object->getObject()->getObjectName() : $object->getObjectName(); if (!isset($description)) { $description = "{$notification} notification {$type} desc"; $descArgs = array(clean($object->getObjectName()), $sendername); } if (!isset($descArgs)) { $descArgs = array(); } if ($object->columnExists('text') && trim($object->getColumnValue('text'))) { $text = escape_html_whitespace(convert_to_links(clean("\n" . $object->getColumnValue('text')))); $properties['text'] = $text; } $second_properties = array(); //$properties['unique id'] = $uid; if ($object->columnExists('description') && trim($object->getColumnValue('description'))) { $text = escape_html_whitespace(convert_to_links(clean("\n" . $object->getColumnValue('description')))); $properties['description'] = $text; } if ($object instanceof ProjectFile && $object->getType() == ProjectFiles::TYPE_DOCUMENT) { $revision = $object->getLastRevision(); if (trim($revision->getComment())) { $text = escape_html_whitespace(convert_to_links(clean("\n" . $revision->getComment()))); $properties['revision comment'] = $text; } } tpl_assign('object', $object); tpl_assign('properties', $properties); tpl_assign('second_properties', $second_properties); $emails = array(); foreach ($people as $user) { if ($user->getId() != $senderid && $object->canView($user)) { // send notification on user's locale and with user info $locale = $user->getLocale(); Localization::instance()->loadSettings($locale, ROOT . '/language'); $workspaces = $object->getUserWorkspaces($user); $ws = ""; $plain_ws = ""; foreach ($workspaces as $w) { if ($ws) { $ws .= ", "; } if ($plain_ws) { $plain_ws .= ", "; } $css = get_workspace_css_properties($w->getColor()); $ws .= "<span style=\"{$css}\">" . $w->getPath() . "</span>"; $plain_ws .= $w->getPath(); } $properties['workspace'] = $ws; tpl_assign('links', $links); tpl_assign('properties', $properties); tpl_assign('description', langA($description, $descArgs)); $from = self::prepareEmailAddress($senderemail, $sendername); $emails[] = array("to" => array(self::prepareEmailAddress($user->getEmail(), $user->getDisplayName())), "from" => self::prepareEmailAddress($senderemail, $sendername), "subject" => $subject = lang("{$notification} notification {$type}", $name, $uid, $typename, $plain_ws), "body" => tpl_fetch(get_template_path('general', 'notifier'))); } } // foreach $locale = logged_user() instanceof User ? logged_user()->getLocale() : DEFAULT_LOCALIZATION; Localization::instance()->loadSettings($locale, ROOT . '/language'); self::queueEmails($emails); }
} if ($object->canDelete(logged_user())) { if ($object->isTrashed()) { add_page_action(lang('restore from trash'), "javascript:if(confirm(lang('confirm restore objects'))) og.openLink('" . $object->getUntrashUrl() . "');", 'ico-restore', null, null, true); add_page_action(lang('delete permanently'), "javascript:if(confirm(lang('confirm delete permanently'))) og.openLink('" . $object->getDeletePermanentlyUrl() . "');", 'ico-delete', null, null, true); } else { add_page_action(lang('move to trash'), "javascript:if(confirm(lang('confirm move to trash'))) og.openLink('" . $object->getTrashUrl() . "');", 'ico-trash', null, null, true); } } // if ?> <div style="padding:7px"> <div class="weblink"> <?php $description = escape_html_whitespace(convert_to_links(clean($object->getDescription()))); $url = clean($object->getUrl()); $title = clean($object->getObjectName()); tpl_assign("url", $url); tpl_assign("desc", $description); tpl_assign("content_template", array('view_content', 'webpage')); tpl_assign("object", $object); tpl_assign('iconclass', $object->isTrashed() ? 'ico-large-weblink-trashed' : ($object->isArchived() ? 'ico-large-weblink-archived' : 'ico-large-weblink')); tpl_assign('title', "<a class=\"link-ico ico-open-link\" target=\"_blank\" href=\"{$url}\">{$title}</a>"); $this->includeTemplate(get_template_path('view', 'co')); ?> </div> </div> <?php } //if isset
echo "<div><span class='bold'>" . lang('object type') . ":</span> " . $subType->getName() . "</div>"; } } ?> <?php if ($task_list->getText()) { ?> <div class="wysiwyg-description"><?php if ($task_list->getTypeContent() == "text") { echo escape_html_whitespace(convert_to_links(clean($task_list->getText()))); } else { echo convert_to_links(purify_html(nl2br($task_list->getText()))); } ?> </div> <?php } // if ?> <?php /** * This section displays the most important information of the task. */ if ($task_list->getAssignedTo()) { if (logged_user()->getId() == $task_list->getAssignedTo()->getId()) {
<?php } ?> <?php } ?> <?php if ($task_list->getObjectSubtype() > 0) { $subType = ProjectCoTypes::findById($task_list->getObjectSubtype()); if ($subType instanceOf ProjectCoType ) { echo "<div><span class='bold'>" . lang('object type') . ":</span> " . $subType->getName() . "</div>"; } } ?> <?php if($task_list->getText()) { ?> <fieldset><legend><?php echo lang('description') ?></legend> <div class="wysiwyg-description"><?php if($task_list->getTypeContent() == "text"){ echo escape_html_whitespace(convert_to_links(clean($task_list->getText()))); }else{ echo purify_html(nl2br($task_list->getText())); } ?></div> </fieldset> <?php } // if $showOpenSubtasksDiv = is_array($task_list->getOpenSubTasks()) && count($task_list->getOpenSubTasks()) > 0; $showCompletedSubtasksDiv = is_array($task_list->getCompletedSubTasks()) && count($task_list->getCompletedSubTasks()) > 0; if($showOpenSubtasksDiv) { ?> <table style="border:1px solid #717FA1;width:100%; padding-left:10px;"> <tr><th style="padding-left:10px;padding-top:4px;padding-bottom:4px;background-color:#E8EDF7;font-size:120%;font-weight:bolder;color:#717FA1;width:100%;"><?php echo lang("open subtasks") ?></th></tr> <tr><td style="padding-left:10px;">
$htmlValue = '<table style="width:100%;margin-bottom:2px">'; foreach ($multValues as $mv) { $value = str_replace('\\|', '"%%_PIPE_%%"', $mv->getValue()); $value = str_replace('|', ',', $value); $value = str_replace('"%%_PIPE_%%"', '|', $value); $title = strlen($value) > 100 && $customProp->getType() != 'memo' ? clean(str_replace('|', ',', $value)) : ''; $showValue = $customProp->getType() == 'memo' ? escape_html_whitespace(convert_to_links(clean($value))) : clean($value); $htmlValue .= '<tr class="' . ($newAlt ? 'altRow' : 'row') . '"><td style="padding:0px 5px" title="' . $title . '">' . $showValue . '</td></tr>'; $newAlt = !$newAlt; } } $htmlValue .= '</table>'; $style = 'style="padding:1px 0px"'; } else { $title = strlen($value) > 100 && $customProp->getType() != 'memo' ? clean($value) : ''; $htmlValue = $customProp->getType() == 'memo' ? escape_html_whitespace(convert_to_links(clean($value))) : $value; } } } } ?> <td class="value" <?php echo $style; ?> title="<?php echo $title; ?> "><?php echo $htmlValue; ?> </td>
/** * Send event notification to the list of users ($people) * * @param ProjectEvent $event Event * @param array $people * @return boolean * @throws NotifierConnectionError */ static function notifEvent(ProjectEvent $object, $people, $notification, $sender) { if (!is_array($people) || !count($people) || !$sender instanceof Contact) { return; // nothing here... } // if $name = $object->getObjectName(); $type = $object->getObjectTypeName(); $typename = lang($object->getObjectTypeName()); tpl_assign('object', $object); tpl_assign('title', $name); tpl_assign('description', escape_html_whitespace(convert_to_links(clean($object->getDescription())))); //descripction //context $contexts = array(); $members = $object->getMembers(); if (count($members) > 0) { foreach ($members as $member) { $dim = $member->getDimension(); if ($dim->getIsManageable()) { if ($dim->getCode() == "customer_project" || $dim->getCode() == "customers") { $obj_type = ObjectTypes::findById($member->getObjectTypeId()); if ($obj_type instanceof ObjectType) { $contexts[$dim->getCode()][$obj_type->getName()][] = '<span style="' . get_workspace_css_properties($member->getMemberColor()) . '">' . $member->getName() . '</span>'; } } else { $contexts[$dim->getCode()][] = '<span style="' . get_workspace_css_properties($member->getMemberColor()) . '">' . $member->getName() . '</span>'; } } } } tpl_assign('contexts', $contexts); //folders $attachments = array(); try { $content = FileRepository::getBackend()->getFileContent(owner_company()->getPictureFile()); if ($content) { $file_path = ROOT . "/tmp/logo_empresa.png"; $handle = fopen($file_path, 'wb'); if ($handle) { fwrite($handle, $content); fclose($handle); $attachments['logo'] = array('cid' => gen_id() . substr($sender->getEmailAddress(), strpos($sender->getEmailAddress(), '@')), 'path' => $file_path, 'type' => 'image/png', 'disposition' => 'inline', 'name' => 'logo_empresa.png'); } } } catch (FileNotInRepositoryError $e) { unset($attachments['logo']); } tpl_assign('attachments', $attachments); // attachments //invitations $invitations = EventInvitations::findAll(array('conditions' => 'event_id = ' . $object->getId())); if (isset($invitations) && is_array($invitations)) { $guests = ""; $send_link = array(); foreach ($invitations as $inv) { $inv_user = Contacts::findById($inv->getContactId()); if ($inv_user instanceof Contact) { if (can_access($inv_user, $object->getMembers(), ProjectEvents::instance()->getObjectTypeId(), ACCESS_LEVEL_READ)) { $state_desc = lang('pending response'); if ($inv->getInvitationState() == 1) { $state_desc = lang('yes'); } else { if ($inv->getInvitationState() == 2) { $state_desc = lang('no'); } else { if ($inv->getInvitationState() == 3) { $state_desc = lang('maybe'); } } } $guests .= '<div style="line-height: 20px; clear:both;">'; $guests .= '<div style="width: 35%;line-height: 20px; float: left;">' . clean($inv_user->getObjectName()) . '</div>'; $guests .= '<div style="line-height: 20px; float: left;">' . $state_desc . '</div></div>'; } if ($inv->getInvitationState() == 0) { $send_link[] = $inv_user->getId(); } } } } tpl_assign('guests', $guests); // invitations $emails = array(); foreach ($people as $user) { if ($user->getId() != $sender->getId() && !$user->getDisabled()) { // send notification on user's locale and with user info $locale = $user->getLocale(); Localization::instance()->loadSettings($locale, ROOT . '/language'); //ALL SUBSCRIBERS if ($object->getSubscribers()) { $subscribers = $object->getSubscribers(); $string_subscriber = ''; $total_s = count($subscribers); $c = 0; foreach ($subscribers as $subscriber) { $c++; if ($c == $total_s && $total_s > 1) { $string_subscriber .= lang('and'); } else { if ($c > 1) { $string_subscriber .= ", "; } } $string_subscriber .= $subscriber->getFirstName(); if ($subscriber->getSurname() != "") { $string_subscriber .= " " . $subscriber->getSurname(); } } tpl_assign('subscribers', $string_subscriber); // subscribers } //start if ($object->getStart() instanceof DateTimeValue) { $date = Localization::instance()->formatDescriptiveDate($object->getStart(), $user->getTimezone()); $time = Localization::instance()->formatTime($object->getStart(), $user->getTimezone()); tpl_assign('start', $date); //start if ($object->getTypeId() != 2) { tpl_assign('time', $time); //time } } if ($object->getTypeId() != 2) { //duration if ($object->getDuration() instanceof DateTimeValue) { $durtime = $object->getDuration()->getTimestamp() - $object->getStart()->getTimestamp(); $durhr = $durtime / 3600 % 24; //seconds per hour tpl_assign('duration', $durhr . " hs"); //duration } } else { tpl_assign('duration', lang('all day event')); //duration } $links = array(); if (in_array($user->getId(), $send_link)) { $links = array(array('img' => get_image_url("/16x16/complete.png"), 'text' => lang('accept invitation'), 'url' => get_url('event', 'change_invitation_state', array('at' => 1, 'e' => $object->getId(), 'u' => $user->getId()))), array('img' => get_image_url("/16x16/del.png"), 'text' => lang('reject invitation'), 'url' => get_url('event', 'change_invitation_state', array('at' => 2, 'e' => $object->getId(), 'u' => $user->getId())))); $description_title = lang("new notification event invitation", $object->getObjectName(), $sender->getObjectName()); $subject_mail = lang("new notification event", $name, $sender->getObjectName()); } else { $description_title = lang("{$notification} notification event desc", $object->getObjectName(), $sender->getObjectName()); $subject_mail = lang("{$notification} notification {$type}", $name, $typename); } tpl_assign('links', $links); tpl_assign('description_title', $description_title); //description_title $toemail = $user->getEmailAddress(); if (!$toemail) { continue; } $emails[] = array("to" => array(self::prepareEmailAddress($toemail, $user->getObjectName())), "from" => self::prepareEmailAddress($sender->getEmailAddress(), $sender->getObjectName()), "subject" => $subject = $subject_mail, "body" => tpl_fetch(get_template_path('general', 'notifier')), "attachments" => $attachments); } } // foreach $locale = logged_user() instanceof Contact ? logged_user()->getLocale() : DEFAULT_LOCALIZATION; Localization::instance()->loadSettings($locale, ROOT . '/language'); self::queueEmails($emails); }
:</td><td style="padding-left:10px;"> <?php echo MailUtilities::displayMultipleAddresses(clean($email->getCc()), true, false); ?> </td></tr> <?php } ?> <tr><td style="font-weight: bold;"><?php echo lang('subject'); ?> :</td><td style="padding-left:10px;"> <?php echo $email->getSubject(); ?> </td></tr> </table> <br /><br /> <?php if ($email->getBodyHtml() != '') { echo $email->getBodyHtml(); } else { echo '<div>' . nl2br(convert_to_links(clean($email->getBodyPlain()))) . '</div>'; } ?> </div> <script> window.print(); </script>
} </style> <div class="print-view-message"> <div class="header"> <h1><?php echo clean($message->getObjectName()); ?></h1> <b><?php echo lang('from') ?>:</b> <?php echo clean($message->getCreatedByDisplayName()) ?><br /> <b><?php echo lang('date') ?>:</b> <?php echo format_datetime($message->getUpdatedOn(), null, logged_user()->getTimezone()) ?><br /> <b><?php /*FIXME echo lang('workspace') ?>:</b> <?php echo clean($message->getWorkspacesNamesCSV()) */?><br /> </div> <div class="body"> <?php if($message->getTypeContent() == "text"){ echo escape_html_whitespace(convert_to_links(clean($message->getText()))); }else{ echo purify_html(nl2br($message->getText())); } ?> </div> <?php $i = 0; $comments = $message->getComments(); if (count($comments) > 0) { ?> <div class="comments"> <h2><?php echo lang("comments") ?></h2> <?php foreach ($comments as $comment) { $i++;
// if } if ($message->canDelete(logged_user())) { if ($message->isTrashed()) { add_page_action(lang('restore from trash'), "javascript:if(confirm(lang('confirm restore objects'))) og.openLink('" . $message->getUntrashUrl() . "');", 'ico-restore', null, null, true); add_page_action(lang('delete permanently'), "javascript:if(confirm(lang('confirm delete permanently'))) og.openLink('" . $message->getDeletePermanentlyUrl() . "');", 'ico-delete', null, null, true); } else { add_page_action(lang('move to trash'), "javascript:if(confirm(lang('confirm move to trash'))) og.openLink('" . $message->getTrashUrl() . "');", 'ico-trash', null, null, true); } } // if add_page_action(lang('print view'), $message->getPrintViewUrl(), "ico-print", "_blank"); ?> <div style="padding:7px"> <div class="message"> <?php $content = escape_html_whitespace(convert_to_links(clean($message->getText()))); if (trim($message->getAdditionalText())) { $content .= '<div class="messageSeparator">' . lang('message separator') . '</div>' . escape_html_whitespace(convert_to_links(clean($message->getAdditionalText()))); } tpl_assign("content", $content); tpl_assign("object", $message); tpl_assign('iconclass', $message->isTrashed() ? 'ico-large-message-trashed' : ($message->isArchived() ? 'ico-large-message-archived' : 'ico-large-message')); $this->includeTemplate(get_template_path('view', 'co')); ?> </div> </div> <?php } //if isset
} } ?> <div style="padding:7px"> <div class="milestone"> <?php $content = ''; if ($milestone->getDueDate()->getYear() > DateTimeValueLib::now()->getYear()) { $content = '<div class="dueDate"><b>' . lang('due date') . ':</b> ' . format_date($milestone->getDueDate(), null, 0) . '</div>'; } else { $content = '<div class="dueDate"><b>' . lang('due date') . ':</b> ' . format_descriptive_date($milestone->getDueDate(), 0) . '</div>'; } // if if ($milestone->getDescription()) { $content .= '<fieldset><legend>' . lang('description') . '</legend>' . escape_html_whitespace(convert_to_links(clean($milestone->getDescription()))) . '</fieldset>'; } $openSubtasks = $milestone->getOpenSubTasks(); if (is_array($openSubtasks)) { // $content .= '<p>' . lang('task lists') . ':</p><ul>'; //show open sub task list $content .= '<br/><table style="border:1px solid #717FA1;width:100%; padding-left:10px;"><tr><th style="padding-left:10px;padding-top:4px;padding-bottom:4px;background-color:#E8EDF7;font-size:120%;font-weight:bolder;color:#717FA1;width:100%;">' . lang("view open tasks") . '</th></tr><tr><td style="padding-left:10px;"> <div class="openTasks"> <table class="blank">'; foreach ($openSubtasks as $task) { $content .= '<tr>'; // Checkboxes if ($task->canChangeStatus(logged_user())) { $content .= '<td class="taskCheckbox">' . checkbox_link($task->getCompleteUrl(rawurlencode(get_url('milestone', 'view', array('id' => $milestone->getId())))), false, lang('mark task as completed')) . '</td>'; } else { $content .= '<td class="taskCheckbox"><img src="' . icon_url('not-checked.jpg') . '" alt="' . lang('open task') . '" /></td>';
/* @var $workspace Workspace */ if ($workspace->getColumnValue('show_description_in_overview')) { ?> <div class="widget-persons widget"> <div class="widget-header" onclick="og.dashExpand('<?php echo $genid; ?> ');"> <div class="widget-title"><?php echo isset($widget_title) ? $widget_title : lang("workspace description"); ?> </div> <div class="dash-expander ico-dash-expanded" id="<?php echo $genid; ?> expander"></div> </div> <div class="widget-body" id="<?php echo $genid; ?> _widget_body"> <?php echo escape_html_whitespace(convert_to_links(clean($description))); ?> </div> </div> <?php }