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));
}
    echo '<table class="search-table-button" style="width: 99%;" border=0>';
    echo '<tr>';
    echo '<td width="25%"><b>' . __('User ') . ' </b>';
    $params = array();
    $params['input_value'] = $id_user_filter;
    $params['input_id'] = 'text-user';
    $params['input_name'] = 'user';
    $params['return'] = false;
    $params['return_help'] = false;
    user_print_autocomplete_input($params);
    echo '</td>';
    echo '<td width="25%"><b>' . __('Start') . ' </b>';
    print_help_tip(__('Empty date is all range time of project'));
    print_input_text('start_date', $start_date, '', 10, 20);
    echo '<td width="25%"><b>' . __('End') . ' </b>';
    print_help_tip(__('Empty date is all range time of project'));
    print_input_text('end_date', $end_date, '', 10, 20);
    echo '</tr>';
    echo '<tr><td colspan=3>';
    print_input_hidden('id_project', $id_project);
    print_input_hidden('action', 'update');
    print_submit_button(__('Update'), 'upd_btn', false, 'class="sub upd"');
    echo '</td></tr>';
    echo "</table>";
    echo "</form>";
    ?>
	<script type="text/javascript">
		add_ranged_datepicker ("#text-start_date", "#text-end_date", null);
	</script>
	<?php 
    echo "<div id='time_graph' style='margin: 0px auto; width: 800px;'></div>";
		//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');
		
		//offset pagination hidden
		if(!isset($params['offset'])){
			$params['offset'] = '';
		}
		$table_search->data[3][0] .= print_input_hidden	('offset', $params['offset'], true, false, 'offset');
		
		//mode: list, tree, pure
		$table_search->data[3][0] .= print_input_hidden ('mode', $params['mode'], true, false, 'mode');
Exemple #4
0
$table->data[8][1] = "<h4>" . __("POP/IMAP Parameters") . "</h4>";
$table->data[9][0] = print_input_text("pop_host", $config["pop_host"], '', 25, 30, true, __('POP/IMAP Host'));
$table->data[9][0] .= print_help_tip(__("Use ssl://host.domain.com if want to use IMAP with SSL"), true);
$table->data[9][1] = print_input_text("pop_port", $config["pop_port"], '', 15, 30, true, __('POP/IMAP Port'));
$table->data[9][1] .= print_help_tip(__("POP3: Port 110, IMAP: Port 143, IMAPS: Port 993, SSL-POP: Port 995"), true);
$table->data[10][0] = print_input_text("pop_user", $config["pop_user"], '', 15, 30, true, __('POP/IMAP User'));
$table->data[10][1] = print_input_text("pop_pass", $config["pop_pass"], '', 15, 30, true, __('POP/IMAP Password'));
$table->data[11][1] = "<h4>" . __("Newsletter SMTP Parameters") . "</h4>";
$table->data[12][0] = print_input_text("news_smtp_host", $config["news_smtp_host"], '', 35, 200, true, __('SMTP Host'));
$table->data[12][1] = print_input_text("news_smtp_port", $config["news_smtp_port"], '', 5, 10, true, __('SMTP Port'));
$table->data[13][0] = print_input_text("news_smtp_user", $config["news_smtp_user"], '', 25, 200, true, __('SMTP User'));
$table->data[13][1] = print_input_text("news_smtp_pass", $config["news_smtp_pass"], '', 25, 200, true, __('SMTP Password'));
$table->data[14][0] = print_input_text("news_batch_newsletter", $config["news_batch_newsletter"], '', 4, 255, true, __('Max. emails sent per execution'));
$table->data[14][0] .= print_help_tip(__("This means, in each execution of the batch external process (integria_cron). If you set your cron to execute each hour in each execution of that process will try to send this ammount of emails. If you set the cron to run each 5 min, will try this number of mails."), true);
$table->data[14][1] = print_input_text("batch_email_validation", $config["batch_email_validation"], '', 4, 255, true, __('Newsletter email validation batch'));
$table->data[14][1] .= print_help_tip(__("This means, in each execution of the batch external process (integria_cron) will try to validate this ammount of emails."), true);
$table->data[15][0] = print_checkbox("active_validate", 1, $config["active_validate"], true, __('Activate email validation'));
$table->data[16][1] = "<h4>" . __("Mail general texts") . "</h4>";
$table->colspan[17][0] = 3;
$table->colspan[18][0] = 3;
$table->colspan[19][0] = 3;
$table->data[17][0] = print_textarea("header_email", 5, 40, $config["HEADER_EMAIL"], '', true, __('Email header'));
$table->data[18][0] = print_textarea("footer_email", 5, 40, $config["FOOTER_EMAIL"], '', true, __('Email footer'));
$table->data[19][1] = "<h4>" . __("Mail queue control");
$total_pending = get_db_sql("SELECT COUNT(*) from tpending_mail");
$table->data[19][1] .= " : " . $total_pending . " " . __("mails in queue") . "</h4>";
if ($total_pending > 0) {
    $table->colspan[20][0] = 3;
    $mail_queue = "<div style='height: 250px; overflow-y: auto;'>";
    $mail_queue .= "<table width=100% class=listing>";
    $mail_queue .= "<tr><th>" . __("Date") . "<th>" . __("Recipient") . "<th>" . __("Subject") . "<th>" . __("Attempts") . "<th>" . __("Status") . "</tr>";
$contacts = get_inventory_contacts ($id, false);

if ($contacts === false)
	$contacts = array ();

$companies = get_companies ();

foreach ($contacts as $contact) {
	$data = array ();
	if(!isset($companies[$contact['id_company']])){
		$companies[$contact['id_company']] = '';
	}
	$data[0] = $companies[$contact['id_company']];
	$data[1] = $contact['fullname'];
	$details = '';
	if ($contact['phone'] != '')
		$details .= '<strong>'.__('Phone number').'</strong>: '.$contact['phone'].'<br />';
	if ($contact['mobile'] != '')
		$details .= '<strong>'.__('Mobile phone').'</strong>: '.$contact['mobile'].'<br />';
	$data[2] = $contact['position'];
	$data[3] = print_help_tip ($details, true, 'tip_view');
	if ($write_permission) {
		$data[4] = '<a href="index.php?sec=inventory&sec2=operation/contacts/contact_detail&id='.$contact['id'].'&id_inventory='.$id.'">'.
				'<img src="images/setup.gif" /></a>';
	}
	array_push ($table->data, $data);
}
print_table ($table);
?>
     $icon = $object["icon"];
     $min_stock = $object["min_stock"];
     $show_in_list = $object["show_in_list"];
 }
 /*if ($id == -1) {
 		echo "<h3>".__('Create a new object')."</h3>";
 	} else {
 		echo "<h3>".__('Update existing object')."</h3>";
 	}*/
 $table->width = '99%';
 $table->class = 'search-table-button';
 $table->colspan = array();
 $table->colspan[3][0] = 2;
 $table->data = array();
 $table->data[0][0] = print_input_text('name', $name, '', 45, 100, true, __('Name'));
 $table->data[0][1] = '<label>' . __('Show in tree view') . print_help_tip(__('If this value is checked this object type will appear as a root inside inventory\'s tree view.'), true) . '</label>';
 $table->data[0][1] .= print_checkbox('show_in_list', 1, $show_in_list, __('Show in tree view'));
 $files = list_files('images/objects/', "png", 1, 0);
 $table->data[1][0] = print_select($files, 'icon', $icon, '', __('None'), "", true, false, false, __('Icon'));
 $table->data[1][0] .= objects_get_icon($id, true);
 $table->data[1][1] = print_input_text('min_stock', $min_stock, '', 45, 100, true, __('Min. stock'));
 $table->data[2][0] = print_textarea('description', 10, 50, $description, '', true, __('Description'));
 $table->colspan[2][0] = 2;
 if ($id == -1) {
     $button = print_submit_button(__('Create'), 'crt_btn', false, 'class="sub next"', true);
     $button .= print_input_hidden('insert_object', 1, true);
 } else {
     $button = print_submit_button(__('Update'), 'upd_btn', false, 'class="sub upd"', true);
     $button .= print_input_hidden('id', $id, true);
     $button .= print_input_hidden('update_object', 1, true);
 }
function combo_users_task($id_task, $icon_list = false, $return = false)
{
    global $config;
    // Show only users assigned to this project
    $task_users = get_db_all_rows_field_filter('trole_people_task', 'id_task', $id_task);
    $visible_users = get_user_visible_users($config["id_user"], 'PR', true);
    $users = array();
    if ($task_users) {
        foreach ($task_users as $user) {
            if (isset($visible_users[$user['id_user']])) {
                if ($icon_list) {
                    array_push($users, $user);
                } else {
                    $users[$user['id_user']] = $user['id_user'];
                }
            }
        }
    }
    $output = '';
    if (!$icon_list) {
        $output .= print_select($users, 'user', '', '', '', '', true, 0, true, false, false, "width:100px");
    } else {
        $text = __('Users') . ':<br />';
        $users_size = count($users);
        $count = 0;
        foreach ($users as $user) {
            $count++;
            $text .= $user["id_user"];
            if ($count < $users_size) {
                $text .= ", ";
            }
        }
        $output .= print_help_tip($text, true, 'tip_people');
    }
    if ($return) {
        return $output;
    }
    echo $output;
}
Exemple #8
0
function ui_print_truncate_text($text, $numChars = GENERIC_SIZE_TEXT, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '&hellip;', $style = false)
{
    global $config;
    if (is_string($numChars)) {
        switch ($numChars) {
            case 'agent_small':
                $numChars = $config['agent_size_text_small'];
                break;
            case 'agent_medium':
                $numChars = $config['agent_size_text_medium'];
                break;
            case 'module_small':
                $numChars = $config['module_size_text_small'];
                break;
            case 'module_medium':
                $numChars = $config['module_size_text_medium'];
                break;
            case 'description':
                $numChars = $config['description_size_text'];
                break;
            case 'item_title':
                $numChars = $config['item_title_size_text'];
                break;
            default:
                $numChars = (int) $numChars;
                break;
        }
    }
    if ($numChars == 0) {
        if ($return == true) {
            return $text;
        } else {
            echo $text;
        }
    }
    $text = safe_output($text);
    if (mb_strlen($text, "UTF-8") > $numChars) {
        // '/2' because [...] is in the middle of the word.
        $half_length = intval(($numChars - 3) / 2);
        // Depending on the strange behavior of mb_strimwidth() itself,
        // the 3rd parameter is not to be $numChars but the length of
        // original text (just means 'large enough').
        $truncateText2 = mb_strimwidth($text, mb_strlen($text, "UTF-8") - $half_length, mb_strlen($text, "UTF-8"), "", "UTF-8");
        $truncateText = mb_strimwidth($text, 0, $numChars - $half_length, "", "UTF-8") . $suffix;
        $truncateText = $truncateText . $truncateText2;
        if ($showTextInTitle) {
            if ($style === null) {
                $truncateText = $truncateText;
            } else {
                if ($style !== false) {
                    $truncateText = '<span style="' . $style . '" title="' . $text . '">' . $truncateText . '</span>';
                } else {
                    $truncateText = '<span title="' . $text . '">' . $truncateText . '</span>';
                }
            }
        }
        if ($showTextInAToopTip) {
            $truncateText = $truncateText . print_help_tip($text, true);
        } else {
            if ($style !== false) {
                $truncateText = '<span style="' . $style . '">' . $truncateText . '</span>';
            }
        }
    } else {
        if ($style !== false) {
            $truncateText = '<span style="' . $style . '">' . $text . '</span>';
        } else {
            $truncateText = $text;
        }
    }
    if ($return == true) {
        return $truncateText;
    } else {
        echo $truncateText;
    }
}
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;
}
		$irpf = get_invoice_irpf($invoice["id"]);
		//~ 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);
		$final_total[strtoupper ($invoice["currency"])] += $total;

		$data[2] = $total;
		
		if (($tax != 0) && ($clean_output == 0))
			$data[2] .= print_help_tip (__("With taxes"). ": ". format_numeric($amount,2), true);
		
		$data[3] = strtoupper ($invoice["currency"]);
		$data[4] = __($invoice["status"]);
		$data[5] = "<span style='font-size: 10px'>".$invoice["invoice_create_date"] . "</span>";
		$data[6] = "<span style='font-size: 10px'>".$invoice["invoice_expiration_date"]. "</span>";

		if ($clean_output == 0){

			$data[7] = '';
			if ($invoice['invoice_type'] == 'Submitted') {
				$data[7] = '<a href="index.php?sec=users&amp;sec2=operation/invoices/invoice_view
				&amp;id_invoice='.$invoice["id"].'&amp;clean_output=1&amp;pdf_output=1&amp;language='.$invoice['id_language'].'">
				<img src="images/page_white_acrobat.png" title="'.__('Export to PDF').'"></a>';
			}
		
Exemple #11
0
    $auth_method = 'mysql';
} else {
    $auth_method = $config['auth_methods'];
}
$disabled = false;
$table->width = '99%';
$table->class = 'search-table-button';
$table->colspan = array();
$table->data = array();
$auth_methods = array('mysql' => __('Local Integria'), 'ldap' => __('LDAP'));
if ($is_enterprise) {
    add_enterprise_auth_methods($auth_methods);
}
$table->data[0][0] = print_select($auth_methods, "auth_methods", $auth_method, '', '', '', true, 0, true, __('Authentication method'));
$table->data[0][1] = print_input_text("session_timeout", $config['session_timeout'], '', 10, 10, true, __('Session timeout (secs)'));
$table->data[0][1] .= print_help_tip(__("This is defined in seconds. "), true);
$table->data[1][0] = '<b>' . __('Autocreate remote users') . '</b>';
$table->data[2][0] = __('Yes') . '&nbsp;' . print_radio_button_extended('autocreate_remote_users', 1, '', $config['autocreate_remote_users'], false, 'enable_autocreate_profile();', '', true) . '&nbsp;&nbsp;';
$table->data[2][0] .= __('No') . '&nbsp;' . print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, 'enable_autocreate_profile();', '', true);
if ($config['autocreate_remote_users'] == 0) {
    $disabled = true;
}
$profile_list = profile_get_profiles();
if ($profile_list === false) {
    $profile_list = array();
}
$table->data[3][0] = print_select($profile_list, "default_remote_profile", $config['default_remote_profile'], '', '', '', true, 0, true, __('Autocreate profile'), $disabled);
$group_list = group_get_groups();
if ($group_list === false) {
    $group_list = array();
}
Exemple #12
0
    $retval = array();
    foreach ($files as $file) {
        $retval["custom_logos/{$file}"] = $file;
    }
    return $retval;
}
$imagelist = get_logo_files();
$table->data[0][0] = print_select($imagelist, 'site_logo', $config["site_logo"], '', __('Default'), '', true, 0, true, __('Site logo') . print_help_tip(__('You can place your custom images into the folder') . ": images/custom_logos", true));
$table->data[1][0] = print_select($imagelist, 'header_logo', $config["header_logo"], '', __('Default'), '', true, 0, true, __('Header logo') . print_help_tip(__('You can place your custom images into the folder') . ": images/custom_logos", true));
$backgrounds_list_jpg = list_files("images/backgrounds", "jpg", 1, 0);
$backgrounds_list_gif = list_files("images/backgrounds", "gif", 1, 0);
$backgrounds_list_png = list_files("images/backgrounds", "png", 1, 0);
$backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
asort($backgrounds_list);
$table->data[2][0] = print_select($backgrounds_list, 'login_background', $config["login_background"], '', __('Default'), '', true, 0, true, __('Login background') . print_help_tip(__('You can place your custom images into the folder') . ": images/backgrounds", true));
$table->data[3][0] = print_input_text("block_size", $config["block_size"], '', 5, 5, true, __('Block size for pagination'));
function get_font_files()
{
    global $config;
    $base_dir = $config['homedir'] . '/include/fonts';
    $files = list_files($base_dir, ".ttf", 1, 0);
    $retval = array();
    foreach ($files as $file) {
        $retval[$config['homedir'] . 'include/fonts/' . $file] = $file;
    }
    return $retval;
}
$fontlist = get_font_files();
$flash_options = array();
$flash_options[0] = "Disabled";
Exemple #13
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);
foreach ($slas_aux as $s) {
    $slas[$s["id"]] = $s["name"];
}
$table->data[5][1] = print_select($slas, 'id_sla', $id_sla, '', '', 0, true, false, false, __('Ticket SLA'));
if (!isset($inventory_name)) {
    $inventory_name = '';
}
$table->data[6][0] = print_input_text('inventory_name', $inventory_name, '', 25, 0, true, __('Default Inventory object'), false);
$table->data[6][0] .= '&nbsp;&nbsp;' . "<a href='javascript: show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\");' title='" . __('Search parent') . "'><img src='images/add.png' /></a>";
if (!isset($id_inventory)) {
    $id_inventory = '';
}
$table->data[6][0] .= print_input_hidden('id_inventory', $id_inventory, true);
$table->data[6][1] = print_input_text('email_from', $email_from, '', 40, 0, true, __('Email from'));
if ($config['enteprise'] == 1) {
    $table->data[7][0] = print_textarea("email_group", 5, 40, $email_group, '', true, __('Email group') . print_help_tip(__("Set values separated by comma. You can use regular expresions"), true));
}
echo '<form id="form-configurar_grupo" method="post" action="index.php?sec=users&sec2=godmode/grupos/lista_grupos">';
print_table($table);
if (!isset($autocreate_user)) {
    $autocreate_user = '';
}
if (!isset($grant_access)) {
    $grant_access = '';
}
if (!isset($send_welcome)) {
    $send_welcome = '';
}
if (!isset($default_company)) {
    $default_company = '';
}
	$params['attributes'] = "style='width:210px;'";
	
	$table->data[2][1] = user_print_autocomplete_input($params);
}

// Various checkboxes
$table->data[3][0] = print_checkbox ('have_cost', 1, $have_cost, true,
	__('Have cost'));
$table->data[3][1] = print_checkbox ('public', 1, $public, true, __('Public'));

if (! $id_workunit) {
	$table->data[4][0] = print_checkbox ('forward', 1, 
		false, true, __('Forward') . print_help_tip (__('If this checkbox is activated, propagation will be forward'), true));
	
	$table->data[4][1] = print_checkbox ('split', 1, false, true, 
		__('Backward')  . print_help_tip (__('If this checkbox is activated, propagation will be backward'),
		true));
}

$table->data[5][0] = print_checkbox ('work_home', 1, $work_home, true, __('Work from home'));

$table->data[6][0] = print_textarea ('description', 10, 30, $description,
	'', true, __('Description'));

echo '<form id="single_task_form" method="post" onsubmit="return validate_single_form()">';
print_table ($table);

$button = '';
echo '<div style="width:100%;">';
	unset($table->data);
	$table->width = '100%';
	$table->class = "button-form";
Exemple #16
0
	$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";
	
	$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='
     $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);
    $table->data[4][1] = print_checkbox('enforce_soft_limit', 1, $enforce_soft_limit, true, __('Enforce soft limit'));
}
$table->data[5][0] = print_input_text('hard_limit', $hard_limit, '', 10, 0, true, __('Tickets Hard limit')) . print_help_tip(__("If it's a standard user it shows the nº of maximum tickets for this group, that one user could have in total (open or closed). If it's a external user it shows the nº of maximum tickets for user, for this group, that one user could have in total (open or closed). When this limit is exceeded, the user will receive a notification in the screen when he try to create a ticket, so he won't be able to create any more."), true);
$slas_aux = get_db_all_rows_sql("SELECT id, name FROM tsla ORDER BY name");
$slas = array();
$slas[0] = __("None");
foreach ($slas_aux as $s) {
    $slas[$s["id"]] = $s["name"];
}
$table->data[5][1] = print_select($slas, 'id_sla', $id_sla, '', '', 0, true, false, false, __('Ticket SLA'));
$table->data[6][0] = print_input_text('inventory_name', $inventory_name, '', 25, 0, true, __('Default Inventory object'), false);
$table->data[6][0] .= "<a href='javascript: show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . '&nbsp;&nbsp;' . __('Search parent') . "</a>";
$table->data[6][0] .= print_input_hidden('id_inventory', $id_inventory, true);
$table->data[6][1] = print_input_text('email_from', $email_from, '', 40, 0, true, __('Email from'));
if ($config['enteprise'] == 1) {
    $table->data[7][0] = print_textarea("email_group", 5, 40, $email_group, '', true, __('Email group') . print_help_tip(__("Place each email address in a new line. You can use regular expresions"), true));
}
echo '<form id="form-configurar_grupo" method="post" action="index.php?sec=users&sec2=godmode/grupos/lista_grupos">';
print_table($table);
enterprise_hook("groups_email_queue_form", array($autocreate_user, $grant_access, $send_welcome, $default_company, $welcome_email, $email_queue, $default_profile, $user_level, $incident_type));
echo '<div class="button" style="width: ' . $table->width . '">';
if ($id) {
    print_submit_button(__('Update'), '', false, 'class="sub upd"');
    print_input_hidden('update_group', 1);
    print_input_hidden('id', $id);
} else {
    print_submit_button(__('Create'), '', false, 'class="sub next"');
    print_input_hidden('create_group', 1);
}
echo '</div></form>';
echo "<div class= 'dialog ui-dialog-content' id='inventory_search_window'></div>";
    if (empty($incident["closed_by"])) {
        $long_name_closer = '<em>' . __('Unknown') . '</em>';
        $incident_users .= print_image('images/avatar_unknown.png', true);
    } else {
        $long_name_closer = get_db_value_filter("nombre_real", "tusuario", array("id_usuario" => $incident["closed_by"]));
        $closer = $incident['closed_by'];
        $options["onclick"] = "openUserInfo(\"{$closer}\")";
        $incident_users .= print_image('images/avatars/' . $avatar_closer . '.png', true, $options);
    }
}
$incident_users .= '</div>';
$incident_users .= '<span>' . __('Closed by') . ':</span><br>' . $long_name_closer;
$incident_users .= "</td>";
$incident_users .= "</tr>";
$incident_users .= "</table>";
$right_side = print_container('incident_users', __('People') . print_help_tip(_('Click on icons for more details'), true), $incident_users);
// Quick editor
if ($config['enabled_ticket_editor']) {
    $has_im = give_acl($config['id_user'], $id_grupo, "IM") || $config['id_user'] == $incident['id_creator'];
    $has_iw = give_acl($config['id_user'], $id_grupo, "IW") || $config['id_user'] == $incident['id_usuario'] || $config['id_user'] == $incident['id_creator'];
    if ($has_iw) {
        $incident_data = get_incident($id);
        $resolution = $incident_data['resolution'];
        $priority = $incident_data['prioridad'];
        $owner = $incident_data['id_usuario'];
        $status = $incident['estado'];
        $ticket_editor .= "<table style='width: 100%;'>";
        $ticket_editor .= "<tr>";
        $ticket_editor .= "<td>";
        $ticket_editor .= print_select(get_priorities(true), 'priority_editor', $priority, "", '', '', true, false, false, __('Priority'), false, '');
        $ticket_editor .= "</td>";
    $leads_conversion_rate .= "<td style='padding-top: 20px; font-size: 45pt; font-weight: bold; text-align:center'>";
    $leads_conversion_rate .= sprintf("%.2f %%", $conversion_rate);
    $leads_conversion_rate .= "</td>";
    $leads_conversion_rate .= "</tr>";
    $leads_conversion_rate .= "<tr>";
    $leads_conversion_rate .= "<td style='padding-top: 36px; padding-bottom: 37px; font-size: 18pt; font-weight: bold; text-align: center;'>";
    $leads_conversion_rate .= __("Total amount") . "<br><br>";
    $leads_conversion_rate .= $total_amount_success . " " . $config["currency"];
    $leads_conversion_rate .= "</td>";
    $leads_conversion_rate .= "</tr>";
    $leads_conversion_rate .= "</table>";
}
$leads_conversion_rate = '<br><div class="pie_frame">' . $leads_conversion_rate . '</div>';
$container_title = __('Conversion ratio');
if (!$clean_output) {
    $container_title .= "&nbsp;" . print_help_tip(__("Conversion ratio is calculated using closed leads (keep in mind that closed leads don't appear in search by default)"), true);
}
echo print_container('conversion_rate', $container_title, $leads_conversion_rate, 'no', true, true, "container_simple_title", "container_simple_div");
//COUNTRIES
$leads_country = crm_get_total_leads_country($where_clause);
if ($read && $enterprise) {
    $leads_country = crm_get_user_leads($config['id_user'], $leads_country);
}
$leads_country = crm_get_data_lead_country_graph($leads_country);
if ($leads_country != false) {
    $leads_country_content = pie3d_graph($config['flash_charts'], $leads_country, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'] - 1, $ttl);
} else {
    $leads_country_content = __('No data to show');
}
$leads_country_content = '<br><div class="pie_frame">' . $leads_country_content . '</div>';
echo "<div style='clear:both'></div>";
    $params_closed['return_help'] = true;
    $params_closed['disabled'] = $blocked_incident;
    //Only print closed by option when incident status is closed
    if ($incident["estado"] == STATUS_CLOSED) {
        $table->data[2][2] = "<div id='closed_by_wrapper'>";
    } else {
        $table->data[2][2] = "<div id='closed_by_wrapper' style='display: none'>";
    }
    $table->data[2][2] .= user_print_autocomplete_input($params_closed);
    $table->data[2][2] .= "</div>";
} else {
    if ($create_incident && $config["change_incident_datetime"]) {
        $date = date('Y-m-d');
        $time = date('H:i');
        $table->data[2][2] = print_input_text('creation_date', $date, '', 10, 100, true, __('Creation date'), $blocked_incident);
        $table->data[2][2] .= print_input_text('creation_time', $time, '', 10, 100, true, __('Creation time'), $blocked_incident) . print_help_tip(__("The format should be hh:mm"), true);
    }
}
$table->colspan[4][0] = 3;
//$table->data[4][0] = "<tr id='row_show_type_fields' colspan='4'></tr>";
$table->data[4][0] = "";
//////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();
$table_advanced->colspan[1][1] = 2;
	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>';
		echo '<td colspan=2><b>'.__('CC').print_help_tip (__("Email to notify changes in workunits"), true).' </b></td>';
	echo '</tr><tr>';
		echo '<td colspan=2><input type="text" name="cc" size=25 value="'.$cc.'"></td>';
	echo '</tr>';
	
	// start and end date
	echo '<tr>';
		echo '<td><b>'.__('Start').' </b>';
		echo print_input_text ('start_date', $start_date, '', 11, 20, true) ."</td>";
	echo '</tr><tr>';	
		echo '<td><b>'.__('End').' </b>';
		echo print_input_text ('end_date', $end_date, '', 11, 20, true) ."</td>";
	echo '</tr>';

	// Description
	echo '<tr>';
Exemple #23
0
$row[] = print_input_text("smtp_pass", $config["smtp_pass"], '', 25, 200, true, __('SMTP Password'));
$row[] = print_button(__("Test"), 'test_smtp', false, '', 'class="sub"', true) . '<div id="test_smtp_images" style="display: inline;"></div>';
$table->data[] = $row;
$row = array();
$row[] = print_input_text("smtp_queue_retries", $config["smtp_queue_retries"], '', 5, 10, true, __('SMTP Queue retries') . print_help_tip(__("This are the number of attempts the mail queue try to send the mail. Should be high (20-30) if your internet connection have frequent downtimes and near zero if its stable"), true));
$row[] = print_input_text("max_pending_mail", $config["max_pending_mail"], '', 10, 255, true, __('Max pending mail') . print_help_tip(__("Maximum number of queued emails. When this number is exceeded, an alert is activated"), true));
$row[] = print_input_text("batch_newsletter", $config["batch_newsletter"], '', 4, 255, true, __('Max. emails sent per execution') . print_help_tip(__("This means, in each execution of the batch external process (integria_cron). If you set your cron to execute each hour in each execution of that process will try to send this ammount of emails. If you set the cron to run each 5 min, will try this number of mails."), true));
$table->data[] = $row;
$row = array();
$row[] = "<br /><h4>" . __("POP/IMAP Parameters") . "</h4>";
$table->data['pop-imap'] = $row;
$table->colspan['pop-imap'][0] = $cols;
$row = array();
$row[] = print_select($popimap, "select_pop_imap", $config["select_pop_imap"], '', '', '', true, 0, true, __('Select IMAP or POP'));
$row[] = print_input_text("pop_host", $config["pop_host"], '', 25, 30, true, __('POP/IMAP Host') . print_help_tip(__("Use ssl://host.domain.com if want to use IMAP with SSL"), true));
$row[] = print_input_text("pop_port", $config["pop_port"], '', 15, 30, true, __('POP/IMAP Port') . print_help_tip(__("POP3: Port 110, IMAP: Port 143, IMAPS: Port 993, SSL-POP: Port 995"), true));
$table->data[] = $row;
$row = array();
$row[] = print_input_text("pop_user", $config["pop_user"], '', 15, 30, true, __('POP/IMAP User'));
$row[] = print_input_text("pop_pass", $config["pop_pass"], '', 15, 30, true, __('POP/IMAP Password'));
$table->data[] = $row;
$row = array();
$row[] = "<br /><h4>" . __("Mail general texts") . "</h4>";
$table->data['mail_header_footer'] = $row;
$table->colspan['mail_header_footer'][0] = $cols;
$row = array();
$row[] = print_textarea("header_email", 9, 40, $config["HEADER_EMAIL"], '', true, __('Email header'));
$table->data['header_email'] = $row;
$table->colspan['header_email'][0] = $cols;
$row = array();
$row[] = print_textarea("footer_email", 15, 40, $config["FOOTER_EMAIL"], '', true, __('Email footer'));
$table->data[0][1] .= $holidays;
$holidays_table = print_table($table, true);
$table_anonym = enterprise_hook('setup_print_incident_anonymize');
if ($table_anonym === ENTERPRISE_NOT_HOOK) {
    $table_anonym = "";
}
$incident_reporter_options[0] = __('Disabled');
$incident_reporter_options[1] = __('Enabled');
$newsletter_options[0] = __('Disabled');
$newsletter_options[1] = __('Enabled');
$ticket_options[0] = __('Disabled');
$ticket_options[1] = __('Enabled');
echo "<table width='99%' class='search-table-button\n'>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_input_text("iwu_defaultime", $config["iwu_defaultime"], '', 5, 5, true, __('Ticket WU Default time')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($incident_reporter_options, "email_on_incident_update", $config["email_on_incident_update"], '', '', '', true, 0, true, __('Send email on every ticket update')) . print_help_tip(__("Enabling this, you will get emails on file attachs also. If left disabled, you only get notifications only in major events on tickets"), true) . "</td>";
echo "<td style='vertical-align: top;'>" . print_input_text("limit_size", $config["limit_size"], '', 5, 5, true, __('Max. tickets by search')) . integria_help("limit_size", true) . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_select($incident_reporter_options, "show_owner_incident", $config["show_owner_incident"], '', '', '', true, 0, true, __('Show ticket owner')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($incident_reporter_options, "show_creator_incident", $config["show_creator_incident"], '', '', '', true, 0, true, __('Show ticket creator')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_input_text("auto_incident_close", $config["auto_incident_close"], '', 10, 10, true, __('Auto ticket close')) . integria_help("auto_incident_close", true) . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_checkbox("iw_creator_enabled", 1, $config["iw_creator_enabled"], true, __('Enable IW to change creator')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($newsletter_options, "incident_creation_wu", $config["incident_creation_wu"], '', '', '', true, 0, true, __('Editor adds a WU on ticket creation')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($ticket_options, "enabled_ticket_editor", $config["enabled_ticket_editor"], '', '', '', true, 0, true, __('Enable quick edit mode')) . "</td>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_checkbox("incident_type_change", 1, $config["incident_type_change"], true, __('Allow to change the ticket type')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_checkbox("change_incident_datetime", 1, $config["change_incident_datetime"], true, __('Allow to set the date/time in creation ')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_checkbox("email_ticket_on_creation_and_closing", 1, $config["email_ticket_on_creation_and_closing"], true, __('Send email only on creation and closing ')) . "</td>";
Exemple #25
0
$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>';
?>

<script type="text/javascript" src="include/js/integria.js"></script>
Exemple #26
0
		$result_msg = '<h3 class="suc">'.__('Successfully deleted').'</h3>';
		if (!unlink ($config["homedir"].'attachment/'.$id_attachment.'_'.$filename))
			$result_msg = '<h3 class="error">'.__('Could not be deleted').'</h3>';
		incident_tracking ($id, INCIDENT_FILE_REMOVED);
		
	} else {
		$result_msg = '<h3 class="error">'.__('You have no permission').'</h3>';
	}
	
	echo $result_msg;
}

if (!$clean_output) {
	echo "<br>";
	echo "<strong>".__("File formats supported")."</strong>";
	echo print_help_tip (__("Please note that you cannot upload .php or .pl files, as well other source code formats. Please compress that files prior to upload (using zip or gz)"), true);
	
	echo "<form id=\"form-incident_files\" class=\"fileupload_form\" method=\"post\" enctype=\"multipart/form-data\">";
	echo 	"<div id=\"drop_file\" style=\"padding:0px 0px;\">";
	echo 		"<table width=\"99%\">";
	echo 			"<td width=\"45%\">";
	echo 				__('Drop the file here');
	echo 			"<td>";
	echo 				__('or');
	echo 			"<td width=\"45%\">";
	echo 				"<a id=\"browse_button\">" . __('browse it') . "</a>";
	echo 		"</table>";
	echo 		"<input name=\"upfile\" type=\"file\" id=\"file-upfile\" class=\"sub file\" />";
	echo 	"</div>";
	echo 	"<ul></ul>";
	echo "</form>";
$table->data = array();
// Field name
$table->data[0][0] = print_input_text('label', $label, '', 45, 100, true, __('Field name'), $global_field);
// Type
$types = array('text' => __('Text'), 'textarea' => __('Textarea'), 'combo' => __('Combo'), 'linked' => __('Linked'), 'numeric' => __('Numeric'));
$table->data[0][1] = print_select($types, 'type', $type, '', '', '', true, 0, false, __("Type"), $global_field);
// Show in the ticket list
$table->data[0][2] = print_checkbox('show_in_list', 1, $show_in_list, true, __('Show in the tickets list'), $global_field);
// Global field
$table->data[0][3] = print_checkbox('global', 1, $global_field, true, __('Global field'), $global_field);
// Combo value
$table->data['id_combo_value'][0] = print_input_text('combo_value', $combo_value, '', 45, 0, true, __('Combo value'), $global_field);
$table->data['id_combo_value'][0] .= print_help_tip(__("Set values separated by comma"), true);
// Add values
if ($global_field) {
    $table->data['id_combo_value'][1] = print_input_text('add_combo_value', $add_combo_value, '', 45, 0, true, __('Add values')) . print_help_tip(__("Set values separated by comma"), true);
}
// Linked values
$sql = "SELECT id, label\n\t\tFROM tincident_type_field\t\n\t\tWHERE id_incident_type = {$id_incident_type}\n\t\t\tAND type = 'linked'";
$parents_result = get_db_all_rows_sql($sql);
if ($parents_result == false) {
    $parents_result = array();
}
$parents = array();
foreach ($parents_result as $result) {
    $parents[$result['id']] = $result['label'];
}
$table->data['id_parent_value'][0] = print_select($parents, 'parent', $parent, '', __('Select parent'), '0', true, 0, true, __("Parent"), $global_field);
$table->data['id_linked_value'][0] = print_textarea('linked_value', 15, 1, $linked_value, '', true, __('Linked value') . integria_help("linked_values", true), $global_field);
if ($global_field) {
    $table->data['id_linked_value'][1] = "";
if ($id_parent)
	$table_advanced->data[3][0] .= '&nbsp;<a target="_blank" href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id='.$id_parent.'"><img src="images/go.png" /></a>';

// Task
$table_advanced->data[3][1] = combo_task_user_participant ($config["id_user"], 0, $id_task, true, __("Task").print_help_tip (__("Task of proyect relation with this ticket"), true), false, true, false, '', false, $blocked_incident);

if ($id_task > 0){
	$table_advanced->data[3][1] .= "&nbsp;&nbsp;<a id='task_link' title='".__('Open this task')."' target='_blank'
							href='index.php?sec=projects&sec2=operation/projects/task_detail&operation=view&id_task=$id_task'>";
	$table_advanced->data[3][1] .= "<img src='images/task.png'></a>";
} else {
	$table_advanced->data[3][1] .= "&nbsp;&nbsp;<a id='task_link' title='".__('Open this task')."' target='_blank' href='javascript:;'></a>";
}


$table_advanced->data[1][1] = print_input_text ('email_copy', $email_copy,"",70,500, true, __("Additional email addresses") . print_help_tip(__("If you will put two or more e-mail adresses, can you put this adresses separated with comma"),true), $blocked_incident);
if (!$blocked_incident) {
	$table_advanced->data[1][1] .= "&nbsp;&nbsp;<a href='javascript: incident_show_contact_search();'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
}

if ($create_incident) {

		$id_inventory = (int) get_parameter ('id_inventory');
		
		$inventories = array ();
		
		if ($id_inventory) {
			if (! give_acl ($config['id_user'], $id_inventory, "VR")) {
				audit_db ($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation",
					"Trying to access inventory #".$id);
			} else {
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;
    }
}
 $table->width = '99%';
 $table->colspan = array();
 $table->colspan[4][0] = 2;
 $table->data = array();
 if ($new_contract || $id && ($write_permission || $manage_permission)) {
     $table->class = 'search-table-button';
     $params = array();
     $params['input_id'] = 'id_company';
     $params['input_name'] = 'id_company';
     $params['input_value'] = $id_company;
     $params['title'] = __('Company');
     $params['return'] = true;
     $table->data[0][0] = print_company_autocomplete_input($params);
     $table->data[0][1] = print_input_text('name', $name, '', 40, 100, true, __('Contract name'));
     $table->data[1][0] = print_input_text('contract_number', $contract_number, '', 40, 100, true, __('Contract number'));
     $table->data[1][1] = print_checkbox('private', '1', $private, true, __('Private')) . print_help_tip(__("Private contracts are visible only by users of the same company"), true);
     $table->data[2][0] = print_input_text('date_begin', $date_begin, '', 15, 20, true, __('Begin date'));
     $table->data[2][1] = print_input_text('date_end', $date_end, '', 15, 20, true, __('End date'));
     if ($id_company) {
         $table->data[3][0] .= "&nbsp;&nbsp;<a href='index.php?sec=customers&sec2=operation/companies/company_detail&id={$id_company}'>";
         $table->data[3][0] .= "<img src='images/company.png'></a>";
     }
     $table->data[3][1] = print_select(get_contract_status(), 'status', $status, '', '', '', true, 0, false, __('Status'));
     $table->data[4][0] = print_textarea("description", 14, 1, $description, '', true, __('Description'));
     // Optional file update
     $html = "";
     $html .= "<div id=\"contract_files\" class=\"fileupload_form\" method=\"post\" enctype=\"multipart/form-data\">";
     $html .= "<div id=\"drop_file\" style=\"padding:0px 0px;\">";
     $html .= "<table width=\"99%\">";
     $html .= "<td width=\"45%\">";
     $html .= __('Drop the file here');