/** * @param $tt TicketTemplate object * @param $withtemplate (default '') **/ static function showForTicketTemplate(TicketTemplate $tt, $withtemplate = '') { global $DB, $CFG_GLPI; $itilcategory = new self(); $ID = $tt->fields['id']; if (!$tt->getFromDB($ID) || !$tt->can($ID, READ)) { return false; } $ttm = new self(); $rand = mt_rand(); echo "<div class='center'>"; $query = "SELECT `glpi_itilcategories`.*\n FROM `glpi_itilcategories`\n WHERE (`tickettemplates_id_incident` = '{$ID}')\n OR (`tickettemplates_id_demand` = '{$ID}')\n ORDER BY `name`"; if ($result = $DB->query($query)) { echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='3'>"; echo "<a href='" . Toolbox::getItemTypeSearchURL($itilcategory->getType()) . "'>"; echo self::getTypeName($DB->numrows($result)); echo "</a>"; echo "</th></tr>"; $used_incident = array(); $used_demand = array(); if ($DB->numrows($result)) { echo "<th>" . __('Name') . "</th>"; echo "<th>" . __('Incident') . "</th>"; echo "<th>" . __('Request') . "</th>"; echo "</tr>"; while ($data = $DB->fetch_assoc($result)) { echo "<tr class='tab_bg_2'>"; $itilcategory->getFromDB($data['id']); echo "<td>" . $itilcategory->getLink(array('comments' => true)) . "</td>"; if ($data['tickettemplates_id_incident'] == $ID) { echo "<td class='center'>\n <img src='" . $CFG_GLPI["root_doc"] . "/pics/ok.png' alt=\"" . __('OK') . "\" width='14' height='14'>\n </td>"; $used_incident[] = $data["id"]; } else { echo "<td> </td>"; } if ($data['tickettemplates_id_demand'] == $ID) { echo "<td class='center'>\n <img src='" . $CFG_GLPI["root_doc"] . "/pics/ok.png' alt=\"" . __('OK') . "\" width='14' height='14'>\n </td>"; $used_demand[] = $data["id"]; } else { echo "<td> </td>"; } } } else { echo "<tr><th colspan='3'>" . __('No item found') . "</th></tr>"; } echo "</table></div>"; } }
/** * Print the computers disks * * @param $comp Computer object * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForComputer(Computer $comp, $withtemplate = '') { global $DB; $ID = $comp->fields['id']; if (!$comp->getFromDB($ID) || !$comp->can($ID, READ)) { return false; } $canedit = $comp->canEdit($ID); if ($canedit && !(!empty($withtemplate) && $withtemplate == 2)) { echo "<div class='center firstbloc'>" . "<a class='vsubmit' href='computerdisk.form.php?computers_id={$ID}&withtemplate=" . $withtemplate . "'>"; _e('Add a volume'); echo "</a></div>\n"; } echo "<div class='center'>"; $query = "SELECT `glpi_filesystems`.`name` AS fsname,\n `glpi_computerdisks`.*\n FROM `glpi_computerdisks`\n LEFT JOIN `glpi_filesystems`\n ON (`glpi_computerdisks`.`filesystems_id` = `glpi_filesystems`.`id`)\n WHERE `computers_id` = '{$ID}'\n AND `is_deleted` = '0'"; if ($result = $DB->query($query)) { echo "<table class='tab_cadre_fixehov table-striped table-hover'>"; $colspan = 7; if (Plugin::haveImport()) { $colspan++; } echo "<tr class='noHover'><th colspan='{$colspan}'>" . self::getTypeName($DB->numrows($result)) . "</th></tr>"; if ($DB->numrows($result)) { $header = "<tr><th>" . __('Name') . "</th>"; if (Plugin::haveImport()) { $header .= "<th>" . __('Automatic inventory') . "</th>"; } $header .= "<th>" . __('Partition') . "</th>"; $header .= "<th>" . __('Mount point') . "</th>"; $header .= "<th>" . __('File system') . "</th>"; $header .= "<th>" . __('Global size') . "</th>"; $header .= "<th>" . __('Free size') . "</th>"; $header .= "<th>" . __('Free percentage') . "</th>"; $header .= "</tr>"; echo $header; Session::initNavigateListItems(__CLASS__, sprintf(__('%1$s = %2$s'), Computer::getTypeName(1), $comp->getName())); $disk = new self(); while ($data = $DB->fetch_assoc($result)) { $disk->getFromDB($data['id']); echo "<tr class='tab_bg_2'>"; echo "<td>" . $disk->getLink() . "</td>"; if (Plugin::haveImport()) { echo "<td>" . Dropdown::getYesNo($data['is_dynamic']) . "</td>"; } echo "<td>" . $data['device'] . "</td>"; echo "<td>" . $data['mountpoint'] . "</td>"; echo "<td>" . $data['fsname'] . "</td>"; //TRANS: %s is a size $tmp = sprintf(__('%s Mio'), Html::formatNumber($data['totalsize'], false, 0)); echo "<td class='right'>{$tmp}<span class='small_space'></span></td>"; $tmp = sprintf(__('%s Mio'), Html::formatNumber($data['freesize'], false, 0)); echo "<td class='right'>{$tmp}<span class='small_space'></span></td>"; echo "<td>"; $percent = 0; if ($data['totalsize'] > 0) { $percent = round(100 * $data['freesize'] / $data['totalsize']); } Html::displayProgressBar('100', $percent, array('simple' => true, 'forcepadding' => false)); echo "</td>"; echo "</tr>"; Session::addToNavigateListItems(__CLASS__, $data['id']); } echo $header; } else { echo "<tr class='tab_bg_2'><th colspan='{$colspan}'>" . __('No item found') . "</th></tr>"; } echo "</table>"; } echo "</div><br>"; }
/** * Print the computers disks * * @param $comp Computer object * * @return Nothing (call to classes members) **/ static function showForComputer(Computer $comp) { global $DB; $ID = $comp->fields['id']; if (!$comp->getFromDB($ID) || !$comp->can($ID, "r")) { return false; } $canedit = $comp->can($ID, "w"); echo "<div class='spaced center'>"; $virtualmachines = getAllDatasFromTable('glpi_computervirtualmachines', "`computers_id` = '{$ID}' AND `is_deleted` = '0'"); echo "<table class='tab_cadre_fixe'>"; Session::initNavigateListItems('ComputerVirtualMachine', sprintf(__('%1$s = %2$s'), __('Computer'), empty($comp->fields['name']) ? "({$ID})" : $comp->fields['name'])); if (empty($virtualmachines)) { echo "<tr><th>" . __('No virtual machine associated with the computer') . "</th></tr>"; } else { echo "<tr><th colspan='10'>" . __('List of virtual machines') . "</th></tr>"; echo "<tr><th>" . __('Name') . "</th>"; if (Plugin::haveImport()) { echo "<th>" . __('Automatic inventory') . "</th>"; } echo "<th>" . __('Virtualization system') . "</th>"; echo "<th>" . __('Virtualization model') . "</th>"; echo "<th>" . __('State of the virtual machine') . "</th>"; echo "<th>" . __('UUID') . "</th>"; echo "<th>" . _x('quantity', 'Processors number') . "</th>"; echo "<th>" . sprintf(__('%1$s (%2$s)'), __('Memory'), __('Mio')) . "</th>"; echo "<th>" . __('Machine') . "</th>"; echo "</tr>"; $vm = new self(); foreach ($virtualmachines as $virtualmachine) { $vm->getFromDB($virtualmachine['id']); echo "<tr class='tab_bg_2'>"; echo "<td>" . $vm->getLink() . "</td>"; if (Plugin::haveImport()) { echo "<td>"; echo Dropdown::getYesNo($vm->isDynamic()); echo "</td>"; } echo "<td>"; echo Dropdown::getDropdownName('glpi_virtualmachinetypes', $virtualmachine['virtualmachinetypes_id']); echo "</td>"; echo "<td>"; echo Dropdown::getDropdownName('glpi_virtualmachinesystems', $virtualmachine['virtualmachinesystems_id']); echo "</td>"; echo "<td>"; echo Dropdown::getDropdownName('glpi_virtualmachinestates', $virtualmachine['virtualmachinestates_id']); echo "</td>"; echo "<td>" . $virtualmachine['uuid'] . "</a></td>"; echo "<td>" . $virtualmachine['vcpu'] . "</td>"; echo "<td>" . $virtualmachine['ram'] . "</td>"; echo "<td>"; if ($link_computer = self::findVirtualMachine($virtualmachine)) { $computer = new Computer(); if ($computer->can($link_computer, 'r')) { $url = "<a href='computer.form.php?id=" . $link_computer . "'>"; $url .= $computer->fields["name"] . "</a>"; $tooltip = "<table><tr><td>" . __('Name') . "</td><td>" . $computer->fields['name'] . '</td></tr>'; $tooltip .= "<tr><td>" . __('Serial number') . "</td><td>" . $computer->fields['serial'] . '</td></tr>'; $tooltip .= "<tr><td>" . __('Comments') . "</td><td>" . $computer->fields['comment'] . '</td></tr></table>'; $url .= " " . Html::showToolTip($tooltip, array('display' => false)); } else { $url = $computer->fields['name']; } echo $url; } echo "</td>"; echo "</tr>"; Session::addToNavigateListItems('ComputerVirtualMachine', $virtualmachine['id']); } } if ($canedit) { echo "<tr class='tab_bg_1'><td colspan='8' class='center'>"; echo "<a class='vsubmit' href='computervirtualmachine.form.php?computers_id={$ID}'>" . __('Add a virtual machine') . "</a></td></tr>"; } echo "</table>"; echo "</div>"; }
/** * Print the HTML array for SLTs linked to a SLA * * @param SLA $sla * @return boolean */ static function showForSla(SLA $sla) { global $CFG_GLPI; $instID = $sla->fields['id']; $slt = new self(); $calendar = new Calendar(); if (!$sla->can($instID, READ)) { return false; } $canedit = $sla->canEdit($instID) && isset($_SESSION["glpiactiveprofile"]) && $_SESSION["glpiactiveprofile"]["interface"] == "central"; $rand = mt_rand(); if ($canedit) { echo "<div id='viewslt{$instID}{$rand}'></div>\n"; echo "<script type='text/javascript' >"; echo "function viewAddSlt{$instID}{$rand}() {"; $params = array('type' => $slt->getType(), 'parenttype' => $sla->getType(), $sla->getForeignKeyField() => $instID, 'id' => -1); Ajax::updateItemJsCode("viewslt{$instID}{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params); echo "}"; echo "</script>"; echo "<div class='center firstbloc'>" . "<a class='vsubmit' href='javascript:viewAddSlt{$instID}{$rand}();'>"; echo __('Add a new SLT') . "</a></div>\n"; } // SLT list $sltList = $slt->find("`slas_id` = '" . $instID . "'"); Session::initNavigateListItems('SLT', sprintf(__('%1$s = %2$s'), $sla::getTypeName(1), $sla->getName())); echo "<div class='spaced'>"; if (count($sltList)) { if ($canedit) { Html::openMassiveActionsForm('mass' . __CLASS__ . $rand); $massiveactionparams = array('container' => 'mass' . __CLASS__ . $rand); Html::showMassiveActions($massiveactionparams); } echo "<table class='tab_cadre_fixehov'>"; $header_begin = "<tr>"; $header_top = ''; $header_bottom = ''; $header_end = ''; if ($canedit) { $header_top .= "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand); $header_top .= "</th>"; $header_bottom .= "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand); $header_bottom .= "</th>"; } $header_end .= "<th>" . __('Name') . "</th>"; $header_end .= "<th>" . __('Type') . "</th>"; $header_end .= "<th>" . __('Maximum time') . "</th>"; $header_end .= "<th>" . __('Calendar') . "</th>"; echo $header_begin . $header_top . $header_end; foreach ($sltList as $val) { $edit = $canedit ? "style='cursor:pointer' onClick=\"viewEditSlt" . $instID . $val["id"] . "{$rand}();\"" : ''; echo "\n<script type='text/javascript' >\n"; echo "function viewEditSlt" . $instID . $val["id"] . "{$rand}() {\n"; $params = array('type' => $slt->getType(), 'parenttype' => $sla->getType(), $sla->getForeignKeyField() => $instID, 'id' => $val["id"]); Ajax::updateItemJsCode("viewslt{$instID}{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params); echo "};"; echo "</script>\n"; echo "<tr class='tab_bg_1'>"; echo "<td width='10' {$edit}>"; if ($canedit) { Html::showMassiveActionCheckBox($slt->getType(), $val['id']); } echo "</td>"; $slt->getFromDB($val['id']); echo "<td {$edit}>" . $slt->getLink() . "</td>"; echo "<td {$edit}>" . $slt->getSpecificValueToDisplay('type', $slt->fields['type']) . "</td>"; echo "<td {$edit}>"; echo $slt->getSpecificValueToDisplay('number_time', array('number_time' => $slt->fields['number_time'], 'definition_time' => $slt->fields['definition_time'])); echo "</td>"; if (!$sla->fields['calendars_id']) { $link = __('24/7'); } else { if ($sla->fields['calendars_id'] == -1) { $link = __('Calendar of the ticket'); } else { if ($calendar->getFromDB($sla->fields['calendars_id'])) { $link = $calendar->getLink(); } } } echo "<td {$edit}>" . $link . "</td>"; echo "</tr>"; } echo $header_begin . $header_bottom . $header_end; echo "</table>"; if ($canedit) { $massiveactionparams['ontop'] = false; Html::showMassiveActions($massiveactionparams); Html::closeForm(); } } else { echo __('No item to display'); } echo "</div>"; }
/** * Print the computers antiviruses * * @param $comp Computer object * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForComputer(Computer $comp, $withtemplate = '') { global $DB; $ID = $comp->fields['id']; if (!$comp->getFromDB($ID) || !$comp->can($ID, READ)) { return false; } $canedit = $comp->canEdit($ID); if ($canedit && !(!empty($withtemplate) && $withtemplate == 2)) { echo "<div class='center firstbloc'>" . "<a class='vsubmit' href='computerantivirus.form.php?computers_id={$ID}&withtemplate=" . $withtemplate . "'>"; _e('Add an antivirus'); echo "</a></div>\n"; } echo "<div class='spaced center'>"; if ($result = $DB->request('glpi_computerantiviruses', array('computers_id' => $ID, 'is_deleted' => 0))) { echo "<table class='tab_cadre_fixehov'>"; $colspan = 7; if (Plugin::haveImport()) { $colspan++; } echo "<tr class='noHover'><th colspan='{$colspan}'>" . self::getTypeName($result->numrows()) . "</th></tr>"; if ($result->numrows() != 0) { $header = "<tr><th>" . __('Name') . "</th>"; if (Plugin::haveImport()) { $header .= "<th>" . __('Automatic inventory') . "</th>"; } $header .= "<th>" . __('Manufacturer') . "</th>"; $header .= "<th>" . __('Antivirus version') . "</th>"; $header .= "<th>" . __('Signature database version') . "</th>"; $header .= "<th>" . __('Active') . "</th>"; $header .= "<th>" . __('Up to date') . "</th>"; $header .= "<th>" . __('Expiration date') . "</th>"; $header .= "</tr>"; echo $header; Session::initNavigateListItems(__CLASS__, sprintf(__('%1$s = %2$s'), Computer::getTypeName(1), $comp->getName())); $antivirus = new self(); foreach ($result as $data) { $antivirus->getFromDB($data['id']); echo "<tr class='tab_bg_2'>"; echo "<td>" . $antivirus->getLink() . "</td>"; if (Plugin::haveImport()) { echo "<td>" . Dropdown::getYesNo($data['is_dynamic']) . "</td>"; } echo "<td>"; if ($data['manufacturers_id']) { echo Dropdown::getDropdownName('glpi_manufacturers', $data['manufacturers_id']) . "</td>"; } else { echo "</td>"; } echo "<td>" . $data['antivirus_version'] . "</td>"; echo "<td>" . $data['signature_version'] . "</td>"; echo "<td>" . Dropdown::getYesNo($data['is_active']) . "</td>"; echo "<td>" . Dropdown::getYesNo($data['is_uptodate']) . "</td>"; echo "<td>" . Html::convDate($data['date_expiration']) . "</td>"; echo "</tr>"; Session::addToNavigateListItems(__CLASS__, $data['id']); } echo $header; } else { echo "<tr class='tab_bg_2'><th colspan='{$colspan}'>" . __('No item found') . "</th></tr>"; } echo "</table>"; } echo "</div>"; }
/** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array()) { global $DB, $CFG_GLPI; if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } if ($item->getType() != 'IPAddress') { return; } $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $header = $row->getGroup()->getHeaderByName('Internet', __CLASS__); if (!$header) { return; } $createRow = isset($options['createRow']) && $options['createRow']; $options['createRow'] = false; $network = new self(); foreach (self::searchNetworksContainingIP($item) as $networks_id) { if ($network->getFromDB($networks_id)) { if ($createRow) { $row = $row->createRow(); } //TRANS: %1$s is address, %2$s is netmask $content = sprintf(__('%1$s / %2$s'), $network->getAddress()->getTextual(), $network->getNetmask()->getTextual()); if ($network->fields['addressable'] == 1) { $content = "<span class='b'>" . $content . "</span>"; } $content = sprintf(__('%1$s - %2$s'), $content, $network->getLink()); $this_cell = $row->addCell($header, $content, $father, $network); } } }
/** Get data to display on GANTT * * @param $ID integer ID of the project * @param $showall boolean show all sub items (projects / tasks) (true by default) */ static function getDataToDisplayOnGantt($ID, $showall = true) { global $DB; $todisplay = array(); $project = new self(); if ($project->getFromDB($ID)) { $projects = array(); foreach ($DB->request('glpi_projects', array('projects_id' => $ID)) as $data) { $projects += static::getDataToDisplayOnGantt($data['id']); } ksort($projects); // Get all tasks $tasks = ProjectTask::getAllForProject($ID); $real_begin = NULL; $real_end = NULL; // Use real if set if (is_null($project->fields['real_start_date'])) { $real_begin = $project->fields['real_start_date']; } // Determine begin / end date of current project if not set (min/max sub projects / tasks) if (is_null($real_begin)) { if (!is_null($project->fields['plan_start_date'])) { $real_begin = $project->fields['plan_start_date']; } else { foreach ($tasks as $task) { if (is_null($real_begin) || !is_null($task['plan_start_date']) && $real_begin > $task['plan_start_date']) { $real_begin = $task['plan_start_date']; } } foreach ($projects as $p) { if (is_null($real_begin) || $p['type'] == 'project' && !is_null($p['from']) && $real_begin > $p['from']) { $real_begin = $p['from']; } } } } // Use real if set if (!is_null($project->fields['real_end_date'])) { $real_end = $project->fields['real_end_date']; } if (is_null($real_end)) { if (!is_null($project->fields['plan_end_date'])) { $real_end = $project->fields['plan_end_date']; } else { foreach ($tasks as $task) { if (is_null($real_end) || !is_null($task['plan_end_date']) && $real_end < $task['plan_end_date']) { $real_end = $task['plan_end_date']; } } foreach ($projects as $p) { if (is_null($real_end) || $p['type'] == 'project' && !is_null($p['to']) && $real_end < $p['to']) { $real_end = $p['to']; } } } } // Add current project $todisplay[$real_begin . '#' . $real_end . '#project' . $project->getID()] = array('id' => $project->getID(), 'name' => $project->fields['name'], 'link' => $project->getLink(), 'desc' => $project->fields['content'], 'percent' => isset($project->fields['percent_done']) ? $project->fields['percent_done'] : 0, 'type' => 'project', 'from' => $real_begin, 'to' => $real_end); if ($showall) { // Add current tasks $todisplay += ProjectTask::getDataToDisplayOnGanttForProject($ID); // Add ordered subprojects foreach ($projects as $key => $val) { $todisplay[$key] = $val; } } } return $todisplay; }
/** * @static function showMap : affiche tous les éléments de la carte (menus, onglets...) * @param $options */ static function showMap($options) { global $CFG_GLPI; if (!$options['locations_id']) { $self = new self(); $self->getFromDB($options["id"]); if (isset($self->fields["itemtype"])) { $options['locations_id'] = $self->fields['locations_id']; } } if ($options['locations_id']) { $documents_id = self::getDocument($options['locations_id']); $Doc = new Document(); if (isset($documents_id) && $Doc->getFromDB($documents_id)) { $params = array("locations_id" => $options['locations_id'], "id" => $options['id'], "itemtype" => $options['itemtype'], "target" => $options['target']); $params['docid'] = $documents_id; $path = GLPI_DOC_DIR . "/" . $Doc->fields["filepath"]; if ($handle = fopen($path, "r")) { $infos_image = @getImageSize($path); $params["largeur"] = $infos_image[0]; $params["hauteur"] = $infos_image[1]; $params["download"] = 1; if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { $params["download"] = 0; } echo "<div class='center'><table class='plugin_positions_tab_cadre_fixe'>"; echo "<tr class='tab_bg_2' valign='top'>"; $items = self::getMapItems($params['locations_id']); if (!isset($options['menuoff'])) { echo "<td>"; self::showLocationForm($params["locations_id"], "100%"); echo "</td>"; } if (Session::haveRight('plugin_positions', UPDATE) && !isset($options['menuoff'])) { echo "<td>"; self::showAddFromPlugin($params['locations_id']); echo "</td>"; echo "<td>"; self::selectDisplay($params, $items); echo "</td>"; } echo "</tr>"; echo "</table></div>"; if (isset($options['menuoff'])) { $params["menuoff"] = $options['menuoff']; } if (Session::haveRight('plugin_positions', UPDATE) && !isset($options['menuoff'])) { echo "<form method='post' name='pointform' id='pointform' action=\"" . $CFG_GLPI["root_doc"] . "/plugins/positions/front/position.form.php\">"; echo "<div class='center'>"; echo "<table class='plugin_positions_tab_cadre_fixe' width='30%'>"; if ($options['id']) { echo "<tr class='tab_bg_2'>"; $form = Toolbox::getItemTypeFormURL($self->getType()); echo "<td colspan='4' class='center'>" . $self->getLink(); echo "</td></tr>"; } echo "<tr class='tab_bg_2'>"; echo "<td colspan='2' class='center'>"; echo "<input type='submit' name='update' value=\"" . __s('Change the coordinates', 'positions') . "\" class='submit'>"; echo "</td>"; //création d'un nouveau bouton pour la création de nouvelles pièces echo "<td colspan='2' class='center'>"; echo "<input type='submit' name='addLocation' value=\"" . __s('Add a sub-area', 'positions') . "\" class='submit'>"; echo "</td>"; echo "<input type='hidden' name='locations_id' value='" . $options['locations_id'] . "'>"; echo "<input type='hidden' name='id' value='" . $options['id'] . "'>"; echo "<input type='hidden' name ='x_coordinates'>"; echo "<input type='hidden' name ='y_coordinates'>"; echo "<input type='hidden' name ='multi'>"; echo "<input type='hidden' name ='referrer' value='" . $options['id'] . "'>"; echo "</tr>"; echo "</table></div>"; } echo "<div class='center'><table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'><th>"; echo $Doc->fields["name"]; echo "</th></tr>"; echo "<tr class='tab_bg_1'><td>"; self::displayMap($items, $params); echo "</td></tr>"; echo "</table>"; if (Session::haveRight('plugin_positions', UPDATE) && !isset($options['menuoff'])) { Html::closeForm(); } } else { echo "<div class='center'>"; _e('No location has a configured map', 'positions'); echo "</div>"; } } else { echo "<div class='center'>"; echo __('The object location does not match a map', 'positions') . "<br><br>"; Html::displayBackLink(); echo "</div>"; } } else { echo "<div class='center'>"; _e('No location selected', 'positions'); echo "</div>"; } }