Exemplo n.º 1
0
 $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);
 $buttons .= print_button(__('Export to CSV'), '', false, 'window.open(\'' . 'include/export_csv.php?export_csv_companies=1&where_clause=' . str_replace('"', "\\'", $where_clause) . '&date=' . $date . '\')', 'class="sub csv"', true);
 $table->data[2][0] = $buttons;
 $table->colspan[2][0] = 4;
 echo '<form method="post" id="company_stats_form" action="index.php?sec=customers&sec2=operation/companies/company_detail">';
 print_table($table);
 // Input hidden for ORDER
 print_input_hidden('order_by_activity', $order_by_activity);
 print_input_hidden('order_by_company', $order_by_company);
 print_input_hidden('order_by_billing', $order_by_billing);
 echo '</form>';
 $companies = crm_get_companies_list($where_clause, $date, $order_by, false, $having);
 $companies = print_array_pagination($companies, "index.php?sec=customers&sec2=operation/companies/company_detail{$search_params}", $offset);
 if ($companies !== false) {
     $table->width = "99%";
     $table->class = "listing";
     $table->data = array();
     $table->style = array();
     $table->colspan = array();
     $table->head[0] = __('ID');
     $table->head[1] = __('Company') . $company_order_image;
     $table->head[2] = __('Role');
     $table->head[3] = __('Contracts');
     $table->head[4] = __('Leads');
     $table->head[5] = __('Manager');
     $table->head[6] = __('Country');
     $table->head[7] = __('Last activity') . $activity_order_image;
     $table->head[8] = __('Billing') . $billing_order_image;
Exemplo n.º 2
0
// Show list of items
// =======================
if (!isset($_GET["update"]) and !isset($_GET["create"])) {
    echo "<h2>" . __('KB Data management') . " &raquo; " . __('Defined data') . "</h2>";
    $condition = get_filter_by_kb_product_accessibility();
    $sql1 = 'SELECT * FROM tkb_data ' . $condition . ' ORDER BY title, id_category, id_product';
    $kb = get_db_all_rows_sql($sql1);
    if (sizeof($kb) > 0) {
        echo '<table width="90%" class="listing">';
        echo "<th>" . __('Title') . "</th>";
        echo "<th>" . __('Timestamp') . "</th>";
        echo "<th>" . __('Category') . "</th>";
        echo "<th>" . __('Product') . "</th>";
        echo "<th>" . __('User') . "</th>";
        echo "<th>" . __('Delete') . "</th>";
        $kb = print_array_pagination($kb, "index.php?sec=kb&sec2=operation/kb/manage_data");
        foreach ($kb as $row) {
            echo "<tr>";
            // Name
            echo "<td valign='top'><b><a href='index.php?sec=kb&sec2=operation/kb/manage_data&update=" . $row["id"] . "'>" . $row["title"] . "</a></b></td>";
            // Timestamp
            echo "<td class='f9'  valign='top'>";
            echo $row["timestamp"];
            // Category
            echo "<td class='f9'>";
            echo get_db_sql("SELECT name FROM tkb_category WHERE id = " . $row["id_category"]);
            // Product
            echo "<td class='f9'>";
            echo get_db_sql("SELECT name FROM tkb_product WHERE id = " . $row["id_product"]);
            // User
            echo "<td class='f9' align='center'>";
Exemplo n.º 3
0
$status_values[1] = __('Show disabled addresses');
$status_values[2] = __('Any');
$table->data[0][3] = print_select($status_values, "search_status", $search_status, '', '', '', true, 0, true);
$validated_values[0] = __('Validated');
$validated_values[1] = __('Pending');
$validated_values[2] = __('Any');
$table->data[0][4] = print_select($validated_values, "search_validate", $search_validate, '', '', '', true, 0, true);
$table->data[0][5] = print_submit_button(__('Search'), "search_btn", false, 'class="sub search"', true);
echo '<form method="post" action="">';
print_table($table);
echo '</form>';
$sql = "SELECT * FROM tnewsletter_address {$where_clause} ORDER BY datetime DESC";
$issues = get_db_all_rows_sql($sql);
$count_addresses = count($issues);
echo '<h5>' . __('Total addresses: ') . $count_addresses . '</h5>';
$issues = print_array_pagination($issues, "index.php?sec=customers&sec2=operation/newsletter/address_definition&search_text={$search_text}&search_status={$search_status}&search_newsletter={$search_newsletter}");
if ($issues !== false) {
    $table->width = "90%";
    $table->class = "listing";
    $table->data = array();
    $table->style = array();
    $table->style[0] = 'font-weight: bold';
    $table->colspan = array();
    $table->head[0] = __('Newsletter');
    $table->head[1] = __('Email');
    $table->head[2] = __('Name');
    $table->head[3] = __('Status');
    $table->head[4] = __('Date');
    $table->head[5] = __('Validated');
    if (give_acl($config["id_user"], $id_group, "CN")) {
        $table->head[6] = __('Disable/Delete');
Exemplo n.º 4
0
}
$table->width = '90%';
$table->class = 'search-table';
$table->style = array();
$table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold;';
$table->data = array();
$table->data[0][0] = __('Search');
$table->data[0][1] = print_input_text("search_text", $search_text, "", 25, 100, true);
$table->data[0][4] = print_submit_button(__('Search'), "search_btn", false, 'class="sub search"', true);
echo '<form method="post" action="">';
print_table($table);
echo '</form>';
$sql = "SELECT * FROM tnewsletter {$where_clause} ORDER BY name";
$newsletters = get_db_all_rows_sql($sql);
$newsletters = print_array_pagination($newsletters, "index.php?sec=customers&sec2=operation/newsletter/operation/newsletter/newsletter_definition&search_text='{$search_text}");
if ($newsletters !== false) {
    $table->width = "90%";
    $table->class = "listing";
    $table->data = array();
    $table->style = array();
    $table->style[0] = 'font-weight: bold; font-size: 14px';
    $table->style[1] = 'font-weight: bold';
    $table->colspan = array();
    $table->head[0] = __('ID');
    $table->head[1] = __('Name');
    $table->head[2] = __('Total addresses');
    $table->head[3] = __('Subscribe Link');
    $table->head[4] = __('Unsubscribe Link');
    $table->head[5] = __('Validated addr.');
    $table->head[6] = __('Invalid addr.');
Exemplo n.º 5
0
		$form .= '</ul></div>';
	$form .= '</div>';
	$form .= '</form>';
	
	print_container_div("lead_form",__("Leads form search"),$form, 'open', false, false);
		
	$leads = crm_get_all_leads ($where_clause);

	if ($leads == false) {
		$count_total_leads = 0;
	} else {
		$count_total_leads = count($leads);
	}

	if ($leads !== false) {
		$leads = print_array_pagination ($leads, "index.php?sec=customers&sec2=operation/leads/lead&tab=search$search_params", $offset);
		unset ($table);
		
		$table = new stdClass();
		$table->width = "100%";
		$table->class = "listing";
		$table->data = array ();
		$table->size = array ();
		$table->style = array ();
		$table->rowstyle = array ();

		$table->style[0] = 'font-weight: bold';
		$table->head = array ();
		$table->head[0] = print_checkbox ('leadcb-all', "", false, true);
		$table->head[1] = __('#');
		$table->head[2] = __('Product');
Exemplo n.º 6
0
	print_table ($table);
	
	echo "</div>";
	echo '</form>';
	
	if ($owner == $config['id_user'] && $creator == "") {
		$order_by = "ORDER BY created_by_user, priority, last_update DESC";
	} elseif ($creator == $config['id_user'] && $owner == "") {
		$order_by = "ORDER BY assigned_user, priority, last_update DESC";
	} else {
		$order_by = "ORDER BY priority, last_update DESC";
	}
	
	$wos = get_workorders ($where_clause, $order_by);

	$wos = print_array_pagination ($wos, "index.php?sec=projects&sec2=operation/workorders/wo$params");

	if ($wos !== false) {
		unset ($table);
		$table = new StdClass();
		$table->width = "100%";
		$table->class = "listing";
		$table->data = array ();
		$table->size = array ();
		$table->style = array ();
		$table->rowstyle = array ();

		
		$table->head = array ();
		$table->head[0] = __('WO #');
		$table->head[2] = __('Name');
Exemplo n.º 7
0
 echo "</td>";
 echo "<td>";
 echo print_input_text('search_date_end', $search_date_end, '', 15, 20, true, __('Ending To'));
 echo "<a href='#' class='tip'><span>" . __('Date format is YYYY-MM-DD') . "</span></a>";
 echo "</td>";
 echo "<td valign=bottom align='right'>";
 echo 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);
 echo print_button(__('Export to CSV'), '', false, 'window.open(\'include/export_csv.php?export_csv_contracts=1&where_clause=' . str_replace('"', "\\'", $where_clause) . '\')', 'class="sub csv"', true);
 echo "</td>";
 echo "</tr>";
 echo "</table>";
 echo '</form>';
 $contracts = crm_get_all_contracts($where_clause);
 $contracts = print_array_pagination($contracts, "index.php?sec=customers&sec2=operation/contracts/contract_detail&{$search_params}");
 if ($contracts !== false) {
     $table->width = "99%";
     $table->class = "listing";
     $table->cellspacing = 0;
     $table->cellpadding = 0;
     $table->tablealign = "left";
     $table->data = array();
     $table->size = array();
     $table->style = array();
     $table->colspan = array();
     $table->style[3] = "font-size: 8px";
     $table->style[4] = "font-size: 8px";
     $table->style[1] = "font-size: 9px";
     $table->head[0] = __('Name');
     $table->head[1] = __('Contract number');
Exemplo n.º 8
0
        audit_db($config["id_user"], $config["REMOTE_ADDR"], "Group management", "Deleted group '{$name}'");
        echo '<h3 class="suc">' . __('Successfully deleted') . '</h3>';
    }
}
$offset = get_parameter("offset", 0);
$search_text = get_parameter("search_text", "");
echo "<table class='search-table' style='width: 99%;'><form name='bskd' method=post action='index.php?sec=users&sec2=godmode/grupos/lista_grupos'>";
echo "<td>";
echo "<b>" . __('Search text') . "</b>&nbsp;&nbsp;";
print_input_text("search_text", $search_text, '', 40, 0, false);
echo "</td>";
echo "<td>";
print_submit_button(__('Search'), '', false, 'class="sub next"', false, false);
echo "</td>";
echo "</table></form>";
$groups = get_db_all_rows_sql("SELECT * FROM tgrupo WHERE nombre LIKE '%{$search_text}%' ORDER BY nombre");
$groups = print_array_pagination($groups, "index.php?sec=users&sec2=godmode/grupos/lista_grupos");
print_groups_table($groups);
echo '<form method="post" action="index.php?sec=users&sec2=godmode/grupos/configurar_grupo">';
echo '<div class="button" style="width: ' . $table->width . '">';
print_submit_button(__('Create'), 'create_btn', false, 'class="sub next"');
echo '</div>';
echo '</form>';
?>

<script type="text/javascript" src="include/js/jquery.validation.functions.js"></script>

<script type="text/javascript">
trim_element_on_submit('#text-search_text');
</script>
Exemplo n.º 9
0
}
// Add item form
$table->width = "99%";
$table->class = "search-table-button";
$table->data = array();
$table->size = array();
$table->style = array();
$table->data[0][0] = "<h3>" . __("Add activity") . "</h3>";
$table->data[1][0] = "<textarea name='comments' style='width:98%; height: 210px'></textarea>";
$table->data[2][0] = print_submit_button(__('Add activity'), "create_btn", false, 'class="sub next"', true);
echo '<form method="post" action="index.php?sec=customers&sec2=operation/leads/lead_detail&id=' . $id . '&op=activity&op2=add">';
print_table($table);
echo '</form>';
$sql = "SELECT * FROM tlead_activity WHERE id_lead = {$id} ORDER BY creation DESC";
$activities = get_db_all_rows_sql($sql);
$activities = print_array_pagination($activities, "index.php?sec=customers&sec2=operation/leads/lead_detail&id={$id}&op=activity");
if ($activities !== false) {
    if (sizeof($activities) == 0) {
        echo "<h3>" . __("There is no activity") . "</h3>";
    } else {
        foreach ($activities as $activity) {
            echo "<div class='notetitle'>";
            // titulo
            $timestamp = $activity["creation"];
            $nota = clean_output_breaks($activity["description"]);
            $id_usuario_nota = $activity["written_by"];
            $avatar = get_db_value("avatar", "tusuario", "id_usuario", $id_usuario_nota);
            // Show data
            echo "<img src='images/avatars/" . $avatar . ".png' class='avatar_small'>&nbsp;";
            echo " <a href='index.php?sec=users&sec2=operation/users/user_edit&id={$id_usuario_nota}'>";
            echo $id_usuario_nota;
Exemplo n.º 10
0
		echo '<form method="post" action="index.php?sec=inventory&sec2=operation/manufacturers/manufacturer_detail">';
			print_table ($table);
		echo '</form>';
		echo '<form method="post" action="index.php?sec=inventory&sec2=operation/manufacturers/manufacturer_detail">';
			unset ($table->data);
			$table->data[0][0] = print_submit_button (__('Create'), 'new_btn', false, 'class="sub next"', true);
			$table->data[0][0] .= print_input_hidden ('new_manufacturer', 1);
			print_table ($table);
		echo '</form>';
	echo '</div>';
	
	$sql = "SELECT * FROM tmanufacturer $where_clause ORDER BY name";
	$manufacturers = get_db_all_rows_sql ($sql);
	echo "<div class='divresult'>";
	if ($manufacturers !== false) {
		$manufacturers = print_array_pagination ($manufacturers, "index.php?sec=inventory&sec2=operation/manufacturers/manufacturer_detail");
		
		unset ($table);
		$table = new StdClass();
		$table->width = "100%";
		$table->class = "listing";
		$table->data = array ();
		$table->style = array ();
		$table->style[1] = 'font-weight: bold';
		$table->head = array ();
		$table->head[0] = __('ID');
		$table->head[1] = __('Name');
		$table->head[2] = __('Address');
		$table->head[3] = __('Company role');
		$table->head[4] = __('Delete');
		
Exemplo n.º 11
0
function incidents_search_result($filter, $ajax = false, $return_incidents = false, $print_result_count = false, $no_parents = false, $resolve_names = false, $report_mode = false, $csv_mode = false)
{
    global $config;
    $params = "";
    foreach ($filter as $key => $value) {
        $params .= "&search_" . $key . "=" . $value;
    }
    //Only show incident for last year if there isn't a search by dates
    if (!$filter['first_date'] && !$filter['last_date']) {
        $filter_year = $filter;
        $now = print_mysql_timestamp();
        $year_in_seconds = 3600 * 24 * 365;
        $year_ago_unix = time() - $year_in_seconds;
        $year_ago = date("Y-m-d H:i:s", $year_ago_unix);
        $filter_year['first_date'] = $year_ago;
        $filter_year['last_date'] = $now;
        $count_this_year = filter_incidents($filter_year, true, false, $no_parents, $csv_mode);
        $aux_text = "(" . $count_this_year . ")" . print_help_tip(__("Tickets created last year"), true);
    }
    if (!$report_mode) {
        //Add offset to filter parameters
        $offset = get_parameter("offset");
        $filter["offset"] = $offset;
        // Store the previous limit filter
        $limit_aux = $filter["limit"];
    }
    // Set the limit filter to 0 to retrieve all the tickets for the array pagination
    $filter["limit"] = 0;
    // All the tickets the user sees are retrieved
    $incidents = filter_incidents($filter, false, true, $no_parents, $csv_mode);
    $count = empty($incidents) ? 0 : count($incidents);
    if ($resolve_names) {
        $incidents_aux = array();
        $i = 0;
        foreach ($incidents as $inc) {
            $incidents_aux[$i] = $inc;
            $incidents_aux[$i]['estado'] = incidents_get_incident_status_text($inc['id_incidencia']);
            $incidents_aux[$i]['resolution'] = incidents_get_incident_resolution_text($inc['id_incidencia']);
            $incidents_aux[$i]['prioridad'] = incidents_get_incident_priority_text($inc['id_incidencia']);
            $incidents_aux[$i]['id_grupo'] = incidents_get_incident_group_text($inc['id_incidencia']);
            $incidents_aux[$i]['id_group_creator'] = incidents_get_incident_group_text($inc['id_incidencia']);
            //~ $incidents_aux[$i]['id_incident_type'] = incidents_get_incident_type_text ($inc['id_incidencia']);
            $i++;
        }
        $incidents = $incidents_aux;
    }
    if ($return_incidents) {
        return $incidents;
    }
    if (!$report_mode) {
        // Set the limit filter to its previous value
        $filter["limit"] = $limit_aux;
        $url = "index.php?sec=incidents&sec2=operation/incidents/incident_search" . $params;
        $incidents = print_array_pagination($incidents, $url, $offset);
    }
    $statuses = get_indicent_status();
    $resolutions = get_incident_resolutions();
    // ORDER BY
    if ($filter['order_by'] && !is_array($filter['order_by'])) {
        $order_by = json_decode(clean_output($filter['order_by']), true);
    } else {
        $order_by = $filter['order_by'];
    }
    if (!$report_mode) {
        if ($order_by["id_incidencia"] != "") {
            if ($order_by["id_incidencia"] == "DESC") {
                $id_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"id_incidencia\", \"ASC\")'><img src='images/arrow_down_orange.png'></a>";
            } else {
                $id_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"id_incidencia\", \"\")'><img src='images/arrow_up_orange.png'></a>";
            }
        } else {
            $id_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"id_incidencia\", \"DESC\")'><img src='images/block_orange.png'></a>";
        }
        if ($order_by["prioridad"] != "") {
            if ($order_by["prioridad"] == "DESC") {
                $priority_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"prioridad\", \"ASC\")'><img src='images/arrow_down_orange.png'></a>";
            } else {
                $priority_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"prioridad\", \"\")'><img src='images/arrow_up_orange.png'></a>";
            }
        } else {
            $priority_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"prioridad\", \"DESC\")'><img src='images/block_orange.png'></a>";
        }
    } else {
        $id_order_image = "";
        $priority_order_image = "";
    }
    // ----------------------------------------
    // Here we print the result of the search
    // ----------------------------------------
    echo '<table width="99%" cellpadding="0" cellspacing="0" border="0px" class="result_table listing" id="incident_search_result_table">';
    echo '<thead>';
    echo "<tr>";
    echo "<th>";
    echo print_checkbox('incidentcb-all', "", false, true);
    echo "</th>";
    echo "<th>";
    echo __('ID') . $id_order_image;
    echo "</th>";
    echo "<th>";
    echo __('SLA');
    echo "</th>";
    if ($report_mode) {
        echo "<th>";
        echo __(' % SLA');
        echo "</th>";
    }
    echo "<th>";
    echo __('Ticket');
    echo "</th>";
    echo "<th>";
    echo __('Group') . "<br><i>" . __('Company') . "</i>";
    echo "</th>";
    echo "<th>";
    echo __('Status') . "<br><i>" . __('Resolution') . "</i>";
    echo "</th>";
    echo "<th>";
    echo __('Priority') . $priority_order_image;
    echo "</th>";
    echo "<th style='width: 70px;'>";
    echo __('Updated') . "<br><i>" . __('Started') . "</i>";
    echo "</th>";
    if ($config["show_creator_incident"] == 1) {
        echo "<th>";
    }
    echo __('Creator');
    echo "</th>";
    if ($config["show_owner_incident"] == 1) {
        echo "<th>";
    }
    echo __('Owner');
    echo "</th>";
    echo "</tr>";
    echo '</thead>';
    echo "<tbody>";
    if ($incidents == false) {
        echo '<tr><td colspan="11">' . __('Nothing was found') . '</td></tr>';
    } else {
        foreach ($incidents as $incident) {
            /* We print the rows directly, because it will be used in a sortable
               jQuery table and it only needs the rows */
            if ($incident["estado"] < 3) {
                $tr_status = 'class="red_row"';
            } elseif ($incident["estado"] < 6) {
                $tr_status = 'class="yellow_row"';
            } else {
                $tr_status = 'class="green_row"';
            }
            echo '<tr ' . $tr_status . ' id="incident-' . $incident['id_incidencia'] . '"';
            echo " style='border-bottom: 1px solid #ccc;' >";
            echo '<td>';
            print_checkbox_extended('incidentcb-' . $incident['id_incidencia'], $incident['id_incidencia'], false, '', '', 'class="cb_incident"');
            echo '</td>';
            //Print incident link if not ajax, if ajax link to js funtion to replace parent
            $link = "index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=" . $incident["id_incidencia"];
            if ($ajax) {
                $link = "javascript:update_parent('" . $incident["id_incidencia"] . "')";
            }
            echo '<td>';
            if (!$report_mode) {
                echo '<strong><a href="' . $link . '">#' . $incident['id_incidencia'] . '</a></strong></td>';
            } else {
                echo '<strong>' . '#' . $incident['id_incidencia'] . '</strong></td>';
            }
            // SLA Fired ??
            if ($incident["affected_sla_id"] != 0) {
                echo '<td width="25"><img src="images/exclamation.png" /></td>';
            } else {
                echo '<td></td>';
            }
            // % SLA
            if ($report_mode) {
                echo "<td>";
                if ($incident["affected_sla_id"] != 0) {
                    echo format_numeric(get_sla_compliance_single_id($incident['id_incidencia']));
                } else {
                    echo "";
                }
                echo "</td>";
            }
            echo '<td>';
            if (!$report_mode) {
                echo '<strong><a href="' . $link . '">' . $incident['titulo'] . '</a></strong><br>';
            } else {
                echo '<strong>' . $incident['titulo'] . '</strong><br>';
            }
            echo "<span style='font-size:11px;font-style:italic'>";
            echo incidents_get_incident_type_text($incident["id_incidencia"]);
            // Added by slerena 26Ago2013
            $sql = sprintf("SELECT *\n\t\t\t\t\t\t\tFROM tincident_type_field\n\t\t\t\t\t\t\tWHERE id_incident_type = %d", $incident["id_incident_type"]);
            $config['mysql_result_type'] = MYSQL_ASSOC;
            $type_fields = get_db_all_rows_sql($sql);
            $type_fields_values_text = "";
            if ($type_fields) {
                foreach ($type_fields as $type_field) {
                    if ($type_field["show_in_list"]) {
                        $field_data = get_db_value_filter("data", "tincident_field_data", array("id_incident" => $incident["id_incidencia"], "id_incident_field" => $type_field["id"]));
                        if ($field_data) {
                            if ($type_field["type"] == "textarea") {
                                $field_data = "<div style='display: inline-block;' title='{$field_data}'>" . substr($field_data, 0, 15) . "...</div>";
                            }
                            $type_fields_values_text .= " <div title='" . $type_field["label"] . "' style='display: inline-block;'>[{$field_data}]</div>";
                        }
                    }
                }
            }
            echo "&nbsp;{$type_fields_values_text}";
            echo '</span></td>';
            echo '<td>' . get_db_value("nombre", "tgrupo", "id_grupo", $incident['id_grupo']);
            if ($config["show_creator_incident"] == 1) {
                $id_creator_company = get_db_value("id_company", "tusuario", "id_usuario", $incident["id_creator"]);
                if ($id_creator_company != 0) {
                    $company_name = (string) get_db_value('name', 'tcompany', 'id', $id_creator_company);
                    echo "<br><span style='font-size:11px;font-style:italic'>{$company_name}</span>";
                }
            }
            echo '</td>';
            $resolution = isset($resolutions[$incident['resolution']]) ? $resolutions[$incident['resolution']] : __('None');
            echo '<td class="f9"><strong>' . $statuses[$incident['estado']] . '</strong><br /><em>' . $resolution . '</em></td>';
            // priority
            echo '<td>';
            print_priority_flag_image($incident['prioridad']);
            $last_wu = get_incident_lastworkunit($incident["id_incidencia"]);
            if ($last_wu["id_user"] == $incident["id_creator"]) {
                echo "<br><img src='images/comment.gif' title='" . $last_wu["id_user"] . "'>";
            }
            echo '</td>';
            echo '<td style="font-size:11px;">' . human_time_comparation($incident["actualizacion"]);
            // Show only if it's different
            if ($incident["inicio"] != $incident["actualizacion"]) {
                echo "<br><em>[" . human_time_comparation($incident["inicio"]);
                echo "]</em>";
            }
            echo "<br>";
            echo '<span style="font-size:9px;">';
            if (isset($config["show_user_name"]) && $config["show_user_name"]) {
                $updated_by = get_db_value('nombre_real', 'tusuario', 'id_usuario', $last_wu["id_user"]);
            } else {
                $updated_by = $last_wu["id_user"];
            }
            echo $updated_by;
            echo "</span>";
            echo '</td>';
            if ($config["show_creator_incident"] == 1) {
                echo "<td class='f9'>";
                if (isset($config["show_user_name"]) && $config["show_user_name"]) {
                    $incident_creator = get_db_value('nombre_real', 'tusuario', 'id_usuario', $incident["id_creator"]);
                } else {
                    $incident_creator = $incident["id_creator"];
                }
                //~ echo substr($incident_creator,0,12);
                echo $incident_creator;
                echo "</td>";
            }
            if ($config["show_owner_incident"] == 1) {
                echo "<td class='f9'>";
                if (isset($config["show_user_name"]) && $config["show_user_name"]) {
                    $incident_owner = get_db_value('nombre_real', 'tusuario', 'id_usuario', $incident["id_usuario"]);
                } else {
                    $incident_owner = $incident["id_usuario"];
                }
                echo $incident_owner;
                echo "</td>";
            }
            echo '</tr>';
        }
    }
    echo "</tbody>";
    echo "</table>";
    if (!$report_mode) {
        pagination($count, $url, $offset, false, $aux_text);
    }
    if ($print_result_count) {
        echo "<h5>" . $count . __(" ticket(s) found") . "</h5>";
    }
    echo "<br>";
}
Exemplo n.º 12
0
}
// Control to upload file
echo '<div style="width: 99%; text-align: right; margin-bottom: 5px;">';
echo print_button(__('Upload a new file'), 'add_link', false, '$(\'#upload_div\').slideToggle (); return false', 'class="sub upload"');
echo '</div>';
echo '<div id="upload_div" style="width: 95%; padding: 20px; margin: 0px; display: none;" class="integria_form">';
$target_directory = 'attachment';
$action = "index.php?sec=projects&sec2=operation/workorders/wo&id={$id}&tab=files&operation=view&upload=1";
$into_form = "<input type='hidden' name='directory' value='{$target_directory}'><b>Description</b>&nbsp;<input type=text name=description size=60>";
print_input_file_progress($action, $into_form, '', 'sub upload');
echo '</div>';
// List of WO attachments
$sql = "SELECT * FROM tattachment WHERE id_todo = {$id} ORDER BY timestamp DESC";
$files = get_db_all_rows_sql($sql);
if ($files !== false) {
    $files = print_array_pagination($files, "index.php?sec=projects&sec2=operation/workorders/wo&id={$id}&tab=files&operation=view");
    echo "<br>";
    echo "<h3>" . __('Current files on this workorder') . "</h3>";
    unset($table);
    $table->width = "99%";
    $table->class = "listing";
    $table->data = array();
    $table->size = array();
    $table->style = array();
    $table->rowstyle = array();
    $table->head = array();
    $table->head[0] = __('Filename');
    $table->head[1] = __('Description');
    $table->head[2] = __('Size');
    $table->head[3] = __('Date');
    $table->head[4] = __('Ops.');
Exemplo n.º 13
0
$table->data[1][0] = "<textarea name='comments' style='width:98%; height: 210px'></textarea>";

echo '<form method="post" action="index.php?sec=customers&sec2=operation/contacts/contact_detail&op=activity&id='.$id.'&op2=add">';
print_table($table);
	echo "<div class='no' style='width:100%; text-align:right;'>";
		unset($table->data);
		$table->class = "button-form";
		$table->data[2][0] = print_submit_button (__('Add activity'), "create_btn", false, 'class="sub next"', true);
		print_table($table);
	echo '</div>';
echo '</form>';

$sql = "SELECT * FROM tcontact_activity WHERE id_contact = $id ORDER BY creation DESC";

$activities = get_db_all_rows_sql ($sql);
$activities = print_array_pagination ($activities, "index.php?sec=customers&sec2=operation/contacts/contact_detail&op=activity&id=$id");

if ($activities !== false) {	
	if (sizeof($activities) == 0){
		echo ui_print_error_message (__("There is no activity"), '', true, 'h3', true);
	} else {
		foreach ($activities as $activity) {
			echo "<div class='notetitle'>"; // titulo

			$timestamp = $activity["creation"];
			$nota = clean_output_breaks($activity["description"]);
			$id_usuario_nota = $activity["written_by"];

			$avatar = get_db_value ("avatar", "tusuario", "id_usuario", $id_usuario_nota);

			// Show data
Exemplo n.º 14
0
    }
}
// Control to upload file
echo '<div style="width: 99%; text-align: right; margin-bottom: 5px;">';
echo print_button(__('Upload a new file'), 'add_link', false, '$(\'#upload_div\').slideToggle (); return false', 'class="sub upload"');
echo '</div>';
echo '<div id="upload_div" style="width: 95%; padding: 20px; margin: 0px; display: none;" class="integria_form">';
$target_directory = 'attachment';
$action = "index.php?sec=customers&sec2=operation/companies/company_detail&id={$id}&op=files&upload=1";
$into_form = "<input type='hidden' name='directory' value='{$target_directory}'><b>Description</b>&nbsp;<input type=text name=description size=60>";
print_input_file_progress($action, $into_form, '', 'sub upload');
echo '</div>';
// List of lead attachments
$sql = "SELECT * FROM tattachment WHERE id_company = {$id} ORDER BY timestamp DESC";
$files = get_db_all_rows_sql($sql);
$files = print_array_pagination($files, "index.php?sec=customers&sec2=operation/companies/company_detail&id={$id}&op=files");
if ($files !== false) {
    unset($table);
    $table->width = "99%";
    $table->class = "listing";
    $table->data = array();
    $table->size = array();
    $table->style = array();
    $table->rowstyle = array();
    $table->head = array();
    $table->head[0] = __('Filename');
    $table->head[1] = __('Description');
    $table->head[2] = __('Size');
    $table->head[3] = __('Date');
    $table->head[4] = __('Ops.');
    foreach ($files as $file) {
Exemplo n.º 15
0
	echo '<ul class="ui-tabs-nav">';
	echo '<li class="ui-tabs-selected"><span>'.__('Files').'</span></li>';
	echo '<li class="ui-tabs-title">' . __('Files') . '</h1></li>';
	echo '</ul>';
	echo '<br>';

	$target_directory = 'attachment';
	$action = "index.php?sec=customers&sec2=operation/companies/company_detail&id=$id_company&id_invoice=$id_invoice&op=invoices&view_invoice=1&upload_file=1";				
	$into_form = "<input type='hidden' name='directory' value='$target_directory'><b>Description</b>&nbsp;<input type=text name=description size=60>";
	print_input_file_progress($action,$into_form,'','sub upload');	


	// List of invoice attachments
	$sql = "SELECT * FROM tattachment WHERE id_invoice = $id_invoice ORDER BY timestamp DESC";
	$files = get_db_all_rows_sql ($sql);
	$files = print_array_pagination ($files, "index.php?sec=customers&sec2=operation/companies/company_detail&id=$id_company&id_invoice=$id_invoice&op=invoices&view_invoice=1");

	if ($files !== false) {
		unset ($table);
		$table->width = "99%";
		$table->class = "listing";
		$table->data = array ();
		$table->size = array ();
		$table->style = array ();
		$table->rowstyle = array ();

		$table->head = array ();
		$table->head[0] = __('Filename');
		$table->head[1] = __('Description');
		$table->head[2] = __('Size');
		$table->head[3] = __('Date');
Exemplo n.º 16
0
$into_form = "<input type='hidden' name='directory' value='$target_directory'><b>Description</b>&nbsp;<input type=text name=description size=20>";
print_input_file_progress($action,$into_form,'','sub upload');
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</div>';

// List of lead attachments

$sql = "SELECT * FROM tattachment WHERE id_lead = $id ORDER BY timestamp DESC";
$files = get_db_all_rows_sql ($sql);	

echo "<div style='width: 86%; float: right;'>";
echo "<div class='divresult'>";
if ($files !== false) {
	$files = print_array_pagination ($files, "index.php?sec=customers&sec2=operation/leads/lead_detail&id=$id&op=files");
	unset ($table);
	$table->width = "100%";
	$table->class = "listing";
	$table->data = array ();
	$table->size = array ();
	$table->style = array ();
	$table->rowstyle = array ();

	$table->head = array ();
	$table->head[0] = __('Filename');
	$table->head[1] = __('Description');
	$table->head[2] = __('Size');
	$table->head[3] = __('Date');
	$table->head[4] = __('Ops.');
Exemplo n.º 17
0
		$form .= '</div>';
	$form .= '</div>';
	$form .= '</form>';
	
	print_container_div("companys_form",__("Invoices form search"),$form, 'open', false, false);
}

$invoices = crm_get_all_invoices ($where_clause, $order_by);

// NO pagination for PDF output
if ($clean_output == 1)
	$config["block_size"] = 5000;

if ($invoices != false) {
	
	$invoices = print_array_pagination ($invoices, "index.php?sec=customers&sec2=operation/invoices/invoice_detail$search_params");
	$url_id_order = 'index.php?sec=customers&sec2=operation/invoices/invoice_detail'.$search_params.'&order_by=bill_id';
	$url_create_order = 'index.php?sec=customers&sec2=operation/invoices/invoice_detail'.$search_params.'&order_by=invoice_create_date';
	switch ($order_by) {
		case "bill_id":
			$id_img = "&nbsp;<a href='$url_id_order'><img src='images/arrow_down_orange.png'></a>";
			$date_img = "&nbsp;<a href='$url_create_order'><img src='images/block_orange.png'></a>";
			break;
		case "invoice_create_date":
			$date_img = "&nbsp;<a href='$url_create_order'><img src='images/arrow_down_orange.png'></a>";
			$id_img = "&nbsp;<a href='$url_id_order'><img src='images/block_orange.png'></a>";
			break;
		case '':
			$id_img = "&nbsp;<a href='$url_id_order'><img src='images/block_orange.png'></a>";
			$date_img = "&nbsp;<a href='$url_create_order'><img src='images/arrow_down_orange.png'></a>";
	}
Exemplo n.º 18
0
 $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][1] = print_company_autocomplete_input($params);
 $table->data[0][2] = 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[0][3] = print_button(__('Export to CSV'), '', false, 'window.open(\'include/export_csv.php?export_csv_contacts=1&where_clause=' . str_replace("'", "\\'", $where_clause) . '\')', 'class="sub csv"', true);
 echo '<form id="contact_search_form" method="post">';
 print_table($table);
 echo '</form>';
 $contacts = crm_get_all_contacts($where_clause);
 $contacts = print_array_pagination($contacts, "index.php?sec=customers&sec2=operation/contacts/contact_detail&params={$search_params}", $offset);
 if ($contacts !== false) {
     unset($table);
     $table->width = "99%";
     $table->class = "listing";
     $table->data = array();
     $table->size = array();
     $table->size[3] = '40px';
     $table->style = array();
     // $table->style[] = 'font-weight: bold';
     $table->head = array();
     $table->head[0] = __('Full name');
     $table->head[1] = __('Company');
     $table->head[2] = __('Email');
     if ($section_write_permission || $section_manage_permission) {
         $table->head[3] = __('Delete');
Exemplo n.º 19
0
    $incidents = get_db_all_rows_sql($sql);
}
echo "<h3>" . __('Related incidents');
echo " - " . __('Task') . " - " . $task_name . "</h3>";
echo "<table width=90% class='listing'>";
echo "<tr><th>";
echo __('Incident');
echo "<th>";
echo __('Title');
echo "<th>";
echo __('WU Hours');
echo "<th>";
echo __('Start');
echo "<th>";
echo __('End');
$incidents = print_array_pagination($incidents, "index.php");
foreach ($incidents as $incident) {
    echo "<tr>";
    echo "<td>";
    echo $incident["id_incidencia"];
    echo "<td>";
    echo "<a href='index.php?sec=incidents&sec2=operation/incidents/incident&id=" . $incident["id_incidencia"] . "'>";
    echo $incident["titulo"];
    echo "</a>";
    echo "<td>";
    echo get_incident_workunit_hours($incident["id_incidencia"]);
    echo "<td class='f9'>";
    echo $incident["inicio"];
    echo "<td class='f9'>";
    echo $incident["cierre"];
}