本文整理汇总了PHP中project_object_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP project_object_tags函数的具体用法?PHP project_object_tags怎么用?PHP project_object_tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了project_object_tags函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lang
?>
</div>
<?php
}
// if
?>
-->
<?php
if (plugin_active('tags')) {
if (project_object_tags($file, $file->getProject()) != '--') {
?>
<div id="fileTags"><span class="propertyName"><?php
echo lang('tags');
?>
:</span> <?php
echo project_object_tags($file, $file->getProject());
?>
</div>
<?php
}
// if
}
// if
$options = array();
if ($file->canEdit(logged_user())) {
$options[] = '<a href="' . $file->getEditUrl() . '">' . lang('edit') . '</a>';
}
if ($file->canDelete(logged_user())) {
$options[] = '<a href="' . $file->getMoveUrl() . '">' . lang('move') . '</a>';
}
if ($file->canDelete(logged_user())) {
示例2: lang
"><?php
echo lang('revisions');
?>
</a>:</span> <?php
echo $file->countRevisions();
?>
</div>
<?php
if (plugin_active('tags')) {
if (project_object_tags($file, active_project()) != '--') {
?>
<div class="fileTags"><?php
echo lang('tags');
?>
: <?php
echo project_object_tags($file, active_project());
?>
</div>
<?php
}
// if
}
// if
?>
</div>
<?php
$options = array();
if ($file->canEdit(logged_user())) {
$options[] = '<a href="' . $file->getEditUrl() . '">' . lang('edit') . '</a>';
}
示例3: getDashboardObject
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())
);
}
示例4: list_all
function list_all()
{
ajx_current("empty");
$project = active_project();
$isProjectView = $project instanceof Project;
$start = array_var($_GET, 'start');
$limit = array_var($_GET, 'limit');
if (!$start) {
$start = 0;
}
if (!$limit) {
$limit = config_option('files_per_page');
}
$order = array_var($_GET, 'sort');
$orderdir = array_var($_GET, 'dir');
$tag = array_var($_GET, 'tag');
$page = (int) ($start / $limit) + 1;
$hide_private = !logged_user()->isMemberOfOwnerCompany();
if (array_var($_GET, 'action') == 'delete') {
$ids = explode(',', array_var($_GET, 'charts'));
list($succ, $err) = ObjectController::do_delete_objects($ids, 'ProjectCharts');
if ($err > 0) {
flash_error(lang('error delete objects', $err));
} else {
flash_success(lang('success delete objects', $succ));
}
} else {
if (array_var($_GET, 'action') == 'tag') {
$ids = explode(',', array_var($_GET, 'charts'));
$tagTag = array_var($_GET, 'tagTag');
list($succ, $err) = ObjectController::do_tag_object($tagTag, $ids, 'ProjectCharts');
if ($err > 0) {
flash_error(lang('error tag objects', $err));
} else {
flash_success(lang('success tag objects', $succ));
}
}
}
if ($page < 0) {
$page = 1;
}
//$conditions = logged_user()->isMemberOfOwnerCompany() ? '' : ' `is_private` = 0';
if ($tag == '' || $tag == null) {
$tagstr = " 1=1";
// dummy condition
} else {
$tagstr = "(select count(*) from " . TABLE_PREFIX . "tags where " . TABLE_PREFIX . "project_charts.id = " . TABLE_PREFIX . "tags.rel_object_id and " . TABLE_PREFIX . "tags.tag = '" . $tag . "' and " . TABLE_PREFIX . "tags.rel_object_manager ='ProjectCharts' ) > 0 ";
}
/* TODO: handle with permissions_sql_for_listings */
//$permission_str = ' AND (' . permissions_sql_for_listings(ProjectCharts::instance(), ACCESS_LEVEL_READ, logged_user()) . ')';
$permission_str = " AND " . ProjectCharts::getWorkspaceString(logged_user()->getWorkspacesQuery(true));
if ($isProjectView) {
$pids = $project->getAllSubWorkspacesQuery(true);
$project_str = " AND " . ProjectCharts::getWorkspaceString($pids);
} else {
$project_str = "";
}
list($charts, $pagination) = ProjectCharts::paginate(array("conditions" => '`trashed_by_id` = 0 AND `archived_by_id` = 0 AND ' . $tagstr . $permission_str . $project_str, 'order' => '`title` ASC'), config_option('files_per_page', 10), $page);
// paginate
tpl_assign('totalCount', $pagination->getTotalItems());
tpl_assign('charts', $charts);
tpl_assign('pagination', $pagination);
tpl_assign('tags', Tags::getTagNames());
$object = array("totalCount" => $pagination->getTotalItems(), "charts" => array());
$factory = new ProjectChartFactory();
$types = $factory->getChartDisplays();
if (isset($charts)) {
foreach ($charts as $c) {
if ($c->getProject() instanceof Project) {
$tags = project_object_tags($c);
} else {
$tags = "";
}
$object["charts"][] = array("id" => $c->getId(), "name" => $c->getTitle(), "type" => $types[$c->getDisplayId()], "tags" => $tags, "project" => $c->getProject() ? $c->getProject()->getName() : '', "projectId" => $c->getProjectId());
}
}
ajx_extra_data($object);
tpl_assign("listing", $object);
}
示例5: do_textile
echo do_textile($milestone->getDescription());
?>
</div>
<?php
}
// if
?>
<?php
if (plugin_active('tags')) {
?>
<p><span><?php
echo lang('tags');
?>
:</span> <?php
echo project_object_tags($milestone, $milestone->getProject());
?>
</p>
<?php
}
// if
$options = array();
if ($milestone->canEdit(logged_user())) {
$options[] = '<a href="' . $milestone->getEditUrl() . '">' . lang('edit') . '</a>';
$options[] = '<a href="' . $milestone->getAddMessageUrl() . '">' . lang('add message') . '</a>';
$options[] = '<a href="' . $milestone->getAddTaskListUrl() . '">' . lang('add task list') . '</a>';
}
if ($milestone->canDelete(logged_user())) {
$options[] = '<a href="' . $milestone->getDeleteUrl() . '">' . lang('delete') . '</a>';
}
if ($milestone->canChangeStatus(logged_user())) {
示例6: getDashboardObject
function getDashboardObject()
{
//FIXME
$wsIds = $this->getWorkspacesIdsCSV(logged_user()->getWorkspacesQuery());
if ($this->getUpdatedById() > 0 && $this->getUpdatedBy() instanceof Contact) {
$updated_by_id = $this->getUpdatedBy()->getObjectId();
$updated_by_name = $this->getUpdatedByDisplayName();
$updated_on = $this->getObjectUpdateTime() instanceof DateTimeValue ? $this->getObjectUpdateTime()->isToday() ? format_time($this->getObjectUpdateTime()) : format_datetime($this->getObjectUpdateTime()) : lang('n/a');
} else {
if ($this->getCreatedById() > 0 && $this->getCreatedBy() instanceof Contact) {
$updated_by_id = $this->getCreatedBy()->getId();
} else {
$updated_by_id = lang('n/a');
}
$updated_by_name = $this->getCreatedByDisplayName();
$updated_on = $this->getObjectCreationTime() instanceof DateTimeValue ? $this->getObjectCreationTime()->isToday() ? format_time($this->getObjectCreationTime()) : format_datetime($this->getObjectCreationTime()) : lang('n/a');
}
$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");
}
$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");
}
return array("id" => $this->getObjectTypeName() . $this->getId(), "object_id" => $this->getId(), "ot_id" => $this->getObjectTypeId(), "name" => $this->getObjectName(), "type" => $this->getObjectTypeName(), "tags" => project_object_tags($this), "createdBy" => $this->getCreatedByDisplayName(), "createdById" => $this->getCreatedById(), "dateCreated" => $this->getObjectCreationTime() instanceof DateTimeValue ? $this->getObjectCreationTime()->isToday() ? format_time($this->getObjectCreationTime()) : format_datetime($this->getObjectCreationTime()) : lang('n/a'), "updatedBy" => $updated_by_name, "updatedById" => $updated_by_id, "dateUpdated" => $updated_on, "wsIds" => $wsIds, "url" => $this->getObjectUrl(), "manager" => get_class($this->manager()), "deletedById" => $this->getTrashedById(), "deletedBy" => $deletedBy, "dateDeleted" => $deletedOn, "archivedById" => $this->getArchivedById(), "archivedBy" => $archivedBy, "dateArchived" => $archivedOn);
}
示例7: lang
?>
<span><?php
echo lang('comments');
?>
:</span> <?php
echo $message->countComments();
}
// if
?>
</div>
<div class="messageTags">
<span><?php
echo lang('tags');
?>
:</span> <?php
echo project_object_tags($message, $message->getProject());
?>
</div>
<?php
$options = array();
if ($message->canEdit(logged_user())) {
$options[] = '<a href="' . $message->getEditUrl() . '">' . lang('edit') . '</a>';
}
// if
if ($message->canDelete(logged_user())) {
$options[] = '<a href="' . $message->getDeleteUrl() . '">' . lang('delete') . '</a>';
}
// if
if (count($options)) {
?>
示例8: lang
</tr>
<?php
}
// if
?>
</table>
</div>
<?php
}
// if
?>
<div class="taskListTags"><span><?php
echo lang('tags');
?>
:</span> <?php
echo project_object_tags($task_list, $task_list->getProject());
?>
</div>
<?php
$options = array();
if ($task_list->canEdit(logged_user())) {
$options[] = '<a href="' . $task_list->getEditUrl() . '">' . lang('edit') . '</a>';
}
// if
if ($task_list->canDelete(logged_user())) {
$options[] = '<a href="' . $task_list->getDeleteUrl() . '">' . lang('delete') . '</a>';
}
// if
if ($task_list->canReorderTasks(logged_user())) {
$options[] = '<a href="' . $task_list->getReorderTasksUrl($on_list_page) . '">' . lang('reorder tasks') . '</a>';
}
示例9: list_files
//.........这里部分代码省略.........
$resultMessage = lang("success move objects", $count);
$resultCode = 0;
}
}
} else {
if (array_var($_GET, 'action') == 'archive') {
$ids = explode(',', array_var($_GET, 'ids'));
$succ = 0;
$err = 0;
foreach ($ids as $id) {
$file = ProjectFiles::findById($id);
if (isset($file) && $file->canEdit(logged_user())) {
try {
DB::beginWork();
$file->archive();
ApplicationLogs::createLog($file, $file->getWorkspaces(), ApplicationLogs::ACTION_ARCHIVE);
DB::commit();
$succ++;
} catch (Exception $e) {
DB::rollback();
//Logger::log($e->getMessage());
$err++;
}
} else {
$err++;
}
}
if ($succ > 0) {
flash_success(lang("success archive objects", $succ));
} else {
flash_error(lang("error archive objects", $err));
}
}
}
}
}
}
}
}
}
Hook::fire('classify_action', null, $ret);
$project = active_project();
/* perform query */
$result = ProjectFiles::getProjectFiles($project, null, $hide_private, $order, $orderdir, $page, $limit, false, $tag, $type, $user);
ProjectFiles::populateData($result[0]);
$objects = null;
$pagination = null;
if (is_array($result)) {
list($objects, $pagination) = $result;
if ($pagination->getTotalItems() < ($page - 1) * $limit) {
// if we are past the last page show the first page
$start = 0;
$page = 1;
$result = ProjectFiles::getProjectFiles($project, null, $hide_private, $order, $orderdir, $page, $limit, false, $tag, $type, $user);
if (is_array($result)) {
list($objects, $pagination) = $result;
}
}
}
/* prepare response object */
$listing = array("totalCount" => $pagination ? $pagination->getTotalItems() : 0, "start" => $start, "files" => array());
if ($objects) {
$index = 0;
foreach ($objects as $o) {
$coName = "";
$coId = $o->getCheckedOutById();
if ($coId != 0) {
if ($coId == logged_user()->getId()) {
$coName = "self";
} else {
$coUser = Users::findById($coId);
if ($coUser instanceof User) {
$coName = $coUser->getUsername();
} else {
$coName = "";
}
}
}
if ($o->isMP3()) {
$songname = $o->getProperty("songname");
$artist = $o->getProperty("songartist");
$album = $o->getProperty("songalbum");
$track = $o->getProperty("songtrack");
$year = $o->getProperty("songyear");
$duration = $o->getProperty("songduration");
$songInfo = json_encode(array($songname, $artist, $album, $track, $year, $duration, $o->getDownloadUrl(), $o->getFilename(), $o->getId()));
} else {
$songInfo = array();
}
$values = array("id" => $o->getId(), "ix" => $index++, "object_id" => $o->getId(), "name" => $o->getFilename(), "type" => $o->getTypeString(), "mimeType" => $o->getTypeString(), "tags" => project_object_tags($o), "createdBy" => $o->getCreatedByDisplayName(), "createdById" => $o->getCreatedById(), "dateCreated" => $o->getCreatedOn() instanceof DateTimeValue ? $o->getCreatedOn()->isToday() ? format_time($o->getCreatedOn()) : format_datetime($o->getCreatedOn()) : '', "dateCreated_today" => $o->getCreatedOn() instanceof DateTimeValue ? $o->getCreatedOn()->isToday() : 0, "updatedBy" => $o->getUpdatedByDisplayName(), "updatedById" => $o->getUpdatedById(), "dateUpdated" => $o->getUpdatedOn() instanceof DateTimeValue ? $o->getUpdatedOn()->isToday() ? format_time($o->getUpdatedOn()) : format_datetime($o->getUpdatedOn()) : '', "dateUpdated_today" => $o->getUpdatedOn() instanceof DateTimeValue ? $o->getUpdatedOn()->isToday() : 0, "icon" => $o->getTypeIconUrl(), "size" => $o->getFileSize(), "wsIds" => $o->getUserWorkspacesIdsCSV(logged_user(), ProjectUsers::instance()->getTableName(true) . ".`can_read_files` = 1"), "url" => $o->getOpenUrl(), "manager" => get_class($o->manager()), "checkedOutByName" => $coName, "checkedOutById" => $coId, "isModifiable" => $o->isModifiable() && $o->canEdit(logged_user()), "modifyUrl" => $o->getModifyUrl(), "songInfo" => $songInfo, "ftype" => $o->getType(), "url" => $o->getUrl(), "isRead" => $o->getIsRead(logged_user()->getId()));
if ($o->isMP3()) {
$values['isMP3'] = true;
}
Hook::fire('add_classification_value', $o, $values);
$listing["files"][] = $values;
}
}
ajx_extra_data($listing);
tpl_assign("listing", $listing);
}
示例10: prepareObject
/**
* Prepares return object for a list of emails and messages
*
* @param array $totMsg
* @param integer $start
* @param integer $limit
* @return array
*/
private function prepareObject($totMsg, $start, $limit, $total)
{
$object = array("totalCount" => $total, "start" => $start, "messages" => array());
for ($i = 0; $i < $limit; $i++) {
if (isset($totMsg[$i])) {
$msg = $totMsg[$i];
if ($msg instanceof ProjectMessage) {
$text = $msg->getText();
if (strlen($text) > 100) {
$text = substr_utf($text, 0, 100) . "...";
}
$object["messages"][] = array("id" => $i, "ix" => $i, "object_id" => $msg->getId(), "type" => 'message', "title" => $msg->getTitle(), "text" => $text, "date" => $msg->getUpdatedOn() instanceof DateTimeValue ? $msg->getUpdatedOn()->isToday() ? format_time($msg->getUpdatedOn()) : format_datetime($msg->getUpdatedOn()) : '', "is_today" => $msg->getUpdatedOn() instanceof DateTimeValue ? $msg->getUpdatedOn()->isToday() : 0, "wsIds" => $msg->getUserWorkspacesIdsCSV(logged_user()), "userId" => $msg->getCreatedById(), "userName" => $msg->getCreatedByDisplayName(), "updaterId" => $msg->getUpdatedById() ? $msg->getUpdatedById() : $msg->getCreatedById(), "updaterName" => $msg->getUpdatedById() ? $msg->getUpdatedByDisplayName() : $msg->getCreatedByDisplayName(), "tags" => project_object_tags($msg), "isRead" => $msg->getIsRead(logged_user()->getId()));
}
}
}
return $object;
}
示例11: lang
<div class="tags">
<span><?php
echo lang('tags');
?>
:</span> <?php
echo project_object_tags($object, $object->getProject());
?>
</div>
示例12: lang
<span><?php echo lang('private task list') ?></span>
</div>
<?php endif ?>
</div>
<?php if (!is_null($task_list->getDueDate())) : ?>
<div class="dueDate"><span><?php echo lang('due date') ?>:</span> <?php echo ($task_list->getDueDate()->getYear() > DateTimeValueLib::now()->getYear()) ? format_date($task_list->getDueDate(), null, 0) : format_descriptive_date($task_list->getDueDate(), 0) ?></div>
<?php endif ?>
<?php if ($task_list->getDescription()): ?>
<div class="desc"><?php echo (do_textile($task_list->getDescription())) ?></div>
<?php endif ?>
<?php if (plugin_active('tags')): ?>
<div class="taskListTags"><span><?php echo lang('tags') ?>:</span> <?php echo project_object_tags($task_list, $task_list->getProject()) ?></div>
<?php endif ?>
<?php if (count($task_list_options)): ?>
<div class="options"><?php echo implode(' | ', $task_list_options) ?></div>
<?php endif ?>
<?php if (is_array($task_list->getOpenTasks())): ?>
<div class="openTasks">
<ul id="<?php echo $task_list->getId() ?>"><!--table class="blank"-->
<?php foreach ($task_list->getOpenTasks() as $task): ?>
<li id="<?php echo $task->getId() ?>" class="<?php odd_even_class($task_list_ln) ?>"><!--tr class="<?php odd_even_class($task_list_ln); ?>"-->
<!-- Task text and options -->
<!--td class="taskText"-->
<div class="task-text">
<?php echo $task->getText() ?>
示例13: task_list_tags
function task_list_tags()
{
global $the_task_list;
if (plugin_active('tags')) {
?>
<div class="taskListTags">
<span><?php
echo lang('tags');
?>
:</span>
<?php
echo project_object_tags($the_task_list, $the_task_list->getProject());
?>
</div>
<?php
}
}
示例14: list_all
//.........这里部分代码省略.........
$ids = explode(',', array_var($_GET, 'ids', ''));
for ($i = 0; $i < count($ids); $i++) {
$id = $ids[$i];
$webpage = ProjectWebpages::findById($id);
if ($webpage instanceof ProjectWebpage && $webpage->canEdit(logged_user())) {
if (!array_var($_GET, "mantainWs")) {
$removed = "";
$ws = $webpage->getWorkspaces();
foreach ($ws as $w) {
if (can_add(logged_user(), $w, 'ProjectWebpages')) {
$webpage->removeFromWorkspace($w);
$removed .= $w->getId() . ",";
}
}
$removed = substr($removed, 0, -1);
$log_action = ApplicationLogs::ACTION_MOVE;
$log_data = ($removed == "" ? "" : "from:{$removed};") . "to:{$wsid}";
} else {
$log_action = ApplicationLogs::ACTION_COPY;
$log_data = "to:{$wsid}";
}
$webpage->addToWorkspace($destination);
ApplicationLogs::createLog($webpage, $webpage->getWorkspaces(), $log_action, false, null, true, $log_data);
$count++;
}
}
// for
$resultMessage = lang("success move objects", $count);
$resultCode = 0;
}
}
} else {
if (array_var($_GET, 'action') == 'archive') {
$ids = explode(',', array_var($_GET, 'webpages'));
$succ = 0;
$err = 0;
foreach ($ids as $id) {
$web_page = ProjectWebpages::findById($id);
if (isset($web_page) && $web_page->canEdit(logged_user())) {
try {
DB::beginWork();
$web_page->archive();
ApplicationLogs::createLog($web_page, $web_page->getWorkspaces(), ApplicationLogs::ACTION_ARCHIVE);
DB::commit();
$succ++;
} catch (Exception $e) {
DB::rollback();
$err++;
}
} else {
$err++;
}
}
if ($succ > 0) {
flash_success(lang("success archive objects", $succ));
}
if ($err > 0) {
flash_error(lang("error archive objects", $err));
}
}
}
}
}
}
}
}
$result = ProjectWebpages::getWebpages($project, $tag, $page, $limit, $order, $orderdir);
if (is_array($result)) {
list($webpages, $pagination) = $result;
if ($pagination->getTotalItems() < ($page - 1) * $limit) {
$start = 0;
$page = 1;
$result = ProjectWebpages::getWebpages($project, $tag, $page, $limit);
if (is_array($result)) {
list($webpages, $pagination) = $result;
} else {
$webpages = null;
$pagination = 0;
}
// if
}
} else {
$webpages = null;
$pagination = 0;
}
// if
/*tpl_assign('totalCount', $pagination->getTotalItems());
tpl_assign('webpages', $webpages);
tpl_assign('pagination', $pagination);
tpl_assign('tags', Tags::getTagNames());*/
$object = array("totalCount" => $pagination->getTotalItems(), "start" => $start, "webpages" => array());
if (isset($webpages)) {
$index = 0;
foreach ($webpages as $w) {
$object["webpages"][] = array("ix" => $index++, "id" => $w->getId(), "title" => $w->getTitle(), "description" => $w->getDescription(), "url" => $w->getUrl(), "tags" => project_object_tags($w), "wsIds" => $w->getWorkspacesIdsCSV(logged_user()->getWorkspacesQuery()), "updatedOn" => $w->getUpdatedOn() instanceof DateTimeValue ? $w->getUpdatedOn()->isToday() ? format_time($w->getUpdatedOn()) : format_datetime($w->getUpdatedOn()) : '', "updatedOn_today" => $w->getUpdatedOn() instanceof DateTimeValue ? $w->getUpdatedOn()->isToday() : 0, "updatedBy" => $w->getUpdatedByDisplayName(), "updatedById" => $w->getUpdatedById(), "isRead" => $w->getIsRead(logged_user()->getId()));
}
}
ajx_extra_data($object);
/*tpl_assign("listing", $object);*/
}
示例15: getDashboardObject
/**
* Return object for task listing
*
* @return unknown
*/
function getDashboardObject(){
if($this->getUpdatedById() > 0 && $this->getUpdatedBy() instanceof Contact){
$updated_by_id = $this->getUpdatedBy()->getObjectId();
$updated_by_name = $this->getUpdatedByDisplayName();
$updated_on = $this->getObjectUpdateTime() instanceof DateTimeValue ? ($this->getObjectUpdateTime()->isToday() ? format_time($this->getObjectUpdateTime()) : format_datetime($this->getObjectUpdateTime())) : lang('n/a');
}else {
if($this->getCreatedBy())
$updated_by_id = $this->getCreatedBy()->getId();
else
$updated_by_id = lang('n/a');
$updated_by_name = $this->getCreatedByDisplayName();
$updated_on = $this->getObjectCreationTime() instanceof DateTimeValue ? ($this->getObjectCreationTime()->isToday() ? format_time($this->getObjectCreationTime()) : format_datetime($this->getObjectCreationTime())) : lang('n/a');
}
if ($this instanceof ProjectTask)
$parent_id = $this->getParentId();
else
$parent_id = $this->getId();
$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");
}
$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");
}
return array(
"id" => $this->getObjectTypeName() . $this->getId(),
"object_id" => $this->getId(),
"ot_id" => $this->getObjectTypeId(),
"name" => $this->getObjectName(),
"type" => $this->getObjectTypeName(),
"tags" => project_object_tags($this),
"createdBy" => $this->getCreatedByDisplayName(),
"createdById" => $this->getCreatedById(),
"dateCreated" => $this->getObjectCreationTime() instanceof DateTimeValue ? ($this->getObjectCreationTime()->isToday() ? format_time($this->getObjectCreationTime()) : format_datetime($this->getObjectCreationTime())) : lang('n/a'),
"updatedBy" => $updated_by_name,
"updatedById" => $updated_by_id,
"dateUpdated" => $updated_on,
"url" => $this->getObjectUrl(),
"parentId" => $parent_id,
"status" => "Pending",
"manager" => get_class($this->manager()),
"deletedById" => $this->getTrashedById(),
"deletedBy" => $deletedBy,
"dateDeleted" => $deletedOn,
"archivedById" => $this->getArchivedById(),
"archivedBy" => $archivedBy,
"dateArchived" => $archivedOn,
"isRead" => $this->getIsRead(logged_user()->getId())
);
}