Пример #1
0
 function index()
 {
     // Get Users
     $users = $this->social_auth->get_users('active', 1);
     $users_view = NULL;
     // Title Stuff
     $this->data['page_title'] = 'Users';
     $this->data['sub_title'] = 'Manage';
     // Users View Loop
     foreach ($users as $user) {
         $this->data['user_id'] = $user->user_id;
         $this->data['name'] = $user->name;
         $this->data['avatar'] = $this->social_igniter->profile_image($user->user_id, $user->image, $user->email);
         $this->data['profile'] = base_url() . 'profile/' . $user->username;
         $this->data['created_on'] = format_datetime('SIMPLE_ABBR', $user->created_on);
         $this->data['last_login'] = format_datetime('SIMPLE_TIME_ABBR', $user->last_login);
         // Alerts
         $this->data['user_alerts'] = item_alerts_user($user);
         // Actions
         $this->data['user_state'] = item_user_state($user->active);
         $this->data['user_edit'] = base_url() . 'users/manage/' . $user->user_id;
         $this->data['user_delete'] = base_url() . 'api/users/destroy/id/' . $user->user_id;
         // View
         $users_view .= $this->load->view(config_item('dashboard_theme') . '/partials/item_users.php', $this->data, true);
     }
     // Final Output
     $this->data['users_view'] = $users_view;
     $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
     $this->render('dashboard_wide');
 }
Пример #2
0
function discGetDiscussion($DID)
{
    $q = db_query("select DID, Author, Body, add_time, Topic, name AS product_name, " . " " . PRODUCTS_TABLE . ".productID AS productID from " . DISCUSSIONS_TABLE . ", " . PRODUCTS_TABLE . " where " . DISCUSSIONS_TABLE . ".productID=" . PRODUCTS_TABLE . ".productID AND DID=" . (int) $DID);
    $row = db_fetch_row($q);
    $row["add_time"] = format_datetime($row["add_time"]);
    return $row;
}
Пример #3
0
/**
 * Render the date published for a content record
 *
 * @param sfSympalContent $content 
 * @param string $slot 
 * @return string $datePublished
 */
function render_content_date_published(sfSympalContent $content, $slot)
{
    if ($content->date_published) {
        sfSympalToolkit::loadHelpers('Date');
        return format_datetime($content->date_published, sfSympalConfig::get('date_published_format'));
    } else {
        return '0000-00-00';
    }
}
Пример #4
0
 function output_datetime($date = 'now', $input = FALSE)
 {
     if ($date == NULL) {
         return '';
     }
     $abbr = $input ? '' : '<abbr title="' . format_datetime($date) . '">';
     $date_output = date('d-m-Y H:i', strtotime($date));
     $abbr_end = $input ? '' : '</abbr>';
     return $abbr . $date_output . $abbr_end;
 }
Пример #5
0
 private function __construct(array $data)
 {
     foreach ($data as $key => $value) {
         $this->data[$key] = $value;
     }
     $this->id = intval($this->data['id']);
     $this->shortname = $this->data['diminutif'];
     if (!is_null($this->axDate)) {
         $this->axDate = format_datetime($this->axDate, '%d/%m/%Y');
     }
 }
Пример #6
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;
     }
 }
Пример #7
0
	function getArrayInfo($include_trash_info = false, $include_archive_info = false) {
		if ($this->getCreatedOn()){
			$dateCreated = $this->getCreatedOn()->isToday() ? lang('today') ." ". format_time($this->getCreatedOn()) : format_datetime($this->getCreatedOn());
		}
		if ($this->getUpdatedOn()){
			$dateUpdated = $this->getUpdatedOn()->isToday() ? lang('today') ." ". format_time($this->getUpdatedOn()) : format_datetime($this->getUpdatedOn());
		}
		$info = array(
			'object_id' => $this->getId(),
			'ot_id' => $this->getObjectTypeId(),
			'name' => $this->getName(),
			'type' => $this->getObjectTypeName(),
			'icon' => $this->getType()->getIconClass(),
			'createdBy' => $this->getCreatedByDisplayName(),
			'createdById' => $this->getCreatedById(),
			'dateCreated' => $dateCreated,
			'updatedBy' => $this->getUpdatedByDisplayName(),
			'updatedById' => $this->getUpdatedById(),
			'dateUpdated' => $dateUpdated,
			'url' => $this->getViewUrl()
		);
		
		if ($include_trash_info) {
			$dateTrashed = $this->getTrashedOn() instanceof DateTimeValue ? ($this->getTrashedOn()->isToday() ? format_time($this->getTrashedOn()) : format_datetime($this->getTrashedOn())) : lang('n/a');
			$info['deletedBy'] = $this->getTrashedByDisplayName();
			$info['deletedById'] = $this->getColumnValue('trashed_by_id');
			$info['dateDeleted'] = $dateTrashed;
		}
		if ($include_archive_info) {
			$dateArchived = $this->getArchivedOn() instanceof DateTimeValue ? ($this->getArchivedOn()->isToday() ? format_time($this->getArchivedOn()) : format_datetime($this->getArchivedOn())) : lang('n/a');
			$archived_by = Contacts::findById($this->getArchivedById());
			$info['archivedBy'] = $archived_by instanceof Contact ? $archived_by->getObjectName() : lang('n/a');
			$info['archivedById'] = $this->getArchivedById();
			$info['dateArchived'] = $dateArchived;
		}
		
		return $info;
	}
Пример #8
0
        ?>
      <tr>
        <td><?php 
        echo checkbox_field('project_' . $project->getId(), $company->isProjectCompany($project), array('id' => 'projectPermissionsCheckbox' . $project->getId(), 'disabled' => !logged_user()->isProjectUser($project)));
        ?>
</td>
        <td>
          <label for="projectPermissionsCheckbox<?php 
        echo $project->getId();
        ?>
" class="checkbox normal">
<?php 
        if ($project->isCompleted()) {
            ?>
          <del><span title="<?php 
            echo lang('project completed on by', format_datetime($project->getCompletedOn()), $project->getCompletedByDisplayName());
            ?>
"><?php 
            echo clean($project->getName());
            ?>
</span></del>
<?php 
        } else {
            ?>
          <?php 
            echo clean($project->getName());
        }
        // if
        ?>
          </label>
        </td>
                  <p>...para a próxima transmissão</p>
                </div>
                <p class="proximos">Pr&oacute;ximos programas ao vivo:</p>
               
              </div>
              <!-- /contador -->


              <ul class="lista-calendario grid2">
              <?php 
            foreach ($displays as $k => $d) {
                ?>
                <li>
                  <div class="barra-grade">
                    <p class="hora"><?php 
                echo format_datetime($d->getDateStart(), "d/M HH:mm");
                ?>
</p>
                    <a href="#" class="btn-toggle"><?php 
                echo $d->Program->getTitle();
                ?>
</a>
                    <a href="#" class="botao btn-toggle"></a>
                  </div>
                  <div class="grade toggle" style="display:none; width:auto; padding-bottom:25px;">
                    <div class="capa-foto" style="width:auto;">
                      <img src="<?php 
                echo $d->retriveLiveImage();
                ?>
" alt="<?php 
                echo $d->retriveTitle();
Пример #10
0
    function printView($start_date = NULL, $end_date = NULL, $editing = FALSE, $public = FALSE)
    {
        if (empty($this->_members)) {
            return;
        }
        if (!$editing && !$public) {
            $my_email = $GLOBALS['user_system']->getCurrentUser('email');
        }
        $GLOBALS['system']->includeDBClass('service');
        $dummy_service = new Service();
        if (is_null($start_date)) {
            $start_date = date('Y-m-d');
        }
        $service_params = array('congregationid' => $this->getCongregations(), '>date' => date('Y-m-d', strtotime($start_date . ' -1 day')));
        if (!is_null($end_date)) {
            $service_params['<date'] = date('Y-m-d', strtotime($end_date . ' +1 day'));
        }
        $services = $GLOBALS['system']->getDBObjectData('service', $service_params, 'AND', 'date');
        $to_print = array();
        foreach ($services as $id => $service_details) {
            $service_details['id'] = $id;
            $to_print[$service_details['date']]['service'][$service_details['congregationid']] = $service_details;
            $to_print[$service_details['date']]['assignments'] = array();
        }
        foreach ($this->getAssignments($start_date, $end_date) as $date => $date_assignments) {
            $to_print[$date]['assignments'] = $date_assignments;
        }
        ksort($to_print);
        $role_objects = array();
        $this_sunday = date('Y-m-d', strtotime('Sunday'));
        if (empty($to_print)) {
            if ($public) {
                ?>
				<div class="alert alert-error">This roster is empty for the current date range.</div>
				<?php 
            } else {
                ?>
				<div class="alert alert-error">There are no services during the date range specified.  Please try a different date range, or create some services using the 'Edit service program' page.</div>
				<?php 
            }
            return;
        }
        if ($editing) {
            $show_lock_fail_msg = false;
            $show_group_denied_msg = false;
            foreach ($this->_members as $id => &$details) {
                if (!empty($details['role_id'])) {
                    $role = $GLOBALS['system']->getDBObject('roster_role', $details['role_id']);
                    if (!($role->canAcquireLock('assignments') && $role->acquireLock('assignments'))) {
                        $details['readonly'] = true;
                        $show_lock_fail_msg = true;
                    }
                    if (!$role->canEditAssignments()) {
                        $details['readonly'] = true;
                        $show_group_denied_msg = true;
                    }
                }
            }
            if ($show_lock_fail_msg) {
                print_message("Some of the roles in this roster are currently being edited by another user.  To edit assignments for these roles, wait until the other user finishes then try again.", 'failure');
            }
            if ($show_group_denied_msg) {
                print_message("There are some roles in this roster which you are not able to edit because they refer to a volunteer group you do not have access to.");
            }
            ?>
			<form method="post" class="warn-unsaved bubble-option-props">
			<script>
				$(document).ready(function() {

					setTimeout('showLockExpiryWarning()', <?php 
            echo (strtotime('+' . LOCK_LENGTH, 0) - 60) * 1000;
            ?>
);
					setTimeout('showLockExpiredWarning()', <?php 
            echo strtotime('+' . LOCK_LENGTH, 0) * 1000;
            ?>
);

					$('table.roster select').keypress(function() { handleRosterChange(this); }).change(function() { handleRosterChange(this); });
					$('table.roster input.person-search-single, table.roster input.person-search-multiple').each(function() {
						this.onchange = function() { handleRosterChange(this); };
					});
					$('table.roster > tbody > tr').each(function() { updateClashesForRow($(this)); });
				});
				function handleRosterChange(inputField)
				{
					var row = null;
					if ($(inputField).hasClass('person-search-single') || $(inputField).hasClass('person-search-multiple')) {
						row = $(inputField).parents('tr:first');
					} else if (inputField.tagName == 'SELECT' || inputField.type == 'hidden') {
						var expandableParent = $(inputField).parents('table.expandable');
						if (expandableParent.length) {
							var row = $(inputField).parents('table:first').parents('tr:first');
						} else {
							var row = $(inputField).parents('tr:first');
						}
					}
					if (row) {
						updateClashesForRow(row);
					}
				}

				function updateClashesForRow(row)
				{
					var uses = new Object();
					// Deal with the single person choosers and select boxes first
					var sameRowInputs = row.find('input.person-search-single, select');
					sameRowInputs.removeClass('clash');
					sameRowInputs.each(function() {
						var thisElt = this;
						var thisVal = 0;
						if (this.className == 'person-search-single') {
							var hiddenInput = document.getElementsByName(this.id.substr(0, this.id.length-6))[0];
							thisVal = hiddenInput.value;
						} else if (this.tagName == 'SELECT') {
							thisVal = this.value;
						}
						if (thisVal != 0) {
							if (!uses[thisVal]) {
								uses[thisVal] = new Array();
							}
							uses[thisVal].push(thisElt);
						}
					});
					// Now add the multi person choosers
					row.find('ul.multi-person-finder li').removeClass('clash').each(function() {
						var thisVal = $(this).find('input')[0].value;
						if (thisVal != 0) {
							if (!uses[thisVal]) {
								uses[thisVal] = new Array();
							}
							uses[thisVal].push(this);
						}
					});
					for (i in uses) {
						if (uses[i].length > 1) {
							for (j in uses[i]) {
								if (typeof uses[i][j] == 'function') continue;
								$(uses[i][j]).addClass('clash');
							}
						}
					}
				}
			</script>
			<?php 
        }
        ?>
		<table class="table roster" border="1" cellspacing="0" cellpadding="1">

			<?php 
        $this->_printTableHeader($editing, $public);
        ?>

			<tbody>
			<?php 
        foreach ($to_print as $date => $ddetail) {
            if ($public && empty($ddetail['assignments'])) {
                continue;
            }
            $class_clause = $date == $this_sunday ? 'class="tblib-hover"' : '';
            ?>
				<tr <?php 
            echo $class_clause;
            ?>
>
					<td class="nowrap">
						<?php 
            echo '<strong>' . str_replace(' ', '&nbsp;', date('j M y', strtotime($date))) . '</strong>';
            if (!$editing && !$public) {
                $emails = array();
                foreach ($ddetail['assignments'] as $roleid => $assignees) {
                    foreach ($assignees as $pid => $pdetails) {
                        if (!empty($pdetails['email']) && $pdetails['email'] != $my_email) {
                            $emails[] = $pdetails['email'];
                        }
                    }
                }
                $emails = array_unique($emails);
                if (!empty($emails)) {
                    ?>
								<p class="smallprint no-print">
									<a href="<?php 
                    echo get_email_href($my_email, NULL, $emails, date('jS F', strtotime($date)));
                    ?>
" <?php 
                    echo email_link_extras();
                    ?>
>Email All</a>
									<?php 
                    if (defined('SMS_HTTP_URL') && constant('SMS_HTTP_URL') && $GLOBALS['user_system']->havePerm(PERM_SENDSMS)) {
                        ?>
										| <span class="clickable" onclick="$(this).parent().next('form').toggle(); $(this).parents('tr:first').addClass('tblib-hover')">SMS All</span>
										<?php 
                    }
                    ?>
								</p>
								<?php 
                    if (defined('SMS_HTTP_URL') && constant('SMS_HTTP_URL') && $GLOBALS['user_system']->havePerm(PERM_SENDSMS)) {
                        $url = build_url(array('view' => '_send_sms_http', 'roster_view' => $this->id, 'start_date' => $date, 'end_date' => $date));
                        ?>
									<form method="post" action="<?php 
                        echo $url;
                        ?>
" style="position: absolute; display: none">
										<div class="standard" style="border-width: 2px; border-radius: 8px">
										<h3>Send SMS</h3>
										<textarea name="message" rows="5" cols="30" maxlength="<?php 
                        echo SMS_MAX_LENGTH;
                        ?>
"></textarea>
										<br />
										<input type="submit" value="Send" />
										<input type="button" onclick="$(this).parents('form').toggle(); $(this).parents('tr:first').removeClass('tblib-hover')" value="Cancel" />
										</div>
									</form>
									<?php 
                    }
                }
            }
            ?>
					</td>
				<?php 
            $last_congid = NULL;
            foreach ($this->_members as $id => $mdetail) {
                $td_class = '';
                if ($mdetail['congregationid'] != $last_congid) {
                    $td_class = 'thick-left-border';
                    $last_congid = $mdetail['congregationid'];
                }
                ?>
					<td class="<?php 
                echo $td_class;
                ?>
">
					<?php 
                if ($mdetail['role_id']) {
                    if ($editing && empty($mdetail['readonly'])) {
                        $currentval = array();
                        foreach (array_get($ddetail['assignments'], $mdetail['role_id'], array()) as $pid => $pdetails) {
                            $currentval[$pid] = $pdetails['name'];
                        }
                        if (empty($role_objects[$mdetail['role_id']])) {
                            $role_objects[$mdetail['role_id']] =& $GLOBALS['system']->getDBObject('roster_role', $mdetail['role_id']);
                        }
                        if (empty($role_objects[$mdetail['role_id']])) {
                            // must've been a problem
                            continue;
                        }
                        $role_objects[$mdetail['role_id']]->printChooser($date, $currentval);
                    } else {
                        $names = array();
                        foreach (array_get($ddetail['assignments'], $mdetail['role_id'], array()) as $personid => $vs) {
                            if (!$public) {
                                $n = '<a href="' . BASE_URL . '?view=persons&personid=' . $personid . '" title="Assigned by ' . ents($vs['assigner']) . ' on ' . format_datetime($vs['assignedon']) . '">' . nbsp(ents($vs['name'])) . '</a>';
                                if (empty($vs['email'])) {
                                    $n .= '&nbsp;<img src="' . BASE_URL . 'resources/img/no_email.png" style="display:inline" title="No Email Address" />';
                                }
                                $names[] = $n;
                            } else {
                                $names[] = nbsp($vs['name']);
                            }
                        }
                        echo implode("<br />", $names);
                    }
                } else {
                    if (!empty($ddetail['service'][$mdetail['congregationid']])) {
                        if ($public && (!defined('SHOW_SERVICE_NOTES_PUBLICLY') || !SHOW_SERVICE_NOTES_PUBLICLY)) {
                            // no notes in public view
                            unset($ddetail['service'][$mdetail['congregationid']]['notes']);
                        }
                        $dummy_service->populate($ddetail['service'][$mdetail['congregationid']]['id'], $ddetail['service'][$mdetail['congregationid']]);
                        $dummy_service->printFieldvalue($mdetail['service_field']);
                    }
                }
                ?>
					</td>
					<?php 
            }
            if (!$public && count($this->_members) > REPEAT_DATE_THRESHOLD) {
                ?>
					<td class="nowrap thick-left-border">
						<strong><?php 
                echo str_replace(' ', '&nbsp;', date('j M y', strtotime($date)));
                ?>
</strong>
					</td>
					<?php 
            }
            ?>
				</tr>
				<?php 
        }
        ?>
		</tbody>

		<?php 
        if (!$public && count($to_print) > 6) {
            $this->_printTableFooter($editing, $public);
        }
        ?>

		</table>

		<?php 
        if ($editing) {
            ?>
			<input type="submit" class="btn" value="Save" accesskey="s" />
			</form>
			<?php 
        }
    }
		<language>en-us</language>
		<pubDate><?php 
echo date(DATE_RSS);
?>
</pubDate>

		<?php 
foreach ($sessionsForImages as $data) {
    ?>
			<item>
				<title><?php 
    echo $data["name"];
    ?>
</title>
				<pubDate><?php 
    echo date(DATE_RSS, strtotime(format_datetime($data["created_at"], "y-MM-dd HH:mm")));
    ?>
</pubDate>
				<description>
Total test cases: <?php 
    echo $data["total"];
    ?>
<br/>
Passed: <?php 
    echo $data["pass"];
    ?>
<br/>
Failed: <?php 
    echo $data["fail"];
    ?>
<br/>
Пример #12
0
				}
				$conversation_block .= '<td style="width:20px;'.$read_style.'">';
				if ($show_user_icon) { 
					$conversation_block .= '<div class="db-ico ico-user"></div>';
				}
				
				$info_text = $info->getTextBody();
				if (strlen_utf($info_text) > 90) $info_text = substr_utf($info_text, 0, 90) . "...";		
				
				$view_url = get_url('mail', 'view', array('id' => $info->getId(), 'replace' => 1));
				$conversation_block .= '<td>';
				$conversation_block .= '	<a style="'.$read_style.'" class="internalLink" href="'.$view_url.'" onclick="og.openLink(\''.$view_url.'\');return false;" title="'.$info->getFrom().'">';
				$conversation_block .= $from;
				if (!$is_current) $conversation_block .= '	</a><span class="desc">- '.$info_text.'</span></td>';
				
				$info_date = $info->getReceivedDate() instanceof DateTimeValue ? ($info->getReceivedDate()->isToday() ? format_time($info->getReceivedDate()) : format_datetime($info->getReceivedDate())) : lang('n/a');
				$conversation_block .= '</td><td style="text-align:right;padding-right:3px"><span class="desc">'. lang('date').': </span>'. $info_date .'</td>';

			} //foreach
			$conversation_block .= '</table>';
			$conversation_block .= '</div>';
		} else {
			$conversation_block = '';
		}
  
		if($email->getBodyHtml() != ''){
			if (defined('SANDBOX_URL')) {
				$html_content = $email->getBodyHtml();
				// prevent some outlook malformed tags
				if(substr_count($html_content, "<style") != substr_count($html_content, "</style>") && substr_count($html_content, "/* Font Definitions */") >= 1) {
					$p1 = strpos($html_content, "/* Font Definitions */", 0);
Пример #13
0
function format_value_to_print($col, $value, $type, $obj_type_id, $textWrapper = '', $dateformat = 'Y-m-d')
{
    switch ($type) {
        case DATA_TYPE_STRING:
            if (preg_match(EMAIL_FORMAT, strip_tags($value))) {
                $formatted = strip_tags($value);
            } else {
                if ($col == 'is_user') {
                    $formatted = $value == 1 ? lang('yes') : lang('no');
                } else {
                    if (strpos($value, "�") !== false) {
                        $value = preg_replace('/\\xA0/s', ' ', $value);
                    }
                    $value = utf8_safe($value);
                    $formatted = $textWrapper . $value . $textWrapper;
                }
            }
            break;
        case DATA_TYPE_INTEGER:
            if ($col == 'priority') {
                switch ($value) {
                    case 100:
                        $formatted = lang('low priority');
                        break;
                    case 200:
                        $formatted = lang('normal priority');
                        break;
                    case 300:
                        $formatted = lang('high priority');
                        break;
                    case 400:
                        $formatted = lang('urgent priority');
                        break;
                    default:
                        $formatted = clean($value);
                }
            } elseif ($col == 'time_estimate') {
                if ($value > 0) {
                    $formatted = DateTimeValue::FormatTimeDiff(new DateTimeValue(0), new DateTimeValue($value * 60), 'hm', 60);
                } else {
                    $formatted = clean($value);
                }
            } else {
                $formatted = clean($value);
            }
            break;
        case DATA_TYPE_BOOLEAN:
            $formatted = $value == 1 ? lang('yes') : lang('no');
            break;
        case DATA_TYPE_DATE:
            if ($value != 0) {
                if (str_ends_with($value, "00:00:00")) {
                    $dateformat .= " H:i:s";
                }
                try {
                    $dtVal = DateTimeValueLib::dateFromFormatAndString($dateformat, $value);
                } catch (Exception $e) {
                    $formatted = $value;
                }
                if (!isset($formatted)) {
                    $formatted = format_date($dtVal, null, 0);
                }
            } else {
                $formatted = '';
            }
            break;
        case DATA_TYPE_DATETIME:
            if ($value != 0) {
                try {
                    $dtVal = DateTimeValueLib::dateFromFormatAndString("{$dateformat} H:i:s", $value);
                } catch (Exception $e) {
                    $formatted = $value;
                }
                if ($dtVal instanceof DateTimeValue) {
                    if ($obj_type_id == ProjectEvents::instance()->getObjectTypeId() || $obj_type_id == ProjectTasks::instance()->getObjectTypeId()) {
                        $dtVal->advance(logged_user()->getTimezone() * 3600, true);
                    }
                    if ($obj_type_id == ProjectEvents::instance()->getObjectTypeId() && ($col == 'start' || $col == 'duration')) {
                        $formatted = format_datetime($dtVal);
                    } else {
                        $formatted = format_date($dtVal, null, 0);
                    }
                }
            } else {
                $formatted = '';
            }
            break;
        default:
            $formatted = $value;
    }
    if ($formatted == '') {
        $formatted = '--';
    }
    return $formatted;
}
Пример #14
0
    ?>
</span></div>
<?php 
}
// if
if ($message->getCreatedBy() instanceof User) {
    ?>
    <div class="author"><?php 
    echo lang('posted on by', format_datetime($message->getCreatedOn()), $message->getCreatedBy()->getCardUrl(), clean($message->getCreatedBy()->getDisplayName()));
    ?>
</div>
<?php 
} else {
    ?>
    <div class="author"><?php 
    echo lang('posted on', format_datetime($message->getCreatedOn()));
    ?>
</div>
<?php 
}
// if
?>
  </div>
  <div class="content">
<?php 
if ($createdBy instanceof User && $createdBy->getContact()->hasAvatar()) {
    ?>
      <div class="avatar"><img src="<?php 
    echo $createdBy->getContact()->getAvatarUrl();
    ?>
" alt="<?php 
		<div class="comments">
		<?php 
    foreach ($entry['comments'] as $comment) {
        ?>
			<blockquote>
				<p><?php 
        echo nl2br(ents(trim($comment['contents'])));
        ?>
</p>
				<small class="author">
					Added by 
					<?php 
        echo $comment['creator_fn'] . ' ' . $comment['creator_ln'] . ' (#' . $entry['creator'] . ')';
        ?>
					<?php 
        echo format_datetime($comment['created']);
        ?>
				</small>
			</blockquote>
			<?php 
    }
    ?>
		</div>
		<?php 
}
if (!empty($show_form)) {
    ?>
		<h4>Add Update:</h4>
			<?php 
    $dummy->printUpdateForm();
    ?>
			<thead>
				<tr>
					<th id="th_test_case">
						<span class="sort">
						    <a id="detailed_case_see_none" class="see_only_failed_button sort_btn non_nft_button active" href="javascript:;" onClick="hideShowAll('tableOfResults', '1', 'hide');" title="Changed">Changed</a>
							<a id="detailed_case_see_all" class="see_all_button sort_btn non_nft_button" href="javascript:; " onClick="hideShowAll('tableOfResults', '0', 'hide');" title="See all">See all</a>
					    </span>
				    </th>
				    <th class="column_head_1">
				      <?php 
echo format_datetime($lastSessions[1]["created_at"], "y-MM-dd HH:mm");
?>
				    </th>
				    <th class="column_head_separate"></th><th class="column_head_1">
				      <?php 
echo format_datetime($lastSessions[0]["created_at"], "y-MM-dd HH:mm");
?>
				    </th>
			    </tr>
		    </thead>

			<?php 
$previousFeatureKey = "";
?>
		    <?php 
$line = 0;
?>
			<?php 
foreach ($currentSession["results"] as $resultKey => $result) {
    ?>
				<?php 
 public function executeMobilegetvideos(sfWebRequest $request)
 {
     require_once '/var/frontend/lib/vendor/symfony/lib/helper/DateHelper.php';
     if ($request->isXmlHttpRequest()) {
         $return = '';
         $start = 0;
         $items = intval($request->getParameter('items'));
         $site = intval($request->getParameter('site'));
         $page = intval($request->getParameter('page'));
         if ($page >= 1) {
             $start = $page * $items - $items;
         }
         if ($site > 0) {
             $assets = Doctrine_Query::create()->select('a.*')->from('Asset a, AssetVideo av')->where('a.asset_type_id = 6')->andWhere('av.asset_id = a.id')->andWhere('a.is_active = ?', 1)->andWhere('a.site_id = ?', $site)->andWhere('av.youtube_id != ""')->orderBy('a.id desc')->limit($items)->offset($start)->execute();
             foreach ($assets as $d) {
                 $return .= '              <!--VIDEO ITEM-->';
                 $return .= '              <li>';
                 $return .= '                <a href="http://www.youtube.com/embed/' . $d->AssetVideo->getYoutubeId() . '?rel=0">';
                 $return .= '                  <fieldset class="ui-grid-a">';
                 $return .= '                    <div class="ui-block-a">';
                 $return .= '                      <div class="fotinho">';
                 $return .= '                        <img class="" src="http://img.youtube.com/vi/' . $d->AssetVideo->getYoutubeId() . '/0.jpg" alt="' . $d->getTitle() . '" width="100%">';
                 $return .= '                      </div>';
                 $return .= '                    </div>';
                 $return .= '                    <div class="ui-block-b video">';
                 $return .= '                      <h4>' . $d->getTitle() . '</h4>';
                 if ($d->getCreatedAt() != "") {
                     $return .= '                      <p class="data">' . format_datetime($d->getCreatedAt(), "dd/MM/yyyy HH:mm:ss") . '</p>';
                 }
                 if ($d->AssetVideo->getDuration() != "") {
                     $return .= '                      <p class="duracao">Duração: ' . format_datetime($d->AssetVideo->getDuration(), "HH:mm:ss") . '</p>';
                 }
                 $return .= '                    </div>';
                 $return .= '                  </fieldset>';
                 $return .= '                </a>';
                 $return .= '                <div class="linha2"></div>';
                 $return .= '              </li>';
                 $return .= '              <!--/VIDEO ITEM-->';
             }
         }
         echo $return;
     }
     die;
 }
Пример #18
0
 function create_public_post()
 {
     // Validation Rules
     $this->form_validation->set_rules('comment_name', 'Name', 'required');
     $this->form_validation->set_rules('comment_email', 'Email Address', 'required|valid_email');
     $this->form_validation->set_rules('comment', 'Comment', 'required');
     // Validates
     if ($this->form_validation->run() == true) {
         /*
         			// Akismet Enabled
         			if (config_item('comments_akismet') == 'TRUE')		
         			{
         				$this->load->library('akismet');
         				
         				$comment = array('author' => $this->input->post('comment_name'), 'email' => $this->input->post('comment_email'), 'body' => $this->input->post('comment'));
         				$config  = array('blog_url' => config_item('site_url'), 'api_key' => config_item('site_akismet_key'), 'comment' => $comment);
         				
         				$this->akismet->init($config);
         				 
         				if ($this->akismet->errors_exist())
         				{				
         					if ($this->akismet->is_error('AKISMET_INVALID_KEY')) 			
         					{
         						return FALSE;
         					}
         					elseif ($this->akismet->is_error('AKISMET_RESPONSE_FAILED'))
         					{
         						return FALSE;
         					}
         					elseif ($this->akismet->is_error('AKISMET_SERVER_NOT_FOUND'))
         					{
         						return FALSE;
         					}
         					else															
         					{
         						return TRUE;
         					}
         				}
         				else
         				{
         					if ($this->akismet->is_spam())	
         					{
         						$this->form_validation->set_message('akistmet_validate', 'We think your comment might be spam!"');		
         						return FALSE; 
         					}
         					else
         					{
         						return TRUE;
         					}
         				}
         			}
         			
         			// ReCAPTCHA Enabled
         			if (config_item('comments_recaptcha') == 'TRUE')		
         			{
         			    $this->load->library('recaptcha');	
         			
         				if ($this->recaptcha->check_answer($this->input->ip_address(), $this->input->post('recaptcha_challenge_field'), $val))
         				{
         					$recaptcha = TRUE;
         				} 
         				else
         				{
         					$this->form_validation->set_message('check_captcha', $this->lang->line('recaptcha_incorrect_response'));
         					$recaptcha = FALSE;
         				}	
         			}
         */
         log_message('debug', 'COOOOM inside validation');
         if ($content = $this->social_igniter->check_content_comments($this->input->post('content_id'))) {
             log_message('debug', 'COOOOM inside content');
             $user = $this->social_auth->get_user('email', $this->input->post('comment_email'));
             if (!$user) {
                 log_message('debug', 'COOOOM inside create user');
                 $username = url_username($this->input->post('comment_name'), 'none', true);
                 $email = $this->input->post('comment_email');
                 $password = random_string('unique');
                 $additional_data = array('name' => $this->input->post('comment_name'));
                 $level = config_item('comments_group');
                 // Register User
                 if ($this->social_auth->register($username, $password, $email, $additional_data, $level)) {
                     log_message('debug', 'COOOOM inside register');
                     $user = $this->social_auth->get_user('email', $this->input->post('comment_email'));
                 }
             }
             $comment_data = array('reply_to_id' => $this->input->post('reply_to_id'), 'content_id' => $content->content_id, 'owner_id' => $content->user_id, 'module' => $content->module, 'type' => $content->type, 'user_id' => $user->user_id, 'comment' => $this->input->post('comment'), 'geo_lat' => $this->input->post('geo_lat'), 'geo_long' => $this->input->post('geo_long'), 'approval' => $content->comments_allow);
             // Insert
             if ($comment = $this->social_tools->add_comment($comment_data)) {
                 log_message('debug', 'COOOOM inside comment created');
                 $comment_data['comment_id'] = $comment->comment_id;
                 $comment_data['created_at'] = format_datetime(config_item('comments_date_style'), $comment->created_at);
                 $comment_data['name'] = $comment->name;
                 $comment_data['username'] = $comment->username;
                 $comment_data['gravatar'] = $comment->gravatar;
                 $comment_data['image'] = $comment->image;
                 $comment_data['sub'] = '';
                 // Set Reply Id For Comments
                 if ($comment->reply_to_id) {
                     $comment_data['sub'] = 'sub_';
                     $comment_data['reply_id'] = $comment->reply_to_id;
                 }
                 // Set Display Comment
                 if ($content->comments_allow == 'A') {
                     $comment_data['comment'] = '<i>Your comment is awaiting approval!</i>';
                 }
                 $message = array('status' => 'success', 'message' => 'Yay we posted your comment', 'data' => $comment_data);
             } else {
                 $message = array('status' => 'error', 'message' => 'Oops unable to post your comment');
             }
         } else {
             $message = array('status' => 'error', 'message' => 'Oops you can not comment on that content');
         }
     } else {
         $message = array('status' => 'error', 'message' => validation_errors());
     }
     $this->response($message, 200);
 }
Пример #19
0
<?php

use_helper('Date');
/*
 * Action for Comment : List by post
 * Vars : $commentPager
 */
echo _open('div.comment.list_by_article');
echo $commentPager->renderNavigationTop();
echo _open('ul.elements');
foreach ($commentPager as $comment) {
    echo _open('li.element');
    echo _tag('p.author', _tag('strong.mr10', $comment->name ? escape($comment->name) : escape('<anonymous>')) . _tag('span.quiet', format_datetime($comment->createdAt, 'f')));
    echo _tag('p', nl2br(escape($comment->text)));
    echo _close('li');
}
echo _close('ul');
echo $commentPager->renderNavigationBottom();
echo _close('div');
    unset($form['target']);
    unset($form['id']);
}
op_include_form('searchCommunityWiki', $form, $options);
?>

<?php 
if ($pager->getNbResults()) {
    ?>

<?php 
    $list = array();
    foreach ($pager->getResults() as $key => $topic) {
        $list[$key] = array();
        $list[$key][__('Name', array(), 'community_wiki_form')] = $topic->getName();
        $list[$key][__('%community% Name')] = $topic->getCommunity()->getName();
        $list[$key][__('Body', array(), 'community_wiki_form')] = $topic->getBody();
        $list[$key][__('Date Updated', array(), 'form_community')] = format_datetime($topic->getUpdatedAt(), 'f');
    }
    $options = array('title' => __('Search Results'), 'pager' => $pager, 'link_to_page' => 'communityWiki/search?page=%d', 'list' => $list, 'link_to_detail' => $link_to_detail);
    op_include_parts('searchResultList', 'searchResultCommunityWiki', $options);
} else {
    if ('topic' === $type) {
        $message = __('Your search queries did not match any community topics.');
    } else {
        if ('wiki' === $type) {
            $message = __('Your search queries did not match any community events.');
        }
    }
    op_include_box('searchCommunityWikiResult', $message, array('title' => __('Search Results')));
}
Пример #21
0
    <ul class="listWithDetails">
<?php 
    foreach ($completed_milestones as $milestone) {
        ?>
      <li><a href="<?php 
        echo $milestone->getViewUrl();
        ?>
"><?php 
        echo clean($milestone->getName());
        ?>
</a><?php 
        if ($milestone->getCompletedBy() instanceof User) {
            if ($milestone->getCompletedBy() instanceof User) {
                ?>
        <br /><span class="desc"><?php 
                echo lang('completed on by', format_datetime($milestone->getCompletedOn()), $milestone->getCompletedBy()->getCardUrl(), clean($milestone->getCompletedBy()->getDisplayName()));
                ?>
</span><?php 
            }
            // if
            ?>
</li>
<?php 
        }
        // if
    }
    // foreach
    ?>
    </ul>
  </div>
</div>
Пример #22
0
function format_value_to_print($col, $value, $type, $obj_type_id, $textWrapper = '', $dateformat = 'Y-m-d')
{
    switch ($type) {
        case DATA_TYPE_STRING:
            if (preg_match(EMAIL_FORMAT, strip_tags($value))) {
                $formatted = strip_tags($value);
            } else {
                $formatted = $textWrapper . clean($value) . $textWrapper;
            }
            break;
        case DATA_TYPE_INTEGER:
            if ($col == 'priority') {
                switch ($value) {
                    case 100:
                        $formatted = lang('low priority');
                        break;
                    case 200:
                        $formatted = lang('normal priority');
                        break;
                    case 300:
                        $formatted = lang('high priority');
                        break;
                    case 400:
                        $formatted = lang('urgent priority');
                        break;
                    default:
                        $formatted = clean($value);
                }
            } elseif ($col == 'time_estimate') {
                if ($value > 0) {
                    $formatted = DateTimeValue::FormatTimeDiff(new DateTimeValue(0), new DateTimeValue($value * 60), 'hm', 60);
                } else {
                    $formatted = clean($value);
                }
            } else {
                $formatted = clean($value);
            }
            break;
        case DATA_TYPE_BOOLEAN:
            $formatted = $value == 1 ? lang('yes') : lang('no');
            break;
        case DATA_TYPE_DATE:
            if ($value != 0) {
                if (str_ends_with($value, "00:00:00")) {
                    $dateformat .= " H:i:s";
                }
                $dtVal = DateTimeValueLib::dateFromFormatAndString($dateformat, $value);
                $formatted = format_date($dtVal, null, 0);
            } else {
                $formatted = '';
            }
            break;
        case DATA_TYPE_DATETIME:
            if ($value != 0) {
                $dtVal = DateTimeValueLib::dateFromFormatAndString("{$dateformat} H:i:s", $value);
                if ($obj_type_id == ProjectEvents::instance()->getObjectTypeId() && $col == 'start') {
                    $formatted = format_datetime($dtVal);
                } else {
                    $formatted = format_date($dtVal, null, 0);
                }
            } else {
                $formatted = '';
            }
            break;
        default:
            $formatted = $value;
    }
    if ($formatted == '') {
        $formatted = '--';
    }
    return $formatted;
}
</p>
    <ul>
        <li><?php 
echo a_('Publication dates');
?>
</li>
        <ul>
            <li><?php 
echo a_('Server time:');
?>
 <?php 
echo format_datetime(time());
?>
</li>
            <li><?php 
echo a_('Publication dates: from %date_from% to %date_to%', array('%date_from%' => $poll->getPublishedFrom() ? format_datetime($poll->getPublishedFrom()) : 'unlimited', '%date_to%' => $poll->getPublishedTo() ? format_datetime($poll->getPublishedTo()) : 'unlimited'));
?>
</li>
        </ul>
        <li><?php 
echo a_('You already submitted an answer and the poll is configured to not display twice. (see app.yml)');
?>
</li>
        <ul>
            <li><?php 
echo a_('Setting: %setting%', array('%setting%' => true == aPollToolkit::getPollAllowMultipleSubmissions($poll) ? a_('Multiple submissions allowed') : a_('Only one answer allowed')));
?>
</li>
        </ul>
    </ul>
    
"></span><?php 
        echo $d->getTitle();
        ?>
</a>
                        <p><?php 
        echo $d->getDescription();
        ?>
</p>
                        <p class="fonte"><a href="#"><?php 
        echo $d->retriveLabel();
        ?>
</a> | <?php 
        echo format_datetime($d->getCreatedAt(), "P");
        ?>
 | <?php 
        echo format_datetime($d->getCreatedAt(), "t");
        ?>
</p>
                      </div>
                    </li>
                  <?php 
    }
    ?>
                </ul>
              </div>
              <!-- /BOX LISTAO -->
            <?php 
}
?>

            <?php 
Пример #25
0
  function getDashboardObject(){
    	$projectId = "0";
    	$project = "";
    	if (count($this->getWorkspaces()) > 0) {
    		$type = "email";
    	} else {
    		$type = "emailunclassified";
    	}
    	$tags = project_object_tags($this);
    	
    	$deletedOn = $this->getTrashedOn() instanceof DateTimeValue ? ($this->getTrashedOn()->isToday() ? format_time($this->getTrashedOn()) : format_datetime($this->getTrashedOn(), 'M j')) : lang('n/a');
		if ($this->getTrashedById() > 0)
			$deletedBy = Contacts::findById($this->getTrashedById());
    	if (isset($deletedBy) && $deletedBy instanceof Contact) {
    		$deletedBy = $deletedBy->getObjectName();
    	} else {
    		$deletedBy = lang("n/a");
    	}
		
    	if ($this->getState() == 1 || $this->getState() == 3 || $this->getState() == 5) {
    		$createdBy = $this->getCreatedBy();
    	}
    	if (isset($createdBy) && $createdBy instanceof Contact) {
    		$createdById = $createdBy->getId();
    		$createdBy = $createdBy->getObjectName();
    	} else {
    		$createdById = 0;
    		$createdBy = $this->getFromName();
    	}
    	
  		$archivedOn = $this->getArchivedOn() instanceof DateTimeValue ? ($this->getArchivedOn()->isToday() ? format_time($this->getArchivedOn()) : format_datetime($this->getArchivedOn(), 'M j')) : lang('n/a');
  		if ($this->getArchivedById() > 0)
			$archivedBy = Contacts::findById($this->getArchivedById());
    	if (isset($archivedBy) &&  $archivedBy instanceof Contact) {
    		$archivedBy = $archivedBy->getObjectName();
    	} else {
    		$archivedBy = lang("n/a");
    	}
    	
    	$sentTimestamp = $this->getReceivedDate() instanceof DateTimeValue ? ($this->getReceivedDate()->isToday() ? format_time($this->getReceivedDate()) : format_datetime($this->getReceivedDate())) : lang('n/a');
    	
		return array(
				"id" => $this->getObjectTypeName() . $this->getId(),
				"object_id" => $this->getId(),
				"name" => $this->getObjectName() != "" ? $this->getObjectName():lang('no subject'),
				"type" => $type,
				"tags" => $tags,
				"createdBy" => $createdBy,
				"createdById" => $createdById,
				"dateCreated" => $sentTimestamp,
				"updatedBy" => $createdBy,
				"updatedById" => $createdById,
				"dateUpdated" => $sentTimestamp,
				"wsIds" => $this->getWorkspacesIdsCSV(logged_user()->getWorkspacesQuery()),
    			"url" => $this->getObjectUrl(),
				"manager" => get_class($this->manager()),
    			"deletedById" => $this->getTrashedById(),
    			"deletedBy" => $deletedBy,
    			"dateDeleted" => $deletedOn,
    			"archivedById" => $this->getArchivedById(),
    			"archivedBy" => $archivedBy,
    			"dateArchived" => $archivedOn,
				"subject" => $this->getSubject(),
				"isRead" => $this->getIsRead(logged_user()->getId())
		);
	}
Пример #26
0
</h3>
</div>

<?php 
    ob_start();
    op_include_pager_navigation($pager, '@communityTopic_recently_topic_list?page=%d');
    $pager_navi = ob_get_contents();
    ob_end_flush();
    ?>

<?php 
    foreach ($pager->getResults() as $topic) {
        ?>
<dl>
<dt><?php 
        echo format_datetime($topic->getUpdatedAt(), 'f');
        ?>
</dt>
<dd>
<?php 
        echo sprintf('%s (%s)', link_to(sprintf('%s(%d)', $topic->getName(), $topic->getCommunityTopicComment()->count()), 'communityTopic_show', $topic), $topic->getCommunity()->getName());
        ?>
</dd>
</dl>
<?php 
    }
    ?>

<?php 
    echo $pager_navi;
    ?>
Пример #27
0
<td><?php 
    echo site_address($row);
    ?>
</td>
<td><?php 
    if ($row->contract_sdate != '' && $row->contract_sdate != null && $row->contract_sdate != '0000-00-00') {
        echo date('d-m-Y', strtotime($row->contract_sdate)) . ' TO ' . date('d-m-Y', strtotime($row->contract_edate));
    }
    ?>
</td>
<td align='center'><?php 
    echo form_is_published($row->id, $row->is_published);
    ?>
</td>
<td><?php 
    echo format_datetime($row->update_time);
    ?>
</td>
<td align='center'><?php 
    echo $row->id;
    ?>
</td>
<?php 
    echo form_row_color_close();
}
?>
</table>
<div class='container text-center'><?php 
echo $pagination_links;
?>
</div>
Пример #28
0
	/**
	 * Prepares return object for a list of emails and messages
	 *
	 * @param array $totMsg
	 * @param integer $start
	 * @param integer $limit
	 * @return array
	 */
	private function prepareObject($objects, $count, $start = 0, $attributes = null)
	{
		$object = array(
			"totalCount" => $count,
			"start" => $start,
			"contacts" => array()
		);
		$custom_properties = CustomProperties::getAllCustomPropertiesByObjectType(Contacts::instance()->getObjectTypeId());
		for ($i = 0; $i < count($objects); $i++){
			if (isset($objects[$i])){
				$c= $objects[$i];
					
				if ($c instanceof Contact && !$c->isCompany()){						
					$company = $c->getCompany();
					$companyName = '';
					if (!is_null($company))
						$companyName= $company->getObjectName();
					
					$personal_emails = $c->getContactEmails('personal');	
					$w_address = $c->getAddress('work');
					$h_address = $c->getAddress('home');
									
					$object["contacts"][$i] = array(
						"id" => $i,
						"ix" => $i,
						"object_id" => $c->getId(),
						"ot_id" => $c->getObjectTypeId(),
						"type" => 'contact',
						"name" => $c->getReverseDisplayName(),
						"email" => $c->getEmailAddress('personal',true),
						"companyId" => $c->getCompanyId(),
						"companyName" => $companyName,
						"website" => $c->getWebpage('personal') ? cleanUrl($c->getWebpageUrl('personal'), false) : '',
						"jobTitle" => $c->getJobTitle(),
						"department" => $c->getDepartment(),
						"email2" => !is_null($personal_emails) && isset($personal_emails[0]) ? $personal_emails[0]->getEmailAddress() : '',
						"email3" => !is_null($personal_emails) && isset($personal_emails[1]) ? $personal_emails[1]->getEmailAddress() : '',
						"workWebsite" => $c->getWebpage('work') ? cleanUrl($c->getWebpageUrl('work'), false) : '',
						"workAddress" => $w_address ? $c->getFullAddress($w_address) : '',
						"workPhone1" => $c->getPhone('work',true) ? $c->getPhoneNumber('work',true) : '',
						"workPhone2" => $c->getPhone('work') ? $c->getPhoneNumber('work') : '',
						"homeWebsite" => $c->getWebpage('personal') ? cleanUrl($c->getWebpageUrl('personal'), false) : '',
						"homeAddress" => $h_address ? $c->getFullAddress($h_address) : '',
						"homePhone1" => $c->getPhone('home',true) ? $c->getPhoneNumber('home',true) : '',
						"homePhone2" => $c->getPhone('home') ? $c->getPhoneNumber('home') : '',
						"mobilePhone" =>$c->getPhone('mobile') ? $c->getPhoneNumber('mobile') : '',
						"createdOn" => $c->getCreatedOn() instanceof DateTimeValue ? ($c->getCreatedOn()->isToday() ? format_time($c->getCreatedOn()) : format_datetime($c->getCreatedOn())) : '',
						"createdOn_today" => $c->getCreatedOn() instanceof DateTimeValue ? $c->getCreatedOn()->isToday() : 0,
						"createdBy" => $c->getCreatedByDisplayName(),
						"createdById" => $c->getCreatedById(),
						"updatedOn" => $c->getUpdatedOn() instanceof DateTimeValue ? ($c->getUpdatedOn()->isToday() ? format_time($c->getUpdatedOn()) : format_datetime($c->getUpdatedOn())) : '',
						"updatedOn_today" => $c->getUpdatedOn() instanceof DateTimeValue ? $c->getUpdatedOn()->isToday() : 0,
						"updatedBy" => $c->getUpdatedByDisplayName(),
						"updatedById" => $c->getUpdatedById(),
						"memPath" => json_encode($c->getMembersToDisplayPath()),
						"userType" => $c->getUserType(),
					);
				} else if ($c instanceof Contact){
					
					$w_address = $c->getAddress('work');
					$object["contacts"][$i] = array(
						"id" => $i,
						"ix" => $i,
						"object_id" => $c->getId(),
						"ot_id" => $c->getObjectTypeId(),
						"type" => 'company',
						'name' => $c->getObjectName(),
						'email' => $c->getEmailAddress(),
						'website' => $c->getWebpage('work') ? cleanUrl($c->getWebpageUrl('work'), false) : '',
						'workPhone1' => $c->getPhone('work',true) ? $c->getPhoneNumber('work',true) : '',
                        'workPhone2' => $c->getPhone('fax',true) ? $c->getPhoneNumber('fax',true) : '',
                        'workAddress' => $w_address ? $c->getFullAddress($w_address) : '',
						"companyId" => $c->getId(),
						"companyName" => $c->getObjectName(),
						"jobTitle" => '',
                        "department" => lang('company'),
						"email2" => '',
						"email3" => '',
						"workWebsite" => $c->getWebpage('work') ? cleanUrl($c->getWebpageUrl('work'), false) : '',
						"homeWebsite" => '',
						"homeAddress" => '',
						"homePhone1" => '',
						"homePhone2" => '',
						"mobilePhone" =>'',
						"createdOn" => $c->getCreatedOn() instanceof DateTimeValue ? ($c->getCreatedOn()->isToday() ? format_time($c->getCreatedOn()) : format_datetime($c->getCreatedOn())) : '',
						"createdOn_today" => $c->getCreatedOn() instanceof DateTimeValue ? $c->getCreatedOn()->isToday() : 0,
						"createdBy" => $c->getCreatedByDisplayName(),
						"createdById" => $c->getCreatedById(),
						"updatedOn" => $c->getUpdatedOn() instanceof DateTimeValue ? ($c->getUpdatedOn()->isToday() ? format_time($c->getUpdatedOn()) : format_datetime($c->getUpdatedOn())) : '',
						"updatedOn_today" => $c->getUpdatedOn() instanceof DateTimeValue ? $c->getUpdatedOn()->isToday() : 0,
						"updatedBy" => $c->getUpdatedByDisplayName(),
						"updatedById" => $c->getUpdatedById(),
						"memPath" => json_encode($c->getMembersToDisplayPath()),
						"contacts" => $c->getContactsByCompany(),
						"users" => $c->getUsersByCompany(),
					);
				}
				
				foreach ($custom_properties as $cp) {
					$cp_value = CustomPropertyValues::getCustomPropertyValue($c->getId(), $cp->getId());
					$object["contacts"][$i]['cp_'.$cp->getId()] = $cp_value instanceof CustomPropertyValue ? $cp_value->getValue() : '';
				}
    		}
		}
		return $object;
	}
Пример #29
0
        echo $counter == 1 ? 'lastRevision' : '';
        ?>
" id="revision<?php 
        echo $revision->getId();
        ?>
">
    <div class="revisionName">
<?php 
        if ($revision->getCreatedBy() instanceof User) {
            ?>
    <?php 
            echo lang('file revision title long', $revision->getDownloadUrl(), $revision->getRevisionNumber(), $revision->getCreatedBy()->getCardUrl(), $revision->getCreatedBy()->getDisplayName(), format_datetime($revision->getCreatedOn()));
        } else {
            ?>
    <?php 
            echo lang('file revision title short', $revision->getDownloadUrl(), $revision->getRevisionNumber(), format_datetime($revision->getCreatedOn()));
        }
        // if
        ?>
    </div>
<?php 
        if (trim($revision->getComment())) {
            ?>
    <div class="revisionComment"><?php 
            echo do_textile($revision->getComment());
            ?>
</div>
<?php 
        }
        // if
        $options = array();
Пример #30
0
    }
?>
</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++;
?>
	<div class="comment">
		<div class="comment-header">
			<b>#<?php echo $i ?>:</b><?php echo lang('comment posted on by', format_datetime($comment->getUpdatedOn()), $comment->getCreatedByCardUrl(), clean($comment->getCreatedByDisplayName())) ?>
		</div>
		<div class="comment-body">
		<?php echo $comment->getText() ?>
		</div>
	</div>
<?php } ?>
</div>
<?php } ?>

</div>

<script>
window.print();
</script>