本文整理汇总了PHP中ajx_extra_data函数的典型用法代码示例。如果您正苦于以下问题:PHP ajx_extra_data函数的具体用法?PHP ajx_extra_data怎么用?PHP ajx_extra_data使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ajx_extra_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_custom_properties
function get_custom_properties()
{
$object_type = array_var($_GET, 'object_type');
if ($object_type) {
$cp = CustomProperties::getAllCustomPropertiesByObjectType($object_type);
$customProperties = array();
foreach ($cp as $custom) {
$prop = array();
$prop['id'] = $custom->getId();
$prop['name'] = $custom->getName();
$prop['object_type'] = $custom->getObjectTypeId();
$prop['description'] = $custom->getDescription();
$prop['type'] = $custom->getType();
$prop['values'] = $custom->getValues();
$prop['default_value'] = $custom->getDefaultValue();
$prop['required'] = $custom->getIsRequired();
$prop['multiple_values'] = $custom->getIsMultipleValues();
$prop['visible_by_default'] = $custom->getVisibleByDefault();
$prop['co_types'] = '';
//CustomPropertiesByCoType::instance()->getCoTypesIdsForCpCSV($custom->getId());
$customProperties[] = $prop;
}
ajx_current("empty");
ajx_extra_data(array("custom_properties" => $customProperties));
}
}
示例2: get_help_content
function get_help_content()
{
if (!array_var($_GET, 'template')) {
return;
}
$template = array_var($_GET, 'template');
ajx_current("empty");
ajx_extra_data(array("content" => load_help($template), "is_help_data" => 1));
}
示例3: get_assignable_parents
function get_assignable_parents()
{
if (!can_manage_dimension_members(logged_user())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
$dim_id = get_id('dim');
$otype_id = get_id('otype');
$parents_info = self::getAssignableParents($dim_id, $otype_id);
ajx_extra_data(array("parents" => $parents_info));
ajx_current("empty");
}
示例4: initial_list_projects
function initial_list_projects()
{
ajx_current("empty");
$parent = 0;
$all_ws = logged_user()->getWorkspaces(true);
if (!is_array($all_ws)) {
$all_ws = array();
}
$wsset = array();
foreach ($all_ws as $w) {
$wsset[$w->getId()] = true;
}
$ws = array();
foreach ($all_ws as $w) {
$tempParent = $w->getParentId();
$x = $w;
while ($x instanceof Project && !isset($wsset[$tempParent])) {
$tempParent = $x->getParentId();
$x = $x->getParentWorkspace();
}
if (!$x instanceof Project) {
$tempParent = 0;
}
$workspace = array("id" => $w->getId(), "name" => $w->getName(), "color" => $w->getColor(), "parent" => $tempParent, "realParent" => $w->getParentId(), "depth" => $w->getDepth());
if (logged_user()->getPersonalProjectId() == $w->getId()) {
$workspace["isPersonal"] = true;
}
$ws[] = $workspace;
}
ajx_extra_data(array('workspaces' => $ws));
}
示例5: get_external_field_values
function get_external_field_values()
{
$field = array_var($_GET, 'external_field');
$report_type = array_var($_GET, 'report_type');
$values = $this->get_ext_values($field, $report_type);
ajx_current("empty");
ajx_extra_data(array('values' => $values));
}
示例6: get_user_preference
function get_user_preference()
{
ajx_current("empty");
$option_name = array_var($_REQUEST, 'name');
$option_value = "";
if ($option_name != '') {
$option_value = user_config_option($option_name);
}
ajx_extra_data(array('opt_val' => $option_value));
}
示例7: search_permission_group
function search_permission_group()
{
$name = trim(array_var($_REQUEST, 'query', ''));
$start = array_var($_REQUEST, 'start', 0);
$orig_limit = array_var($_REQUEST, 'limit');
$limit = $orig_limit + 1;
$query_name = "";
if (strlen($name) > 0) {
$query_name = "AND (c.first_name LIKE '%{$name}%' OR c.surname LIKE '%{$name}%' OR pg.name LIKE '%{$name}%')";
}
// query for permission groups
$sql = "SELECT * FROM " . TABLE_PREFIX . "permission_groups pg LEFT JOIN " . TABLE_PREFIX . "contacts c ON pg.id=c.permission_group_id\r\n\t\t\tWHERE pg.type IN ('permission_groups', 'user_groups') AND (c.user_type IS NULL OR c.user_type >= " . logged_user()->getUserType() . ") {$query_name}\r\n\t\t\tORDER BY c.first_name, c.surname, pg.name\r\n\t\t\tLIMIT {$start}, {$limit}";
$rows = DB::executeAll($sql);
if (!is_array($rows)) {
$rows = array();
}
// show more
$show_more = false;
if (count($rows) > $orig_limit) {
array_pop($rows);
$show_more = true;
}
if ($show_more) {
ajx_extra_data(array('show_more' => $show_more));
}
$tmp_companies = array();
$tmp_roles = array();
$permission_groups = array();
foreach ($rows as $pg_data) {
// basic data
$data = array('pg_id' => $pg_data['id'], 'type' => $pg_data['type'] == 'permission_groups' ? 'user' : 'group', 'iconCls' => '', 'name' => is_null($pg_data['first_name']) && is_null($pg_data['surname']) ? $pg_data['name'] : trim($pg_data['first_name'] . ' ' . $pg_data['surname']));
// company name
$comp_id = array_var($pg_data, 'company_id');
if ($comp_id > 0) {
if (!isset($tmp_companies[$comp_id])) {
$tmp_companies[$comp_id] = Contacts::findById($comp_id);
}
$c = array_var($tmp_companies, $comp_id);
if ($c instanceof Contact) {
$data['company_name'] = trim($c->getObjectName());
}
}
// picture
if ($pg_data['type'] == 'permission_groups') {
$data['user_id'] = array_var($pg_data, 'object_id');
if (array_var($pg_data, 'picture_file') != '') {
$data['picture_url'] = get_url('files', 'get_public_file', array('id' => array_var($pg_data, 'picture_file')));
}
}
// user type
$user_type_id = array_var($pg_data, 'user_type');
if ($user_type_id > 0) {
if (!isset($tmp_roles[$user_type_id])) {
$tmp_roles[$user_type_id] = PermissionGroups::findById($user_type_id);
}
$rol = array_var($tmp_roles, $user_type_id);
if ($rol instanceof PermissionGroup) {
$data['role'] = trim($rol->getName());
if (in_array($rol->getName(), array('Guest', 'Guest Customer'))) {
$data['is_guest'] = '1';
}
}
}
$permission_groups[] = $data;
}
$row = "search-result-row-medium";
ajx_extra_data(array('row_class' => $row));
ajx_extra_data(array('permission_groups' => $permission_groups));
ajx_current("empty");
}
示例8: view
/**
* View single message
*
* @access public
* @param void
* @return null
*/
function view()
{
$this->addHelper('textile');
$message = ProjectMessages::findById(get_id());
if (!$message instanceof ProjectMessage) {
flash_error(lang('message dnx'));
ajx_current("empty");
return;
}
// if
if (!$message->canView(logged_user())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
// if
$this->setHelp("view_message");
//read object for this user
$message->setIsRead(logged_user()->getId(), true);
tpl_assign('message', $message);
tpl_assign('subscribers', $message->getSubscribers());
ajx_extra_data(array("title" => $message->getTitle(), 'icon' => $message->getIconClass()));
ajx_set_no_toolbar(true);
ApplicationReadLogs::createLog($message, ApplicationReadLogs::ACTION_READ);
}
示例9: list_tags
/**
* List all tags
*
*/
function list_tags()
{
ajx_current("empty");
$order = array_var($_GET, 'order', 'count');
$ts = array();
$tags = Tags::getTagNames($order);
$extra = array();
$extra['tags'] = $tags;
ajx_extra_data($extra);
}
示例10: get_cusotm_property_columns
function get_cusotm_property_columns() {
$grouped = array();
$cp_rows = DB::executeAll("SELECT cp.id, cp.name as cp_name, ot.name as obj_type FROM ".TABLE_PREFIX."custom_properties cp INNER JOIN ".TABLE_PREFIX."object_types ot on ot.id=cp.object_type_id ORDER BY ot.name");
if (is_array($cp_rows)) {
foreach ($cp_rows as $row) {
if (!isset($grouped[$row['obj_type']])) $grouped[$row['obj_type']] = array();
$grouped[$row['obj_type']][] = array('id' => $row['id'], 'name' => $row['cp_name']);
}
}
ajx_current("empty");
ajx_extra_data(array('properties' => $grouped));
}
示例11: get_template_tasks_data
function get_template_tasks_data()
{
ajx_current("empty");
$ids = explode(',', array_var($_REQUEST, 'ids'));
foreach ($ids as $k => &$id) {
if (!is_numeric($id)) {
unset($ids[$k]);
}
}
$objects = array();
if (count($ids) > 0) {
$tasks = TemplateTasks::findAll(array('conditions' => 'id IN (' . implode(',', $ids) . ')'));
$ot = ObjectTypes::findByName('template_task');
foreach ($tasks as $task) {
$objects[] = $this->prepareObject($task->getId(), $task->getId(), $task->getObjectName(), $ot->getName(), $task->manager(), "", $task->getMilestoneId(), array(), $task->getParentId(), 'ico-task');
}
}
ajx_extra_data(array('tasks' => $objects));
}
示例12: delete_project_timeslot
function delete_project_timeslot()
{
if (!can_manage_time(logged_user(), true)) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
ajx_current("empty");
$timeslot = Timeslots::findById(get_id());
if (!$timeslot instanceof Timeslot) {
flash_error(lang('timeslot dnx'));
return;
}
if (!$timeslot->canDelete(logged_user())) {
flash_error(lang('no access permissions'));
return;
}
try {
DB::beginWork();
$timeslot->delete();
DB::commit();
ajx_extra_data(array("timeslotId" => get_id()));
} catch (Exception $e) {
DB::rollback();
flash_error($e->getMessage());
}
// try
}
示例13: get_assignable_milestones
/**
* Returns the milestones included in the present workspace and all of its parents. This is because tasks from a particular workspace
* can only be assigned to milestones from that workspace and from any of its parents.
*/
function get_assignable_milestones() {
ajx_current("empty");
$ms = ProjectMilestones::findAll();
if ($ms === null) $ms = array();
$ms_info = array();
foreach ($ms as $milestone) {
$ms_info[] = $milestone->getArrayInfo();
}
ajx_extra_data(array('milestones' => $ms_info));
}
示例14: edit
/**
* Edit specific message
*
* @access public
* @param void
* @return null
*/
function edit()
{
$this->setTemplate('add_message');
if (logged_user()->isGuest()) {
flash_error(lang('no access permissions'));
ajx_current('empty');
return;
}
$message = ProjectMessages::findById(get_id());
if (!$message instanceof ProjectMessage) {
flash_error(lang('message dnx'));
ajx_current("empty");
return;
}
// if
if (!$message->canEdit(logged_user())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
// if
$message_data = array_var($_POST, 'message');
if (!is_array($message_data)) {
$tag_names = $message->getTagNames();
$message_data = array('milestone_id' => $message->getMilestoneId(), 'title' => $message->getTitle(), 'text' => $message->getText(), 'additional_text' => $message->getAdditionalText(), 'tags' => is_array($tag_names) ? implode(', ', $tag_names) : '', 'is_private' => $message->isPrivate(), 'is_important' => $message->getIsImportant(), 'comments_enabled' => $message->getCommentsEnabled(), 'anonymous_comments_enabled' => $message->getAnonymousCommentsEnabled());
// array
}
// if
tpl_assign('message', $message);
tpl_assign('message_data', $message_data);
if (is_array(array_var($_POST, 'message'))) {
try {
//MANAGE CONCURRENCE WHILE EDITING
$upd = array_var($_POST, 'updatedon');
if ($upd && $message->getUpdatedOn()->getTimestamp() > $upd && !array_var($_POST, 'merge-changes') == 'true') {
ajx_current('empty');
evt_add("handle edit concurrence", array("updatedon" => $message->getUpdatedOn()->getTimestamp(), "genid" => array_var($_POST, 'genid')));
return;
}
if (array_var($_POST, 'merge-changes') == 'true') {
$this->setTemplate('view');
$edited_note = ProjectMessages::findById($message->getId());
tpl_assign('message', $edited_note);
tpl_assign('subscribers', $edited_note->getSubscribers());
ajx_extra_data(array("title" => $edited_note->getTitle(), 'icon' => 'ico-message'));
ajx_set_no_toolbar(true);
ajx_set_panel(lang('tab name', array('name' => $edited_note->getTitle())));
return;
}
$old_is_private = $message->isPrivate();
$old_is_important = $message->getIsImportant();
$old_comments_enabled = $message->getCommentsEnabled();
$old_anonymous_comments_enabled = $message->getAnonymousCommentsEnabled();
$message->setFromAttributes($message_data);
// Options are reserved only for members of owner company
if (!logged_user()->isMemberOfOwnerCompany()) {
$message->setIsPrivate($old_is_private);
$message->setIsImportant($old_is_important);
$message->setCommentsEnabled($old_comments_enabled);
$message->setAnonymousCommentsEnabled($old_anonymous_comments_enabled);
}
// if
DB::beginWork();
$message->save();
$message->setTagsFromCSV(array_var($message_data, 'tags'));
$object_controller = new ObjectController();
$object_controller->add_to_workspaces($message);
$object_controller->link_to_new_object($message);
$object_controller->add_subscribers($message);
$object_controller->add_custom_properties($message);
$message->resetIsRead();
ApplicationLogs::createLog($message, $message->getWorkspaces(), ApplicationLogs::ACTION_EDIT);
DB::commit();
flash_success(lang('success edit message', $message->getTitle()));
if (array_var($_POST, 'popup', false)) {
ajx_current("reload");
} else {
ajx_current("back");
}
} catch (Exception $e) {
DB::rollback();
flash_error($e->getMessage());
ajx_current("empty");
}
// try
}
// if
}
示例15: initial_list_dimension_members_tree
function initial_list_dimension_members_tree() {
$dimension_id = array_var($_REQUEST, 'dimension_id');
$checkedField = (array_var($_REQUEST, 'checkboxes'))?"checked":"_checked";
$objectTypeId = array_var($_REQUEST, 'object_type_id', null );
$allowedMemberTypes = json_decode(array_var($_REQUEST, 'allowedMemberTypes', null ));
if (!is_array($allowedMemberTypes)) {
$allowedMemberTypes = null;
}
$only_names = array_var($_REQUEST, 'onlyname', false);
$name = trim(array_var($_REQUEST, 'query', ''));
$extra_cond = $name == "" ? "" : " AND name LIKE '".$name."%'";
$selected_member_ids = json_decode(array_var($_REQUEST, 'selected_ids', "[0]"));
$selected_members = Members::findAll(array('conditions' => 'id IN ('.implode(',',$selected_member_ids).')'));
$memberList = $this->initial_list_dimension_members($dimension_id, $objectTypeId, $allowedMemberTypes, false, $extra_cond, null, false, null, $only_names, $selected_members);
$tree = buildTree($memberList, "parent", "children", "id", "name", $checkedField);
ajx_current("empty");
ajx_extra_data(array('dimension_members' => $tree, 'dimension_id' => $dimension_id));
}