Common Title Function
static public displayTitle ( $ref_pic_link = "", $ref_pic_text = "", $ref_title = "", $ref_btts = "" ) : nothing | ||
$ref_pic_link | Path to the image to display (default '') | |
$ref_pic_text | Alt text of the icon (default '') | |
$ref_title | Title to display (default '') | |
$ref_btts | Extra items to display array(link=>text...) (default '') | |
return | nothing |
function title() { $buttons = array(); $title = ""; $buttons["thread.php"] = __('Back to processes list', 'ocsinventoryng'); Html::displayTitle("", "", $title, $buttons); echo "<br>"; }
/** * Print a good title for group pages * *@return nothing (display) **/ function title() { global $CFG_GLPI; $buttons = array(); $title = ""; if (Session::haveRight(static::$rightname, UPDATE)) { $url = Toolbox::getItemTypeSearchURL('PluginDatainjectionModel'); $buttons[$url] = PluginDatainjectionModel::getTypeName(); $title = ""; Html::displayTitle($CFG_GLPI["root_doc"] . "/plugins/datainjection/pics/datainjection.png", PluginDatainjectionModel::getTypeName(), $title, $buttons); } }
/** * Print a good title for user pages * * @return nothing (display) **/ function title() { global $CFG_GLPI; $buttons = array(); $title = self::getTypeName(2); if (static::canCreate()) { $buttons["user.form.php"] = __('Add user...'); $title = ""; if (Auth::useAuthExt()) { // This requires write access because don't use entity config. $buttons["user.form.php?new=1&ext_auth=1"] = __('... From an external source'); } } if (Session::haveRight("import_externalauth_users", "w")) { if (AuthLdap::useAuthLdap()) { $buttons["ldap.php"] = __('LDAP directory link'); } } Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", self::getTypeName(2), $title, $buttons); }
function title() { global $CFG_GLPI; $buttons = array(); if (countElementsInTable($this->getTable())) { $buttons["notimportedemail.php"] = __('List of not imported emails'); } $errors = getAllDatasFromTable($this->getTable(), '`errors` > 0'); $message = ''; if (count($errors)) { $servers = array(); foreach ($errors as $data) { $this->getFromDB($data['id']); $servers[] = $this->getLink(); } $message = sprintf(__('Receivers in error: %s'), implode(" ", $servers)); } if (count($buttons)) { Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", _n('Receiver', 'Receivers', Session::getPluralNumber()), $message, $buttons); } }
/** * Print a good title for group pages * *@return nothing (display) **/ function title() { global $CFG_GLPI; $buttons = array(); if (Group::canUpdate() && Session::haveRight("user", User::UPDATEAUTHENT) && AuthLdap::useAuthLdap()) { $buttons["ldap.group.php"] = __('LDAP directory link'); $title = ""; } else { $title = self::getTypeName(Session::getPluralNumber()); } Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/groupes.png", self::getTypeName(Session::getPluralNumber()), $title, $buttons); }
/** * Print the config form for External API * * @since 9.1 * @return Nothing (display) **/ function showFormAPI() { global $DB, $CFG_GLPI; if (!self::canView()) { return false; } echo "<div class='center spaced' id='tabsbody'>"; $canedit = Config::canUpdate(); if ($canedit) { echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>"; } echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='4'>" . __('API') . "</th></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . __('URL of the API') . "</td>"; echo "<td colspan='3'><input type='text' name='url_base_api' size='80' value='" . $CFG_GLPI["url_base_api"] . "'></td>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . __("Enable Rest API") . "</td>"; echo "<td>"; Dropdown::showYesNo("enable_api", $CFG_GLPI["enable_api"]); echo "</td>"; if ($CFG_GLPI["enable_api"]) { echo "<td colspan='2'>"; $inline_doc_api = trim($CFG_GLPI['url_base_api'], '/') . "/"; echo "<a href='{$inline_doc_api}'>" . __("API inline Documentation") . "</a>"; echo "</td>"; } echo "</tr>"; echo "<tr><th colspan='4'>" . __('Authentication') . "</th></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>"; echo __("Enable login with credentials") . " "; Html::showToolTip(__("Allow to login to api and get a session token with user credentials")); echo "</td>"; echo "<td>"; Dropdown::showYesNo("enable_api_login_credentials", $CFG_GLPI["enable_api_login_credentials"]); echo "</td>"; echo "<td>"; echo __("Enable login with external token") . " "; Html::showToolTip(__("Allow to login to api and get a session token with user external token. See Remote access key in user Settings tab ")); echo "</td>"; echo "<td>"; Dropdown::showYesNo("enable_api_login_external_token", $CFG_GLPI["enable_api_login_external_token"]); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_2'><td colspan='4' class='center'>"; echo "<input type='submit' name='update' class='submit' value=\"" . _sx('button', 'Save') . "\">"; echo "<br><br><br>"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); echo "<table class='tab_cadre_fixe'>"; echo "<tr><td>"; echo "<hr>"; $buttons["apiclient.form.php"] = __('Add API client'); $title = ""; Html::displayTitle("", self::getTypeName(Session::getPluralNumber()), "", $buttons); Search::show("APIClient"); echo "</td></tr>"; echo "</table></div>"; }
This file is part of GLPI. GLPI 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. GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief Search engine from cron tasks */ include '../inc/includes.php'; Session::checkRight("config", "w"); Html::header(Crontask::getTypeName(2), $_SERVER['PHP_SELF'], 'config', 'crontask'); $crontask = new CronTask(); if ($crontask->getNeedToRun(CronTask::MODE_INTERNAL)) { $name = sprintf(__('%1$s %2$s'), $crontask->fields['name'], Html::getSimpleForm($crontask->getFormURL(), array('execute' => $crontask->fields['name']), __('Execute'))); Html::displayTitle($CFG_GLPI['root_doc'] . '/pics/warning.png', __('Next run'), sprintf(__('Next task to run: %s'), $name)); } else { Html::displayTitle($CFG_GLPI['root_doc'] . '/pics/ok.png', __('No action pending'), __('No action pending')); } Search::show('CronTask'); Html::footer();
/** * Print a title for backup rules * * @since version 0.85 * * @return nothing (display) **/ static function titleBackup() { global $CFG_GLPI; $buttons = array(); $title = ""; $buttons["rule.backup.php?action=import"] = _x('button', 'Import'); $buttons["rule.backup.php?action=export"] = _x('button', 'Export'); Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/sauvegardes.png", _n('User', 'Users', Session::getPluralNumber()), $title, $buttons); }
/** * @param $item CommonITILObject * @param $type */ static function alertValidation(CommonITILObject $item, $type) { global $CFG_GLPI; // No alert for new item if ($item->isNewID($item->getID())) { return; } $status = array_merge($item->getClosedStatusArray(), $item->getSolvedStatusArray()); $message = __s("This item is waiting for approval, do you really want to resolve or close it?"); switch ($type) { case 'status': Html::scriptStart(); echo "\$('[name=\"status\"]').change(function() {\n var status_ko = 0;\n var input_status = \$(this).val();\n if (input_status != undefined) {\n if (("; $first = true; foreach ($status as $val) { if (!$first) { echo "||"; } echo "input_status == {$val}"; $first = false; } echo " )\n && input_status != " . $item->fields['status'] . "){\n status_ko = 1;\n }\n }\n if ((status_ko == 1)\n && ('" . $item->fields['global_validation'] . "' == '" . self::WAITING . "')) {\n alert('" . $message . "');\n }\n });"; echo Html::scriptEnd(); break; case 'solution': if (!in_array($item->fields['status'], $status) && $item->fields['global_validation'] == self::WAITING) { Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message); } break; } }
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. GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief Search engine from cron tasks */ include '../inc/includes.php'; Session::checkRight("config", UPDATE); Html::header(Crontask::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'config', 'crontask'); $crontask = new CronTask(); if ($crontask->getNeedToRun(CronTask::MODE_INTERNAL)) { $name = sprintf(__('%1$s %2$s'), $crontask->fields['name'], Html::getSimpleForm($crontask->getFormURL(), array('execute' => $crontask->fields['name']), __('Execute'))); Html::displayTitle($CFG_GLPI['root_doc'] . '/pics/warning.png', __('Next run'), sprintf(__('Next task to run: %s'), $name)); } else { Html::displayTitle($CFG_GLPI['root_doc'] . '/pics/ok.png', __('No action pending'), __('No action pending')); } if ($CFG_GLPI['cron_limit'] < countElementsInTable('glpi_crontasks', "frequency = '" . MINUTE_TIMESTAMP . "'")) { Html::displayTitle('', '', __('You have more automatic actions which need to run each minute than the number allow each run. Increase this config.')); } Search::show('CronTask'); Html::footer();
/** * Show the central personal view **/ static function showMyView() { global $DB, $CFG_GLPI; $showticket = Session::haveRight("show_all_ticket", "1") || Session::haveRight("show_assign_ticket", "1"); $showproblem = Session::haveRight("show_all_problem", "1") || Session::haveRight("show_my_problem", "1"); echo "<table class='tab_cadre_central'>"; if (Session::haveRight("config", "w")) { $logins = User::checkDefaultPasswords(); $user = new User(); if (!empty($logins)) { $accouts = array(); foreach ($logins as $login) { $user->getFromDBbyName($login); $accounts[] = $user->getLink(); } $message = sprintf(__('For security reasons, please change the password for the default users: %s'), implode(" ", $accounts)); echo "<tr><th colspan='2'>"; Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message); echo "</th></tr>"; } if (file_exists(GLPI_ROOT . "/install/install.php")) { echo "<tr><th colspan='2'>"; $message = sprintf(__('For security reasons, please remove file: %s'), "install/install.php"); Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message); echo "</th></tr>"; } } if ($DB->isSlave() && !$DB->first_connection) { echo "<tr><th colspan='2'>"; Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", __('MySQL replica: read only'), __('MySQL replica: read only')); echo "</th></tr>"; } echo "<tr><td class='top'><table class='central'>"; echo "<tr><td>"; if (Session::haveRight('validate_request', 1) || Session::haveRight('validate_incident', 1)) { Ticket::showCentralList(0, "tovalidate", false); } if (Ticket::isAllowedStatus(Ticket::SOLVED, Ticket::CLOSED)) { Ticket::showCentralList(0, "toapprove", false); } Ticket::showCentralList(0, "rejected", false); Ticket::showCentralList(0, "requestbyself", false); Ticket::showCentralList(0, "observed", false); if ($showticket) { Ticket::showCentralList(0, "process", false); Ticket::showCentralList(0, "waiting", false); } if ($showproblem) { Problem::showCentralList(0, "process", false); } echo "</td></tr>"; echo "</table></td>"; echo "<td class='top'><table class='central'>"; echo "<tr><td>"; Planning::showCentral(Session::getLoginUserID()); Reminder::showListForCentral(); if (Session::haveRight("reminder_public", "r")) { Reminder::showListForCentral(false); } echo "</td></tr>"; echo "</table></td></tr></table>"; }
function title() { global $CFG_GLPI; $buttons = array(); $title = __('Task', 'fusioninventory'); if ($this->canCreate()) { $buttons["task.form.php?new=1"] = __('Add task', 'fusioninventory'); $title = ""; } Html::displayTitle($CFG_GLPI["root_doc"] . "/plugins/fusinvdeploy/pics/task.png", $title, $title, $buttons); }
/** * Show the central personal view **/ static function showMyView() { global $DB, $CFG_GLPI; $showticket = Session::haveRightsOr("ticket", array(Ticket::READMY, Ticket::READALL, Ticket::READASSIGN)); $showproblem = Session::haveRightsOr('problem', array(Problem::READALL, Problem::READMY)); echo "<table class='tab_cadre_central'>"; if (Session::haveRight("config", UPDATE)) { $logins = User::checkDefaultPasswords(); $user = new User(); if (!empty($logins)) { $accouts = array(); foreach ($logins as $login) { $user->getFromDBbyName($login); $accounts[] = $user->getLink(); } $message = sprintf(__('For security reasons, please change the password for the default users: %s'), implode(" ", $accounts)); echo "<tr><th colspan='2'>"; Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message); echo "</th></tr>"; } if (file_exists(GLPI_ROOT . "/install/install.php")) { echo "<tr><th colspan='2'>"; $message = sprintf(__('For security reasons, please remove file: %s'), "install/install.php"); Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message); echo "</th></tr>"; } } if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { if (!DBMysql::isMySQLStrictMode()) { echo "<tr><th colspan='2'>"; $message = __('MySQL strict mode is not enabled'); Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message); echo "</th></tr>"; } } if ($DB->isSlave() && !$DB->first_connection) { echo "<tr><th colspan='2'>"; Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", __('MySQL replica: read only'), __('MySQL replica: read only')); echo "</th></tr>"; } echo "<tr class='noHover'><td class='top' width='50%'><table class='central'>"; echo "<tr class='noHover'><td>"; if (Session::haveRightsOr('ticketvalidation', TicketValidation::getValidateRights())) { Ticket::showCentralList(0, "tovalidate", false); } if ($showticket) { if (Ticket::isAllowedStatus(Ticket::SOLVED, Ticket::CLOSED)) { Ticket::showCentralList(0, "toapprove", false); } Ticket::showCentralList(0, "survey", false); Ticket::showCentralList(0, "rejected", false); Ticket::showCentralList(0, "requestbyself", false); Ticket::showCentralList(0, "observed", false); Ticket::showCentralList(0, "process", false); Ticket::showCentralList(0, "waiting", false); } if ($showproblem) { Problem::showCentralList(0, "process", false); } echo "</td></tr>"; echo "</table></td>"; echo "<td class='top' width='50%'><table class='central'>"; echo "<tr class='noHover'><td>"; Planning::showCentral(Session::getLoginUserID()); Reminder::showListForCentral(); if (Session::haveRight("reminder_public", READ)) { Reminder::showListForCentral(false); } echo "</td></tr>"; echo "</table></td></tr></table>"; }
/** * Print a good title for group pages * *@return nothing (display) **/ function title() { global $CFG_GLPI; $buttons = array(); if (Session::haveRight("group", "w") && Session::haveRight("user_authtype", "w") && AuthLdap::useAuthLdap()) { $buttons["ldap.group.php"] = __('LDAP directory link'); $title = ""; } else { $title = self::getTypeName(2); } Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/groupes.png", self::getTypeName(2), $title, $buttons); }
function title() { global $CFG_GLPI; $buttons = array(); $title = self::getTypeName(); if ($this->canCreate()) { $buttons["group.form.php?new=1"] = __('Add group', 'fusioninventory'); $title = ""; } Html::displayTitle($CFG_GLPI['root_doc'] . "/plugins/fusinvdeploy/pics/menu_group.png", $title, $title, $buttons); }
/** * add First config Link *@return nothing **/ static function addFirstconfigLink() { global $LANG, $CFG_GLPI; $buttons = array(); $title = _n("User", "Users", 2); if (plugin_mreporting_haveRight('config', 'w')) { $buttons["config.php?new=1"] = $LANG['plugin_mreporting']["config"][10]; $title = ""; } Html::displayTitle($CFG_GLPI["root_doc"] . "/plugins/mreporting/pics/config2.png", _n("User", "Users", 2), $title, $buttons); }