but WITHOUT ANY WARRANTY; without even the implied warranty of 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/>. -------------------------------------------------------------------------- */ // Original Author of file: Benoit Machiavello // ---------------------------------------------------------------------- $USEDBREPLICATE = 1; $DBCONNECTION_REQUIRED = 1; // Really a big SQL request include "../../../../inc/includes.php"; includeLocales("histohard"); plugin_reports_checkRight('reports', "histohard", "r"); $computer = new Computer(); $computer->checkGlobal('r'); //TRANS: The name of the report = History of last hardware's installations Html::header(__("histohard_report_title", 'reports'), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); echo "<div class='center'>"; echo "<table class='tab_cadrehov'>\n"; echo "<tr class='tab_bg_1 center'>" . "<th colspan='5'>" . __("History of last hardware's installations", 'reports') . "</th></tr>\n"; echo "<tr><th>" . __('Date of inventory', 'reports') . "</th>" . "<th>" . __('User') . "</th>" . "<th>" . __('Network device') . "</th>" . "<th>" . __(-'Field') . "</th>" . "<th>" . __('Modification', 'reports') . "</th></tr>\n"; $sql = "SELECT `glpi_logs`.`date_mod` AS dat, `linked_action`, `itemtype`, `itemtype_link`,\n `old_value`, `new_value`, `glpi_computers`.`id` AS cid, `name`, `user_name`\n FROM `glpi_logs`\n LEFT JOIN `glpi_computers` ON (`glpi_logs`.`items_id` = `glpi_computers`.`id`)\n WHERE `glpi_logs`.`date_mod` > DATE_SUB(Now(), INTERVAL 21 DAY)\n AND `itemtype` = 'Computer'\n AND `linked_action` IN (" . Log::HISTORY_CONNECT_DEVICE . ",\n " . Log::HISTORY_DISCONNECT_DEVICE . ",\n " . Log::HISTORY_DELETE_DEVICE . ",\n " . Log::HISTORY_UPDATE_DEVICE . ",\n " . Log::HISTORY_ADD_DEVICE . ")\n AND `glpi_computers`.`entities_id` = '" . $_SESSION["glpiactive_entity"] . "'\n ORDER BY `glpi_logs`.`id` DESC\n LIMIT 0,100"; $result = $DB->query($sql); $prev = ""; $class = "tab_bg_2"; while ($data = $DB->fetch_array($result)) { if ($prev == $data["dat"] . $data["name"]) {
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/>. -------------------------------------------------------------------------- */ // Original Author of file: Remi Collet // Purpose of file: // ---------------------------------------------------------------------- $USEDBREPLICATE = 1; $DBCONNECTION_REQUIRED = 1; // Really a big SQL request include "../../../../inc/includes.php"; includeLocales("histoinst"); plugin_reports_checkRight('reports', "histoinst", "r"); $computer = new Computer(); $computer->checkGlobal('r'); $software = new Software(); $software->checkGlobal('r'); //TRANS: The name of the report = History of last software's installations Html::header(__('histoinst_report_title', 'reports'), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); echo "<div class='center'>"; echo "<table class='tab_cadrehov' cellpadding='5'>\n"; echo "<tr class='tab_bg_1 center'>" . "<th colspan='4'>" . __("History of last software's installations", "reports") . "</th></tr>\n"; echo "<tr class='tab_bg_2'><th>" . __('Date of inventory', 'reports') . "</th>" . "<th>" . __('User') . "</th>" . "<th>" . __("Computer's name") . "</th>" . "<th>" . sprintf(__('%1$s (%2$s)'), _n('Software', 'Software', 1), __('version')) . "</th></tr>\n"; $sql = "SELECT a.`date_mod` AS dat, a.`new_value`, `glpi_computers`.`id` AS cid, `name`,\n a.`user_name`\n FROM (SELECT `date_mod`, `new_value`, `user_name`, `items_id`, `id`\n FROM `glpi_logs`\n WHERE `glpi_logs`.`date_mod` > DATE_SUB(Now(), INTERVAL 21 DAY)\n AND `linked_action` = '" . Log::HISTORY_INSTALL_SOFTWARE . "'\n AND `itemtype` = 'Computer') a\n LEFT JOIN `glpi_computers` ON (a.`items_id` = `glpi_computers`.`id`)\n WHERE `glpi_computers`.`entities_id` = '" . $_SESSION["glpiactive_entity"] . "'\n ORDER BY a.`id` DESC\n LIMIT 0,200"; $result = $DB->query($sql); $prev = ""; $class = "tab_bg_2";
(at your option) any later version. reports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 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/>. -------------------------------------------------------------------------- */ //***********************REQUETES À REVOIR******************************** //************************************************************************* include "../../../../inc/includes.php"; includeLocales("doublons"); plugin_reports_checkRight('reports', "doublons", "r"); $computer = new Computer(); $computer->checkGlobal('r'); //TRANS: The name of the report = Duplicate computers Html::header(__('doublons_report_title', 'report'), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); $crits = array(0 => Dropdown::EMPTY_VALUE, 1 => __('Name'), 2 => __('Model') . " + " . __('Serial number'), 3 => __('Name') . " + " . __('Model') . " + " . __('Serial number'), 4 => __('MAC address'), 5 => __('IP address'), 6 => __('Inventory number')); if (isset($_GET["crit"])) { $crit = $_GET["crit"]; } else { if (isset($_POST["crit"])) { $crit = $_POST["crit"]; } else { if (isset($_SESSION['plugin_reports_doublons_crit'])) { $crit = $_SESSION['plugin_reports_doublons_crit']; } else {
the Free Software Foundation; either version 2 of the License, or (at your option) any later version. reports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 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/>. -------------------------------------------------------------------------- */ $USEDBREPLICATE = 1; $DBCONNECTION_REQUIRED = 0; include "../../../../inc/includes.php"; plugin_reports_checkRight('reports', "rules", "r"); function plugin_reports_rulelist($rulecollection, $title) { Session::checkRight($rulecollection::$right, "r"); $rulecollection->getCollectionDatas(true, true); echo "<div class='center'>"; echo "<table class='tab_cadre' cellpadding='5'>\n"; echo "<tr><th colspan='6'><a href='" . $_SERVER["PHP_SELF"] . "'>" . __('rules_report_title', 'reports') . "</a> - " . $title . "</th></tr>"; echo "<tr><th>" . __('Name') . "</th>"; echo "<th>" . __('Description') . "</th>"; echo "<th colspan='2'>" . _n('Criterion', 'Criteria', 2) . "</th>"; echo "<th>" . _n('Action', 'Actions', 2) . "</th>"; echo "<th>" . __('Active') . "</th></tr>\n"; foreach ($rulecollection->RuleList->list as $rule) { echo "<tr class='tab_bg_1'>"; echo "<td>" . $rule->fields["name"] . "</td>";
/** * Display a common search criterias form * @param target the form's target * @param params the search criterias */ function displayCriteriasForm() { global $HEADER_LOADED; //Get criteria's values $this->manageCriteriasValues(); //Display Html::header is output is HTML if (isset($_POST["display_type"]) && $_POST["display_type"] != Search::HTML_OUTPUT) { return; } if (!$HEADER_LOADED) { $title = $this->title; if ($this->subname) { $title = sprintf(__('%1$s - %2$s'), $title, $this->subname); } if (isStat($this->name)) { Html::header($title, $_SERVER['PHP_SELF'], "maintain", "stat"); Stat::title(); } else { Html::header($title, $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); } } plugin_reports_checkRight($this->plug, $this->name, "r"); //Display form only if there're criterias if (!empty($this->criterias)) { echo "<div class='center'>"; echo "<form method='post' name='form' action='" . $_SERVER['PHP_SELF'] . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='6'>" . __('Search criteria', 'reports'); //If form is validated, then display the bookmark button if ($this->criteriasValidated()) { //Add parameters to uri to be saved as bookmarks $_SERVER["REQUEST_URI"] = $this->buildBookmarkUrl(); Bookmark::showSaveButton(Bookmark::URI, isStat($this->name) ? 'PluginReportsStat' : 'PluginReportsReport'); } echo "</th></tr>\n"; //Display each criteria's html selection item foreach ($this->criterias as $criteria) { $criteria->displayCriteria(); } $this->closeColumn(); echo "<tr class='tab_bg_2'><td colspan='4' class='center'>"; echo "<input type='submit' name='find' value='" . _sx('button', 'Search') . "' class='submit'>"; echo "</td></tr>"; echo "</table></div>"; Html::closeForm(); } }
global $DB; // Search child entities $sql = "SELECT `id`\n FROM `glpi_entities`\n WHERE `entities_id` = '{$entity}'\n ORDER BY `name`"; $result = $DB->query($sql); while ($data = $DB->fetch_array($result)) { $fille = doStat($table, $data["id"], $header, $level); foreach ($header as $id => $name) { $total[$id] += $fille[$id]; } $total["tot"] += $fille["tot"]; } } $USEDBREPLICATE = 1; $DBCONNECTION_REQUIRED = 0; include "../../../../inc/includes.php"; plugin_reports_checkRight('reports', "pcsbyentity", "r"); //TRANS: The name of the report = Number of items by entity Html::header(__('pcsbyentity_report_title', 'reports'), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); echo "<div class='center'>"; // ---------- Form ------------ echo "<form action='" . $_SERVER["PHP_SELF"] . "' method='post'>"; echo "<table class='tab_cadre' cellpadding='5'>\n"; echo "<tr class='tab_bg_1 center'><th colspan='2'>" . __('Number of items by entity', 'reports') . "</th></tr>\n"; echo "<tr class='tab_bg_1'><td class='right'>" . __('Item type') . "</td>"; echo "<td><select name='type'><option value=''>" . Dropdown::EMPTY_VALUE . "</option>"; $choix = array('Computer' => _n('Computer', 'Computers', 2), 'Monitor' => _n('Monitor', 'Monitors', 2), 'Printer' => _n('Printer', 'Printers', 2), 'NetworkEquipment' => __('Networking'), 'Phone' => _n('Phone', 'Phones', 2)); foreach ($choix as $id => $name) { $item = new $id(); if ($item->canView()) { echo "<option value='" . $id;