Example #1
0
function user_print_autocomplete_input($parameters)
{
    if (isset($parameters['input_name'])) {
        $input_name = $parameters['input_name'];
    }
    $input_value = '';
    if (isset($parameters['input_value'])) {
        $input_value = $parameters['input_value'];
    }
    if (isset($parameters['input_id'])) {
        $input_id = $parameters['input_id'];
    }
    $return = false;
    if (isset($parameters['return'])) {
        $return = $parameters['return'];
    }
    $input_size = 20;
    if (isset($parameters['size'])) {
        $input_size = $parameters['size'];
    }
    $input_maxlength = 30;
    if (isset($parameters['maxlength'])) {
        $input_maxlength = $parameters['maxlength'];
    }
    $src_code = print_image('images/group.png', true, false, true);
    if (isset($parameters['image'])) {
        $src_code = print_image($parameters['image'], true, false, true);
    }
    $title = '';
    if (isset($parameters['title'])) {
        $title = $parameters['title'];
    }
    $help_message = "Type at least two characters to search";
    if (isset($parameters['help_message'])) {
        $help_message = $parameters['help_message'];
    }
    $return_help = true;
    if (isset($parameters['return_help'])) {
        $return_help = $parameters['return_help'];
    }
    $disabled = false;
    if (isset($parameters['disabled'])) {
        $disabled = $parameters['disabled'];
    }
    $attributes = '';
    if (isset($parameters['attributes'])) {
        $attributes = $parameters['attributes'];
    }
    return print_input_text_extended($input_name, $input_value, $input_id, '', $input_size, $input_maxlength, $disabled, '', $attributes, $return, '', $title . print_help_tip($help_message, $return_help));
}
function update_manager_main()
{
    global $config;
    echo "<div class='note_simple'>";
    echo "<p><b>";
    $license = $config['license'];
    if ($license == 'INTEGRIA-FREE') {
        echo "<h3 class='update'>" . __('Your Integria IMS version number is') . ' ' . $config['db_scheme_build'] . "</h3>";
    } else {
        if ($config['current_package'] == 0) {
            echo "<h3 class='update'>" . __('You do not have installed any updates of Integria IMS') . "</h3>";
        } else {
            echo "<h3 class='update'>" . __('Your Integria IMS version number is') . ' ' . $config['current_package'] . "</h3>";
        }
    }
    echo "</b></p>";
    echo '<p class="info_update">' . __('This is a automatilly update Integria IMS. Be careful if you have changed any php file, please make a backup this modified files php. Because the update action ovewrite all php files in Integria IMS.') . '</p>' . '<p class="info_update">' . __('Update Manager sends anonymous information about Integria IMS usage (number of users). To disable it, just remove remote server address from Update Manager in main setup.') . '</p>';
    echo "<h3 class='update_online'>" . __('Online') . "</h3>";
    echo "<div id='box_online'>";
    echo "<div class='loading' style='width:100%; text-align: center;'>";
    print_image("images/wait.gif");
    echo "</div>";
    echo "<div class='checking_package' style='width:100%; text-align: center; display: none;'>";
    echo __('Checking for the newest package.');
    echo "</div>";
    echo "<div class='download_package' style='width:100%; text-align: center; display: none;'>";
    echo __('Downloading the package.');
    echo "</div>";
    echo "<div class='content'></div>";
    echo "<div class='progressbar' style='display: none;'><img class='progressbar_img' src='' /></div>";
    echo "</div>";
    echo "</div>";
    ?>
	<script type="text/javascript">
		var version_update = "";
		var stop_check_progress = 0;
		
		$(document).ready(function() {
			check_online_packages();
			
			
		});
		
		function check_online_packages() {
			$("#box_online .checking_package").show();
			
			var parameters = {};
			parameters['page'] = 'godmode/setup/update_manager';
			parameters['check_online_free_packages'] = 1;
			
			jQuery.post(
				"ajax.php",
				parameters,
				function (data) {
					$("#box_online .checking_package").hide();
					
					$("#box_online .loading").hide();
					$("#box_online .content").html(data);
				},
				"html"
			);
		}
		
		function update_last_package(package, version) {
			version_update = version;
			
			$("#box_online .content").html("");
			$("#box_online .loading").show();
			$("#box_online .download_package").show();
			
			
			var parameters = {};
			parameters['page'] = 'godmode/setup/update_manager';
			parameters['update_last_free_package'] = 1;
			parameters['package'] = package;
			parameters['version'] = version;
			
			jQuery.post(
				"ajax.php",
				parameters,
				function (data) {
					if (data['in_progress']) {
						$("#box_online .loading").hide();
						$("#box_online .download_package").hide();
						
						$("#box_online .content").html(data['message']);
						
						install_package(package,version);
						setTimeout(check_progress_update, 1000);
					}
					else {
						$("#box_online .content").html(data['message']);
					}
				},
				"json"
			);
		}
		
		function install_package(package, version) {
			var parameters = {};
			parameters['page'] = 'godmode/setup/update_manager';
			parameters['install_package'] = 1;
			parameters['package'] = package;
			parameters['version'] = version;
			
			jQuery.post(
				"ajax.php",
				parameters,
				function (data) {
					if (data["status"] == "success") {
						$("#box_online .loading").hide();
						$("#box_online .progressbar").hide();
						$("#box_online .content").html(data['message']);
						stop_check_progress = 1;
					}
					else {
						$("#box_online .loading").hide();
						$("#box_online .progressbar").hide();
						$("#box_online .content").html(data['message']);
						stop_check_progress = 1;
					}
				},
				"json"
			);
		}
		
		function check_progress_update() {
			if (stop_check_progress) {
				return;
			}
			
			var parameters = {};
			parameters['page'] = 'godmode/setup/update_manager';
			parameters['check_update_free_package'] = 1;
			
			jQuery.post(
				"ajax.php",
				parameters,
				function (data) {
					if (stop_check_progress) {
						return;
					}
					
					if (data['correct']) {
						if (data['end']) {
							//$("#box_online .content").html(data['message']);
						}
						else {
							$("#box_online .progressbar").show();
							
							$("#box_online .progressbar .progressbar_img").attr('src',
								data['progressbar']);
							
							setTimeout(check_progress_update, 1000);
						}
					}
					else {
						//$("#box_online .content").html(data['message']);
					}
				},
				"json"
			);
		}
	</script>
	<?php 
}
<h1>Asignaciรณn de tareas globales</h1>
<p>
	La secciรณn Asignaciรณn de tareas globales permite ver las tareas que tiene asignadas un usuario concreto, su rol en la tarea, las unidades de trabajo que ha imputado en ella y las unidades de trabajo totales de la tarea.
	</br>
	</br>
	Ademรกs, desde aquรญ podemos asignar de forma rรกpida (โ€œen bloqueโ€) tareas especรญficas a ese usuario.
	</br>
	</br>
	Esta secciรณn es especialmente รบtil para administradores, en ella pueden ver si un usuario tiene asignadas tareas que no deberรญa, bien de forma global o viendo que el usuario no ha imputado ninguna hora en la tarea. O bien confirmar si el rol del usuario en la tarea es el correcto. Aquรญ podemos โ€œsacarโ€ de una tarea a un usuario con pulsar un solo click.
</p>
<p>
<?php 
print_image("images/help/project26.png", false, false);
?>
</p>
<p>
	Los campos personalizados pueden ser de tipo numรฉrico, texto, combo o bien externo.
</p>
<p>
	<?php 
print_image("images/help/inventory3.png", false, false);
?>
</p>
<p>
	Los campos de tipo externo hacen referencia a una tabla externa en la base de datos y pueden relacionarse con otras tablas. Cuando se crean, se debe detallar el nombre de la tabla y el campo identificador de la misma. En el caso de estar relacionada con otra tabla, tambiรฉn habrรก que especificar el nombre de la tabla padre y el nombre del campo donde se va a almacenar el valor del identificador de dicho padre.
</p>
<p>
	<?php 
print_image("images/help/inventory4.png", false, false);
?>
</p>
<p>
	A la hora de seleccionar el valor de estos campos aparecerรก una ventana modal mostrando toda la informaciรณn de la tabla externa.
</p>
<p>
	<?php 
print_image("images/help/inventory5.png", false, false);
?>
</p>
<p><i>
	Para aรฑadir una tabla externa y usarla posteriormente en los objetos de inventario 
	sรณlo tiene que aรฑadir la tabla que desee con los datos correspondientes dentro 
	de la base de datos de Integria. El mantenimiento de esta tabla se realiza de 
	forma manual operando con ella por medio de sentencias SQL, o bien, utilizando 
	el editor de tablas externas que proporciona Integria IMS.
</i></p>
Example #5
0
define('PATH_site', ereg_replace('[^/]*.[^/]*$', '', dirname(dirname(PATH_thisScript))));
define('PATH_typo3', PATH_site . 'typo3/');
define('PATH_typo3conf', PATH_site . 'typo3conf/');
define('PATH_t3lib', PATH_site . 't3lib/');
require_once PATH_t3lib . 'class.t3lib_div.php';
$image = $_GET['image'];
// remove domain if it is prepended
$image = str_replace(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '', $image);
$allowedExtensions = t3lib_div::trimExplode(',', strlen($TYPO3_CONF_VARS['GFX']['imagefile_ext']) > 0 ? $TYPO3_CONF_VARS['GFX']['imagefile_ext'] : 'gif,jpg,jpeg,tif,bmp,pcx,tga,png,pdf,ai', 1);
$imageInfo = pathinfo($image);
if (!is_file(t3lib_div::getFileAbsFileName($image)) || !in_array(strtolower($imageInfo['extension']), $allowedExtensions)) {
    die('You try to download a file, you are not allowed to download');
}
switch ($_GET['mode']) {
    case 'print':
        print_image($image);
        break;
    case 'save':
        force_download($image);
        break;
    default:
        break;
}
exit;
function print_image($filename)
{
    echo '<html>
	<head>
		<title>Print</title>
		<script type="text/javascript">
		function printit(){
<p>
	El siguiente campo que vamos a crear es MODELO. Se selecciona el padre MARCA y se ponen los valores.
</p>
<p>
	<?php 
print_image("images/help/ticket11.png", false, false);
?>
</p>
<p>
	Por รบltimo, creamos el campo MOTOR.
</p>
<p>
	<?php 
print_image("images/help/ticket12.png", false, false);
?>
</p>
<p>
	Los campos marcados con el check <b>โ€œMostrar en la vista generalโ€</b> son campos que se pueden usar en bรบsquedas y que se muestran en la visualizaciรณn de lista. En los campos de tipo textarea no se puede usar esta casilla.
	</br>
	</br>
	Los campos marcados como <b>โ€œCampo Globalโ€</b> aparecerรกn en todos los tipos de tickets. Serรกn campos comunes usados por todos los tipos de tickets existentes.
</p>
<h1>Vista general:</h1>
<p>
	Aquรญ se pueden ver todos los campos personalizados que tiene un tipo. Desde esta vista se pueden aรฑadir campos, editar, borrar y ordenar su visualizaciรณn en el ticket.
</p>
<p>
	<?php 
print_image("images/help/tipoticket5.png", false, false);
?>
</p>
Example #7
0
<p>
 The new group is important for a few reasons: Firstly, the old alt.* php
 groups suffered from poor propagation - i.e. not all servers carried them,
 and the community was split between multiple groups. This new group offers a
 chance to unite the PHP-Usenet community. Secondly, most servers have longer
 post-retention times for comp.* than alt.*. Finally, the creation of
 comp.lang.php represents PHP's coming to acceptance and maturity. Virtually
 all languages have a spot under the comp.lang.* hierarchy. Stop on by and
 become a part of the community - comp.lang.php is a great place to get help
 and to help others.
</p>

<hr />

<?php 
print_image("news/engine.gif", "Zend Engine 2", "right");
?>

<h1>Alpha 2 of PHP w/ the Zend Engine 2 Now Available</h1>
<p>
 <span class="newsdate">[30-Jun-2002]</span>
 The second alpha release of PHP w/ Zend Engine 2 is <a href="/downloads.php">now
 available</a>. It is based on the current PHP 4 CVS (4.3.0-dev) and includes the new 
 scripting engine which greatly improves the object model, adds exception
 handling and provides a much better infrastructure for the integration
 of external technologies like Java or .NET. For more details and
 examples you can check out the <a href="/zend-engine-2.php">file describing
 the changes</a>.
</p>

<p>
Example #8
0
function graphic_error($flow = true)
{
    global $config;
    if ($flow) {
        Header('Content-type: image/png');
        $imgPng = imageCreateFromPng($config["homedir"] . '/images/error.png');
        imageAlphaBlending($imgPng, true);
        imageSaveAlpha($imgPng, true);
        imagePng($imgPng);
    } else {
        return print_image('images/error.png', true);
    }
}
new or recently created, if its assigned, if it's been reopened, if it's been verified or if it's been unconfirmed. 
This cycle is open to the user and can pass on from one user to another without default restrictions. 
</p>
<p>
In case we want to define the flow, we have an option to Map statuses, 
on which we'll be able to the define which status and solutions will be available to the user: 
</p>
<p>
<?php 
print_image("images/help/workflow_map_status.png", false);
?>
</p>

<p>
<strong >An example of different ticket statuses</strong>
</p>
<p>
<?php 
print_image("images/help/workflow_map_status_2.png", false);
?>
</p>

<p>
There are particular circumstances which act automatically when whe change status. 
When changing status to โ€œclosedโ€, automatically a text box will be activated, an which previously wasn't accessible, 
named โ€œepilogueโ€. The epilogue carries the purpose of explaining the result of the intervention or change, or which was 
-in summary- the cause of the problem and its solution. As we'll see further along, a solved ticket is the basics to generating 
an article in the knowledge base that can be revisited on other occasions, in order to solve a problem in a quick and documented manner.
</p>

Example #10
0
         $table_wu->head['content'] = __('Content');
     }
     $table_wu->style = array();
     $table_wu->style['content'] = 'text-align: center';
     $table_wu->data = array();
     foreach ($all_wu as $wu) {
         // Add the values to the row
         $row = array();
         $row['id_user'] = $wu['id_user'];
         $row['date'] = $wu['date'];
         $row['duration'] = (double) $wu['duration'];
         $row['ticket_id'] = $wu['ticket_id'] ? '#' . $wu['ticket_id'] : '';
         $row['ticket_title'] = $wu['ticket_title'];
         $row['ticket_status'] = $wu['ticket_status'];
         if (!$pdf_output) {
             $row['content'] = sprintf('<div class="tooltip_title" title="%s">%s</div>', $wu['content'], print_image("images/note.png", true));
         }
         $table_wu->data[] = $row;
     }
     $tasks_report .= '<div class="pie_frame">';
     $tasks_report .= print_table($table_task, true) . print_table($table_wu, true);
     $tasks_report .= '</div><br>';
     if ($pdf_output) {
         $tasks_report .= '<hr>';
     }
 } else {
     $tasks_report .= '<div class="pie_frame">';
     $tasks_report .= print_table($table_task, true);
     $tasks_report .= '</div><br>';
     if ($pdf_output) {
         $tasks_report .= '<hr>';
Necesita enviar un email de aviso a un coordinador, cuando una incidencia de prioridad muy alta y de un grupo determinado lleva mรกs de 5 dรญas sin actualizaciones. 
<br>
<br>
Simplemente tiene que rellenar en la condiciรณn โ€œMatch all fieldsโ€, el grupo especรญfico y la prioriad muy alta, solo para incidencias asignadas. En โ€œTime Updateโ€ escogeremos un mes.
</p>

<p>
<?php 
print_image("images/help/workflow_conditions.png", false);
?>
</p>

<p>
Al aรฑadir la acciรณn de enviar un mail, se crearรก automรกticamente la accion de actualizar el ticket, que dejaremos tal cual, para actualizar el ticket y evitar que siga saltando la regla. 
</p>

<p>
<?php 
print_image("images/help/workflow_actions.png", false, false);
?>
</p>
<p>
<?php 
print_image("images/help/workflow_actions2.png", false, false);
?>
</p>
<p>
Al pasar una semana, si no se ha actualizado la incidencia, volverรก a saltar la regla y asi de forma indefinida.
</p>

Example #12
0
										tis.name AS estado
									FROM tworkunit_incident twi
									INNER JOIN tincidencia ti
										ON twi.id_incident = ti.id_incidencia
											AND ti.id_task = %d
									INNER JOIN tincident_status tis
										ON ti.estado = tis.id
								) twin
									ON tw2.id = twin.id_workunit
							) final
							ORDER BY final.id_user, final.timestamp',
							$task['id'], $task['id']);
			$all_wu = get_db_all_rows_sql($sql);
			
			if (!empty($all_wu)) {
				$img_link_tabla_wu = "<span class='img_h2_toggle'><a href='javascript: workunits_task(".$task['id'].")'>" . print_image('images/note.png', true, array('title' => __("Workunit of this task"), 'class' => "wu_image")) . "</a></span>";
				$tabla_taks = print_table($table_task, true);
				
				$tasks_report .= '<tr><td>' . print_container_div("taks_".$task['id'], __('Task').": ".$task['name']. $img_link_tabla_wu, $tabla_taks, 'closed', true, false, '', '', 1, '', 'margin-bottom:0px;') . '</td></tr>';
			}
			else {
				$tasks_report .= '<tr><td>' .print_container_div("task_".$task['id'], __('Task').": ".$task['name'], print_table($table_task, true), 'closed', true, false, '', '', 1, '', '') .'</td></tr>';
			}
		}
	}
	echo '<div class="divresult">';
	//Print containers
		echo "<div class='divhalf divhalf-left'>";
			echo print_container('project_labour_report', __('Labour'), $labour, 'no', true, true, "container_simple_title", "container_simple_div");
		echo "</div>";
		echo "<div class='divhalf divhalf-right'>";	
$search_role = (int) get_parameter("search_role");
$search_country = (string) get_parameter("search_country");
$search_manager = (string) get_parameter("search_manager");
$search_parent = get_parameter("search_parent");
$search_date_begin = get_parameter('search_date_begin');
$search_date_end = get_parameter('search_date_end');
$search_min_billing = (double) get_parameter("search_min_billing");
$order_by_activity = (string) get_parameter("order_by_activity");
$order_by_company = (string) get_parameter("order_by_company");
$order_by_billing = (string) get_parameter("order_by_billing");
echo "<div id='incident-search-content'>";
echo "<h1>" . __('Search statistics');
echo "<div id='button-bar-title'>";
echo "<ul>";
echo "<li>";
echo "<a id='search_form_submit' href='index.php?sec=customers&sec2=operation/companies/company_detail&search_text={$search_text}&search_role={$search_role}&search_country={$search_country}&search_manager={$search_manager}&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}'>" . print_image("images/go-previous.png", true, array("title" => __("Back to search"))) . "</a>";
echo "</li>";
echo "</ul>";
echo "</div>";
echo "</h1>";
$where_clause = '';
if ($search_text != "") {
    $where_clause .= sprintf(' AND ( name LIKE "%%%s%%" OR country LIKE "%%%s%%")  ', $search_text, $search_text);
}
if ($search_role != 0) {
    $where_clause .= sprintf(' AND id_company_role = %d', $search_role);
}
if ($search_country != "") {
    $where_clause .= sprintf(' AND country LIKE "%%s%%" ', $search_country);
}
if ($search_manager != "") {
Example #14
0
     $end = 1;
     foreach ($cont as $row) {
         if ($row != end($cont)) {
             $end = 0;
         }
         $aux_ref_tree = $ref_tree . "" . $count;
         $new = false;
         $count++;
         echo "<li style='margin: 0; padding: 0;'>";
         $less = $lessBranchs;
         if ($count != $countRows) {
             $img = print_image("images/tree/closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $aux_ref_tree . "_object_types_" . $row["id"], "pos_tree" => "2"));
         } else {
             $less = $less + 2;
             // $less = $less or 0b10
             $img = print_image("images/tree/last_closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $aux_ref_tree . "_object_types_" . $row["id"], "pos_tree" => "3"));
         }
         echo "<a onfocus='JavaScript: this.blur()'\n\t\t\t\t\t\thref='javascript: loadTable(\"object_types\",\"" . $row["id"] . "\", " . $less . ", \"" . $id_item . "\",  \"" . $sql_search . "\", \"" . $aux_ref_tree . "\", \"" . $end . "\")'>";
         echo $img;
         echo "<img src='images/objects/" . $row["icon"] . "' style='vertical-align: middle'>";
         echo '&nbsp;' . $row["name"];
         echo "</a>";
         if ($end) {
             echo "<div hiddenDiv='1' loadDiv='0' class='tree_view' id='tree_div" . $aux_ref_tree . "_object_types_" . $row["id"] . "'></div>";
         } else {
             echo "<div hiddenDiv='1' loadDiv='0' class='tree_view tree_view_branch' id='tree_div" . $aux_ref_tree . "_object_types_" . $row["id"] . "'></div>";
         }
         echo "</li>";
     }
     echo "</ul>\n";
 }
function list_property($list)
{
    global $es_settings;
    $es_dimension = get_dimension();
    ?>

    <li class="prop_id-<?php 
    echo $list->prop_id;
    ?>
">
        <div class="es_my_list_in clearfix">
            <div class="es_my_list_pic">
                <div class="prop_labels">
                    <?php 
    if ($list->prop_foreclosure == 1) {
        ?>

                        <label class="es_foreclosure">
                            <?php 
        _e("Foreclosure", 'es-plugin');
        ?>

                        </label><br/>
                    <?php 
    }
    ?>

                    <?php 
    if ($list->prop_open_house == 1) {
        ?>

                        <label class="es_openhouse">
                            <?php 
        _e("Openhouse", 'es-plugin');
        ?>

                        </label><br/>
                    <?php 
    }
    ?>

                    <?php 
    if ($list->prop_featured == 1) {
        ?>

                        <label class="es_featured">
                            <?php 
        _e("Featured", 'es-plugin');
        ?>

                        </label><br/>
                    <?php 
    }
    ?>

                    <?php 
    if ($list->prop_hot == 1) {
        ?>

                        <label class="es_hot">
                            <?php 
        _e("Hot", 'es-plugin');
        ?>

                        </label>
                    <?php 
    }
    ?>

                </div>

                <a href="<?php 
    echo get_permalink($list->prop_id);
    ?>
">
                    <?php 
    print_image($list->prop_id);
    ?>

                </a>

            </div>
            <div class="es_my_list_title">
                <?php 
    $title = $es_settings->title == 1 ? $list->prop_title : $list->prop_address;
    ?>

                <h3>
                    <a href="<?php 
    echo get_permalink($list->prop_id);
    ?>
">
                        <?php 
    echo es_excerpt($title, 30);
    ?>

                    </a>
                </h3>

                <?php 
    if ($es_settings->price == 1) {
        ?>

                <h2>
                    <?php 
        echo get_price($list->prop_price);
        ?>

                </h2>
                <?php 
    }
    ?>

            </div>

            <div class="es_my_list_specs clearfix">
                <span class="es_dimen">
                    <?php 
    if ($list->prop_area != 0) {
        echo $list->prop_area . ' ' . $es_dimension;
    }
    ?>

                </span>
                <span class="es_bd">
                        <?php 
    if ($list->prop_bedrooms != 0) {
        echo $list->prop_bedrooms;
        echo _n(" bed", " beds", $list->prop_bedrooms, 'es-plugin');
    }
    ?>

                </span>
                <span class="es_bth">
                    <?php 
    if ($list->prop_bathrooms != 0) {
        echo str_replace('.0', '', $list->prop_bathrooms);
        echo _n(" bath", " baths", $list->prop_bathrooms, 'es-plugin');
    }
    ?>

                </span>
            </div>
            <div class="es_my_list_more clearfix">
                <a onclick="es_map_view_click(this); return false;"
                   href="<?php 
    if ($list->prop_latitude != "" && $list->prop_longitude != "") {
        echo $list->prop_latitude;
        ?>
,<?php 
        echo $list->prop_longitude;
    }
    ?>
" 
                   class="es_map_view">
                   <?php 
    _e("View on map", 'es-plugin');
    ?>

                </a>
                <a href="<?php 
    echo get_permalink($list->prop_id);
    ?>
"
                   class="es_detail_btn">
                   <?php 
    _e("Details", 'es-plugin');
    ?>

                </a>
            </div>
        </div>
    </li>

<?php 
}
<h1>Dashboard (Main view)</h1>
<p>
	The dashboard is a view that allows the user to, from a simple glance, see tickets that are grouped and have direct access to previously configured custom searches. It's the default screen when we click on Tickets in the main menu.
</p>
<p>
	<?php 
print_image("images/help/ticket20.png", false, false);
?>
</p>
?>
</p>
<p>
	Un ejemplo de uso serรญa si es una factura generada por otro sistema y queremos guardar una imagen del archivo original de la factura aquรญ se puede adjuntar un fichero.
</p>
<p>
	<?php 
print_image("images/help/company9.png", false, false);
?>
</p>
<h2>Generaciรณn de IDs en facturas</h2>
<p>
	Esta utilidad nos permite generar IDs automรกticamente a la hora de generar facturas. Para ello, activaremos la opciรณn 'Enable auto ID' en la configuraciรณn de CRM como vemos en la siguiente captura:
</p>
<p>
	<?php 
print_image("images/help/company10.png", false, false);
?>
</p>
<p>
	En el campo Invoice ID pattern se guarda una cadena de texto que se utilizarรก como patrรณn para generar los IDs. Este patrรณn contendrรก una parte fija y una variable. La parte variable debe ser numรฉrica y servirรก como primer elemento a partir del cual calcular una secuencia. La parte variable irรก entre corchetes. Lo demรกs serรก constante en todas las facturas.
	Ejemplo de patrรณn: 15/[1000].
	</br>
	En este caso, las tres primeras facturas que se va a generar serรกn 15/1000, 15/1001 y 15/1002.
	</br>
	La generaciรณn de IDs de facturas se aplica รบnicamente en las facturas de tipo Enviado.
</p>
<h2>Bloqueo de facturas</h2>
<p>
	Una factura se puede bloquear -mediante el icono del candado- de forma que una vez bloqueada, no se puede modificar. Solo la puede modificar o borrar la persona que bloqueรณ la factura.
</p>
Example #18
0
        $code .= substr($possible, mt_rand(0, strlen($possible) - 1), 1);
        $i++;
    }
    return $code;
}
function print_image($code, $width = 120, $height = 40, $characters = 6)
{
    $font_path = __DIR__ . '/monofont.ttf';
    $font_size = $height * 0.75;
    $image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
    $background_color = imagecolorallocate($image, 255, 255, 255);
    $text_color = imagecolorallocate($image, 20, 40, 100);
    $noise_color = imagecolorallocate($image, 225, 160, 11);
    for ($i = 0; $i < $width * $height / 3; $i++) {
        imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noise_color);
    }
    $textbox = imagettfbbox($font_size, 0, $font_path, $code) or die('Error in imagettfbbox function');
    $x = ($width - $textbox[4]) / 2;
    $y = ($height - $textbox[5]) / 2;
    imagettftext($image, $font_size, 0, $x, $y, $text_color, $font_path, $code) or die('Error in imagettftext function');
    header('Content-Type: image/jpeg');
    imagejpeg($image);
    imagedestroy($image);
    exit;
}
$width = isset($_GET['width']) ? (int) $_GET['width'] : 253;
$height = isset($_GET['height']) ? (int) $_GET['height'] : 60;
$characters = isset($_GET['characters']) && $_GET['characters'] > 1 ? (int) $_GET['characters'] : 6;
$_SESSION['security_code'] = generateCode($characters);
print_image($_SESSION['security_code'], $width, $height, $characters);
Example #19
0
		//1.- Because this user hasn't got incident assigned
		//2.- Because the operator hasn't got enough privileges to see the incidents
		if (!$incidents) {
			continue;
		}		
		
		if ($count % 4 == 0) {
			$search_by_owner .= "<tr>";
		}

		$incidents = get_incidents("id_usuario = '".$owners["id_usuario"]."' AND estado <> 7", true);
		
		$search_by_owner .= "<td>";
		$search_by_owner .= "<a href='index.php?sec=incidents&sec2=operation/incidents/incident_search&search_first_date=" . $first_start . "&search_id_user="******"id_usuario"]."'>";
		if($owners["avatar"]){
			$search_by_owner .= '<div class="bubble_little">' . print_image('images/avatars/' . $owners["avatar"] . '.png', true) . '</div>';
		} else {
			$search_by_owner .= '<div class="bubble_little"></div>';
		}
		$long_name = get_db_value_filter ("nombre_real", "tusuario", array("id_usuario" => $owners["id_usuario"]));
	
		$search_by_owner .= $long_name." (".count($incidents).")";
		$search_by_owner .= "</a>";
		$search_by_owner .= "</td>";
		
		if ($count % 4 == 3) {
			$search_by_owner .= "</tr>";
		}

		//Increase counter
		$count++;
Example #20
0
        echo "<div class= 'dialog ui-dialog-content' title='" . __("User info") . "' id='user_info_window'></div>";
    }
}
// No id passed as parameter
if (!$id and $new_company == 0) {
    $message = get_parameter('message', '');
    if ($message != '') {
        echo "<h3 class='suc'>" . __($message) . "</h3>";
    }
    // Search // General Company listing
    echo "<div id='inventory-search-content'>";
    echo "<h1>" . __('Company management');
    echo "<div id='button-bar-title'>";
    echo "<ul>";
    echo "<li>";
    echo "<a id='company_stats_form_submit' href='javascript: changeAction();'>" . print_image("images/chart_bar_dark.png", true, array("title" => __("Search statistics"))) . "</a>";
    echo "</li>";
    echo "</ul>";
    echo "</div>";
    echo "</h1>";
    $search_text = (string) get_parameter("search_text");
    $search_role = (int) get_parameter("search_role");
    $search_country = (string) get_parameter("search_country");
    $search_manager = (string) get_parameter("search_manager");
    $search_parent = (int) get_parameter("search_parent");
    $search_date_begin = (string) get_parameter("search_date_begin");
    $search_date_end = (string) get_parameter("search_date_end");
    $search_min_billing = (double) get_parameter("search_min_billing");
    $order_by_activity = (string) get_parameter("order_by_activity");
    $order_by_company = (string) get_parameter("order_by_company");
    $order_by_billing = (string) get_parameter("order_by_billing");
		echo "</table>";
	}
    return;
}

echo "<h2>".__('Inventory reports')."</h2>";
if ($id) {
	echo "<h4>".__('Update');
		echo "<div id='button-bar-title'><ul>";
			echo "<li><a href='index.php?sec=projects&sec2=operation/inventories/inventory_reports'>".print_image ("images/flecha_volver.png", true, array("title" => __("Back to Report")))."</a></li>";
		echo "</ul></div>";
	echo "</h4>";
 } else {
	echo "<h4>".__('Create');
		echo "<div id='button-bar-title'><ul>";
			echo "<li><a href='index.php?sec=projects&sec2=operation/inventories/inventory_reports'>".print_image ("images/flecha_volver.png", true, array("title" => __("Back to Report")))."</a></li>";
		echo "</ul></div>";
	echo "</h4>";
}
echo $result_msg;

$table = new stdClass;
$table->width = '100%';
$table->class = 'search-table-button';
$table->data = array ();
$table->colspan = array ();
$table->colspan[1][0] = 2;
$table->colspan[2][0] = 2;
	
$table->data[0][0] = print_input_text ('name', $name, '', 40, 255, true, __('Name'));
Example #22
0
	if(!isset($REMOTE_ADDR)){
		$REMOTE_ADDR = '';
	}
	audit_db ($config['id_user'], $REMOTE_ADDR, "Contact deleted", "Contact named '$fullname' has been deleted");
	echo ui_print_success_message (__('Successfully deleted'), '', true, 'h3', true);
	$id = 0;
}

// FORM (Update / Create)
if ($id || $new_contact) {
	if ($new_contact) {
		echo "<h4>".__('New Contact');
		echo integria_help ("contact_detail", true);
		echo "<div id='button-bar-title'>";
			echo "<ul>";
				echo "<li><a href='index.php?sec=customers&sec2=operation/contacts/contact_detail'>".print_image ("images/flecha_volver.png", true, array("title" => __("Back")))."</a></li>";
			echo "</ul>";
		echo "</div>";
		echo "</h4>";
		if (!$section_write_permission && !$section_manage_permission) {
			audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation","Trying to create a contact in a group without access");
			require ("general/noaccess.php");
			exit;
		}
		$id = 0;
		$fullname = (string) get_parameter ('fullname');
		$phone = (string) get_parameter ('phone');
		$mobile = (string) get_parameter ('mobile');
		$email = (string) get_parameter ('email');
		$position = (string) get_parameter ('position');
		$id_company = (int) get_parameter ('id_company');
  <td></td>
  <td>
   <ul>
    <li>PHP icon resource for Windows</li>
    <li>suitable as icons for file extensions like .php and .phtml</li>
    <li>48x48, 32x32, 24x24, 16x16 sizes, in each of Windows XP Alpha, 256 colour, and 16 colour formats... all in one .ICO file</li>
    <li>these icons are made by Travis Carden (AM)</li>
    <li><a href="/images/logos/php_script.ico">ICO format</a></li>
   </ul>
  </td>
 </tr>

 <tr>
  <td class="logo">
   <?php 
print_image("logos/php_xpstyle_ico.gif", "Windows XP PHP file icons");
?>
<br>
   (not exactly as shown)
  </td>
  <td></td>
  <td>
   <ul>
    <li>PHP icon resource for Windows XP [<b>use only on WinXP!</b>]</li>
    <li>suitable as icons for file extensions like .php and .phtml</li>
    <li>
     48x48, 32x32, 24x24, 16x16 sizes, in each of 16 colour, 256 colour,
     and true colour formats... all in one .ICO file
    </li>
    <li>these icons are made by Jonathan Metillon</li>
    <li><a href="/images/logos/php_xpstyle.ico">XP ICO format</a></li>
Example #24
0
/**
 * Print a code into a DIV and enable a toggle to show and hide it
 * 
 * @param string html code
 * @param string name of the link
 * @param string title of the link
 * @param bool if the div will be hidden by default (default: true)
 * @param bool Whether to return an output string or echo now (default: true)
 * 
 */
function ui_toggle($code, $name, $title = '', $hidde_default = true, $return = false)
{
    /*
    	$hack_metaconsole = '';
    	if (defined('METACONSOLE'))
    		$hack_metaconsole = '../../';
    */
    // Generate unique Id
    $uniqid = uniqid('');
    // Options
    if ($hidde_default) {
        $style = 'display:none';
        $toggle_a = "\$('#tgl_div_" . $uniqid . "').show();";
        $toggle_b = "\$('#tgl_div_" . $uniqid . "').hide();";
        $image_a = print_image("images/go.png", true, false, true);
        $image_b = print_image("images/down.png", true, false, true);
        $original = "images/down.png";
    } else {
        $style = '';
        $toggle_a = "\$('#tgl_div_" . $uniqid . "').hide();";
        $toggle_b = "\$('#tgl_div_" . $uniqid . "').show();";
        $image_a = print_image("images/down.png", true, false, true);
        $image_b = print_image("images/go.png", true, false, true);
        $original = "images/go.png";
    }
    // Link to toggle
    $output = '';
    $output .= '<a href="#" id="tgl_ctrl_' . $uniqid . '"><b>' . $name . '</b>&nbsp;' . print_image($original, true, array("title" => $title, "id" => "image_" . $uniqid)) . '</a>';
    $output .= '<br /><br />';
    // Code into a div
    $output .= "<div id='tgl_div_" . $uniqid . "' style='" . $style . "'>\n";
    $output .= $code;
    $output .= "</div>";
    // JQuery Toggle
    $output .= '<script type="text/javascript">';
    $output .= '/* <![CDATA[ */';
    $output .= "\$(document).ready (function () {";
    $output .= "\$('#tgl_ctrl_" . $uniqid . "').toggle(function() {";
    $output .= $toggle_a;
    $output .= "\$('#image_" . $uniqid . "').attr({src: '" . $image_a . "'});";
    $output .= "}, function() {";
    $output .= $toggle_b;
    $output .= "\$('#image_" . $uniqid . "').attr({src: '" . $image_b . "'});";
    $output .= "});";
    $output .= "});";
    $output .= '/* ]]> */';
    $output .= '</script>';
    if (!$return) {
        echo $output;
    } else {
        return $output;
    }
}
Example #25
0
// $Id$
$_SERVER['BASE_PAGE'] = 'usage.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
site_header("PHP Usage Stats", array("current" => "community"));
?>

<h1>Usage Stats for January 2013</h1>

<p>
PHP: 244M sites, 2.1M IP addresses<br>
Source: <a href="http://news.netcraft.com/archives/2013/01/31/php-just-grows-grows.html">Netcraft</a><br>
</p>

<p>
<?php 
print_image("stats/php-trend-201301-netcraft.png", "Graph");
?>
</p>

<p>
<a href="http://w3techs.com/">w3techs.com</a> provides statistics for
<a href="http://w3techs.com/technologies/overview/programming_language/all">server-side programming languages</a>
where you can also see the market share
<a href="http://w3techs.com/technologies/details/pl-php/all/all">by version</a>.
<br>
See their <a href="http://w3techs.com/faq">FAQ</a> and <a href="http://w3techs.com/technologies">technologies</a>
page for the details of the methodologies used for the surveys.
</p>

<p>
 You can also see how popular PHP is relative to other Apache modules
    echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '&tab=workunits#incident-operations">' . print_image("images/star_dark.png", true, array("title" => __('Comments'))) . '</a>';
    echo '</li>';
    echo '<li>';
    echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '&tab=files#incident-operations">' . print_image("images/disk.png", true, array("title" => __('Files'))) . '</a>';
    echo '</li>';
    echo '<li>';
    echo '<a target="_blank" href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '&clean_output=1">' . print_image("images/chart_bar_dark.png", true, array("title" => __('Statistics'))) . '</a>';
    echo '</li>';
    $tab_extensions = get_tab_extensions($sec2, "indicent-details-view");
    foreach ($tab_extensions as $tab_extension) {
        echo '<li>';
        echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '&tab=' . $tab_extension['tab']['id'] . '">' . print_image($tab_extension['tab']['icon'], true, array("title" => __($tab_extension['tab']['name']))) . '</a>';
        echo '</li>';
    }
    echo '<li class="ui-tabs">';
    echo "<a href='index.php?sec=incidents&sec2=operation/incidents/incident_search&serialized_filter=1'>" . print_image("images/zoom.png", true, array("title" => __("Back to search"))) . "</a>";
    echo '</li>';
    echo "</ul>";
    echo "</div>";
    echo "</h1>";
    $tab = get_parameter("tab", "");
    foreach ($tab_extensions as $tab_extension) {
        if ($tab == $tab_extension['tab']['id']) {
            extensions_call_tab_function($tab, $sec2, "indicent-details-view");
            return;
        }
    }
} else {
    //Close title
    echo "</h1>";
}
Example #27
0
		
		//status
		$all_inventory_status = inventories_get_inventory_status ();
		array_unshift($all_inventory_status, __("All"));
		if(!isset($params['inventory_status'])){
			$params['inventory_status'] = 'All';
		}
		$table_search->data[2][0] = print_select ($all_inventory_status, 'inventory_status', $params['inventory_status'], '', '', '', true, false, false, __('Status'));

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

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

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

		//order column table hidden
		$table_search->data[3][0] .= print_input_hidden ('sort_field', $params['sort_field_num'], true, false, 'sort_field');
		$table_search->data[3][0] .= print_input_hidden	('sort_mode', $params['sort_mode'], true, false, 'sort_mode');
		
		//offset pagination hidden
Example #28
0
function form_search_incident($return = false, $filter = false)
{
    include_once "functions_user.php";
    global $config;
    $output = '';
    if (!$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_id_creator');
        $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('show_hierarchy');
        $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 {
        $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'];
        $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 = "99%";
    $table->class = "search-table-button";
    $table->cellspacing = 2;
    $table->cellpadding = 2;
    $table->data = array();
    $table->size = array();
    $table->style = array();
    $table->style[0] = 'width: 25%';
    $table->style[1] = 'width: 25%';
    $table->style[2] = 'width: 25%; vertical-align:text-top;';
    $table->style[3] = 'width: 25%';
    $table->rowstyle = array();
    $table->rowstyle[1] = 'display: none';
    $table->rowstyle[2] = 'display: none';
    $table->rowstyle[3] = 'display: none';
    $table->rowstyle[4] = 'display: none';
    $table->rowstyle[5] = 'display: none';
    $table->rowstyle[6] = 'text-align: right';
    $table->colspan = array();
    $table->colspan[0][0] = 2;
    $table->colspan[6][0] = 4;
    $table->colspan[7][1] = 3;
    $table->rowspan = array();
    $table->rowspan[2][2] = 2;
    $table->data[0][0] = print_input_text('search_string', $search_string, '', 50, 100, true, __('Search string'));
    $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 = 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'));
    $table->data[0][3] = print_checkbox_extended('search_show_hierarchy', 1, $show_hierarchy, false, '', '', true, __('Show hierarchy'));
    $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['return'] = true;
    $table->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['return'] = true;
    $table->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['return'] = true;
    $table->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['return'] = true;
    $table->data[1][3] = user_print_autocomplete_input($params_creator);
    $table->data[2][0] = print_select(get_priorities(), 'search_priority', $priority, '', __('Any'), -1, true, false, false, __('Priority'), false);
    $table->data[2][1] = print_select(get_incident_resolutions(), 'search_resolution', $resolution, '', __('Any'), -1, true, false, false, __('Resolution'), false);
    $table->data[2][2] = get_last_date_control($date_from, 'search_from_date', __('Date'), $date_start, 'search_first_date', __('Created from'), $date_end, 'search_last_date', __('Created to'));
    $name = $id_inventory ? get_inventory_name($id_inventory) : '';
    $table->data[2][3] = print_input_text('inventory_name', $name, '', 7, 0, true, __('Inventory'), false);
    $table->data[2][3] .= "&nbsp;&nbsp;<a href='javascript: show_search_inventory(\"\",\"\",\"\",\"\",\"\",\"\");'>" . print_image('images/zoom.png', true, array('title' => __('Search inventory'))) . "</a>";
    $table->data[2][3] .= print_input_hidden('id_inventory', $id_inventory, true);
    if (!get_external_user($config["id_user"])) {
        $table->data[4][0] = print_select(get_companies(), 'search_id_company', $id_company, '', __('All'), 0, true, false, false, __('Company'));
    }
    $table->data[4][1] = print_select(get_incident_types(), 'search_id_incident_type', $search_id_incident_type, 'javascript:change_type_fields_table();', __('All'), 0, true, false, false, __('Ticket type'));
    $table->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->data[5][0] = print_select($sla_states, 'search_sla_state', $sla_state, '', __('All'), 0, true, false, false, __('SLA'));
    $table->data[5][1] = combo_task_user_participant($config["id_user"], 0, $id_task, true, __("Task"), 'search_id_task');
    $table->data[5][2] = print_input_text('search_left_sla', $left_sla, '', 7, 0, true, __('SLA > (%)'), false);
    $table->data[5][3] = print_input_text('search_right_sla', $right_sla, '', 7, 0, true, __('SLA < (%)'), false);
    $table_type_fields = new stdclass();
    $table_type_fields->width = "100%";
    $table_type_fields->class = "search-table";
    $table_type_fields->data = array();
    //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']];
            if ($type_field['type'] == "text" || $type_field['type'] == "textarea") {
                $input = print_input_text('search_type_field_' . $type_field['id'], $data, '', 30, 30, true, $type_field['label']);
            } else {
                if ($type_field['type'] == "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']);
                } else {
                    if ($type_field['type'] == "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']);
                    }
                }
            }
            $table_type_fields->data[$row][$column] = $input;
            if ($column >= 3) {
                $column = 0;
                $row++;
            } else {
                $column++;
            }
        }
    }
    if ($table_type_fields->data) {
        $table_type_fields_html = print_table($table_type_fields, true);
    }
    $table->data[6][0] = "<div id='table_type_fields'>" . $table_type_fields_html . "</div>";
    $table->data[7][0] = '<div style="width: 100%; text-align: left; height: 20px;"><a class="show_advanced_search" id="show_advanced_search" href="javascript:show_ad_search();">' . __('Advanced search') . '></a></div>';
    //Store serialize filter
    serialize_in_temp($filter, $config["id_user"]);
    $table->data[7][2] = print_submit_button(__('Search'), 'search', false, 'class="sub search"', true);
    $table->data[7][2] .= print_button(__('Export to CSV'), '', false, 'window.open(\'' . 'include/export_csv.php?export_csv_tickets=1' . '\')', 'class="sub csv"', true);
    $table->colspan[7][2] = 4;
    $output .= '<form id="search_incident_form" method="post" action="index.php?sec=incidents&sec2=operation/incidents/incident_search">';
    $output .= print_table($table, true);
    $output .= '</form>';
    echo "<div class= 'dialog ui-dialog-content' id='search_inventory_window'></div>";
    if ($return) {
        return $output;
    }
    echo $output;
}
Example #29
0
function print_container($id, $title, $content, $open = 'open', $return = true, $margin = true, $h2_clases = '', $div_classes = '')
{
    $container_div_style = '';
    $container_style = '';
    $h2_style = '';
    $h2_class_extra = ' clickable';
    $arrow = '';
    $onclick = 'toggleDiv (\'' . $id . '_div\')';
    switch ($open) {
        case 'open':
            $arrow = '&nbsp;&nbsp;' . print_image('images/arrow_down.png', true, array('class' => 'arrow_down')) . '</h2>';
            break;
        case 'closed':
            $arrow = '&nbsp;&nbsp;' . print_image('images/arrow_right.png', true, array('class' => 'arrow_right')) . '</h2>';
            $container_div_style = 'display: none;';
            break;
        case 'no':
        default:
            $onclick = '';
            $h2_style = 'cursor: auto;';
            $h2_class_extra = '';
            break;
    }
    if ($margin !== true) {
        $margin = (int) $margin;
        $h2_style .= 'padding-left: ' . $margin . 'px; height: 22px;';
        $container_style = 'padding-left: 0px; padding-bottom: 3px; font-size: 0.90em; min-height: 0px;';
    }
    $container = '<div class="container ' . $id . '_container" style="' . $container_style . '">';
    $container .= '<h2 id="' . $id . '" class="dashboard_h2 ' . $h2_class_extra . ' ' . $h2_clases . '" onclick="' . $onclick . '" style="' . $h2_style . '">' . $title;
    $container .= $arrow;
    $container .= '</h2>';
    $container .= '<div id="' . $id . '_div" class="container_div ' . $div_classes . '" style="' . $container_div_style . '">';
    $container .= $content;
    $container .= '</div>';
    $container .= '</div>';
    // container
    if ($return) {
        return $container;
    } else {
        echo $container;
    }
}
Example #30
0
    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 {
            $inventories[$id_inventory] = get_db_value('name', 'tinventory', 'id', $id_inventory);
        }
    }
    $table_advanced->data[3][2] = print_select($inventories, 'incident_inventories', NULL, '', '', '', true, false, false, __('Objects affected'));
    $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: incident_show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
    $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: removeInventory();'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
} else {
    $inventories = get_inventories_in_incident($id);
    $table_advanced->data[3][2] = print_select($inventories, 'incident_inventories', NULL, '', '', '', true, false, false, __('Objects affected'), $blocked_incident);
    if (!$blocked_incident) {
        $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: incident_show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
        $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: removeInventory();'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
    }
}
foreach ($inventories as $inventory_id => $inventory_name) {
    $table_advanced->data[3][2] .= print_input_hidden("inventories[]", $inventory_id, true, 'selected-inventories');
}
// END TABLE ADVANCED
$table->colspan['row_advanced'][0] = 4;
$table->data['row_advanced'][0] = print_container('advanced_parameters_incidents_form', __('Advanced parameters'), print_table($table_advanced, true), 'closed', true, false);
$table->colspan[9][0] = 4;
$table->colspan[10][0] = 4;
$disabled_str = $disabled ? 'readonly="1"' : '';
$table->data[9][0] = print_textarea('description', 9, 80, $description, $disabled_str, true, __('Description'), $blocked_incident);
// This is never shown in create form
if (!$create_incident) {
    //Show or hidden epilog depending on incident status