/**
  * @param $report
  * @param $name            (default 'itemtype')
  * @param $label           (default '')
  * @param $types     array
  * @param $ignored   array
  **/
 function __construct($report, $name = 'itemtype', $label = '', $types = array(), $ignored = array())
 {
     global $CFG_GLPI;
     parent::__construct($report, $name, NOT_AVAILABLE, $label ? $label : __('Item type'));
     if (is_array($types) && count($types)) {
         // $types is an hashtable of itemtype => display name
         $this->types = $types;
     } else {
         if (is_string($types) && isset($CFG_GLPI[$types])) {
             // $types is the name of an configured type hashtable (infocom_types, doc_types, ...)
             foreach ($CFG_GLPI[$types] as $itemtype) {
                 if (($item = getItemForItemtype($itemtype)) && !in_array($itemtype, $ignored)) {
                     $this->types[$itemtype] = $item->getTypeName();
                 }
             }
             $this->types['all'] = __('All');
         } else {
             // No types, use helpdesk_types
             $this->types = Ticket::getAllTypesForHelpdesk();
             $this->types['all'] = __('All');
         }
     }
 }
 /**
  * @param $report
  * @param $name      (default 'softwarecategories_id')
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'softwarecategories_id', $label = '')
 {
     parent::__construct($report, $name, 'glpi_softwarecategories', $label ? $label : -n('Software category', 'Software categories', 1));
 }
Пример #3
0
 /**
  * @param $report
  * @param $name         (default 'groups_id')
  * @param $label        (default '')
  * @param $condition    (default '')
  **/
 function __construct($report, $name = 'groups_id', $label = '', $condition = '')
 {
     parent::__construct($report, $name, 'glpi_groups', $label ? $label : __('Group'), $condition);
 }
 /**
  * @param $report
  * @param $name      (default 'softwares_id')
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'softwares_id', $label = '')
 {
     parent::__construct($report, $name, 'glpi_softwares', $label ? $label : __('Location'));
 }
Пример #5
0
 /**
  * @param $report
  * @param $name      (default usercategories_id)
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'usercategories_id', $label = '')
 {
     parent::__construct($report, $name, 'glpi_usercategories', $label ? $label : sprintf(__('%1$s: %2$s'), _n('User', 'Users', 1), _n('Type', 'Types', 1)));
 }
Пример #6
0
$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);
    }
    $sql = '';
    foreach ($types as $itemtype) {
            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');
        foreach ($DB->request($sql) as $data) {
            $types[] = $data['itemtype'];
 /**
  * @param $report
  * @param $name      (default 'states_id')
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'states_id', $label = '')
 {
     parent::__construct($report, $name, 'glpi_states', $label ? $label : _n('Status', 'Statuses', 1));
 }
 /**
  * @param $report
  * @param $name      (default 'taskcategories_id')
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'taskcategories_id', $label = '')
 {
     parent::__construct($report, $name, 'glpi_taskcategories', $label ? $label : __('Task category'));
 }
Пример #10
0
 /**
  * @param $report
  * @param $name      (default user)
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'user', $label = '')
 {
     parent::__construct($report, $name, 'glpi_users', $label ? $label : _n('User', 'Users', 1));
 }
Пример #11
0
 /**
  * @param $report
  * @param $name      (default 'value')
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'value', $label = '')
 {
     parent::__construct($report, $name, NOT_AVAILABLE, $label ? $label : __('Name'));
 }
Пример #12
0
 /**
  * @param $report
  * @param $name            (default 'value')
  * @param $label           (default '')
  * @param $signe           (default '')
  * @param $min             (default 0)
  * @param $max             (default 100)
  * @param $coef            (default 1)
  * @param $unit            (default '')
  **/
 function __construct($report, $name = 'value', $label = '', $signe = '', $min = 0, $max = 100, $coef = 1, $unit = '')
 {
     parent::__construct($report, $name, NOT_AVAILABLE, $label ? $label : __('Value'));
     $this->setOptions($signe, $min, $max, $coef, $unit);
 }
 /**
  * @param $report
  * @param $name      (default 'requesttypes_id')
  * @param $label     (default '')
  **/
 function __construct($report, $name = 'requesttypes_id', $label = '')
 {
     parent::__construct($report, $name, NOT_AVAILABLE, $label ? $label : _n('Request source', 'Request sources', 1));
 }
Пример #14
0
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with reports. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
*/
//	Options for GLPI 0.71 and newer : need slave db to access the report
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 1;
// Initialization of the variables
include "../../../../inc/includes.php";
//TRANS: The name of the report = Helpdesk requesters and tickets by entity
$report = new PluginReportsAutoReport(__('statticketsbyentity_report_title', 'reports'));
//Report's search criterias
$prof = new PluginReportsDropdownCriteria($report, 'profiles_id', 'glpi_profiles', __('Profile'));
//Display criterias form is needed
$report->displayCriteriasForm();
//If criterias have been validated
if ($report->criteriasValidated()) {
    $report->setSubNameAuto();
    //Names of the columns to be displayed
    $cols = array(new PluginReportsColumn('name', __('Entity'), array('sorton' => '`glpi_entities`.`completename`')), new PluginReportsColumnInteger('nbusers', __('Users count', 'reports'), array('withtotal' => true, 'sorton' => 'nbusers')), new PluginReportsColumnInteger('number', __('Tickets count', 'reports'), array('withtotal' => true, 'sorton' => 'number')), new PluginReportsColumnDateTime('mindate', __('Older', 'reports'), array('sorton' => 'mindate')), new PluginReportsColumnDateTime('maxdate', __('Newer', 'reports'), array('sorton' => 'maxdate')));
    $report->setColumns($cols);
    $subcpt = "SELECT COUNT(*)\n              FROM `glpi_profiles_users`\n              WHERE `glpi_profiles_users`.`entities_id`=`glpi_entities`.`id` " . $prof->getSqlCriteriasRestriction();
    $query = "SELECT `glpi_entities`.`completename` AS name,\n                    ({$subcpt}) as nbusers,\n                    COUNT(`glpi_tickets`.`id`) AS number,\n                    MIN(`glpi_tickets`.`date`) as mindate,\n                    MAX(`glpi_tickets`.`date`) as maxdate\n             FROM `glpi_entities`\n             INNER JOIN `glpi_tickets` ON (`glpi_tickets`.`entities_id`=`glpi_entities`.`id`)\n             WHERE NOT `glpi_tickets`.`is_deleted` " . getEntitiesRestrictRequest('AND', "glpi_entities") . "GROUP BY `glpi_entities`.`id`" . $report->getOrderBy('name');
    $report->setSqlRequest($query);
    $report->execute(array('withtotal' => true));
} else {
    Html::footer();
}
Пример #15
0
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Resources. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
//Options for GLPI 0.71 and newer : need slave db to access the report
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 1;
include "../../../../inc/includes.php";
// Instantiate Report with Name
$titre = $LANG['plugin_resources']['professionwithoutvolume'];
$report = new PluginReportsAutoReport($titre);
//Report's search criterias
$professioncategory = new PluginReportsDropdownCriteria($report, 'plugin_resources_professioncategories_id', 'glpi_plugin_resources_professioncategories', PluginResourcesProfessionCategory::getTypeName(1));
$professionline = new PluginReportsDropdownCriteria($report, 'plugin_resources_professionlines_id', 'glpi_plugin_resources_professionlines', PluginResourcesProfessionLine::getTypeName(1));
//Display criterias form is needed
$report->displayCriteriasForm();
//colname with sort allowed
$columns = array('professioncategory' => array('sorton' => 'professioncategory'), 'professionline' => array('sorton' => 'professionline'), 'profession' => array('sorton' => 'profession'), 'profession_code' => array('sorton' => 'profession_code'), 'rank_name' => array('sorton' => 'rank'), 'rank_code' => array('sorton' => 'rank_code'), 'begin_date' => array('sorton' => 'begin_date'), 'end_date' => array('sorton' => 'end_date'));
$output_type = Search::HTML_OUTPUT;
// Form validate
if ($report->criteriasValidated()) {
    if (isset($_POST['list_limit'])) {
        $_SESSION['glpilist_limit'] = $_POST['list_limit'];
        unset($_POST['list_limit']);
    }
    if (!isset($_REQUEST['sort'])) {
        $_REQUEST['sort'] = "profession";
        $_REQUEST['order'] = "ASC";
    }
Пример #16
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Typology. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
//Options for GLPI 0.71 and newer : need slave db to access the report
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 1;
include "../../../../inc/includes.php";
$titre = __('Typologies list by service with materials list', 'typology');
// Instantiate Report with Name
$report = new PluginReportsAutoReport($titre);
//Report's search criterias
$typocrit = new PluginReportsDropdownCriteria($report, '`glpi_plugin_typology_typologies`.`id`', 'glpi_plugin_typology_typologies', PluginTypologyTypology::getTypeName(1));
//Display criterias form is needed
$report->displayCriteriasForm();
//colname with sort allowed
$columns = array('entity' => array('sorton' => 'entity'), 'groups_id' => array('sorton' => 'groups_id'), 'typoID' => array('sorton' => 'typoID'), 'COUNT' => array('sorton' => 'COUNT'));
$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'];
if (isset($_POST["display_type"])) {
 /**
  * @param $report
  * @param $name      (default 'itilcategories_id')
  * @param $label     (default '')
  * @param $type      (default '')
  **/
 function __construct($report, $name = 'itilcategories_id', $label = '', $type = '')
 {
     parent::__construct($report, $name, 'glpi_itilcategories', $label ? $label : _n('Categorie of ticket', 'Categories of tickets', 1), $type);
 }
 function __construct($report, $name, $label = '', $options = array())
 {
     parent::__construct($report, $name, NOT_AVAILABLE, $label ? $label : _n('Criterion', 'Criteria', 2));
     $this->choice = $options;
 }
 /**
  * @param $report
  * @param $name      (default 'suppliers_id')
  * @param $label     default '')
  **/
 function __construct($report, $name = 'suppliers_id', $label = '')
 {
     parent::__construct($report, $name, 'glpi_suppliers', $label ? $label : _n('Supplier', 'Suppliers', 1));
 }