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>';
        }
    }
}
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 function workEstimate(ProjectTask $task)
 {
     tpl_assign('task_assigned', $task);
     if (!$task->getAssignedTo() instanceof Contact) {
         return true;
         // not assigned to user
     }
     if (!is_valid_email($task->getAssignedTo()->getEmailAddress())) {
         return true;
     }
     $locale = $task->getAssignedTo()->getLocale();
     Localization::instance()->loadSettings($locale, ROOT . '/language');
     tpl_assign('title', $task->getObjectName());
     tpl_assign('by', $task->getAssignedBy()->getObjectName());
     tpl_assign('asigned', $task->getAssignedTo()->getObjectName());
     $text = "";
     if (config_option("wysiwyg_tasks")) {
         $text = purify_html(nl2br($task->getDescription()));
     } else {
         $text = escape_html_whitespace($task->getDescription());
     }
     tpl_assign('description', $text);
     //descripction
     tpl_assign('description_title', lang("new task work estimate to you desc", $task->getObjectName(), $task->getAssignedBy()->getObjectName()));
     //description_title
     //priority
     if ($task->getPriority()) {
         if ($task->getPriority() >= ProjectTasks::PRIORITY_URGENT) {
             $priorityColor = "#FF0000";
             $priority = lang('urgent priority');
         } else {
             if ($task->getPriority() >= ProjectTasks::PRIORITY_HIGH) {
                 $priorityColor = "#FF9088";
                 $priority = lang('high priority');
             } else {
                 if ($task->getPriority() <= ProjectTasks::PRIORITY_LOW) {
                     $priorityColor = "white";
                     $priority = lang('low priority');
                 } else {
                     $priorityColor = "#DAE3F0";
                     $priority = lang('normal priority');
                 }
             }
         }
         tpl_assign('priority', array($priority, $priorityColor));
     }
     //context
     $contexts = array();
     $members = $task->getMembers();
     if (count($members) > 0) {
         foreach ($members as $member) {
             $dim = $member->getDimension();
             if ($dim->getIsManageable()) {
                 /* @var $member Member */
                 $parent_members = $member->getAllParentMembersInHierarchy();
                 $parents_str = '';
                 foreach ($parent_members as $pm) {
                     /* @var $pm Member */
                     if (!$pm instanceof Member) {
                         continue;
                     }
                     $parents_str .= '<span style="' . get_workspace_css_properties($pm->getMemberColor()) . '">' . $pm->getName() . '</span>';
                 }
                 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()][] = $parents_str . '<span style="' . get_workspace_css_properties($member->getMemberColor()) . '">' . $member->getName() . '</span>';
                     }
                 } else {
                     $contexts[$dim->getCode()][] = $parents_str . '<span style="' . get_workspace_css_properties($member->getMemberColor()) . '">' . $member->getName() . '</span>';
                 }
             }
         }
     }
     tpl_assign('contexts', $contexts);
     //workspaces
     //start date, due date or start
     if ($task->getStartDate() instanceof DateTimeValue) {
         $date = Localization::instance()->formatDescriptiveDate($task->getStartDate(), $task->getAssignedTo()->getTimezone());
         $time = Localization::instance()->formatTime($task->getStartDate(), $task->getAssignedTo()->getTimezone());
         if ($time > 0) {
             $date .= " " . $time;
         }
         tpl_assign('start_date', $date);
         //start_date
     }
     if ($task->getDueDate() instanceof DateTimeValue) {
         $date = Localization::instance()->formatDescriptiveDate($task->getDueDate(), $task->getAssignedTo()->getTimezone());
         $time = Localization::instance()->formatTime($task->getDueDate(), $task->getAssignedTo()->getTimezone());
         if ($time > 0) {
             $date .= " " . $time;
         }
         tpl_assign('due_date', $date);
         //due_date
     }
     $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($task->getAssignedBy()->getEmailAddress(), strpos($task->getAssignedBy()->getEmailAddress(), '@')), 'path' => $file_path, 'type' => 'image/png', 'disposition' => 'inline', 'name' => 'logo_empresa.png');
             }
         }
     } catch (FileNotInRepositoryError $e) {
         unset($attachments['logo']);
     }
     tpl_assign('attachments', $attachments);
     // attachments
     //ALL SUBSCRIBERS
     if ($task->getSubscribers()) {
         $subscribers = $task->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
     }
     if ($task->getAssignedById() == $task->getAssignedToContactId()) {
         if (!$task->getAssignedBy()->getDisabled()) {
             $emails[] = array("to" => array(self::prepareEmailAddress($task->getAssignedBy()->getEmailAddress(), $task->getAssignedBy()->getObjectName())), "from" => self::prepareEmailAddress($task->getUpdatedBy()->getEmailAddress(), $task->getUpdatedByDisplayName()), "subject" => lang('work estimate title'), "body" => tpl_fetch(get_template_path('work_estimate', 'notifier')), "attachments" => $attachments);
         }
     } else {
         if (!$task->getAssignedBy()->getDisabled()) {
             $emails[] = array("to" => array(self::prepareEmailAddress($task->getAssignedBy()->getEmailAddress(), $task->getAssignedBy()->getObjectName())), "from" => self::prepareEmailAddress($task->getUpdatedBy()->getEmailAddress(), $task->getUpdatedByDisplayName()), "subject" => lang('work estimate title'), "body" => tpl_fetch(get_template_path('work_estimate', 'notifier')), "attachments" => $attachments);
         }
         if (!$task->getAssignedTo()->getDisabled()) {
             $emails[] = array("to" => array(self::prepareEmailAddress($task->getAssignedTo()->getEmailAddress(), $task->getAssignedTo()->getObjectName())), "from" => self::prepareEmailAddress($task->getUpdatedBy()->getEmailAddress(), $task->getUpdatedByDisplayName()), "subject" => lang('work estimate title'), "body" => tpl_fetch(get_template_path('work_estimate', 'notifier')), "attachments" => $attachments);
         }
     }
     self::queueEmails($emails);
     $locale = logged_user() instanceof Contact ? logged_user()->getLocale() : DEFAULT_LOCALIZATION;
     Localization::instance()->loadSettings($locale, ROOT . '/language');
 }
Exemplo n.º 4
0
	<?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;">
Exemplo n.º 5
0
<?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 ;?>
Exemplo n.º 6
0
					<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 {
Exemplo n.º 7
0
			}
			$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">&lt;'.lang('hidden quoted text').'&gt;</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'>&nbsp;".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;
Exemplo n.º 9
0
                    	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>
Exemplo n.º 10
0
 function workEstimate(ProjectTask $task)
 {
     tpl_assign('task_assigned', $task);
     if (!$task->getAssignedTo() instanceof Contact) {
         return true;
         // not assigned to user
     }
     if (!is_valid_email($task->getAssignedTo()->getEmailAddress())) {
         return true;
     }
     $locale = $task->getAssignedTo()->getLocale();
     Localization::instance()->loadSettings($locale, ROOT . '/language');
     tpl_assign('title', $task->getObjectName());
     tpl_assign('by', $task->getAssignedBy()->getObjectName());
     tpl_assign('asigned', $task->getAssignedTo()->getObjectName());
     $text = "";
     if (config_option("wysiwyg_tasks")) {
         $text = purify_html(nl2br($task->getDescription()));
     } else {
         $text = escape_html_whitespace($task->getDescription());
     }
     tpl_assign('description', $text);
     //descripction
     tpl_assign('description_title', lang("new task work estimate to you desc", $task->getObjectName(), $task->getCreatedBy()->getObjectName()));
     //description_title
     //priority
     if ($task->getPriority()) {
         if ($task->getPriority() >= ProjectTasks::PRIORITY_URGENT) {
             $priorityColor = "#FF0000";
             $priority = lang('urgent priority');
         } else {
             if ($task->getPriority() >= ProjectTasks::PRIORITY_HIGH) {
                 $priorityColor = "#FF9088";
                 $priority = lang('high priority');
             } else {
                 if ($task->getPriority() <= ProjectTasks::PRIORITY_LOW) {
                     $priorityColor = "white";
                     $priority = lang('low priority');
                 } else {
                     $priorityColor = "#DAE3F0";
                     $priority = lang('normal priority');
                 }
             }
         }
         tpl_assign('priority', array($priority, $priorityColor));
     }
     //context
     $contexts = array();
     if ($task->getMembersToDisplayPath()) {
         $members = $task->getMembersToDisplayPath();
         foreach ($members as $key => $member) {
             $dim = Dimensions::getDimensionById($key);
             if ($dim->getCode() == "customer_project") {
                 foreach ($members[$key] as $member) {
                     $obj_type = ObjectTypes::findById($member['ot']);
                     $contexts[$dim->getCode()][$obj_type->getName()][] = '<span style="' . get_workspace_css_properties($member['c']) . '">' . $member['name'] . '</span>';
                 }
             } else {
                 foreach ($members[$key] as $member) {
                     $contexts[$dim->getCode()][] = '<span style="' . get_workspace_css_properties($member['c']) . '">' . $member['name'] . '</span>';
                 }
             }
         }
     }
     tpl_assign('contexts', $contexts);
     //workspaces
     //start date, due date or start
     if ($task->getStartDate() instanceof DateTimeValue) {
         $date = Localization::instance()->formatDescriptiveDate($task->getStartDate(), $task->getAssignedTo()->getTimezone());
         $time = Localization::instance()->formatTime($task->getStartDate(), $task->getAssignedTo()->getTimezone());
         if ($time > 0) {
             $date .= " " . $time;
         }
         tpl_assign('start_date', $date);
         //start_date
     }
     if ($task->getDueDate() instanceof DateTimeValue) {
         $date = Localization::instance()->formatDescriptiveDate($task->getDueDate(), $task->getAssignedTo()->getTimezone());
         $time = Localization::instance()->formatTime($task->getDueDate(), $task->getAssignedTo()->getTimezone());
         if ($time > 0) {
             $date .= " " . $time;
         }
         tpl_assign('due_date', $date);
         //due_date
     }
     $attachments = array();
     try {
         $content = FileRepository::getBackend()->getFileContent(owner_company()->getPictureFile());
         $file_path = ROOT . "/upload/logo_empresa.png";
         $handle = fopen($file_path, 'wb');
         fwrite($handle, $content);
         fclose($handle);
         if ($content != "") {
             $attachments['logo'] = array('cid' => gen_id() . substr($task->getAssignedBy()->getEmailAddress(), strpos($task->getAssignedBy()->getEmailAddress(), '@')), 'path' => $file_path, 'type' => 'image/png', 'disposition' => 'inline', 'name' => 'logo_empresa.png');
             tpl_assign('attachments', $attachments);
             // attachments
         }
     } catch (FileNotInRepositoryError $e) {
         // If no logo is set, don't interrupt notifications.
     }
     tpl_assign('attachments', $attachments);
     // attachments
     self::queueEmail(array(self::prepareEmailAddress($task->getCreatedBy()->getEmailAddress(), $task->getCreatedBy()->getObjectName())), self::prepareEmailAddress($task->getUpdatedBy()->getEmailAddress(), $task->getUpdatedByDisplayName()), lang('work estimate title'), tpl_fetch(get_template_path('work_estimate', 'notifier')), 'text/html', '8bit', $attachments);
     // send
     $locale = logged_user() instanceof Contact ? logged_user()->getLocale() : DEFAULT_LOCALIZATION;
     Localization::instance()->loadSettings($locale, ROOT . '/language');
 }
Exemplo n.º 11
0
    </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');
    ?>
Exemplo n.º 12
0
		<?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()) {?>
Exemplo n.º 13
0
 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);
 }
Exemplo n.º 14
0
    }
    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
Exemplo n.º 15
0
         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();
Exemplo n.º 16
0
                                $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>
Exemplo n.º 17
0
}
</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++;
Exemplo n.º 18
0
        // 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
Exemplo n.º 19
0
        }
    }
    ?>

<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>';
Exemplo n.º 20
0
/* @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 
}