@copyright Copyright (c) 2009-2015 Reports plugin team
 @license   AGPL License 3.0 or (at your option) any later version
            http://www.gnu.org/licenses/agpl-3.0-standalone.html
 @link      https://forge.indepnet.net/projects/reports
 @link      http://www.glpi-project.org/
 @since     2009
 --------------------------------------------------------------------------
*/
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 1;
// Initialization of the variables
include "../../../../inc/includes.php";
//TRANS: The name of the report = Time before equipment start-up
$report = new PluginReportsAutoReport(__('iteminstall_report_title', 'reports'));
//Report's search criterias
$date = new PluginReportsDateIntervalCriteria($report, 'buy_date');
$type = new PluginReportsItemTypeCriteria($report, 'itemtype', '', 'infocom_types');
$budg = new PluginReportsDropdownCriteria($report, 'budgets_id', 'glpi_budgets', __('Budget'));
//Display criterias form is needed
$report->displayCriteriasForm();
$display_type = Search::HTML_OUTPUT;
//If criterias have been validated
if ($report->criteriasValidated()) {
    $report->setSubNameAuto();
    $title = $report->getFullTitle();
    $itemtype = $type->getParameterValue();
    if ($itemtype && $itemtype != "all") {
        $types = array($itemtype);
    } else {
        $types = array();
        $sql = "SELECT DISTINCT `itemtype`\n                FROM `glpi_infocoms` " . getEntitiesRestrictRequest('WHERE', 'glpi_infocoms') . $date->getSqlCriteriasRestriction('AND') . $budg->getSqlCriteriasRestriction('AND');
Beispiel #2
0
 */
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 0;
include "../../../../inc/includes.php";
/*
 * TODO : add more criteria
 *
 * - num_immo not empry
 * - otherserial not empty
 * - etc
 *
 */
//TRANS: The name of the report = Financial information
$report = new PluginReportsAutoReport(__('infocom_report_title', 'reports'));
$ignored = array('Cartridge', 'CartridgeItem', 'Consumable', 'ConsumableItem', 'Software');
$date = new PluginReportsDateIntervalCriteria($report, '`glpi_infocoms`.`buy_date`', __('Date of purchase'));
$type = new PluginReportsItemTypeCriteria($report, 'itemtype', '', 'infocom_types', $ignored);
$budg = new PluginReportsDropdownCriteria($report, '`glpi_infocoms`.`budgets_id`', 'Budget', __('Budget'));
//Display criterias form is needed
$report->displayCriteriasForm();
//If criterias have been validated
if ($report->criteriasValidated()) {
    $report->setSubNameAuto();
    $cols = array(new PluginReportsColumnType('itemtype', __('Item type')), new PluginReportsColumn('manufacturer', __('Manufacturer')), new PluginReportsColumn('type', __('Type')), new PluginReportsColumn('model', __('Model')), new PluginReportsColumnTypeLink('itemid', __('Name'), 'itemtype'), new PluginReportsColumn('serial', __('Serial number')), new PluginReportsColumn('otherserial', __('Inventory number')), new PluginReportsColumn('location', __('Location')), new PluginReportsColumn('building', __('Building number')), new PluginReportsColumn('room', __('Room number')), new PluginReportsColumnLink('groups_id', __('Group'), 'Group'), new PluginReportsColumn('state', __('Status')), new PluginReportsColumn('immo_number', __('Immobilization number')), new PluginReportsColumnDate('buy_date', __('Date of purchase')), new PluginReportsColumnDate('use_date', __('Startup date')), new PluginReportsColumnDate('warranty_date', __('Start date of warranty')), new PluginReportsColumnInteger('warranty_duration', __('Warranty duration')), new PluginReportsColumnInteger('warranty_info', __('Warranty information')), new PluginReportsColumnLink('suppliers_id', __('Supplier'), "Supplier"), new PluginReportsColumnDate('order_date', __('Order date')), new PluginReportsColumn('order_number', __('Order number')), new PluginReportsColumnDate('delivery_date', __('Delivery date')), new PluginReportsColumn('delivery_number', __('Delivery form')), new PluginReportsColumnFloat('value', __('Value')), new PluginReportsColumnFloat('warranty_value', __('Warranty extension value')), new PluginReportsColumnInteger('sink_time', __('Amortization duration')), new PluginReportsColumnInteger('sink_type', __('Amortization type')), new PluginReportsColumnFloat('sink_coeff', __('Amortization coefficient')), new PluginReportsColumn('bill', __('Invoice number')), new PluginReportsColumn('budget', __('Budget')), new PluginReportsColumnDate('inventory_date', __('Date of last physical inventory')));
    $report->setColumns($cols);
    $sel = $type->getParameterValue();
    if ($sel) {
        $types = array($sel);
    } else {
        $types = array_diff($CFG_GLPI['infocom_types'], $ignored);
    }
include "../../../../inc/includes.php";
// Instantiate Report with Name
$report = new PluginReportsAutoReport(__("statSpentTimeByGroup_report_title", "timelineticket"));
//Report's search criterias
$dateYear = date("Y-m-d", mktime(0, 0, 0, date("m"), 1, date("Y") - 1));
$lastday = cal_days_in_month(CAL_GREGORIAN, date("m"), date("Y"));
if (date("d") == $lastday) {
    $dateMonthend = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d"), date("Y")));
    $dateMonthbegin = date("Y-m-d", mktime(0, 0, 0, date("m"), 1, date("Y")));
} else {
    $lastday = cal_days_in_month(CAL_GREGORIAN, date("m") - 1, date("Y"));
    $dateMonthend = date("Y-m-d", mktime(0, 0, 0, date("m") - 1, $lastday, date("Y")));
    $dateMonthbegin = date("Y-m-d", mktime(0, 0, 0, date("m") - 1, 1, date("Y")));
}
$endDate = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d"), date("Y")));
$date = new PluginReportsDateIntervalCriteria($report, '`glpi_tickets`.`closedate`', __('Closing date'));
$date->setStartDate($dateMonthbegin);
$date->setEndDate($dateMonthend);
//Display criterias form is needed
$report->displayCriteriasForm();
$columns = array('closedate' => array('sorton' => 'closedate'), 'id' => array('sorton' => 'id'), 'entities_id' => array('sorton' => 'entities_id'), 'status' => array('sorton' => 'status'), 'date' => array('sorton' => 'date'), 'date_mod' => array('sorton' => 'date_mod'), 'priority' => array('sorton' => 'priority'), 'type' => array('sorton' => 'type'), 'itilcategories_id' => array('sorton' => 'itilcategories_id'), 'name' => array('sorton' => 'name'), 'requesttypes_id' => array('sorton' => 'requesttypes_id'), 'takeintoaccount_delay_stat' => array('sorton' => 'takeintoaccount_delay_stat'), 'slas_id' => array('sorton' => 'slas_id'));
$output_type = Search::HTML_OUTPUT;
if (isset($_POST['list_limit'])) {
    $_SESSION['glpilist_limit'] = $_POST['list_limit'];
    unset($_POST['list_limit']);
}
if (!isset($_REQUEST['sort'])) {
    $_REQUEST['sort'] = "entity";
    $_REQUEST['order'] = "ASC";
}
$limit = $_SESSION['glpilist_limit'];