function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getType() == 'Profile' && $item->getField('interface') != 'helpdesk') {
         return PluginFinancialreportsFinancialreport::getTypeName();
     }
     return '';
 }
Financialreports is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Financialreports 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 Financialreports. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginFinancialreportsFinancialreport::getTypeName(), '', "utils", "report");
Session::checkCentralAccess();
//First time this screen is displayed : set the pc mode to 'all'
if (!isset($_SESSION["displaypc"])) {
    $_SESSION["displaypc"] = false;
}
//Changing the pc mode
if (isset($_GET["displaypc"])) {
    if ($_GET["displaypc"] == "false") {
        $_SESSION["displaypc"] = false;
    } else {
        $_SESSION["displaypc"] = true;
    }
}
//First time this screen is displayed : set the notebook mode to 'all'
if (!isset($_SESSION["displaynotebook"])) {
 function showForm($type, $device)
 {
     global $DB, $CFG_GLPI;
     $PluginFinancialreportsFinancialreport = new PluginFinancialreportsFinancialreport();
     $canedit = $PluginFinancialreportsFinancialreport->canView();
     $query = "SELECT *\n      FROM `" . $this->getTable() . "`\n      WHERE `itemtype` = '" . $type . "'\n      AND `items_id` = '" . $device . "'";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     echo "<form method='post' action=\"" . $CFG_GLPI["root_doc"] . "/plugins/financialreports/front/financialreport.php\">";
     echo "<div align='center'><table class=\"tab_cadre_fixe\"  cellspacing=\"2\" cellpadding=\"2\">";
     echo "<tr><th colspan='3'>" . PluginFinancialreportsFinancialreport::getTypeName() . "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td class='left'>";
     echo __('Indicate the date of disposal', 'financialreports') . "</td><td class='left'>";
     if ($number == 1) {
         while ($line = $DB->fetch_array($result)) {
             $ID = $line["id"];
             Html::showDateFormItem("date_disposal", $line["date_disposal"], true, true);
             echo "</td>";
             if ($canedit) {
                 echo "<td class='center' class='tab_bg_2'>";
                 Html::showSimpleForm($CFG_GLPI['root_doc'] . '/plugins/financialreports/front/financialreport.php', 'delete_date', _x('button', 'Delete permanently'), array('id' => $ID));
                 echo "</td>";
             }
         }
     } else {
         if ($canedit) {
             Html::showDateFormItem("date_disposal", "", true, true);
             echo "</td>";
             echo "</tr>";
             echo "<tr><th colspan='3'>";
             echo "<input type='hidden' name='items_id' value='" . $device . "'>";
             echo "<input type='hidden' name='itemtype' value='" . $type . "'>";
             echo "<input type=\"submit\" name=\"add_date\" class=\"submit\" value='" . _sx('button', 'Post') . "'>";
             echo "</th></tr>";
         }
     }
     echo "</table></div>";
     Html::closeForm();
 }