Ejemplo n.º 1
0
$titleBlock = new w2p_Theme_TitleBlock($ttl, 'icon.png', $m);
$titleBlock->addViewLink('project', $task_project);
$titleBlock->addViewLink('task', $object_id);
$titleBlock->show();
// Get contacts list
$selected_contacts = array();
if ($object_id) {
    $myContacts = $object->getContacts(null, $object_id);
    $selected_contacts = array_keys($myContacts);
}
if ($object_id == 0 && (isset($contact_id) && $contact_id > 0)) {
    $selected_contacts[] = '' . $contact_id;
}
$department_selection_list = array();
$department = new CDepartment();
$deptList = $department->departments($project->project_company);
foreach ($deptList as $dept) {
    $department_selection_list[$dept['dept_id']] = $dept['dept_name'];
}
$department_selection_list = arrayMerge(array('0' => ''), $department_selection_list);
//Dynamic tasks are by default now off because of dangerous behavior if incorrectly used
if (is_null($object->task_dynamic)) {
    $object->task_dynamic = 0;
}
$can_edit_time_information = $object->canUserEditTimeInformation($project->project_owner, $AppUI->user_id);
//get list of projects, for task move drop down list.
$tmpprojects = $project->getAllowedProjects($AppUI->user_id);
$projects = array();
$projects[0] = $AppUI->_('Do not move');
foreach ($tmpprojects as $proj) {
    $projects[$proj['project_id']] = $proj['project_name'];
Ejemplo n.º 2
0
 /**
  * @deprecated
  */
 public static function getDepartmentList($AppUI = null, $companyId, $departmentId = 0)
 {
     trigger_error("The CDepartment::getDepartmentList static method has been deprecated in 3.1 and will be removed in v4.0. Please use CDepartment->departments() instead.", E_USER_NOTICE);
     $department = new CDepartment();
     return $department->departments($companyId, $departmentId);
 }
Ejemplo n.º 3
0
function getDepartmentSelectionList($company_id, $checked_array = array(), $dept_parent = 0, $spaces = 0)
{
    global $departments_count, $AppUI;
    $parsed = '';
    if ($AppUI->isActiveModule('departments') && canView('departments')) {
        $department = new CDepartment();
        $depts_list = $department->departments($company_id, $dept_parent);
        foreach ($depts_list as $dept_id => $dept_info) {
            $selected = in_array($dept_id, $checked_array) ? ' selected="selected"' : '';
            $parsed .= '<option value="' . $dept_id . '"' . $selected . '>' . str_repeat('&nbsp;', $spaces) . $dept_info['dept_name'] . '</option>';
            $parsed .= getDepartmentSelectionList($company_id, $checked_array, $dept_id, $spaces + 5);
        }
    }
    return $parsed;
}