Example #1
0
 } else {
     $table->data[2][1] = print_select($companies, 'inventory_companies', NULL, '', '', '', true, false, false, __('Associated companies'));
     $table->data[2][2] = print_select($users, 'inventory_users', NULL, '', '', '', true, false, false, __('Associated users'));
 }
 $objects_type = get_object_types();
 if ($id_object_type == 0) {
     $disabled = false;
 } else {
     $disabled = true;
 }
 if ($write_permission || !$id) {
     $table->data[3][0] = print_label(__('Object type'), '', '', true);
     $table->data[3][0] .= print_select($objects_type, 'id_object_type', $id_object_type, 'show_fields();', 'Select', '', true, 0, true, false, $disabled);
 } else {
     $object_name = get_db_value('name', 'tobject_type', 'id', $id_object_type);
     $table->data[3][0] = print_label(__('Object type'), '', '', true, $object_name);
     //show object hidden
     echo '<div id="show_object_fields_hidden" style="display:none;">';
     print_input_text('show_object_hidden', 1);
     echo '</div>';
     //id_object_type hidden
     echo '<div id="id_object_type_hidden" style="display:none;">';
     print_input_text('id_object_type_hidden', $id_object_type);
     echo '</div>';
 }
 $table->data[3][1] = print_input_text('receipt_date', $receipt_date, '', 15, 15, true, __('Receipt date'));
 $table->data[3][2] = print_input_text('issue_date', $issue_date, '', 15, 15, true, __('Removal date'));
 /* Fourth row */
 $table->colspan[4][0] = 3;
 $table->data[4][0] = "";
 /* Fifth row */
Example #2
0
	foreach ( $tax as $key => $campo) { 
		$result = $result + $campo;
		$contador++;
	}
	$tax = $result;
	$irpf = get_invoice_irpf($id_invoice);
	//~ Descuento sobre el total
	$before_amount = $amount * ($discount_before/100);
	$total_before = round($amount - $before_amount, 2);
	//~ Se aplica sobre el descuento los task 
	$tax_amount = $total_before * ($tax/100);
	//~ Se aplica sobre el descuento el irpf
	$irpf_amount = $total_before * ($irpf/100);
	$total = round($total_before + $tax_amount - $irpf_amount, 2);
	$table->data[15][0] = print_label(__('Total amount: ').format_numeric($total,2).' '.$invoice['currency'], 'total_amount', 'text', true);
	$table->data[15][1] = print_label(__('Total amount without taxes or discounts: ').format_numeric($amount,2).' '.$invoice['currency'], 'total_amount_without_taxes', 'text', true);
}


$table->colspan[16][0] = 2;
$table->data[16][0] = print_textarea ('description', 5, 40, $description, '', true, __('Description'));

$table->colspan[17][0] = 2;
$table->data[17][0] = print_textarea ('internal_note', 5, 40, $internal_note, '', true, __('Internal note'));

echo '<form id="form-invoice" method="post" enctype="multipart/form-data"
action="index.php?sec=customers&sec2=operation/companies/company_detail
&view_invoice=1&op=invoices&id_invoice='.$id_invoice.'">';

print_table ($table);
Example #3
0
	$table->data[1][0] .= "<input type='text' name='min_response' id='text-min_response' value='$min_response' size='5' maxlenght='100' onChange='hours_to_dms(\"min\")'>";
		
	$min_response_time = incidents_hours_to_dayminseg ($min_response);
	$table->data[1][0] .= print_input_text ('min_response_time', $min_response_time, '',
		7, 100, true, '', true);

	$table->data[1][1] = print_label(__('Max. resolution time (in hours)'), '', 'text', true);
	$table->data[1][1] .= "<input type='text' name='max_response' id='text-max_response' value='$max_response' size='5' maxlenght='100' onChange='hours_to_dms(\"max\")'>";
	$max_response_time = incidents_hours_to_dayminseg ($max_response);
	$table->data[1][1] .= print_input_text ('max_response_time', $max_response_time, '',
		7, 100, true, '', true);

	$table->data[1][2] = print_input_text ("max_incidents", $max_incidents, '',
		5, 100, true, __('Max. tickets at the same time'));

	$table->data[1][3] = print_label(__('Max. ticket inactivity (in hours)'), '', 'text', true);
	$table->data[1][3] .= "<input type='text' name='max_inactivity' id='text-max_inactivity' value='$max_inactivity' size='5' maxlenght='100' onChange='hours_to_dms(\"inactivity\")'>";
	$max_inactivity_time = incidents_hours_to_dayminseg ($max_inactivity);
	$table->data[1][3] .= print_input_text ('max_inactivity_time', $max_inactivity_time, '',
		7, 100, true, '', true);
		

	$table->data[2][0] = print_input_text ('time_from', $time_from, '',
		5, 10, true, __('Start hour to compute SLA'));
	$table->data[2][1] = print_input_text ('time_to', $time_to, '',
		5, 10, true, __('Last hour to compute SLA'));		
		
	$table->data[2][2] = print_checkbox ('five_daysonly', 1 ,$five_daysonly, true, __('Disable SLA on weekends'));

	$table->data[2][3] = print_checkbox ('no_holidays', 1 ,$no_holidays, true, __('Disable SLA on holidays'));
		//field object types
		$select_object = '<div class = "divform">';
			$select_object .= '<table class="search-table"><tr><td>';
				$objects_type = get_object_types ();
				$objects_type[-1] = __('All');
				$select_object .= print_label (__('Object type'), '','',true);
				$select_object .= print_select($objects_type, 'id_object_type_search', $params['id_object_type_search'], 'change_object_type();', '', '', true, 4, false, false, false, '');
			$select_object .= '</td></tr></table>';
		$select_object .= '</div>';
		
		print_container_div("inventory_type_object",__("Select type object").print_help_tip (__("Select ALL to see all objects"), true),$select_object, 'open', false, false);

		//field label object types
		$select_label_object = '<div class = "divform" id = "pr">';
			$select_label_object .= '<table class="search-table"><tr><td>';
				$select_label_object .= print_label (__('Object fields').'<span id="object_fields_select_all"><a href="javascript: select_all_object_field()" >'.__('Select all').'</a><span>', '','',true);
				$select_label_object .= '<div id = "object_fields_search_check" class="div_multiselect" >';
				//checkbox id
				if ($params['object_fields'][0]){
					$select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[0]" checked value="id" id="id"><label for="id">'.__('ID').'</label>';
				} else {
					$select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[0]" value="id" id="id"><label for="id">'.__('ID').'</label>';
				}

				//checkbox name
				if ($params['object_fields'][1]){	
					$select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[1]" checked value="name" id="name"><label for="name">'.__('Name').'</label>';
				} else {
					$select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[1]" value="name" id="name"><label for="name">'.__('Name').'</label>';
				}
Example #5
0
    if ($associated_user != '') {
        $sql_search .= " AND tinventory.id IN (SELECT id_inventory FROM tinventory_acl WHERE `type`='user' AND id_reference='{$associated_user}')";
        $sql_search_count .= " AND tinventory.id IN (SELECT id_inventory FROM tinventory_acl WHERE `type`='user' AND id_reference='{$associated_user}')";
        $params .= "&associated_user={$associated_user}";
    }
}
if (!$clean_output) {
    echo '<form id="tree_search" method="post" action="index.php?sec=inventory&sec2=operation/inventories/inventory">';
    $table_search->class = 'search-table';
    $table_search->width = '98%';
    $table_search->data = array();
    $table_search->data[0][0] = print_input_text('search_free', $search_free, '', 40, 128, true, __('Search'));
    $objects_type = get_object_types();
    $table_search->data[0][1] = print_label(__('Object type'), '', '', true);
    $table_search->data[0][1] .= print_select($objects_type, 'id_object_type_search', $id_object_type, 'show_type_fields();', 'Select', '', true, 0, true, false, false, 'width: 200px;');
    $table_search->data[0][2] = print_label(__('Object fields'), '', '', true);
    $table_search->data[0][2] .= print_select($object_fields, 'object_fields_search[]', '', '', 'Select', '', true, 4, true, false, false, 'width: 200px;');
    $params_assigned['input_id'] = 'text-owner';
    $params_assigned['input_name'] = 'owner';
    $params_assigned['input_value'] = $owner;
    $params_assigned['title'] = 'Owner';
    $params_assigned['return'] = true;
    $table_search->data[1][0] = user_print_autocomplete_input($params_assigned);
    $contracts = get_contracts();
    $manufacturers = get_manufacturers();
    $table_search->data[1][1] = print_select($contracts, 'id_contract', $id_contract, '', __('None'), 0, true, false, false, __('Contract'), '', 'width: 200px;');
    $table_search->data[1][2] = print_select($manufacturers, 'id_manufacturer', $id_manufacturer, '', __('None'), 0, true, false, false, __('Manufacturer'), '', 'width: 200px;');
    $table_search->data[1][3] = print_checkbox_extended('last_update', 1, $last_update, false, '', '', true, __('Last updated'));
    $buttons = '<div style=" text-align: right;">';
    $buttons .= print_input_hidden('search', 1, true);
    $buttons .= print_input_hidden('mode', $mode, true);
Example #6
0
function combo_project_user($actual, $id_user, $disabled = 0, $return = false)
{
    $output = '';
    if ($disabled) {
        $output .= print_label(__('Project'), '', '', true);
        $name = get_db_value('name', 'tproject', 'id', $actual);
        if ($name === false) {
            $name = __('N/A');
        }
        $output .= $name;
        if ($return) {
            return $output;
        }
        echo $output;
        return;
    }
    $values = array();
    $values[0] = __('N/A');
    $sql = sprintf('SELECT tproject.id, tproject.name as pname 
			FROM tproject, ttask, trole_people_task
			WHERE ttask.id_project = tproject.id AND tproject.disabled = 0 AND ttask.id = trole_people_task.id_task
			AND trole_people_task.id_user = "******"
			ORDER BY pname', $id_user);
    $projects = get_db_all_rows_sql($sql);
    if ($projects === false) {
        $projects = array();
    }
    foreach ($projects as $project) {
        $values[$project['id']] = $project['pname'];
    }
    $output = print_select($values, 'id_project', $actual, '', '', 0, true, false, false, __('Project'));
    if ($return) {
        return $output;
    }
    echo $output;
    return;
}
        }
    }
}
if ($id_field) {
    $field_data = get_db_row_filter('tuser_field', array('id' => $id_field));
    $label = $field_data['label'];
    $type = $field_data['type'];
    $combo_value = $field_data['combo_value'];
}
echo '<h1>' . __('User fields editor') . '</h1>';
$table->width = "99%";
$table->class = "search-table-button";
$table->data = array();
$table->data[0][0] = print_input_text('label', $label, '', 45, 100, true, __('Field name'));
$types = array('text' => __('Text'), 'textarea' => __('Textarea'), 'combo' => __('Combo'));
$table->data[0][1] = print_label(__("Type"), "label-id", 'text', true);
$table->data[0][1] .= print_select($types, 'type', $type, '', __('Select type'), '0', true);
$table->data['id_combo_value'][0] = print_input_text('combo_value', $combo_value, '', 45, 100, true, __('Combo value')) . print_help_tip(__("Set values separated by comma"), true);
if (!$id_field) {
    $button = print_input_hidden('add_field', 1, true);
    $button .= print_submit_button(__('Create'), 'create_btn', false, 'class="sub next"', true);
} else {
    $button = print_input_hidden('update_field', 1, true);
    $button .= print_input_hidden('add_field', 0, true);
    $button .= print_input_hidden('id_field', $id_field, true);
    $button .= print_submit_button(__('Update'), 'update_btn', false, 'class="sub upd"', true);
}
$table->data['button'][0] = $button;
$table->colspan['button'][0] = 3;
echo '<form method="post" action="index.php?sec=users&sec2=godmode/usuarios/user_field_editor">';
print_table($table);
Example #8
0
$a = round ($hours);
$b = round (get_task_workunit_hours ($id_task));

$image = histogram_2values($a, $b, $labela, $labelb);
$table_advanced->data[0][1] = print_label (__('Estimated hours'), '', '', true, $image);

$labela = __('Total');
$labelb = __('Imp');
$a = round (task_workunit_cost ($id_task, 0));
$b = round (task_workunit_cost ($id_task, 1));
$image = histogram_2values($a, $b, $labela, $labelb);
$table_advanced->data[0][1] .= print_label (__('Imputable estimation'), '', '', true, $image);	

$labela = __('Est.');
$labelb = __('Real');
$a = $estimated_cost;
$b = round (task_workunit_cost ($id_task, 1));
$image = histogram_2values($a, $b, $labela, $labelb);
$table_advanced->data[0][1] .= print_label (__('Cost estimation'), '', '', true, $image);	

//Workload distribution chart
$image = graph_workunit_task (200, 170, $id_task, true);
$image = '<div class="graph_frame">' . $image . '</div>';
$table_advanced->data[0][2] = print_label (__('Workunit distribution'), '', '', true, $image);

$table->colspan['row_task_stats'][0] = 3;
$table->data['row_task_stats'][0] = print_container_div('task_stats', __('Task statitics'), print_table($table_advanced, true), 'open', true, true);	

print_table ($table);

?>
Example #9
0
	
	$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); 
	
	//~ $table_advanced->class = 'search-table';
	//~ $table_advanced->style = array ();
	//~ $table_advanced->style[0] = 'font-weight: bold;';
	//~ $table_advanced->data = array ();
	//~ $table_advanced->width = "99%";
	//~ $table_advanced->colspan = array();
	//~ $table_advanced->colspan[1][1] = 2;
	$table_advanced = '<tr>';
	$params = array();
	$params['input_id'] = 'id_company_search';
	$params['input_name'] = 'id_company_search';
	$params['input_value'] = $id_company;
	$params['title'] = __('Managed by');
Example #10
0
} 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('start_date', $start, '', 15, 15, true, __('Start'));
$table->data[1][1] = print_input_text('end_date', $end, '', 15, 15, true, __('End'));
$table->data[1][2] = print_select(get_periodicities(), 'periodicity', $periodicity, '', __('None'), 'none', true, false, false, __('Recurrence'));
$table->data[2][0] = print_input_text('hours', $hours, '', 5, 5, true, __('Estimated hours'));
$table->data[2][0] .= "&nbsp;&nbsp;<a href='javascript: show_calculation();'>" . print_image('images/play.gif', true, array('title' => __('Calculate hours'))) . "</a>";
$table->data[2][1] = print_input_text('estimated_cost', $estimated_cost, '', 7, 11, true, __('Estimated cost'));
$table->data[2][1] .= ' ' . $config['currency'];
$table->data[2][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[3][0] = print_input_text('cc', $cc, '', 60, 240, true, __('CC') . print_help_tip(__("Email to notify changes in workunits"), true));
$table->colspan[4][0] = 3;
$completion_label = __('Completion') . " <em>(<span id=completion>" . $completion . "%</span>)</em>";
$table->data[4][0] = print_label($completion_label, '', '', true, '<div id="slider" style="margin-top: 5px;"><div class="ui-slider-handle"></div></div>');
$table->data[4][0] .= print_input_hidden('completion', $completion, true);
//////TABLA ADVANCED
$table_advanced->width = '98%';
$table_advanced->class = 'search-table';
$table_advanced->size = array();
$table_advanced->size[0] = '33%';
$table_advanced->size[1] = '33%';
$table_advanced->size[2] = '33%';
$table_advanced->style = array();
$table_advanced->data = array();
$links_1 = projects_get_task_links($id_project, $id_task, 1);
$hint = print_help_tip(__("The task cannot start before all tasks in this section start"), true);
$table_advanced->data[0][0] = print_select($links_1, 'link_1', NULL, '', '', '', true, false, false, __('Start to start') . $hint);
$table_advanced->data[0][0] .= "&nbsp;&nbsp;<a href='javascript: show_task_link_selector(1," . $id_project . "," . $id_task . ");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced->data[0][0] .= "&nbsp;&nbsp;<a href='javascript: remove_link(1);'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
Example #11
0
    $output .= print_label(__('Serial number') . ': ', '', '', true, $filter['serial_number']) . '<br />';
}
if ($filter['part_number'] != '') {
    $output .= print_label(__('Part number') . ': ', '', '', true, $filter['part_number']) . '<br />';
}
if ($filter['ip_address'] != '') {
    $output .= print_label(__('IP address') . ': ', '', '', true, $filter['ip_address']) . '<br />';
}
if ($filter['id_building'] != 0) {
    $output .= print_label(__('Building') . ': ', '', '', true, get_db_value('name', 'tbuilding', 'id', $filter['id_building'])) . '<br />';
}
if ($filter['id_company'] != 0) {
    $output .= print_label(__('Company') . ': ', '', '', true, get_db_value('name', 'tcompany', 'id', $filter['id_company'])) . '<br />';
}
if ($filter['id_contract'] != 0) {
    $output .= print_label(__('Contract') . ': ', '', '', true, get_db_value('name', 'tcontract', 'id', $filter['id_contract'])) . '<br />';
}
$output .= '</div>';
echo '<div class="report_info" style="text-align: left; width: 95%">';
if ($output != '') {
    echo $output;
} else {
    echo __('All inventory');
}
echo '</div>';
// Build object tree
$tree = array();
$tree_root = array();
foreach ($inventories as $inventory) {
    $id = $inventory['id'];
    $id_parent = $inventory['id_parent'];
function print_field($field)
{
    // Container
    $html = "\t" . '<div class="field clearfix' . (isset($field['class']) ? ' ' . $field['class'] : ' ' . $field['name']) . (isset($field['error']) && $field['error'] != '' ? ' error' : '') . '">' . "\n";
    $labelHTML = '';
    $inputHTML = '';
    $errorHTML = '';
    // Label
    if (isset($field['label']) && $field['label'] != '') {
        $label = array();
        $label['label'] = $field['label'];
        if (isset($field['labelFor'])) {
            $label['labelFor'] = $field['labelFor'];
        } else {
            if (isset($field['id'])) {
                $label['labelFor'] = $field['id'];
            }
        }
        $label['labelClass'] = $field['type'] . '_label';
        if (isset($field['labelClass'])) {
            $label['labelClass'] .= ' ' . $field['labelClass'];
        }
        if (isset($field['hint'])) {
            $label['hint'] = $field['hint'];
        }
        if (isset($field['mandatory'])) {
            $label['mandatory'] = $field['mandatory'];
        }
        $labelHTML .= print_label($label);
    }
    if (isset($field['mandatory']) && $field['mandatory']) {
        if (isset($field['placeholder'])) {
            $field['placeholder'] .= ' *';
        }
        if (isset($field['label'])) {
            $field['label'] .= ' *';
        }
    }
    // Input element
    switch ($field['type']) {
        case 'hidden':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '');
            $inputHTML = print_input_hidden($input);
            break;
        case 'text':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_text($input);
            break;
        case 'textarea':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_textarea($input);
            break;
        case 'xhtml_textarea':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_xhtml_textarea($input);
            break;
        case 'select':
            if (!$field['mandatory']) {
                $field['options'] = array('' => 'Select from the list') + $field['options'];
            }
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_select($input);
            break;
        case 'multiselect':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_multiselect($input);
            break;
        case 'checkbox':
            foreach ($field['options'] as $option => $label) {
                $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'checked' => isset($field['checked']) && $field['checked'] ? TRUE : FALSE, 'value' => $option, 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
                $inputHTML = print_input_checkbox($input);
            }
            break;
        case 'multicheckbox':
            foreach ($field['options'] as $option => $label) {
                $input = array('name' => $field['name'] . '[]', 'id' => (isset($field['id']) ? $field['id'] : '') . '_' . $option, 'label' => $label, 'checked' => isset($field['value']) && $field['value'] != '' && in_array($option, $field['value']) ? TRUE : FALSE, 'value' => $option, 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
                $inputHTML .= print_input_multicheckbox($input);
            }
            break;
        case 'radio':
            foreach ($field['options'] as $option => $label) {
                $input = array('name' => $field['name'], 'id' => (isset($field['id']) ? $field['id'] : '') . '_' . $option, 'label' => $label, 'checked' => isset($field['value']) && $field['value'] == $option ? TRUE : FALSE, 'value' => $option, 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
                $inputHTML .= print_input_radio($input);
            }
            break;
        case 'image_upload':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_image_upload($input);
            break;
        case 'file_upload':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_file_upload($input);
            break;
        case 'gallery':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'attachs' => $field['attachs']);
            $inputHTML = print_input_gallery($input);
            break;
        case 'password':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_password($input);
            break;
        case 'linked_content':
            if (!$field['mandatory']) {
                $field['options'] = array('' => 'Select from the list') + $field['options'];
            }
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_select($input);
            break;
        case 'multiple_linked_content':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_multiselect($input);
            break;
        case 'date':
        case 'datetime':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'class' => (isset($field['class']) ? $field['class'] : '') . ' ' . $field['type'] . 'picker');
            $inputHTML = print_input_text($input);
            break;
    }
    // Error
    if (isset($field['showError']) && $field['showError'] && isset($field['error']) && $field['error']) {
        $errorHTML = print_error($field['error']);
    }
    switch ($field['type']) {
        case 'text':
        case 'textarea':
        case 'xhtml_textarea':
        case 'select':
        case 'multiselect':
        case 'radio':
        case 'password':
        case 'date':
        case 'datetime':
        case 'multicheckbox':
        case 'linked_content':
        case 'multiple_linked_content':
            $html .= "\t\t" . $labelHTML . "\n\t\t" . $inputHTML . "\n\t" . $errorHTML;
            break;
        case 'checkbox':
            $html .= "\t\t" . $inputHTML . "\n\t\t" . $labelHTML . "\n\t" . $errorHTML;
            break;
        case 'file_upload':
            $html .= '<div class="file_upload">' . $labelHTML . $inputHTML . $errorHTML . '</div>' . print_file_preview($field['attach'], $field['name']);
            break;
        case 'image_upload':
            $html .= '<div class="image_upload">' . $labelHTML . $inputHTML . $errorHTML . '</div>' . print_image_preview($field['attach'], $field['name']);
            break;
        case 'gallery':
            $html .= '<div class="clearfix">' . '<div class="image_upload gallery">' . $labelHTML . $inputHTML . $errorHTML . '</div>' . print_gallery_preview($field['attachs'], $field['name']) . '</div>';
            break;
        case 'hidden':
            $html .= "\t\t" . $inputHTML . "\n\t";
            break;
    }
    $html .= '</div>' . "\n";
    return $html;
}
Example #13
0
    $res = process_sql($sql);
    $valid = true;
    if ($res) {
        $valid = false;
    }
    echo json_encode(array("result" => $valid));
    exit;
}
if ($get_calculator) {
    $days = get_parameter('days', 0);
    $people = get_parameter('people', 0);
    $hours_per_day = $config['hours_perday'];
    $total = $days * $people * $hours_per_day;
    $table->width = "99%";
    $table->class = "search-table-button";
    $table->data = array();
    $table->colspan = array();
    $table->colspan[3][1] = 2;
    $table->data[0][0] = print_label(__('Days'), '', 'text', true);
    $table->data[0][1] = print_input_text('days', $days, '', 15, 15, true);
    $table->data[1][0] = print_label(__('People'), '', 'text', true);
    $table->data[1][1] = print_input_text('people', $people, '', 15, 15, true);
    $table->data[2][0] = print_label(__('Total hours'), '', 'text', true);
    $table->data[2][1] = print_input_text('total', $total, '', 15, 15, true, '', true);
    $table->data[3][1] = print_submit_button(__('Set value'), 'set_value', false, 'class="sub upd"', true);
    $table->data[3][1] .= print_submit_button(__('Calculate'), 'calculate', false, 'class="sub search"', true);
    '<form id="calculator_form">';
    print_table($table, false);
    '</form>';
    exit;
}
Example #14
0
function combo_project_user($actual, $id_user, $disabled = 0, $return = false, $full_report = false, $start_date = null, $end_date = null, $user_id = false)
{
    $output = '';
    global $config;
    if ($disabled) {
        $output .= print_label(__('Project'), '', '', true);
        $name = get_db_value('name', 'tproject', 'id', $actual);
        if ($name === false) {
            $name = __('N/A');
        }
        $output .= $name;
        if ($return) {
            return $output;
        }
        echo $output;
        return;
    }
    $values = array();
    $values[0] = __('N/A');
    if ($full_report == 100) {
        if ($user_id != "") {
            $user_search = " AND tworkunit.id_user = '******'";
        } else {
            $user_search = "";
        }
        if (dame_admin($config["id_user"]) or $config["id_user"] == $user_id) {
            $sql = sprintf('SELECT tproject.id as id, tproject.name as name
				FROM tproject, ttask, tworkunit_task, tworkunit
				WHERE tworkunit_task.id_workunit = tworkunit.id ' . $user_search . '
				AND tworkunit_task.id_task = ttask.id
				AND ttask.id_project = tproject.id
				AND tworkunit.timestamp >= "%s"
				AND tworkunit.timestamp <= "%s"
				GROUP BY tproject.name', $start_date, $end_date);
        } else {
            $sql = sprintf('SELECT tproject.id as id, tproject.name as name
				FROM tproject, ttask, tworkunit_task, tworkunit
				WHERE tworkunit_task.id_workunit = tworkunit.id ' . $user_search . '
				AND tworkunit_task.id_task = ttask.id
				AND ttask.id_project = tproject.id
				AND tworkunit.timestamp >= "%s"
				AND tworkunit.timestamp <= "%s"
				AND tproject.id_owner = "%s" 
				GROUP BY tproject.name', $start_date, $end_date, $config["id_user"]);
        }
    } else {
        $sql = sprintf('SELECT tproject.id, tproject.name as name 
			FROM tproject, ttask, trole_people_task
			WHERE ttask.id_project = tproject.id AND tproject.disabled = 0 AND ttask.id = trole_people_task.id_task
			AND trole_people_task.id_user = "******"
			ORDER BY pname', $id_user);
    }
    $projects = get_db_all_rows_sql($sql);
    if ($projects === false) {
        $projects = array();
    }
    foreach ($projects as $project) {
        $values[$project['id']] = $project['name'];
    }
    $output = print_select($values, 'id_project', $actual, '', '', 0, true, false, false, __('Project'));
    if ($return) {
        return $output;
    }
    echo $output;
    return;
}
function form_inventory($params)
{
    //field label object types
    $select_label_object = '<div class = "divform" id = "pr">';
    $select_label_object .= '<table class="search-table"><tr><td>';
    $select_label_object .= print_label(__('Object fields') . '<span id="object_fields_select_all"><a href="javascript: select_all_object_field()" >' . __('Select all') . '</a><span>', '', '', true);
    $select_label_object .= '<div id = "object_fields_search_check" class="div_multiselect" >';
    //checkbox id
    if ($params['object_fields'][0]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[0]" checked value="id" id="id"><label for="id">' . __('ID') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[0]" value="id" id="id"><label for="id">' . __('ID') . '</label>';
    }
    //checkbox name
    if ($params['object_fields'][1]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[1]" checked value="name" id="name"><label for="name">' . __('Name') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[1]" value="name" id="name"><label for="name">' . __('Name') . '</label>';
    }
    //checkbox owner
    if ($params['object_fields'][2]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[2]" checked value="owner" id="owner"><label for="owner">' . __('Owner') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[2]" value="owner" id="owner"><label for="owner">' . __('Owner') . '</label>';
    }
    //checkbox id_parent
    if ($params['object_fields'][3]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[3]" checked value="id_parent" id="id_parent"><label for="id_parent">' . __('Parent object') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[3]" value="id_parent" id="id_parent"><label for="id_parent">' . __('Parent object') . '</label>';
    }
    //checkbox id_object_type
    if ($params['object_fields'][4]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[4]" checked value="id_object_type" id="id_object_type"><label for="id_object_type">' . __('Object type') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[4]" value="id_object_type" id="id_object_type"><label for="id_object_type">' . __('Object type') . '</label>';
    }
    //checkbox manufacturer
    if ($params['object_fields'][5]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[5]" checked value="id_manufacturer" id="id_manufacturer"><label for="id_manufacturer">' . __('Manufacturer') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[5]" value="id_manufacturer" id="id_manufacturer"><label for="id_manufacturer">' . __('Manufacturer') . '</label>';
    }
    //checkbox id_contract
    if ($params['object_fields'][6]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[6]" checked value="id_contract" id="id_contract"><label for="id_contract">' . __('Contract') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[6]" value="id_contract" id="id_contract"><label for="id_contract">' . __('Contract') . '</label>';
    }
    //checkbox status
    if ($params['object_fields'][7]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[7]" checked value="status" id="status"><label for="status">' . __('Status') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[7]" value="status" id="status"><label for="status">' . __('Status') . '</label>';
    }
    //checkbox status
    if ($params['object_fields'][8]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[8]" checked value="receipt_date" id="receipt_date"><label for="receipt_date">' . __('Receipt date') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[8]" value="receipt_date" id="receipt_date"><label for="receipt_date">' . __('Receipt date') . '</label>';
    }
    //checkbox status
    if ($params['object_fields'][9]) {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[9]" checked value="issue_date" id="issue_date"><label for="issue_date">' . __('Issue date') . '</label>';
    } else {
        $select_label_object .= '<input type="checkbox" class="checkbox_object_field" name="object_fields[9]" value="issue_date" id="issue_date"><label for="issue_date">' . __('Issue date') . '</label>';
    }
    //checkbox custom fields
    if ($params['object_fields_custom']) {
        $i = 10;
        foreach ($params['object_fields_custom'] as $object) {
            if ($params['object_fields'][$i]) {
                $select_label_object .= '<input name="object_fields[' . $i . ']" checked class="checkbox_object_field" value="' . $object['id'] . '" type="checkbox" id="' . $object['id'] . '">';
            } else {
                $select_label_object .= '<input name="object_fields[' . $i . ']" class="checkbox_object_field" value="' . $object['id'] . '" type="checkbox" id="' . $object['id'] . '">';
            }
            $select_label_object .= '<label for="' . $object['id'] . '">' . $object['label'] . '</label>';
            $i++;
        }
    }
    $select_label_object .= '</div>';
    $select_label_object .= '</td></tr></table>';
    $select_label_object .= '</div>';
    echo $select_label_object;
}
Example #16
0
			$start_date = '';
		}
		
		if ($creator != $config["id_user"]){
			$table->data[4][0] = print_label (__("Start date"), '', 'input', true);
			$table->data[4][0] .= $start_date;
			$table->data[4][0] .= print_input_hidden ("start_date", $start_date, true);
		} else
			$table->data[4][0] = print_input_text ('start_date', $start_date , '', 25, 25, true, __('Start date'));
		
		if ($end_date == "0000-00-00 00:00:00"){
				$end_date = '';
		}

		if ($creator != $config["id_user"]){
			$table->data[4][1] = print_label (__("Deadline"), '', 'input', true);
			if ($end_date == "")
				$table->data[4][1] .= __("None");
			else
				$table->data[4][1] .= $end_date;
			$table->data[4][1] .= print_input_hidden ("end_date", $end_date, true);
		} else 
			$table->data[4][1] = print_input_text ('end_date', $end_date , '', 25, 25, true, __('Deadline'));

		$table->data[5][0] = print_checkbox_extended ('email_notify', 1, $email_notify,
                false, '', '', true, __('Notify changes by email'));
                
		$table->data[6][0] = print_textarea ('description', 12, 50, $description, '', true, __('Description'));

		if ($operation == 'create') {
			$button = print_submit_button (__('Create'), 'crt', false, 'class="sub create"', true);
/**
 * Print a table with statistics of a list of inventories.
 *
 * @param array List of inventories to get stats.
 * @param bool Whether to return an output string or echo now (optional, echo by default).
 *
 * @return Inventories stats if return parameter is true. Nothing otherwise
 */
function print_inventory_stats($inventories, $return = false)
{
    $output = '';
    $total = sizeof($inventories);
    $inventory_incidents = 0;
    $inventory_opened = 0;
    foreach ($inventories as $inventory) {
        $incidents = get_incidents_on_inventory($inventory['id'], false);
        if (sizeof($incidents) == 0) {
            continue;
        }
        $inventory_incidents++;
        foreach ($incidents as $incident) {
            if ($incident['estado'] != 7 && $incident['estado'] != 6) {
                $inventory_opened++;
                break;
            }
        }
    }
    $incidents_pct = 0;
    if ($total != 0) {
        $incidents_pct = format_numeric($inventory_incidents / $total * 100);
        $incidents_opened_pct = format_numeric($inventory_opened / $total * 100);
    }
    $table->width = '50%';
    $table->class = 'float_left blank';
    $table->style = array();
    $table->style[1] = 'vertical-align: top';
    $table->rowspan = array();
    $table->rowspan[0][1] = 3;
    $table->data = array();
    $table->data[0][0] = print_label(__('Total objects'), '', '', true, $total);
    $data = array(__('With tickets') => $inventory_incidents, __('Without tickets') => $total - $inventory_incidents);
    $table->data[0][1] = pie3d_chart($config['flash_charts'], $data, 200, 150);
    $table->data[1][0] = print_label(__('Total objects with tickets'), '', '', true, $inventory_incidents . ' (' . $incidents_pct . '%)');
    $table->data[2][0] = print_label(__('Total objects with opened tickets'), '', '', true, $inventory_opened . ' (' . $incidents_opened_pct . '%)');
    $output .= print_table($table, true);
    if ($return) {
        return $output;
    }
    echo $output;
}
Example #18
0
 $table->colspan = array();
 $table->rowspan = array();
 $table->data = array();
 $table->colspan[0][0] = 2;
 $table->data[0][0] = print_input_text('entry_title', $entry['title'], '', 40, 100, true, __('Title'));
 $table->data[0][2] = print_checkbox('entry_public', $entry['public'], $entry['public'], true, __('Public'));
 if (!$entry['duration']) {
     $entry['duration'] = 0;
 }
 $table->data[1][0] = print_input_text('entry_duration', $entry['duration'], '', 6, 6, true, __('Duration in hours'));
 $alarms = array();
 $alarms[60] = __('One hour');
 $alarms[120] = __('Two hours');
 $alarms[240] = __('Four hours');
 $alarms[1440] = __('One day');
 $table->data[1][1] = print_label(__('Alarm'), 'entry_alarm', 'select', true);
 $table->data[1][1] .= html_print_select($alarms, 'entry_alarm', $entry['alarm'], '', __('None'), 0, true, false, false);
 $table->rowspan[1][2] = 2;
 $table->data[1][2] = html_print_entry_visibility_groups($config['id_user'], $entry['groups'], true);
 if (!$entry['timestamp']) {
     if (!$date) {
         $date = date('Y-m-d');
     }
     $time = date('H:i');
 } else {
     if (!$date) {
         $date = date('Y-m-d', $entry['timestamp']);
     }
     $result = explode(" ", $entry['timestamp']);
     $time = $result[1];
 }
Example #19
0
    $id_object_type = get_db_value_sql('SELECT id_object_type FROM tinventory WHERE id=' . $id_inventory);
    if ($id_object_type) {
        $object_fields = get_db_all_rows_sql("SELECT * FROM tobject_type_field WHERE id_object_type=" . $id_object_type);
        if ($object_fields == false) {
            $object_fields = array();
        }
        $table_info->class = 'list';
        $table_info->width = '98%';
        $table_info->data = array();
        $i = 0;
        foreach ($object_fields as $field) {
            $value = get_db_value_sql("SELECT data FROM tobject_field_data WHERE id_inventory=" . $id_inventory . " AND id_object_type_field=" . $field['id']);
            if ($value == "") {
                $value = "--";
            }
            $table_info->data[$i][0] = print_label($field['label'], '', '', true);
            $table_info->data[$i][1] = $value;
            $i++;
        }
        print_table($table_info);
        return;
    } else {
        echo "<b>" . __('No data to show') . "</b>";
        return;
    }
}
if ($change_owner) {
    $config['mysql_result_type'] = MYSQL_ASSOC;
    $id_name = get_parameter('id_name');
    $sql = "SELECT com.id, com.name FROM tcompany com, tusuario usr WHERE usr.id_company = com.id AND id_usuario='" . $id_name . "';";
    $name_company = get_db_all_rows_sql($sql);
            $params_assigned['title'] = __('Owner');
            $params_assigned['help_message'] = __("User assigned here is user that will be responsible to manage tickets. If you are opening a ticket and want to be resolved by someone different than yourself, please assign to other user");
            $params_assigned['return'] = true;
            $params_assigned['return_help'] = true;
            $ticket_editor .= user_print_autocomplete_input($params_assigned);
        } else {
            $ticket_editor .= print_label(__('Owner'), 'id_user', '', true, '<div id="plain-id_user">' . dame_nombre_real($owner) . '</div>');
        }
        $ticket_editor .= "</td>";
        $ticket_editor .= "</tr>";
        $ticket_editor .= "<tr>";
        $ticket_editor .= "<td>";
        if ($has_im) {
            $ticket_editor .= combo_incident_resolution($resolution, false, true, false, "");
        } else {
            $ticket_editor .= print_label(__('Resolution'), '', '', true, render_resolution($resolution));
        }
        $ticket_editor .= "</td>";
        $ticket_editor .= "<td>";
        $ticket_editor .= combo_incident_status($status, false, 0, true, false, "");
        $ticket_editor .= "</td>";
        $ticket_editor .= "<td>";
        $img = print_image("images/accept.png", true, array("title" => __("Update")));
        $ticket_editor .= "<a onfocus='JavaScript: this.blur()' href='javascript: setParams({$id});'>" . $img . "</a>";
        $ticket_editor .= "</td>";
        $ticket_editor .= "</tr>";
        $ticket_editor .= "</table>";
        $right_side .= print_container('ticket_editor', __('Quick edit'), $ticket_editor);
    }
}
// Incident dates
Example #21
0
 $table->size = array();
 $table->head = array();
 $table->style = array();
 $table->data = array();
 $table->colspan[2][1] = 2;
 $sql = "SELECT * FROM trole_people_project WHERE id_project = {$id_project}";
 $people = get_db_all_rows_sql($sql);
 if ($people === false) {
     $people = array();
 }
 $people_project = array();
 foreach ($people as $person) {
     $role_name = get_db_value('name', 'trole', 'id', $person['id_role']);
     $people_project[$person['id_user'] . '/' . $person['id_role']] = $person['id_user'] . ' / ' . $role_name;
 }
 $table->data[0][0] = print_label(__('People involved in project') . ' / ' . __('Role'), '', 'text', true);
 $table->data[1][0] = print_select($people_project, "people[]", '', '', '', 0, true, 10, false, false, false, 'width: 300px;');
 $table->data[2][1] = print_submit_button(__('Update'), 'upd_btn', false, 'class="sub next"', true);
 echo "<form id='form-project_people_manager' method='post' action='index.php?sec=projects&sec2=operation/projects/people_manager&id_project={$id_project}&id_task={$id_task}&action=insert_all'>";
 print_table($table);
 echo "</form>";
 echo '<br>';
 echo "<h4>" . __('Add other users') . "</h4>";
 echo "<form id='form-people_manager' method='post' action='index.php?sec=projects&sec2=operation/projects/people_manager&id_project={$id_project}&id_task={$id_task}&action=insert'>";
 echo "<table cellpadding=4 cellspacing=4 width=99% class='search-table-button'>";
 echo "<tr><td valign='top' class='datos2'>";
 echo __('Role');
 echo "<td valign='top' class='datos2'>";
 echo combo_roles();
 echo "<td valign='top' class='datos2'>";
 echo __('User');
Example #22
0
$table_advanced->style = array();
$table_advanced->data = array();
$table_advanced->colspan[1][1] = 2;
// Table for advanced controls
if ($editor) {
    $table_advanced->data[0][0] = print_label(__('Editor'), '', '', true, $editor);
} else {
    $table_advanced->data[0][0] = "&nbsp;";
}
if ($has_im && $create_incident) {
    $groups = get_user_groups($config['id_user'], "IW");
    $table_advanced->data[0][1] = print_select($groups, "id_group_creator", $id_grupo_incident, '', '', 0, true, false, false, __('Creator group'), $blocked_incident);
} elseif ($create_incident) {
    $table_advanced->data[0][1] = print_label(__('Creator group'), '', '', true, dame_nombre_grupo($id_grupo_incident));
} elseif ($id_group_creator) {
    $table_advanced->data[0][1] = print_label(__('Creator group'), '', '', true, dame_nombre_grupo($id_group_creator));
}
if ($has_im) {
    $table_advanced->data[0][2] = print_checkbox_extended('sla_disabled', 1, $sla_disabled, $blocked_incident, '', '', true, __('SLA disabled'));
    $table_advanced->data[1][0] = print_checkbox("email_notify_form", 1, $email_notify, true, __('Notify changes by email '), $blocked_incident);
} else {
    $table_advanced->data[0][2] = print_input_hidden('sla_disabled', 0, true);
    $table_advanced->data[1][0] = print_input_hidden('email_notify', 1, true);
}
$parent_name = $id_parent ? __('Ticket') . ' #' . $id_parent : __('None');
if ($has_im) {
    $table_advanced->data[3][0] = print_input_text('search_parent', $parent_name, '', 10, 100, true, __('Parent ticket'), $blocked_incident);
    $table_advanced->data[3][0] .= print_input_hidden('id_parent', $id_parent, true);
    if (!$blocked_incident) {
        $table_advanced->data[3][0] .= print_image("images/cross.png", true, array("onclick" => "clean_parent_field()", "style" => "cursor: pointer"));
    }
Example #23
0
	$table->data[2][0] .= print_help_tip (__('You can add several email addresses, separated by commas.'), true);
	$table->data[2][1] = print_input_text ('phone', $phone, '', 20, 40, true, __('Telephone'));
	$table->data[4][0] = print_select_from_sql ("SELECT id_language, name FROM tlanguage ORDER BY name",
		'language_code', $lang, '', __('Default'), '', true, false, false, __('Language'));

	$table->data[4][1] = "<b>".__('Total tickets opened'). "</b><br><input type=text readonly size=5 value='". get_db_sql ("SELECT COUNT(*) FROM tincidencia WHERE id_creator = '".$id_user."'"). "'>";

	$table->data[5][0] = print_textarea ('comments', 8, 55, $comments, '', true, __('Comments'));
} else {
	$email = ($email != '') ? $email : __('Not provided');
	$phone = ($phone != '') ? $phone : __('Not provided');
	
	$table->data[2][0] = print_label (__('Email'), '', '', true, $email);
	$table->data[2][1] = print_label (__('Telephone'), '', '', true, $phone);
	if ($user['comentarios'] != '')
		$table->data[3][0] = print_label (__('Comments'), '', '', true, $comments);
}

if ($has_permission) {
	echo '<form id="form-user_edit" method="post" action="index.php?sec=users&sec2=operation/users/user_edit" enctype="multipart/form-data">';
	
	print_table ($table);
	echo "<div class='button-form' >";
		$data = print_submit_button (__('Update'), 'upd_btn', false, 'class="upd sub"', true);
		$data .= print_input_hidden ('update_user', 1, true);
		echo $data;
	echo "</div>";
	
	$table->data = array ();
	$table->data[0][0] = print_input_password ('password', '', '', 20, 20, true, __('Password'));
	$table->data[0][1] = print_input_password ('password_confirmation', '', '', 20, 20, true, __('Password confirmation'));
Example #24
0
$table->data[0][1] = print_input_text("sitename", $config["sitename"], '', 30, 50, true, __('Sitename'));
$error_log_options[0] = __('Disabled');
$error_log_options[1] = __('Enabled');
$table->data[1][0] = print_checkbox("error_log", $error_log_options, $config["error_log"], true, __('Enable error log') . print_help_tip(__("This errorlog is on /integria.log"), true));
$table->data[1][1] = print_input_text("timezone", $config["timezone"], '', 15, 30, true, __('Timezone for integria'));
$table->data[2][0] = print_textarea("api_acl", 2, 1, $config["api_acl"], 'style="max-width: 280px;"', true, __('List of IP with access to API') . print_help_tip(__("List of IP (separated with commas which can access to the integria API. Use * for any address (INSECURE!)"), true), false);
$table->data[2][1] = print_input_password("api_password", $config["api_password"], '', 30, 255, true, __('API password'));
$days_of_week = get_days_of_week();
$table->data[4][0] = print_select($days_of_week, "first_day_week", $config["first_day_week"], '', '', '', true, 0, false, __('First day of the week'));
$table->data[4][1] = print_input_text("url_updatemanager", $config["url_updatemanager"], '', 35, 255, true, __('URL update manager'));
$table->data[5][0] = print_input_text("loginhash_pwd", $config["loginhash_pwd"], '', 30, 255, true, __('Loginhash password'));
$table->data[5][1] = print_checkbox("access_protocol", 1, $config["access_protocol"], true, __('Enable HTTPS access'));
$table->data[6][0] = print_input_text("access_port", $config["access_port"], '', 10, 255, true, __('Access port') . print_help_tip(__("Leave blank to use default port (80)"), true));
$table->data[6][1] = print_input_text("access_public", $config["access_public"], '', 30, 50, true, __('Public access to server') . print_help_tip(__("Public IP or name for the server, for example (23.45.67.3 or mydomain.com)"), true));
$csv_standard_encoding = !isset($config['csv_standard_encoding']) ? false : (bool) $config['csv_standard_encoding'];
$table->data[7][0] = print_label(__('CSV encoding type'), '', '', true);
$table->data[7][0] .= __('Excel') . '&nbsp;' . print_radio_button('csv_standard_encoding', 0, '', $csv_standard_encoding, true);
$table->data[7][0] .= print_help_tip(__("The Excel type may not be compatible with other applications"), true);
$table->data[7][0] .= '&nbsp;&nbsp;' . __('Other') . '&nbsp;' . print_radio_button('csv_standard_encoding', 1, '', $csv_standard_encoding, true);
$table->data[7][1] = print_checkbox("enable_update_manager", 1, $config["enable_update_manager"], true, __('Enable update manager updates'));
$table->data[8][0] = print_input_text("max_direct_download", $config["max_direct_download"], '', 10, 255, true, __('Maximum direct download size (MB)'));
$table->data[8][1] = print_input_text("max_file_size", $config["max_file_size"], '', 10, 255, true, __('Max. Upload file size'));
echo "<form name='setup' method='post'>";
print_table($table);
echo "<div class='button-form'>";
print_input_hidden('update', 1);
print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"');
echo "</div>";
echo '</form>';
?>
Example #25
0
    if ($config["show_owner_incident"] == 1) {
        $table->head[10] = __('Owner');
    }
    $table->style = array();
    $table->style[0] = '';
    print_table($table);
    print_table_pager();
    unset($table);
    $table->class = 'result_table listing';
    $table->width = '99%';
    $table->id = 'incident_massive';
    $table->style = array();
    $table->head[0] = print_label(__('Status'), '', '', true);
    $table->head[1] = print_label(__('Priority'), '', '', true);
    $table->head[2] = print_label(__('Resolution'), '', '', true);
    $table->head[3] = print_label(__('Assigned user'), '', '', true);
    echo '<br><h2>&nbsp;' . print_image('images/arrow_ele_blue.png', true) . ' ' . __('Massive operations over selected items') . '</h2>';
    $table->data[0][0] = combo_incident_status(-1, 0, 0, true, true);
    $table->data[0][1] = print_select(get_priorities(), 'mass_priority', -1, '', __('Select'), -1, true);
    $table->data[0][2] = combo_incident_resolution($resolution, $disabled, true, true);
    $table->data[0][3] = print_select_from_sql('SELECT id_usuario, nombre_real FROM tusuario;', 'mass_assigned_user', '0', '', __('Select'), -1, true);
    print_table($table);
    echo "<div style='width:" . $table->width . "'>";
    print_submit_button(__('Update selected items'), 'massive_update', false, 'class="sub next" style="float:right;');
    echo "</div>";
    /* End of first tab container */
    echo '</div>';
    echo '<div id="incident-stats" style="display">TODO STATS</div>';
}
//////
echo '</div>';
Example #26
0
/**
 * Render a checkbox button input. Extended version, use print_checkbox() to simplify.
 *
 * @param string Input name.
 * @param string Input value.
 * @param string Set the button to be marked (optional, unmarked by default).
 * @param bool Disable the button  (optional, button enabled by default).
 * @param string Script to execute when onClick event is triggered (optional).
 * @param string Optional HTML attributes. It's a free string which will be
 * inserted into the HTML tag, use it carefully (optional).
 * @param bool Whether to return an output string or echo now (optional, echo by default).
 */
function print_checkbox_extended($name, $value, $checked, $disabled, $script, $attributes, $return = false, $label = false)
{
    $output = '';
    if ($label) {
        $output .= ' ';
        $output .= print_label($label, $name, 'checkbox', true);
    }
    $output .= '<input name="' . $name . '" type="checkbox" ' . $attributes . ' value="' . $value . '" ' . ($checked ? 'checked="1"' : '');
    $output .= ' id="checkbox-' . $name . '"';
    if ($script != '') {
        $output .= ' onClick="' . $script . '"';
    }
    if ($disabled) {
        $output .= ' disabled="1"';
    }
    $output .= ' />';
    $output .= "\n";
    if ($return) {
        return $output;
    }
    echo $output;
}
Example #27
0
	    echo "<tr><td>";

	    //echo print_label (, '', true);
	    $params_user['input_id'] = 'text-user_id';
	    $params_user['input_name'] = 'user_id';
	    $params_user['title'] = __("User");
		$params_user['input_value'] = $user_id;
	    $params_user['return'] = false;
	    $params_user['return_help'] = true;
	    user_print_autocomplete_input($params_user);
	   
	    echo "</td><td>"; 
	    echo print_label (__("Begin date"), '', true);
	    print_input_text ('start_date', $start_date, '', 10, 20);	
	    echo "</td><td>";
	    echo print_label (__("End date"), '', true);
	    print_input_text ('end_date', $end_date, '', 10, 20);	


	    echo "<tr><td>";
	    echo print_checkbox ('only_projects', 1, $only_projects, true, __('All Project search') .
			print_help_tip (__("If selected, will render all projects info.
				If not, will show only projects for user"), true));

	    echo "<td>";
	    echo print_checkbox ('only_incidents', 1, $only_incidents, true, __('Show ticket summary'));

	    echo "<td>";
	    echo print_checkbox ('only_summary', 1, $only_summary, true, __('Show only summary').
			print_help_tip (__("If not selected, will skip the data tables with information and render only totals in hours and working days"), true));