$ItemList->global_icon(T_('Reset all filters!'), 'reset_filters', '?ctrl=items&blog=' . $Blog->ID . '&filter=reset', T_('Reset filters'), 3, 3, array('class' => 'action_icon btn-warning')); } if ($current_User->check_perm('blog_post_statuses', 'edit', false, $Blog->ID)) { // We have permission to add a post with at least one status: $ItemList->global_icon(T_('Create a new task...'), 'new', '?ctrl=items&action=new&blog=' . $Blog->ID . '&redirect_to=' . rawurlencode(regenerate_url('', '', '', '&')), T_('New task') . ' »', 3, 4, array('class' => 'action_icon btn-primary')); } // EXECUTE the query now: $ItemList->restart(); // Initialize funky display vars now: global $postIDlist, $postIDarray; $postIDlist = $ItemList->get_page_ID_list(); $postIDarray = $ItemList->get_page_ID_array(); // DISPLAY table now: $ItemList->display(NULL, $result_fadeout); // Print JS to edit a task priority echo_editable_column_js(array('column_selector' => '.task_priority_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=item_task_edit&field=priority&' . url_crumb('itemtask'), 'options' => item_priority_titles(), 'new_field_name' => 'new_priority', 'ID_value' => 'jQuery( this ).attr( "rel" )', 'ID_name' => 'post_ID', 'colored_cells' => true)); // Print JS to edit a task assigned // Load current blog members into cache: $UserCache =& get_UserCache(); // Load only first 21 users to know when we should display an input box instead of full users list $UserCache->load_blogmembers($Blog->ID, 21, false); // Init this array only for <select> when we have less than 21 users, otherwise we use <input> field with autocomplete feature $field_type = count($UserCache->cache) < 21 ? 'select' : 'text'; $task_assignees = array(0 => T_('No user')); if ($field_type == 'select') { foreach ($UserCache->cache as $User) { $task_assignees[$User->ID] = $User->login; } } echo_editable_column_js(array('column_selector' => '.task_assigned_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=item_task_edit&field=assigned&' . url_crumb('itemtask'), 'options' => $task_assignees, 'new_field_name' => $field_type == 'select' ? 'new_assigned_ID' : 'new_assigned_login', 'ID_value' => 'jQuery( this ).attr( "rel" )', 'ID_name' => 'post_ID', 'field_type' => $field_type, 'field_class' => 'autocomplete_login only_assignees', 'null_text' => TS_('No user'))); // Print JS to edit a task status
?> </div> <div class="right_col col-lg-3 col-md-4"> <?php // ################### MODULES SPECIFIC ITEM SETTINGS ################### modules_call_method('display_item_settings', array('Form' => &$Form, 'Blog' => &$Blog, 'edited_Item' => &$edited_Item, 'edit_layout' => 'expert', 'fold' => true)); // ############################ WORKFLOW ############################# if ($Blog->get_setting('use_workflow')) { // We want to use workflow properties for this blog: $Form->begin_fieldset(T_('Workflow properties') . get_manual_link('post-edit-workflow-panel'), array('id' => 'itemform_workflow_props', 'fold' => true)); echo '<div id="itemform_edit_workflow" class="edit_fieldgroup">'; $Form->switch_layout('linespan'); $Form->select_input_array('item_priority', $edited_Item->priority, item_priority_titles(), T_('Priority'), '', array('force_keys_as_values' => true)); echo ' '; // allow wrapping! // Load current blog members into cache: $UserCache =& get_UserCache(); // Load only first 21 users to know when we should display an input box instead of full users list $UserCache->load_blogmembers($Blog->ID, 21, false); if (count($UserCache->cache) > 20) { $assigned_User =& $UserCache->get_by_ID($edited_Item->get('assigned_user_ID'), false, false); $Form->username('item_assigned_user_login', $assigned_User, T_('Assigned to'), '', 'only_assignees'); } else { $Form->select_object('item_assigned_user_ID', NULL, $edited_Item, T_('Assigned to'), '', true, '', 'get_assigned_user_options'); } echo ' '; // allow wrapping! $ItemStatusCache =& get_ItemStatusCache();
/** * Get priority title of an item by priority value * * @param integer Priority value * @return string Priority title */ function item_priority_title($priority) { $titles = item_priority_titles(); return isset($titles[$priority]) ? $titles[$priority] : $priority; }