Ejemplo n.º 1
0
function user_print_autocomplete_input($parameters)
{
    if (isset($parameters['input_name'])) {
        $input_name = $parameters['input_name'];
    }
    $input_value = '';
    if (isset($parameters['input_value'])) {
        $input_value = $parameters['input_value'];
    }
    if (isset($parameters['input_id'])) {
        $input_id = $parameters['input_id'];
    }
    $return = false;
    if (isset($parameters['return'])) {
        $return = $parameters['return'];
    }
    $input_size = 20;
    if (isset($parameters['size'])) {
        $input_size = $parameters['size'];
    }
    $input_maxlength = 30;
    if (isset($parameters['maxlength'])) {
        $input_maxlength = $parameters['maxlength'];
    }
    $src_code = print_image('images/group.png', true, false, true);
    if (isset($parameters['image'])) {
        $src_code = print_image($parameters['image'], true, false, true);
    }
    $title = '';
    if (isset($parameters['title'])) {
        $title = $parameters['title'];
    }
    $help_message = "Type at least two characters to search";
    if (isset($parameters['help_message'])) {
        $help_message = $parameters['help_message'];
    }
    $return_help = true;
    if (isset($parameters['return_help'])) {
        $return_help = $parameters['return_help'];
    }
    $disabled = false;
    if (isset($parameters['disabled'])) {
        $disabled = $parameters['disabled'];
    }
    $attributes = '';
    if (isset($parameters['attributes'])) {
        $attributes = $parameters['attributes'];
    }
    return print_input_text_extended($input_name, $input_value, $input_id, '', $input_size, $input_maxlength, $disabled, '', $attributes, $return, '', $title . print_help_tip($help_message, $return_help));
}
Ejemplo n.º 2
0
	$table->id = 'cost_form';
	$table->width = '100%';
	$table->class = 'search-table';
	if(!isset($bill_id)){
		$bill_id = '';
	}
	$table->data[0][0] = "<b>" . __('Bill ID') . "</b>";
	$table->data[1][0] = print_input_text_extended ('bill_id', $bill_id, '', '', 15, 50, false, '', 'style="width:255px !important;"', true);
	if(!isset($amount)){
		$amount = '';
	}
	$table->data[2][0] = "<b>" . __('Amount') . "</b>";
	$table->data[3][0] = print_input_text_extended ('amount', $amount, '', '', 10, 20, false, '', 'style="width:255px !important;"', true);//Check
	
	$table->data[4][0] = "<b>" . __('Description') . "</b>";
	$table->data[5][0] = print_input_text_extended ('description', '', '', '', 60, 250, false, '', 'style="width:255px !important;"', true);
	
	$table->data[6][0] = "<b>" . __('Attach a file') . "</b>";
	$table->data[7][0] = '<input type="file" name="upfile" value="upfile" class="sub" size="30">';
	
	
	//~ if ($operation == "") {
		$table->align['button'] = 'center';
		$table->data[8]['button'] = print_submit_button (__('Add'), "crt", false, '', true);
		$table->data[8]['button'] .= print_input_hidden ('operation', "add", true);
		//~ $button_name = "button-crt";
	//~ } else {
		//~ $table->align['button'] = 'center';
		//~ $table->data[8]['button'] .= print_input_hidden ('id', $id_profile, true);
		//~ $table->data[8]['button'] .= print_input_hidden ('update_profile', 1, true);
		//~ $table->data[8]['button'] .= print_button (__('Update'), "upd", false, '', 'class=""', true);
Ejemplo n.º 3
0
 }
 if ($id_category) {
     $where_clause .= sprintf(' AND id_wo_category = %d ', $id_category);
 }
 if ($id_project) {
     $where_clause .= sprintf(' AND id_task = ANY(SELECT id FROM ttask WHERE id_project = %d) ', $id_project);
 }
 echo '<form id="form-search_wo" action="index.php?sec=projects&sec2=operation/workorders/wo" method="post">';
 $table->class = 'search-table';
 $table->style = array();
 $table->style[0] = 'font-weight: bold;';
 $table->data = array();
 $table->width = "99%";
 $table->data[0][0] = print_input_text("search_text", $search_text, "", 15, 100, true, __('Search'));
 $table->data[0][1] = print_input_text_extended('owner', $owner, 'text-user', '', 15, 30, false, '', '', true, '', __('Owner')) . print_help_tip(__("Type at least two characters to search") . ". " . __("Use '*' for get all values"), true);
 $table->data[0][2] = print_input_text_extended('creator', $creator, 'text-user2', '', 15, 30, false, '', '', true, '', __('Submitter')) . print_help_tip(__("Type at least two characters to search"), true);
 $wo_status_values = wo_status_array();
 $table->data[1][0] = print_select($wo_status_values, 'search_status', $search_status, '', __("Any"), -1, true, 0, false, __('WO Status'));
 $priorities = get_priorities();
 $table->data[1][1] = print_select($priorities, 'search_priority', $search_priority, '', __("Any"), -1, true, 0, false, __('Priority'));
 $avatar = get_db_value('avatar', 'tusuario', 'id_usuario', $config["id_user"]);
 if (!$avatar) {
     $avatar = "avatar1";
 }
 $table->data[1][2] = print_submit_button(__('Search'), "search_btn", false, 'class="sub search"', true);
 $table->data[1][2] .= ' <a href="index.php?sec=projects&sec2=operation/workorders/wo&owner=' . $config["id_user"] . '"><img src="images/avatars/' . $avatar . '.png" class="avatar_small" title="' . __('My WO\'s') . '"></a>';
 $table->data[1][2] .= ' <a href="index.php?sec=projects&sec2=operation/workorders/wo&creator=' . $config["id_user"] . '"><img src="images/user_comment.png" title="' . __('My delegated WO\'s') . '"></a>';
 $table->rowspan[0][3] = 3;
 if ($owner != "") {
     $table->data[0][3] = '<b>' . __('Submitters') . '</b>';
     $table->data[0][3] .= '<br>' . graph_workorder_num('200', '100', 'submitter', $where_clause, 5);
Ejemplo n.º 4
0
}
$table->colspan[8][0] = 2;
$rate4 = sprintf("%.2f", $amount[3] * $rates);
$table->data[8][0] = print_input_text ('concept4', $concept[3], '', 60, 250, true);
$table->data[8][2] = print_input_text_extended ('amount4', $amount[3], 'text-amount4', '', 18, 20, false, '', "oninput='calculate_rate(\"text-amount4\", \"text-rate4\")'",true);
$table->data[8][3] = print_input_text ('rate4', $rate4, '', 18, 20, true);
if(!isset($amount[4])){
	$amount[4] = '';
}
if(!isset($concept[4])){
	$concept[4] = '';
}
$table->colspan[9][0] = 2;
$rate5 = sprintf("%.2f", $amount[4] * $rates);
$table->data[9][0] = print_input_text ('concept5', $concept[4], '', 60, 250, true);
$table->data[9][2] = print_input_text_extended ('amount5', $amount[4], 'text-amount5', '', 18, 20, false, '', "oninput='calculate_rate(\"text-amount5\", \"text-rate5\")'",true);
$table->data[9][3] = print_input_text ('rate5', $rate5, '', 18, 20, true);

$table->colspan[10][0] = 2;
$table->data[10][0] = '<br/>' . print_input_text ('discount_concept', $discount_concept, '', 60, 50, true, __('Concept discount'));
$table->colspan[10][2] = 2;
$table->data[10][2] = '<br/>' . print_input_text ('discount_before', $discount_before, '', 5, 20, true, __('Discount before taxes (%)'));

$contcampo2 = 1;
if (is_string($tax_name)){
	$table->colspan[11][0] = 2;
	$table->data[11][0] = print_input_text ('tax_name1', $tax_name, '', 60, 50, true, __('Concept tax'));
	$table->data[11][0] .= '</br>';
	$contcampo2++;
}else{
	foreach ( $tax_name as $key => $campo) { 
Ejemplo n.º 5
0
	
		$table_search->data[1][2] = user_print_autocomplete_input($params_associated);
		
		//status
		$all_inventory_status = inventories_get_inventory_status ();
		array_unshift($all_inventory_status, __("All"));
		if(!isset($params['inventory_status'])){
			$params['inventory_status'] = 'All';
		}
		$table_search->data[2][0] = print_select ($all_inventory_status, 'inventory_status', $params['inventory_status'], '', '', '', true, false, false, __('Status'));

		//Parent name
		if(!isset($params['parent_name'])){
			$params['parent_name'] = '';
		}
		$table_search->data[2][1] =  print_input_text_extended ("parent_name", $params['parent_name'], "text-parent_name", '', 20, 0, false, "", "class='inventory_obj_search' style='width:165px !important;'", true, false,  __('Parent object'), false, true);
		$table_search->data[2][1] .= "&nbsp;&nbsp;" . print_image("images/add.png", true, array("onclick" => "show_inventory_search('','','','','','','','','','', '', '')", "style" => "cursor: pointer"));	
		$table_search->data[2][1] .= "&nbsp;&nbsp;" . print_image("images/cross.png", true, array("onclick" => "cleanParentInventory()", "style" => "cursor: pointer"));	
		//$table_search->data[2][1] .= print_input_hidden ('id_parent', $id_parent, true);

		//check
		$table_search->data[2][2] = print_checkbox_extended ('last_update', 1, $params['last_update'],
		false, '', '', true, __('Last updated'));

		//input pagination size
		$table_search->data[3][0] = '<label id="label-text-block_size" for="text-block_size">'.__('Block size for pagination').print_help_tip (__("Selects the paging block. By default it's set in the general options and limited to 2-1000"), true).'</label>';
		$table_search->data[3][0] .= '<input type="number" required pattern="^[2-100]" name="block_size" id="text-block_size" value="'.$params['block_size'].'" size="2" min="2" max="1000">';

		//order column table hidden
		$table_search->data[3][0] .= print_input_hidden ('sort_field', $params['sort_field_num'], true, false, 'sort_field');
		$table_search->data[3][0] .= print_input_hidden	('sort_mode', $params['sort_mode'], true, false, 'sort_mode');
Ejemplo n.º 6
0
     $company_order_image = "&nbsp;<a href='javascript:changeCompanyOrder(\"ASC\")'><img src='images/block_orange.png'></a>";
 } else {
     $order_by .= "tcompany.last_update DESC";
     $activity_order_image = "&nbsp;<a href='javascript:changeActivityOrder(\"ASC\")'><img src='images/arrow_up_orange.png'></a>";
     $company_order_image = "&nbsp;<a href='javascript:changeCompanyOrder(\"ASC\")'><img src='images/block_orange.png'></a>";
     $billing_order_image = "&nbsp;<a href='javascript:changeBillingOrder(\"ASC\")'><img src='images/block_orange.png'></a>";
 }
 $search_params = "&search_manager={$search_manager}&search_text={$search_text}&search_role={$search_role}&search_country={$search_country}&search_parent={$search_parent}&search_date_begin={$search_date_begin}&search_date_end={$search_date_end}&search_min_billing={$search_min_billing}&order_by_activity={$order_by_activity}&order_by_company={$order_by_company}&order_by_billing={$order_by_billing}";
 $table->width = '99%';
 $table->class = 'search-table-button';
 $table->style = array();
 $table->data = array();
 $table->data[0][0] = print_input_text("search_text", $search_text, "", 15, 100, true, __('Search'));
 $table->data[0][1] = print_select_from_sql('SELECT id, name FROM tcompany_role ORDER BY name', 'search_role', $search_role, '', __('Select'), 0, true, false, false, __('Company Role'));
 $table->data[0][2] = print_input_text("search_country", $search_country, "", 10, 100, true, __('Country'));
 $table->data[0][3] = print_input_text_extended('search_manager', $search_manager, 'text-user', '', 15, 30, false, '', array(), true, '', __('Manager')) . print_help_tip(__("Type at least two characters to search"), true);
 // $companies_name = crm_get_companies_list("", false, "ORDER BY name", true);
 // $table->data[1][0] = print_select ($companies_name, 'search_parent', $search_parent, '', __('Any'), 0, true, false, false, __('Parent'));
 $params = array();
 $params['input_id'] = 'search_parent';
 $params['input_name'] = 'search_parent';
 $params['input_value'] = $search_parent;
 $params['title'] = __('Parent');
 $params['return'] = true;
 $table->data[1][0] = print_company_autocomplete_input($params);
 $table->data[1][1] = print_input_text('search_date_begin', $search_date_begin, '', 15, 20, true, __('Date from'));
 $table->data[1][2] = print_input_text('search_date_end', $search_date_end, '', 15, 20, true, __('Date to'));
 $table->data[1][3] = print_input_text('search_min_billing', $search_min_billing, '', 15, 20, true, __('Min. billing'));
 $buttons = print_submit_button(__('Search'), "search_btn", false, 'class="sub search"', true);
 // Delete new lines from the string
 $where_clause = str_replace(array("\r", "\n"), '', $where_clause);
Ejemplo n.º 7
0
		echo "</span></td>";
	echo "</tr>";
	
	// Name
	echo '<tr>';
		echo '<td colspan=2><b>'.__('Name').' </b></td>';
	echo "</tr><tr>";
		echo '<td colspan=2><input type="text" name="name" value="'.$name.'"></td>';
	echo '</tr>';
	
	// Owner
	$id_owner = get_db_value ( 'id_owner', 'tproject', 'id', $id_project);
	echo '<tr>';
		echo "<td colspan=2><b>".__('Manager')." </b></td>";
	echo "</tr><tr>";
		echo "<td colspan=2>" . print_input_text_extended ('id_owner', $owner, 'text-id_owner', '', 25, 20, false, '', '', true, '',''). "</td>" ;
	echo "</tr>";
	
	// Project group
	echo "<tr>";	
		echo "<td colspan=2><b>". __('Project group')."</b><br>";
	echo "</tr><tr>";
		if (!$clean_output) {
			echo "<td colspan=2>". print_select_from_sql ("SELECT * from tproject_group ORDER BY name", "id_project_group", $id_project_group, "", __('None'), '0', true, false, true, false) ."</td>";
		} else {
			echo "<td colspan=2>". get_db_value ("name", "tproject_group", "id", $id_project_group) ."</td>";
		}
	echo "</tr>";
	
	// CC
	echo '<tr>';
Ejemplo n.º 8
0
function form_search_incident($return = false, $filter = false, $ajax = 0)
{
    include_once "functions_user.php";
    global $config;
    $output = '';
    if (!$filter) {
        $inverse_filter = (bool) get_parameter('search_inverse_filter');
        $search_string = (string) get_parameter('search_string');
        $status = (int) get_parameter('search_status', -10);
        $priority = (int) get_parameter('search_priority', -1);
        $resolution = (int) get_parameter('search_resolution', -1);
        $id_group = (int) get_parameter('search_id_group');
        $id_inventory = (int) get_parameter('search_id_inventory');
        $id_company = (int) get_parameter('search_id_company');
        $search_id_user = (string) get_parameter('search_id_user');
        $search_id_incident_type = (int) get_parameter('search_id_incident_type');
        $date_from = (int) get_parameter("search_from_date");
        $date_start = (string) get_parameter("search_first_date");
        $date_end = (string) get_parameter("search_last_date");
        $search_creator = (string) get_parameter('search_id_creator');
        $search_editor = (string) get_parameter('search_editor');
        $search_closed_by = (string) get_parameter('search_closed_by');
        $group_by_project = (bool) get_parameter('search_group_by_project');
        $sla_state = (int) get_parameter('search_sla_state', 0);
        $id_task = (int) get_parameter('search_id_task', 0);
        $left_sla = (int) get_parameter('search_left_sla', 0);
        $right_sla = (int) get_parameter('search_right_sla', 0);
        $show_hierarchy = (bool) get_parameter('search_show_hierarchy');
        $search_medal = get_parameter('search_medals');
        $name = get_parameter('parent_name');
        $type_fields = incidents_get_type_fields($search_id_incident_type);
        $search_type_field = array();
        foreach ($type_fields as $key => $type_field) {
            $search_type_field[$type_field['id']] = (string) get_parameter('search_type_field_' . $type_field['id']);
        }
    } else {
        $inverse_filter = (bool) $filter['inverse_filter'];
        $search_string = (string) $filter['string'];
        $priority = (int) $filter['priority'];
        $id_group = (int) $filter['id_group'];
        $status = (int) $filter['status'];
        $resolution = (int) $filter['resolution'];
        $id_company = (int) $filter['id_company'];
        $id_inventory = (int) $filter['id_inventory'];
        $search_id_incident_type = (int) $filter['id_incident_type'];
        $search_id_user = (string) $filter['id_user'];
        $date_from = (int) $filter['from_date'];
        $date_start = (string) $filter['first_date'];
        $date_end = (string) $filter['last_date'];
        $search_creator = (string) $filter['id_creator'];
        $search_editor = (string) $filter['editor'];
        $search_closed_by = (string) $filter['closed_by'];
        $group_by_project = (bool) $filter['group_by_project'];
        $sla_state = (int) $filter['sla_state'];
        $id_task = (int) $filter['id_task'];
        $left_sla = (int) $filter['left_sla'];
        $right_sla = (int) $filter['right_sla'];
        $show_hierarchy = (bool) $filter['show_hierarchy'];
        $search_medal = (int) $filter['medals'];
        $name = (string) $filter['parent_name'];
        //This is inventory obj name value !!!
        $type_fields = incidents_get_type_fields($search_id_incident_type);
        $search_type_field = array();
        if ($type_fields) {
            foreach ($type_fields as $key => $type_field) {
                $search_type_field[$type_field['id']] = (string) $filter['type_field_' . $type_field['id']];
            }
        }
    }
    /* No action is set, so the form will be sent to the current page */
    $table = new stdclass();
    $table->width = "100%";
    $table->class = "search-table-button";
    $table->data = array();
    // Filter text
    $table->data[0][0] = print_input_text('search_string', $search_string, '', 30, 100, true, __('Text filter'));
    // Status
    $available_status = get_indicent_status();
    $available_status[-10] = __("Not closed");
    $table->data[0][1] = print_select($available_status, 'search_status', $status, '', __('Any'), 0, true, false, true, __('Status'));
    // Groups
    $groups = users_get_groups_for_select($config['id_user'], "IW", true, true);
    $table->data[0][2] = print_select($groups, 'search_id_group', $id_group, '', '', '', true, false, false, __('Group'));
    // Check Box
    $table->data[0][3] = print_checkbox_extended('search_show_hierarchy', 1, $show_hierarchy, false, '', '', true, __('Show hierarchy'));
    $table_advanced = new stdclass();
    $table_advanced->width = "100%";
    $table_advanced->class = "search-table-button";
    $params_owner = array();
    $params_owner['input_id'] = 'text-search_id_user';
    $params_owner['input_name'] = 'search_id_user';
    $params_owner['input_value'] = $search_id_user;
    $params_owner['title'] = __('Owner');
    $params_owner['attributes'] = 'style="width: 210px;"';
    $params_owner['return'] = true;
    $table_advanced->data[1][0] = user_print_autocomplete_input($params_owner);
    $params_editor = array();
    $params_editor['input_id'] = 'text-search_editor';
    $params_editor['input_name'] = 'search_editor';
    $params_editor['input_value'] = $search_editor;
    $params_editor['title'] = __('Editor');
    $params_editor['attributes'] = 'style="width: 210px;"';
    $params_editor['return'] = true;
    $table_advanced->data[1][1] = user_print_autocomplete_input($params_editor);
    $params_closed_by = array();
    $params_closed_by['input_id'] = 'text-search_closed_by';
    $params_closed_by['input_name'] = 'search_closed_by';
    $params_closed_by['input_value'] = $search_closed_by;
    $params_closed_by['title'] = __('Closed by');
    $params_closed_by['attributes'] = 'style="width: 210px;"';
    $params_closed_by['return'] = true;
    $table_advanced->data[1][2] = user_print_autocomplete_input($params_closed_by);
    $params_creator = array();
    $params_creator['input_id'] = 'text-search_id_creator';
    $params_creator['input_name'] = 'search_id_creator';
    $params_creator['input_value'] = $search_creator;
    $params_creator['title'] = __('Creator');
    $params_creator['attributes'] = 'style="width: 210px;"';
    $params_creator['return'] = true;
    $table_advanced->data[1][3] = user_print_autocomplete_input($params_creator);
    $table_advanced->data[2][0] = print_select(get_priorities(), 'search_priority', $priority, '', __('Any'), -1, true, false, false, __('Priority'), false);
    $table_advanced->data[2][1] = print_select(get_incident_resolutions(), 'search_resolution', $resolution, '', __('Any'), -1, true, false, false, __('Resolution'), false);
    //$name = $id_inventory ? get_inventory_name ($id_inventory) : '';
    //Parent name
    $table_advanced->data[2][2] = print_input_text_extended("parent_name", $name, "text-parent_name", '', 20, 0, false, "", "class='inventory_obj_search' style='width:165px !important;'", true, false, __('Inventory object'), false, true);
    $table_advanced->data[2][2] .= "&nbsp;&nbsp;" . print_image("images/add.png", true, array("onclick" => "show_inventory_search('','','','','','','','','','', '', '')", "style" => "cursor: pointer"));
    $table_advanced->data[2][2] .= "&nbsp;&nbsp;" . print_image("images/cross.png", true, array("onclick" => "cleanParentInventory()", "style" => "cursor: pointer"));
    $table_advanced->data[2][2] .= print_input_hidden('id_parent', $id_inventory, true);
    $table_advanced->data[2][3] = get_last_date_control($date_from, 'search_from_date', __('Date'), $date_start, 'search_first_date', __('Created from'), $date_end, 'search_last_date', __('Created to'));
    $table_advanced->rowspan[2][3] = 2;
    $table_advanced->cellstyle[2][3] = "vertical-align:top;";
    if (!get_standalone_user($config["id_user"])) {
        $table_advanced->data[4][0] = print_select(get_companies(), 'search_id_company', $id_company, '', __('Any'), 0, true, false, false, __('Company'));
    }
    $table_advanced->data[4][1] = print_select(get_incident_types(), 'search_id_incident_type', $search_id_incident_type, 'javascript:change_type_fields_table(\'' . __('Custom field') . '\');', __('Any'), 0, true, false, false, __('Ticket type'));
    $table_advanced->data[4][3] = print_checkbox_extended('search_group_by_project', 1, $group_by_project, false, '', '', true, __('Group by project/task'));
    $sla_states = array();
    $sla_states[1] = __('SLA is fired');
    $sla_states[2] = __('SLA is not fired');
    $table_advanced->data[5][0] = print_select($sla_states, 'search_sla_state', $sla_state, '', __('Any'), 0, true, false, false, __('SLA'));
    $table_advanced->data[5][1] = combo_task_user_participant($config["id_user"], 0, $id_task, true, __("Task"), 'search_id_task');
    $table_advanced->data[5][2] = "<div>";
    $table_advanced->data[5][2] .= "<div style='display: inline-block;'>" . print_input_text('search_left_sla', $left_sla, '', 8, 0, true, __('SLA > (%)'), false) . "</div>";
    $table_advanced->data[5][2] .= "&nbsp;<div style='display: inline-block;'>" . print_input_text('search_right_sla', $right_sla, '', 8, 0, true, __('SLA < (%)'), false) . "</div>";
    $table_advanced->data[5][2] .= "</div>";
    $medals = array();
    $medals[1] = __('Gold medals');
    $medals[2] = __('Black medals');
    $table_advanced->data[5][3] = print_select($medals, 'search_medals', $search_medal, '', __('Any'), 0, true, false, false, __('Medals'));
    $table_type_fields = new StdClass();
    $table_type_fields->width = "100%";
    $table_type_fields->class = "search-table";
    $table_type_fields->data = array();
    $table_type_fields->align[0] = 'left';
    //Print custom field data
    $column = 0;
    $row = 0;
    if ($type_fields) {
        foreach ($type_fields as $key => $type_field) {
            $data = $search_type_field[$type_field['id']];
            switch ($type_field['type']) {
                case "text":
                    $input = print_input_text('search_type_field_' . $type_field['id'], $data, '', 30, 30, true, $type_field['label']);
                    break;
                case "combo":
                    $combo_values = explode(",", $type_field['combo_value']);
                    $values = array();
                    foreach ($combo_values as $value) {
                        $values[$value] = $value;
                    }
                    $input = print_select($values, 'search_type_field_' . $type_field['id'], $data, '', __('Any'), '', true, false, false, $type_field['label']);
                    break;
                case "linked":
                    $linked_values = explode(",", $type_field['linked_value']);
                    $values = array();
                    foreach ($linked_values as $value) {
                        $value_without_parent = preg_replace("/^.*\\|/", "", $value);
                        $values[$value_without_parent] = $value_without_parent;
                        $has_childs = get_db_all_rows_sql("SELECT * FROM tincident_type_field WHERE parent=" . $type_field['id']);
                        if ($has_childs) {
                            $i = 0;
                            foreach ($has_childs as $child) {
                                if ($i == 0) {
                                    $childs = $child['id'];
                                } else {
                                    $childs .= ',' . $child['id'];
                                }
                                $i++;
                            }
                            $childs = "'" . $childs . "'";
                            $script = 'javascript:change_linked_type_fields_table(' . $childs . ',' . $type_field['id'] . ');';
                        } else {
                            $script = '';
                        }
                    }
                    $input = print_select($values, 'search_type_field_' . $type_field['id'], $data, $script, __('Any'), '', true, false, false, $type_field['label']);
                    break;
                case "numeric":
                    $input = print_input_number('search_type_field_' . $type_field['id'], $data, 1, 1000000, '', true, $type_field['label']);
                    break;
                case "date":
                    $input = print_input_date('search_type_field_' . $type_field['id'], $data, '', '', '', true, $type_field['label']);
                    break;
                case "textarea":
                    $input = print_input_text('search_type_field_' . $type_field['id'], $data, '', 30, 30, true, $type_field['label']);
                    break;
            }
            $table_type_fields->data[$row][$column] = $input;
            if ($column >= 3) {
                $column = 0;
                $row++;
            } else {
                $column++;
            }
        }
    }
    $table_advanced->colspan[6][0] = 4;
    if ($table_type_fields->data) {
        $table_type_fields_html = print_table($table_type_fields, true);
    }
    if (!isset($table_type_fields_html)) {
        $table_type_fields_html = '';
    }
    $table_advanced->data[6][0] = "<div id='table_type_fields'>" . $table_type_fields_html . "</div>";
    $table->colspan['row_advanced'][0] = 5;
    $table->data['row_advanced'][0] = print_container_div('advanced_parameters_incidents_search', __('Advanced filter'), print_table($table_advanced, true), 'closed', true, true);
    //Store serialize filter
    serialize_in_temp($filter, $config["id_user"]);
    $table->colspan['button'][0] = 2;
    $table->colspan['button'][2] = 2;
    $table->data['button'][0] = '</br>';
    $table->data['button'][2] = print_submit_button(__('Filter'), 'search', false, 'class="sub search"', true);
    $table->data['button'][2] .= print_input_hidden('search_inverse_filter', (int) $inverse_filter, true);
    $table->data['button'][2] .= print_submit_button(__('Inverse filter'), 'submit_inverse_filter', false, 'class="sub search"', true);
    $table->data['button'][2] .= print_button(__('Export to CSV'), '', false, 'window.open(\'' . 'include/export_csv.php?export_csv_tickets=1' . '\')', 'class="sub"', true);
    // Inverse filter info
    $output .= '<div id="inverse_filter_info" style="display: ' . ($inverse_filter ? 'block' : 'none') . ';">';
    $output .= ui_print_message(__('Inverse filter enabled'), 'suc', 'style="display:inline;padding-top: 15px;padding-bottom: 15px;"', true, 'h3', false);
    $output .= print_help_tip(__('The result will be the items which doesn\'t match the filters') . '. ' . __('The select controls with \'Any\' or \'All\' selected will be ignored'), true);
    $output .= '<br /><br />';
    $output .= '</div>';
    if ($ajax) {
        $output .= '<form id="search_incident_form" method="post">';
    } else {
        $output .= '<form id="search_incident_form" method="post" onsubmit="incidents_gift();return false">';
    }
    //~ $output .= '<form id="search_incident_form" method="post">';
    $output .= '<div class="divresult_incidents">' . print_table($table, true) . '</div>';
    $output .= '</form>';
    echo "<div class= 'dialog ui-dialog-content' id='search_inventory_window'></div>";
    // WARNING: Important for the inverse filter feature
    // Change the search_inverse_filter value when the form is submitted using the submit_inverse_filter or the search buttons
    // Show or hide the inverse filter info
    $output .= '<script type="text/javascript">';
    $output .= '$(document).ready(function () {';
    $output .= 'var inverseFilterInfo = document.getElementById("inverse_filter_info");';
    $output .= 'var filterForm = document.getElementById("search_incident_form");';
    $output .= 'var filterBtn = filterForm.elements["search"];';
    $output .= 'var inverseFilterBtn = filterForm.elements["submit_inverse_filter"];';
    $output .= 'var inverseFilter = filterForm.elements["search_inverse_filter"];';
    $output .= '$(filterBtn).click(function (e) {';
    $output .= 'inverseFilter.value = 0;';
    $output .= '$(inverseFilterInfo).hide();';
    $output .= '});';
    $output .= '$(inverseFilterBtn).click(function (e) {';
    $output .= 'inverseFilter.value = 1;';
    $output .= '$(inverseFilterInfo).show();';
    $output .= '});';
    $output .= '});';
    $output .= '</script>';
    if ($return) {
        return $output;
    }
    echo $output;
}
Ejemplo n.º 9
0
if ($id_user != "")
	echo " &raquo; ".__("For user"). " ".$id_user;
	echo integria_help ("role_user_global", true);
echo "</h4>";

// Controls
echo "<div class='divform'>";
	echo "<form name='xx' method=post action='index.php?sec=projects&sec2=operation/projects/role_user_global'>";
		// Select user
		$table = new stdClass;
		$table->id = "cost_form";
		$table->width = "99%";
		$table->class = "search-table";
		$table->data = array ();
		$table->data[0][0] = '<b>'.__('User ').'</b>' . print_help_tip (__("Type at least two characters to search"), true);
		$table->data[1][0] = print_input_text_extended ('id_user', $id_user, 'text-id_user', '', 26, 30, false, '', '', true, '');
		$table->data[2][0] = print_submit_button (__('Go'), 'sub_btn', false, '', true);
		print_table ($table);
		unset($table);
	echo "</form>";
	// Form to give project/task access
	echo "<form name='form-access' method=post action='index.php?sec=projects&sec2=operation/projects/role_user_global&add=1&id_user=$id_user'>";
		$table = new stdClass;
		$table->id = "cost_form";
		$table->width = "99%";
		$table->class = "search-table";
		$table->data = array ();
		$table->data[0][0] = '<b>'.__('Tasks').'</b>';
		$table->data[1][0] = combo_task_user_manager ($config['id_user'], 0, true, '', 'tasks[]', '', true);
		if (dame_admin($config['id_user'])) {
			$table->data[2][0] = '<b>'.__('Role').'</b>';
Ejemplo n.º 10
0
 $params_assigned['input_value'] = $owner;
 $params_assigned['title'] = 'Owner';
 $params_assigned['return'] = true;
 if ($write_permission || !$id) {
     $table->data[0][1] = user_print_autocomplete_input($params_assigned);
 } else {
     $table->data[0][1] = print_label(__('Owner'), '', '', true, $owner);
 }
 if ($write_permission || !$id) {
     $table->data[0][2] = print_checkbox_extended('public', 1, $public, false, '', '', true, __('Public'));
 } else {
     $table->data[0][2] = print_checkbox_extended('public', 1, $public, true, '', '', true, __('Public'));
 }
 if ($write_permission || !$id) {
     $parent_name = $id_parent ? get_inventory_name($id_parent) : __("None");
     $table->data[1][0] = print_input_text_extended("parent_name", $parent_name, "text-parent_name", '', 20, 0, false, "show_inventory_search('','','','','','','','','','', '', '')", "class='inventory_obj_search'", true, false, __('Parent object'));
     $table->data[1][0] .= print_image("images/cross.png", true, array("onclick" => "cleanParentInventory()", "style" => "cursor: pointer"));
     $table->data[1][0] .= print_input_hidden('id_parent', $id_parent, true);
 } else {
     $parent_name = $id_parent ? get_inventory_name($id_parent) : __('Not set');
     $table->data[1][0] = print_label(__('Parent object'), '', '', true, $parent_name);
     if ($id_parent) {
         $table->data[1][0] .= '<a href="index.php?sec=inventory&sec2=operation/inventories/inventory_detail&id=' . $id_parent . '"><img src="images/go.png" /></a>';
     }
 }
 $contracts = get_contracts();
 $manufacturers = get_manufacturers();
 if ($write_permission || !$id) {
     $table->data[1][1] = print_select($contracts, 'id_contract', $id_contract, '', __('None'), 0, true, false, false, __('Contract'));
     $table->data[1][2] = print_select($manufacturers, 'id_manufacturer', $id_manufacturer, '', __('None'), 0, true, false, false, __('Manufacturer'));
 } else {
Ejemplo n.º 11
0
echo "<strong>" . __("Username") . "</strong>";
echo '</td>';
echo '</tr>';
echo '<tr>';
echo "<td colspan=2 class='login_input'>";
echo print_input_text_extended("nick", '', "nick", '', '', '', false, '', 'class="login"', true);
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td colspan=2 class="login_label">';
echo "<strong>" . __("Password") . "</strong>";
echo '</td>';
echo '</tr>';
echo '<tr>';
echo "<td colspan=2 class='login_input'>";
echo print_input_text_extended("pass", '', "pass", '', '', '', false, '', 'class="login"', true, true);
echo '</td>';
echo '</tr>';
echo "<tr>";
echo "<td>";
echo '<div id="ver_num">';
echo $config["version"];
echo "</div>";
echo "</td>";
echo "<td class='login_button'>";
echo '<input class="sub next login_button" type="submit" value="LOGIN" name="Login">';
echo '</td></tr>';
echo "</table>";
echo "</div>";
//show object hidden
echo '<div id="show_login_hidden" style="display:none;">';
Ejemplo n.º 12
0
    $max_upload = (double) ini_get('upload_max_filesize');
    $max_post = (double) ini_get('post_max_size');
    $memory_limit = (double) ini_get('memory_limit');
    $upload_mb = min($max_upload, $max_post, $memory_limit);
    echo "<div class=\"upload-params-info\">";
    echo sprintf(__("The users can upload files with a maximum size of %sMB"), $upload_mb) . ". " . __("To increase this value, change your server settings") . ".";
    echo "</div>";
    // Select user
    echo "<div>";
    echo "<form method=post action='index.php?sec=file_sharing&sec2=operation/file_sharing/manage'>";
    $table = new StdClass();
    $table->id = "cost_form";
    $table->class = "search-table";
    $table->data = array();
    $row = array();
    $row[] = print_input_text_extended('id_user', $id_user, 'text-id_user', '', 50, 250, false, '', '', true, '') . print_help_tip(__("Type at least two characters to search"), true);
    $row[] = print_submit_button(__('Go'), 'sub_btn', false, 'class="next sub"', true);
    $table->data[] = $row;
    print_table($table);
    unset($table);
    echo "</form>";
    echo "</div>";
}
?>

<div id="file_sharing_table" class="table">
	<div class="table_row">
		<div id="file_sharing_list_cell" class="table_cell">
			<?php 
require $config['homedir'] . "/operation/file_sharing/list.php";
?>
Ejemplo n.º 13
0
echo "<strong>" . __("Username") . "</strong>";
echo '</td>';
echo '</tr>';
echo '<tr>';
echo "<td class='login_input'>";
echo print_input_text_extended("nick", '', "nick", '', '', '', false, '', 'class="login" placeholder="' . __("Nick") . '"', true);
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="login_label">';
echo "<strong>" . __("Password") . "</strong>";
echo '</td>';
echo '</tr>';
echo '<tr>';
echo "<td class='login_input'>";
echo print_input_text_extended("pass", '', "pass", '', '', '', false, '', 'class="login" placeholder="' . __("Password") . '"', true, true);
echo '</td>';
echo '</tr>';
echo "<tr>";
echo "<td class='login_button'>";
echo '<input class="sub next login_button" 
				type="submit" value="' . __("LOGIN") . '" name="Login">';
echo '</td>';
echo '</tr>';
echo "</table>";
echo '<div id="ver_num">';
echo '<div id="ver_num_rotate">';
echo $config["version"];
echo "</div>";
echo "</div>";
echo "</div>";
Ejemplo n.º 14
0
		$table->data[0][1] = user_print_autocomplete_input($params_assigned);
	} else {
		$table->data[0][1] = print_label (__('Owner'), '', '', true, $owner);
	}
	
	if ($write_permission || !$id) {
		$table->data[0][2] = print_checkbox_extended ('public', 1, $public, false, '', '', true, __('Public'));
	} else {
		$table->data[0][2] = print_checkbox_extended ('public', 1, $public, true, '', '', true, __('Public'));
	}
	
	if ($write_permission || !$id) {
	
		$parent_name = $id_parent ? get_inventory_name ($id_parent) : __("None");
	
		$table->data[1][0] = print_input_text_extended ("parent_name", $parent_name, "text-parent_name", '', 20, 0, false, "", "class='inventory_obj_search' style='width:210px;'", true, false,  __('Parent object'), false, true);
		$table->data[1][0] .= "&nbsp;&nbsp;" . print_image("images/add.png", true, array("onclick" => "show_inventory_search('','','','','','','','','','', '', '')", "style" => "cursor: pointer"));
		$table->data[1][0] .= "&nbsp;&nbsp;" . print_image("images/cross.png", true, array("onclick" => "cleanParentInventory()", "style" => "cursor: pointer"));	
		$table->data[1][0] .= print_input_hidden ('id_parent', $id_parent, true);

	} else {
		$parent_name = $id_parent ? get_inventory_name ($id_parent) : __('Not set');
	
		$table->data[1][0] = print_label (__('Parent object'), '', '', true, $parent_name);
		
		if ($id_parent)
			$table->data[1][0] .= '<a href="index.php?sec=inventory&sec2=operation/inventories/inventory_detail&id='.$id_parent.'"><img src="images/go.png" /></a>';
	}

	$contracts = get_contracts ();
	$manufacturers = get_manufacturers ();
Ejemplo n.º 15
0
			$where_clause .= ' AND id IN (-1) ';
	}
	
	$form = '<form id="lead_stats_form" action="index.php?sec=customers&sec2=operation/leads/lead&tab=search" method="post">';		

	$table->class = 'search-table-button';
	$table->style = array ();
	$table->style[0] = 'font-weight: bold;';
	$table->data = array ();
	$table->width = "100%";
	$table->colspan = array();
	$table->colspan['tags'][0] = 4;

	$table->data[0][0] = print_input_text ("search_text", $search_text, "", 21, 100, true, __('Search'));
	
	$table->data[0][1] = print_input_text_extended ('owner_search', $owner, 'text-user', '', 21, 30, false, '',
			array(), true, '', __('Owner'). print_help_tip (__("Type at least two characters to search"), true));

	$table->data[0][2] =  print_checkbox ("show_100_search", 1, $show_100, true, __("Show finished leads"));


	$table->data[1][0] = print_input_text ("country_search", $country, "", 21, 100, true, __('Country'));

	$table->data[1][1] = print_input_text ("est_sale_search", $est_sale, "", 21, 100, true, __('Estimated Sale'));
	
	$table->data[1][2] =  print_checkbox ("show_not_owned_search", 1, $show_not_owned, true, __("Show not owned leads"));

	
	$tag_editor_props = array('name' => 'tags', 'selected_tags' => $tags);
	$table->data['tags'][0] = print_label (__('Tags'), '', 'select', true);
	$table->data['tags'][0] .= html_render_tags_editor($tag_editor_props, true); 
	
Ejemplo n.º 16
0
	$table->rowspan[0][1] = 2;
	$table->rowspan[0][2] = 2;
	$table->data = array();

	$table->data[0][0] = print_input_text ("search_text", $search_text, "", 30, 100, true, __('Search'));

	$sql = 'SELECT id, name FROM tcompany_role ORDER BY name';
	$table->data[1][0] = print_select_from_sql ($sql, 'search_company_role', $search_company_role, '', __('Any'), 0, true, false, false, __('Company Role'));
	
	$table->data[0][1] = get_last_date_control_div ($search_last_date, 'search_last_date', __('Date Creation'), $search_date_begin, 'search_date_begin', __('From'), $search_date_end, 'search_date_end', __('To'), 'last_div');

	$table->data[0][2] = get_last_date_control_div ($search_exp_date, 'search_exp_date', __('Date Expiration'), $search_exp_begin, 'search_exp_begin', __('From'), $search_exp_end, 'search_exp_end', __('To'), 'expiration_div');
	
	$invoice_types = array("All"=>__('All'), "Submitted"=>__('Submitted'), "Received"=>__('Received'));
	$table->data[0][3] = print_select ($invoice_types, 'search_invoice_type', $search_invoice_type, '','', 0, true, 0, false, __('Invoice type'), false, 'width:150px;');
	$table->data[1][3] = print_input_text_extended ('search_company_manager', $search_company_manager, 'text-search_company_manager', '', 20, 50, false, '', array(), true, '', __("Manager") . print_help_tip (__("Type at least two characters to search"), true), true);

	$table->data[1][4] = print_input_text ("search_contract_number", $search_contract_number, "", 20, 100, true, __('Contract number'));

	$invoice_status_ar = array();
	$invoice_status_ar['active'] = __("Active");
	$invoice_status_ar['pending'] = __("Pending");
	$invoice_status_ar['paid'] = __("Paid");
	$invoice_status_ar['canceled'] = __("Canceled");
	$table->data[0][4] = print_select ($invoice_status_ar, 'search_invoice_status', $search_invoice_status, '', __("Any"), '', true, 0, false, __('Invoice status'), false, 'width:150px;');
	$form .= '<div class="form_result">';
		$form .= "<div class='divresult_left'>";
			$form .= print_table($table,true);
		$form .= '</div>';
		$form .= "<div class='divform_right'>";
			$form .= "<div class='button-form'>";
Ejemplo n.º 17
0
    }
}
// Title
echo "<h1>" . __("Global assignment");
if ($id_user != "") {
    echo " &raquo; " . __("For user") . " " . $id_user;
}
echo "</h1><br>";
// Controls
echo "<form name='xx' method=post action='index.php?sec=projects&sec2=operation/projects/role_user_global'>";
// Select user
$table->id = "cost_form";
$table->width = "250px";
$table->class = "search-table";
$table->data = array();
$table->data[0][0] = print_input_text_extended('id_user', $id_user, 'text-id_user', '', 15, 30, false, '', '', true, '') . print_help_tip(__("Type at least two characters to search"), true);
$table->data[0][0] .= print_submit_button(__('Go'), 'sub_btn', false, 'class="next sub"', true);
print_table($table);
unset($table);
echo "</form>";
// Form to give project/task access
echo "<form name='form-access' method=post action='index.php?sec=projects&sec2=operation/projects/role_user_global&add=1&id_user={$id_user}'>";
$table->id = "cost_form";
$table->width = "99%";
$table->class = "search-table";
$table->data = array();
$table->data[0][0] = combo_task_user_manager($config['id_user'], 0, true, __('Tasks'), 'tasks[]', '', true);
if (dame_admin($config['id_user'])) {
    $table->data[0][1] = combo_roles(false, "roles", __('Role'), true);
} else {
    $table->data[0][1] = combo_roles(false, "roles", __('Role'), true, false);
Ejemplo n.º 18
0
	
	$table = new StdClass();
	$table->class = 'search-table';
	$table->style = array ();
	$table->style[0] = 'font-weight: bold;';
	$table->data = array ();
	$table->width = "100%";

	$table->data[0][0] = print_input_text ("search_text", $search_text, "", 15, 100, true, __('Search'));

	$table->data[0][1] = print_input_text_extended ('owner', $owner, 'text-user', '', 15, 30, false, '',
			'', true, '', __('Owner'))

		. print_help_tip (__("Type at least two characters to search"). ". " . __("Use '*' for get all values"), true);

	$table->data[0][2] = print_input_text_extended ('creator', $creator, 'text-user2', '', 15, 30, false, '',
			'', true, '', __('Submitter'))

		. print_help_tip (__("Type at least two characters to search"), true);


	$wo_status_values = wo_status_array ();		

	$table->data[1][0] = print_select ($wo_status_values, 'search_status', $search_status, '', __("Any"), -1, true, 0, false, __('WO Status') );

	$priorities = get_priorities();
	$table->data[1][1] = print_select ($priorities, 'search_priority', $search_priority, '', __("Any"), -1, true, 0, false, __('Priority') );
	
	$avatar = get_db_value ('avatar', 'tusuario', 'id_usuario', $config["id_user"]);
	if (!$avatar)
		$avatar = "avatar1";
	
Ejemplo n.º 19
0
        echo '<div style="width: ' . $table->width . '; text-align: right;">';
        print_submit_button(__('Add field'), 'create_btn', false, 'class="sub create"', false);
        echo '</div>';
        echo "</form>";
        $table_sort->class = 'search-table';
        $table_sort->width = '99%';
        $table_sort->colspan[0][0] = 3;
        $table_sort->size = array();
        $table_sort->size[0] = '25%';
        $table_sort->size[1] = '25%';
        $table_sort->size[2] = '25%';
        $table_sort->size[3] = '25%';
        $table_sort->data[0][0] = "<b>" . __("Sort items") . "</b>";
        $table_sort->data[1][0] = __('Sort selected items from position: ');
        $table_sort->data[1][1] = print_select(array('before' => __('Move before to'), 'after' => __('Move after to')), 'move_to', '', '', '', '0', true);
        $table_sort->data[1][2] = print_input_text_extended('position_to_sort', 1, 'text-position_to_sort', '', 3, 10, false, "only_numbers('position_to_sort');", '', true);
        $table_sort->data[1][2] .= print_input_hidden('ids_items_to_sort', '', true);
        $table_sort->data[1][3] = print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
        echo "<form action='index.php?sec=incidents&sec2=operation/incidents/type_detail&sort_items=1&id=" . $id . "'\n\t\t\tmethod='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
        print_table($table_sort);
        echo "</form>";
    }
    //LISTADO GENERAL
} else {
    $search_text = (string) get_parameter('search_text');
    $where_clause = '';
    if ($search_text != "") {
        $where_clause .= sprintf('WHERE name LIKE "%%%s%%"', $search_text);
    }
    $table->width = '99%';
    $table->class = 'search-table';
Ejemplo n.º 20
0
$table->width = '100%';
$table->class = 'search-table-button';
$table->id = "incident-editor";
$table->size = array ();
$table->size[0] = '430px';
$table->size[1] = '';
$table->size[2] = '';
$table->head = array();
$table->style = array();
$table->data = array ();
$table->cellspacing = 2;
$table->cellpadding = 2;

//~ if (($has_permission && (!isset($blocked_incident))) || (give_acl ($config['id_user'], $id_grupo, "SI") && (!isset($blocked_incident)))) {
if (($has_permission && (!$blocked_incident)) || (give_acl ($config['id_user'], $id_grupo, "SI") && (!$blocked_incident))) {
	$table->data[0][0] = print_input_text_extended ('titulo', $titulo, '', '', 55, 100, false, '', "style='width:300px;'", true, false, __('Title'));
} else {
	$table->data[0][0] = print_label (__('Title'), '', '', true, $titulo);
}

//Get group if was not defined
if($id_grupo==0) {
	$id_grupo_incident = get_db_value("id_grupo", "tusuario_perfil", "id_usuario", $config['id_user']);
	
	//If no group assigned use ALL by default
	if (!$id_grupo_incident) {
		$id_grupo_incident = 1;
	}
	
} else {
	$id_grupo_incident = $id_grupo;
Ejemplo n.º 21
0
        process_sql($sql);
    }
}
if ($id_user != $config["id_user"] and give_acl($config["id_user"], 0, "PM") != 1) {
    $id_user = $config["id_user"];
}
$sql = "SELECT ttask.id, ttask.name, tproject.name, ttask.completion, tproject.id, ttask.id, ttask.priority FROM trole_people_task, ttask, tproject WHERE trole_people_task.id_user = '******' AND trole_people_task.id_task = ttask.id AND ttask.id_project = tproject.id AND tproject.disabled = 0 AND ttask.completion < 100 ORDER BY tproject.name DESC";
echo "<h1>" . __('Global task assignment') . " " . __('For user') . " '" . $id_user . "' " . print_user_avatar($id_user, true, true) . "</h1>";
if (give_acl($config["id_user"], 0, "PM")) {
    echo "<form id='form-user_task_assignment' name='xx' method=post action='index.php?sec=users&sec2=operation/users/user_task_assigment'>";
    echo "<table style='width: 99%;' class=search-table>";
    echo "<tr><td style='width: 150px;'>";
    // Show user
    //combo_user_visible_for_me ($config["id_user"], "id_user", 0, "PR");
    $src_code = print_image('images/group.png', true, false, true);
    echo print_input_text_extended('id_user', '', 'text-id_user', '', 15, 30, false, '', array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true, '', '');
    //. print_help_tip (__("Type at least two characters to search"), true);
    echo "<td>";
    print_submit_button(__('Go'), 'sub_btn', false, 'class="upd sub"');
    echo "<td>";
    echo "</form></table>";
}
echo "<table  class='listing' width=99%>";
echo "<th>" . __('Pri');
echo "<th>" . __('Project');
echo "<th>" . __('Task');
echo "<th>" . __('Progress');
echo "<th>" . __('Worked hours');
echo "<th>" . __('Last update');
echo "<th>" . __('Operation');
$result = mysql_query($sql);
Ejemplo n.º 22
0
function show_task_row($table, $id_project, $task, $level, $users)
{
    global $config;
    $id_task = $task['id'];
    // Second column (Task  name)
    $prefix = '';
    for ($i = 0; $i < $level; $i++) {
        $prefix .= '<img src="images/small_arrow_right_green.gif" style="position: relative; top: 5px;"> ';
    }
    echo "<td>";
    echo $prefix . print_input_text("name_" . $id_task, $task['name'], "", 40, 0, true);
    echo "</td>";
    // Thrid column (Owner)Completion
    echo "<td style='text-align:center;'>";
    $owners = get_db_value('COUNT(DISTINCT(id_user))', 'trole_people_task', 'id_task', $task['id']);
    if ($owners > 1) {
        echo combo_users_task($task['id'], 1, true);
        echo ' ';
        echo $owners;
    } else {
        $owner_id = get_db_value('id_user', 'trole_people_task', 'id_task', $task['id']);
        print_select($users, "owner_" . $id_task, $owner_id, '', '', 0, false, 0, true, false, false, 'width: 90px');
    }
    echo "</td>";
    // Fourth column (Start date)
    echo "<td style='text-align:center;'>";
    print_input_text_extended("start_" . $id_task, $task['start'], "start_" . $id_task, '', 7, 15, 0, '', 'style="font-size:9px;"');
    echo "</td>";
    // Fifth column (End date)
    echo "<td style='text-align:center;'>";
    print_input_text_extended("end_" . $id_task, $task['end'], "end_" . $id_task, '', 7, 15, 0, '', 'style="font-size:9px;"');
    echo "</td>";
    //Worked time based on workunits
    $worked_time = get_task_workunit_hours($id_task);
    echo "<td style='text-align:left;'>" . $worked_time . "</td>";
    // Sixth column (Delay)
    //If task was completed delay is 0
    if ($task['completion']) {
        $delay = 0;
    } else {
        //If was not completed check for time delay from end to now
        $end = strtotime($task['end']);
        $now = time();
        $a_day_in_sec = 3600 * 24;
        if ($now > $end) {
            $diff = $now - $end;
            $delay = $diff / $a_day_in_sec;
            $delay = round($delay, 1);
        } else {
            $delay = 0;
        }
    }
    echo "<td style='text-align:left;'>" . $delay . "</td>";
    // Seventh column (Delay)
    //Task status
    /*
     * 0%-40% = Pending
     * 41%-90% = In process
     * 91%-99% = Completed
     * 100% = Verified
     * 
     */
    //Check selected status
    $selected = 0;
    if ($task['completion'] < 40) {
        $selected = 0;
    } else {
        if ($task['completion'] < 90) {
            $selected = 45;
        } else {
            if ($task['completion'] < 100) {
                $selected = 95;
            } else {
                if ($task['completion'] == 100) {
                    $selected = 100;
                }
            }
        }
    }
    $fields = array();
    $fields[0] = __("Pending");
    $fields[45] = __("In process");
    $fields[95] = __("Completed");
    $fields[100] = __("Verified");
    echo "<td>";
    print_select($fields, "status_" . $id_task, $selected, '', '', 0, false, 0, true, false, false, "width: 100px;");
    echo "</td>";
    // Last Edit and del column. (Del) Only for PM flag
    //Create new task only if PM && TM flags or PW and project manager.
    echo "<td style='text-align:center;'>";
    echo '<a href="index.php?sec=projects&sec2=operation/projects/task_detail&id_project=' . $id_project . '&id_task=' . $task['id'] . '&operation=view">';
    echo '<img style="margin-right: 6px;" src="images/wrench.png">';
    echo '</a>';
    echo '<a href="index.php?sec=projects&sec2=operation/projects/task_planning&id_project=' . $id_project . '&delete=' . $task["id"] . '"
		onClick="if (!confirm(\'' . __('Are you sure?') . '\')) return false;"><img src="images/cross.png" /></a>';
    echo "</td>";
}
Ejemplo n.º 23
0
    $project_info .= '<span style="vertical-align:bottom">';
    $completion = format_numeric(calculate_project_progress($id_project));
    $project_info .= progress_bar($completion, 90, 20, $graph_ttl);
    $project_info .= "</span>";
}
$project_info .= "</td>";
$project_info .= "</tr>";
// start and end date
$project_info .= '<tr><td width="25%"><b>' . __('Start') . ' </b><br>';
$project_info .= print_input_text('start_date', $start_date, '', 10, 20, true);
$project_info .= '<td width="25%"><b>' . __('End') . ' </b><br>';
$project_info .= print_input_text('end_date', $end_date, '', 10, 20, true);
$id_owner = get_db_value('id_owner', 'tproject', 'id', $id_project);
$project_info .= '<td width="25%">';
$project_info .= "<b>" . __('Project manager') . " </b><br>";
$project_info .= print_input_text_extended('id_owner', $owner, 'text-id_owner', '', 10, 20, false, '', '', true, '', '');
$project_info .= '<td width="25%"><b>';
$project_info .= __('Project group') . "</b><br>";
if (!$clean_output) {
    $project_info .= print_select_from_sql("SELECT * from tproject_group ORDER BY name", "id_project_group", $id_project_group, "", __('None'), '0', true, false, true, false);
} else {
    $project_info .= get_db_value("name", "tproject_group", "id", $id_project_group);
}
// CC
$project_info .= '<tr><td class="datos" colspan=3><b>' . __('CC') . print_help_tip(__("Email to notify changes in workunits"), true) . ' </b><br>';
$project_info .= '<input type="text" name="cc" size=70 value="' . $cc . '">';
// Description
$project_info .= "<tr><td colspan=4><b>" . __("Description") . "</b><br>";
$project_info .= '<textarea name="description" style="height: 40px;">';
$project_info .= $description;
$project_info .= "</textarea></td></tr>";
Ejemplo n.º 24
0
function print_company_autocomplete_input($parameters)
{
    if (isset($parameters['input_name'])) {
        $input_name = $parameters['input_name'];
    }
    $input_value = '';
    $company_name = '';
    if (isset($parameters['input_value'])) {
        $input_value = $parameters['input_value'];
        $company_name = get_db_value("name", "tcompany", "id", $input_value);
        if (!$company_name) {
            $company_name = "";
        }
    }
    if (isset($parameters['input_id'])) {
        $input_id = $parameters['input_id'];
    }
    $return = false;
    if (isset($parameters['return'])) {
        $return = $parameters['return'];
    }
    //$input_size = 15;
    if (isset($parameters['size'])) {
        $input_size = $parameters['size'];
    }
    //$input_maxlength = 50;
    if (isset($parameters['maxlength'])) {
        $input_maxlength = $parameters['maxlength'];
    }
    $title = '';
    if (isset($parameters['title'])) {
        $title = $parameters['title'];
    }
    $help_message = "Type at least two characters to search";
    if (isset($parameters['help_message'])) {
        $help_message = $parameters['help_message'];
    }
    $return_help = true;
    if (isset($parameters['return_help'])) {
        $return_help = $parameters['return_help'];
    }
    $filter = "";
    if (isset($parameters['filter'])) {
        $filter = $parameters['filter'];
    }
    $attributes = 'class="company_autocomplete"';
    $html = "";
    $html .= print_input_text_extended("autocomplete_" . $input_name, $company_name, $input_id, '', $input_size, $input_maxlength, false, '', $attributes, true, '', __($title)) . print_help_tip(__($help_message), $return_help);
    $html .= print_input_hidden($input_name, $input_value, true);
    if ($filter) {
        $html .= print_input_hidden("autocomplete_" . $input_name . "_filter", $filter, true);
    }
    if ($return) {
        return $html;
    } else {
        echo $html;
    }
}
Ejemplo n.º 25
0
$table->data[0][0] = print_input_text_extended ('name', $name, '', '', 40, 240, false, '', "style='width:300px;'", true, false, __('Name'));

$table->data[0][1] = print_select (get_priorities (), 'priority', $priority,
	'', '', '', true, false, false, __('Priority'));

if ($project_permission['manage'] || $operation == "view") {
	$combo_none = __('None');
} else {
	$combo_none = false;
}

$table->data[0][2] = combo_task_user_manager ($config['id_user'], $parent, true, __('Parent'), 'parent', $combo_none, false, $id_project, $id_task);

$table->data[1][0] = print_input_text_extended ('cc', $cc, '', '', 40,
			240, false, '', "style='width:300px;'", true, false, 
				__('CC') . print_help_tip (__("Email to notify changes in workunits"), true));
if(!isset($periodicity)){
	$periodicity = "";
}
$table->data[1][1] = print_select (get_periodicities (), 'periodicity', $periodicity, '', __('None'), 'none', true, false, false, __('Recurrence'));

$table->data[1][2] = print_checkbox_extended ('count_hours', 1, $count_hours,
		false, '', '', true, __('Completion based on hours') . 
		print_help_tip (__("Calculated task completion using workunits inserted by project members, if not it uses Completion field of this form"), true));

$table->data[2][0] = print_input_text ('start_date', $start, '', 8, 15, true, __('Start'));
$table->data[2][1] = print_input_text ('end_date', $end, '', 8, 15, true, __('End'));