本文整理汇总了PHP中Software::isRecursive方法的典型用法代码示例。如果您正苦于以下问题:PHP Software::isRecursive方法的具体用法?PHP Software::isRecursive怎么用?PHP Software::isRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Software
的用法示例。
在下文中一共展示了Software::isRecursive方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForSoftware
/**
* Show Licenses of a software
*
* @param $software Software object
*
* @return nothing
**/
static function showForSoftware(Software $software)
{
global $DB, $CFG_GLPI;
$softwares_id = $software->getField('id');
$license = new self();
$computer = new Computer();
if (!$software->can($softwares_id, READ)) {
return false;
}
$columns = array('name' => __('Name'), 'entity' => __('Entity'), 'serial' => __('Serial number'), 'number' => _x('quantity', 'Number'), '_affected' => __('Affected computers'), 'typename' => __('Type'), 'buyname' => __('Purchase version'), 'usename' => __('Version in use'), 'expire' => __('Expiration'));
if (!$software->isRecursive()) {
unset($columns['entity']);
}
if (isset($_GET["start"])) {
$start = $_GET["start"];
} else {
$start = 0;
}
if (isset($_GET["order"]) && $_GET["order"] == "DESC") {
$order = "DESC";
} else {
$order = "ASC";
}
if (isset($_GET["sort"]) && !empty($_GET["sort"]) && isset($columns[$_GET["sort"]])) {
$sort = "`" . $_GET["sort"] . "`";
} else {
$sort = "`entity` {$order}, `name`";
}
// Righ type is enough. Can add a License on a software we have Read access
$canedit = Software::canUpdate();
$showmassiveactions = $canedit;
// Total Number of events
$number = countElementsInTable("glpi_softwarelicenses", "glpi_softwarelicenses.softwares_id = {$softwares_id} " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true));
echo "<div class='spaced'>";
Session::initNavigateListItems('SoftwareLicense', sprintf(__('%1$s = %2$s'), Software::getTypeName(1), $software->getName()));
if ($canedit) {
echo "<div class='center firstbloc'>";
echo "<a class='vsubmit' href='softwarelicense.form.php?softwares_id={$softwares_id}'>" . _x('button', 'Add a license') . "</a>";
echo "</div>";
}
$rand = mt_rand();
$query = "SELECT `glpi_softwarelicenses`.*,\n `buyvers`.`name` AS buyname,\n `usevers`.`name` AS usename,\n `glpi_entities`.`completename` AS entity,\n `glpi_softwarelicensetypes`.`name` AS typename\n FROM `glpi_softwarelicenses`\n LEFT JOIN `glpi_softwareversions` AS buyvers\n ON (`buyvers`.`id` = `glpi_softwarelicenses`.`softwareversions_id_buy`)\n LEFT JOIN `glpi_softwareversions` AS usevers\n ON (`usevers`.`id` = `glpi_softwarelicenses`.`softwareversions_id_use`)\n LEFT JOIN `glpi_entities`\n ON (`glpi_entities`.`id` = `glpi_softwarelicenses`.`entities_id`)\n LEFT JOIN `glpi_softwarelicensetypes`\n ON (`glpi_softwarelicensetypes`.`id`\n = `glpi_softwarelicenses`.`softwarelicensetypes_id`)\n WHERE (`glpi_softwarelicenses`.`softwares_id` = '{$softwares_id}') " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true) . "\n ORDER BY {$sort} {$order}\n LIMIT " . intval($start) . "," . intval($_SESSION['glpilist_limit']);
if ($result = $DB->query($query)) {
if ($num_displayed = $DB->numrows($result)) {
// Display the pager
Html::printAjaxPager(self::getTypeName(Session::getPluralNumber()), $start, $number);
if ($showmassiveactions) {
Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
$massiveactionparams = array('num_displayed' => $num_displayed, 'container' => 'mass' . __CLASS__ . $rand, 'extraparams' => array('options' => array('glpi_softwareversions.name' => array('condition' => "`glpi_softwareversions`.`softwares_id`\n = {$softwares_id}"), 'glpi_softwarelicenses.name' => array('itemlink_as_string' => true))));
Html::showMassiveActions($massiveactionparams);
}
$sort_img = "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . ($order == "DESC" ? "puce-down.png" : "puce-up.png") . "\" alt='' title=''>";
$sort_img = "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . ($order == "DESC" ? "puce-down.png" : "puce-up.png") . "\" alt='' title=''>";
echo "<table class='tab_cadre_fixehov'>";
$header_begin = "<tr><th>";
$header_top = Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
$header_bottom = Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
$header_end = '';
foreach ($columns as $key => $val) {
// Non order column
if ($key[0] == '_') {
$header_end .= "<th>{$val}</th>";
} else {
$header_end .= "<th>" . ($sort == "`{$key}`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort={$key}&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>{$val}</a></th>";
}
}
$header_end .= "</tr>\n";
echo $header_begin . $header_top . $header_end;
$tot_assoc = 0;
for ($tot = 0; $data = $DB->fetch_assoc($result);) {
Session::addToNavigateListItems('SoftwareLicense', $data['id']);
$expired = true;
if (is_null($data['expire']) || $data['expire'] > date('Y-m-d')) {
$expired = false;
}
echo "<tr class='tab_bg_2" . ($expired ? '_2' : '') . "'>";
if ($license->canEdit($data['id'])) {
echo "<td>" . Html::getMassiveActionCheckBox(__CLASS__, $data["id"]) . "</td>";
} else {
echo "<td> </td>";
}
echo "<td><a href='softwarelicense.form.php?id=" . $data['id'] . "'>" . $data['name'] . (empty($data['name']) ? "(" . $data['id'] . ")" : "") . "</a></td>";
if (isset($columns['entity'])) {
echo "<td>";
echo $data['entity'];
echo "</td>";
}
echo "<td>" . $data['serial'] . "</td>";
echo "<td class='numeric'>" . ($data['number'] > 0 ? $data['number'] : __('Unlimited')) . "</td>";
$nb_assoc = Computer_SoftwareLicense::countForLicense($data['id']);
$tot_assoc += $nb_assoc;
$color = $data['is_valid'] ? 'green' : 'red';
echo "<td class='numeric {$color}'>" . $nb_assoc . "</td>";
//.........这里部分代码省略.........
示例2: showForm
/**
* Print the Software / version form
*
* @param $ID Integer : Id of the version or the template to print
* @param $options array
* - target form target
* - softwares_id ID of the software for add process
*
* @return true if displayed false if item not found or not right to display
*
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI, $LANG;
$softwares_id = -1;
if (isset($options['softwares_id'])) {
$softwares_id = $options['softwares_id'];
}
if (!haveRight("software", "r")) {
return false;
}
if ($ID > 0) {
$this->check($ID, 'r');
} else {
$soft = new Software();
$soft->getFromDB($softwares_id);
// Create item
$input = array('entities_id' => $soft->getEntityID(), 'is_recursive' => $soft->isRecursive());
$this->check(-1, 'w', $input);
}
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'><td>" . $LANG['help'][31] . " :</td>";
echo "<td>";
if ($ID > 0) {
$softwares_id = $this->fields["softwares_id"];
} else {
echo "<input type='hidden' name='softwares_id' value='{$softwares_id}'>";
}
echo "<a href='software.form.php?id=" . $softwares_id . "'>" . Dropdown::getDropdownName("glpi_softwares", $softwares_id) . "</a>";
echo "</td>";
echo "<td rowspan='4' class='middle'>" . $LANG['common'][25] . " :</td>";
echo "<td class='center middle' rowspan='4'>";
echo "<textarea cols='45' rows='3' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>\n";
echo "<tr class='tab_bg_1'><td>" . $LANG['common'][16] . " :</td>";
echo "<td>";
autocompletionTextField($this, "name");
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'><td>" . $LANG['setup'][5] . " :</td><td>";
Dropdown::show('OperatingSystem', array('value' => $this->fields["operatingsystems_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'><td>" . $LANG['state'][0] . " :</td><td>";
Dropdown::show('State', array('value' => $this->fields["states_id"]));
echo "</td></tr>\n";
// Only count softwareversions_id_buy (don't care of softwareversions_id_use if no installation)
if (SoftwareLicense::countForVersion($ID) > 0 || Computer_SoftwareVersion::countForVersion($ID) > 0) {
$options['candel'] = false;
}
$this->showFormButtons($options);
$this->addDivForTabs();
return true;
}
示例3: maybeRecursive
/**
* Is the license may be recursive
*
* @return boolean
**/
function maybeRecursive()
{
$soft = new Software();
if (isset($this->fields["softwares_id"]) && $soft->getFromDB($this->fields["softwares_id"])) {
return $soft->isRecursive();
}
return false;
}
示例4: showInstallations
/**
* Show installations of a software
*
* @param $searchID valeur to the ID to search
* @param $crit to search : softwares_id (software) or id (version)
*
* @return nothing
**/
private static function showInstallations($searchID, $crit)
{
global $DB, $CFG_GLPI, $LANG;
if (!haveRight("software", "r") || !$searchID) {
return false;
}
$canedit = haveRight("software", "w");
$canshowcomputer = haveRight("computer", "r");
if (isset($_REQUEST["start"])) {
$start = $_REQUEST["start"];
} else {
$start = 0;
}
if (isset($_REQUEST["order"]) && $_REQUEST["order"] == "DESC") {
$order = "DESC";
} else {
$order = "ASC";
}
if (isset($_REQUEST["sort"]) && !empty($_REQUEST["sort"])) {
// manage several param like location,compname : order first
$tmp = explode(",", $_REQUEST["sort"]);
$sort = "`" . implode("` {$order},`", $tmp) . "`";
} else {
if ($crit == "softwares_id") {
$sort = "`entity` {$order}, `version`, `compname`";
} else {
$sort = "`entity` {$order}, `compname`";
}
}
// Total Number of events
if ($crit == "softwares_id") {
// Software ID
$query_number = "SELECT COUNT(*) AS cpt\n FROM `glpi_computers_softwareversions`\n INNER JOIN `glpi_softwareversions`\n ON (`glpi_computers_softwareversions`.`softwareversions_id`\n = `glpi_softwareversions`.`id`)\n INNER JOIN `glpi_computers`\n ON (`glpi_computers_softwareversions`.`computers_id`\n = `glpi_computers`.`id`)\n WHERE `glpi_softwareversions`.`softwares_id` = '{$searchID}'" . getEntitiesRestrictRequest(' AND', 'glpi_computers') . "\n AND `glpi_computers`.`is_deleted` = '0'\n AND `glpi_computers`.`is_template` = '0'";
} else {
//SoftwareVersion ID
$query_number = "SELECT COUNT(*) AS cpt\n FROM `glpi_computers_softwareversions`\n INNER JOIN `glpi_computers`\n ON (`glpi_computers_softwareversions`.`computers_id`\n = `glpi_computers`.`id`)\n WHERE `glpi_computers_softwareversions`.`softwareversions_id` = '{$searchID}'" . getEntitiesRestrictRequest(' AND', 'glpi_computers') . "\n AND `glpi_computers`.`is_deleted` = '0'\n AND `glpi_computers`.`is_template` = '0'";
}
$number = 0;
if ($result = $DB->query($query_number)) {
$number = $DB->result($result, 0, 0);
}
echo "<div class='center'>";
if ($number < 1) {
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th>" . $LANG['search'][15] . "</th></tr>";
echo "</table></div>\n";
return;
}
// Display the pager
printAjaxPager($LANG['software'][19], $start, $number);
$query = "SELECT DISTINCT `glpi_computers_softwareversions`.*,\n `glpi_computers`.`name` AS compname,\n `glpi_computers`.`id` AS cID,\n `glpi_computers`.`serial`,\n `glpi_computers`.`otherserial`,\n `glpi_users`.`name` AS username,\n `glpi_users`.`id` AS userid,\n `glpi_users`.`realname` AS userrealname,\n `glpi_users`.`firstname` AS userfirstname,\n `glpi_softwareversions`.`name` AS version,\n `glpi_softwareversions`.`id` AS vID,\n `glpi_softwareversions`.`softwares_id` AS sID,\n `glpi_softwareversions`.`name` AS vername,\n `glpi_entities`.`completename` AS entity,\n `glpi_locations`.`completename` AS location,\n `glpi_states`.`name` AS state,\n `glpi_groups`.`name` AS groupe\n FROM `glpi_computers_softwareversions`\n INNER JOIN `glpi_softwareversions`\n ON (`glpi_computers_softwareversions`.`softwareversions_id`\n = `glpi_softwareversions`.`id`)\n INNER JOIN `glpi_computers`\n ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`)\n LEFT JOIN `glpi_entities` ON (`glpi_computers`.`entities_id` = `glpi_entities`.`id`)\n LEFT JOIN `glpi_locations`\n ON (`glpi_computers`.`locations_id` = `glpi_locations`.`id`)\n LEFT JOIN `glpi_states` ON (`glpi_computers`.`states_id` = `glpi_states`.`id`)\n LEFT JOIN `glpi_groups` ON (`glpi_computers`.`groups_id` = `glpi_groups`.`id`)\n LEFT JOIN `glpi_users` ON (`glpi_computers`.`users_id` = `glpi_users`.`id`)\n WHERE (`glpi_softwareversions`.`{$crit}` = '{$searchID}') " . getEntitiesRestrictRequest(' AND', 'glpi_computers') . "\n AND `glpi_computers`.`is_deleted` = '0'\n AND `glpi_computers`.`is_template` = '0'\n ORDER BY {$sort} {$order}\n LIMIT " . intval($start) . "," . intval($_SESSION['glpilist_limit']);
$rand = mt_rand();
if ($result = $DB->query($query)) {
if ($data = $DB->fetch_assoc($result)) {
$softwares_id = $data['sID'];
$soft = new Software();
$showEntity = $soft->getFromDB($softwares_id) && $soft->isRecursive();
$linkUser = haveRight('user', 'r');
$title = $LANG['help'][31] . " = " . $soft->fields["name"];
if ($crit == "id") {
$title .= " - " . $data["vername"];
}
initNavigateListItems('Computer', $title);
$sort_img = "<img src='" . $CFG_GLPI["root_doc"] . "/pics/" . ($order == "DESC" ? "puce-down.png" : "puce-up.png") . "' alt='' title=''>";
if ($canedit) {
echo "<form name='softinstall" . $rand . "' id='softinstall" . $rand . "' method='post'\n action='" . $CFG_GLPI["root_doc"] . "/front/computer_softwareversion.form.php'>";
echo "<input type='hidden' name='softwares_id' value='{$softwares_id}'>";
echo "<table class='tab_cadre_fixehov'><tr>";
echo "<th> </th>";
} else {
echo "<table class='tab_cadre_fixehov'><tr>";
}
if ($crit == "softwares_id") {
echo "<th>" . ($sort == "`vername`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=vername&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['software'][5] . "</a></th>";
}
echo "<th>" . ($sort == "`compname`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=compname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][16] . "</a></th>";
if ($showEntity) {
echo "<th>" . (strstr($sort, "entity") ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=entity,compname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['entity'][0] . "</a></th>";
}
echo "<th>" . ($sort == "`serial`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=serial&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][19] . "</a></th>";
echo "<th>" . ($sort == "`otherserial`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=otherserial&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][20] . "</a></th>";
echo "<th>" . (strstr($sort, "`location`") ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=location,compname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][15] . "</a></th>";
echo "<th>" . (strstr($sort, "state") ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=state,compname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['state'][0] . "</a></th>";
echo "<th>" . (strstr($sort, "groupe") ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=groupe,compname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][35] . "</a></th>";
echo "<th>" . (strstr($sort, "username") ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=username,compname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][34] . "</a></th>";
echo "<th>" . ($sort == "`lname`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=lname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['software'][11] . "</a></th>";
echo "</tr>\n";
do {
addToNavigateListItems('Computer', $data["cID"]);
echo "<tr class='tab_bg_2'>";
if ($canedit) {
echo "<td><input type='checkbox' name='item[" . $data["id"] . "]' value='1'></td>";
//.........这里部分代码省略.........
示例5: showInstallations
/**
* Show installations of a software
*
* @param $searchID value of the ID to search
* @param $crit to search : softwares_id (software) or id (version)
*
* @return nothing
**/
private static function showInstallations($searchID, $crit)
{
global $DB, $CFG_GLPI;
if (!Software::canView() || !$searchID) {
return false;
}
$canedit = Session::haveRightsOr("software", array(CREATE, UPDATE, DELETE, PURGE));
$canshowcomputer = Computer::canView();
$refcolumns = array('vername' => _n('Version', 'Versions', Session::getPluralNumber()), 'compname' => __('Name'), 'entity' => __('Entity'), 'serial' => __('Serial number'), 'otherserial' => __('Inventory number'), 'location,compname' => __('Location'), 'state,compname' => __('Status'), 'groupe,compname' => __('Group'), 'username,compname' => __('User'), 'lname' => _n('License', 'Licenses', Session::getPluralNumber()));
if ($crit != "softwares_id") {
unset($refcolumns['vername']);
}
if (isset($_GET["start"])) {
$start = $_GET["start"];
} else {
$start = 0;
}
if (isset($_GET["order"]) && $_GET["order"] == "DESC") {
$order = "DESC";
} else {
$order = "ASC";
}
if (isset($_GET["sort"]) && !empty($_GET["sort"]) && isset($refcolumns[$_GET["sort"]])) {
// manage several param like location,compname : order first
$tmp = explode(",", $_GET["sort"]);
$sort = "`" . implode("` {$order},`", $tmp) . "`";
} else {
if ($crit == "softwares_id") {
$sort = "`entity` {$order}, `version`, `compname`";
} else {
$sort = "`entity` {$order}, `compname`";
}
}
// Total Number of events
if ($crit == "softwares_id") {
// Software ID
$query_number = "SELECT COUNT(*) AS cpt\n FROM `glpi_computers_softwareversions`\n INNER JOIN `glpi_softwareversions`\n ON (`glpi_computers_softwareversions`.`softwareversions_id`\n = `glpi_softwareversions`.`id`)\n INNER JOIN `glpi_computers`\n ON (`glpi_computers_softwareversions`.`computers_id`\n = `glpi_computers`.`id`)\n WHERE `glpi_softwareversions`.`softwares_id` = '{$searchID}'" . getEntitiesRestrictRequest(' AND', 'glpi_computers') . "\n AND `glpi_computers`.`is_deleted` = '0'\n AND `glpi_computers`.`is_template` = '0'\n AND `glpi_computers_softwareversions`.`is_deleted` = '0'";
} else {
//SoftwareVersion ID
$query_number = "SELECT COUNT(*) AS cpt\n FROM `glpi_computers_softwareversions`\n INNER JOIN `glpi_computers`\n ON (`glpi_computers_softwareversions`.`computers_id`\n = `glpi_computers`.`id`)\n WHERE `glpi_computers_softwareversions`.`softwareversions_id`\n = '{$searchID}'" . getEntitiesRestrictRequest(' AND', 'glpi_computers') . "\n AND `glpi_computers`.`is_deleted` = '0'\n AND `glpi_computers`.`is_template` = '0'\n AND `glpi_computers_softwareversions`.`is_deleted` = '0'";
}
$number = 0;
if ($result = $DB->query($query_number)) {
$number = $DB->result($result, 0, 0);
}
echo "<div class='center'>";
if ($number < 1) {
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th>" . __('No item found') . "</th></tr>";
echo "</table></div>\n";
return;
}
// Display the pager
Html::printAjaxPager(self::getTypeName(Session::getPluralNumber()), $start, $number);
$query = "SELECT DISTINCT `glpi_computers_softwareversions`.*,\n `glpi_computers`.`name` AS compname,\n `glpi_computers`.`id` AS cID,\n `glpi_computers`.`serial`,\n `glpi_computers`.`otherserial`,\n `glpi_users`.`name` AS username,\n `glpi_users`.`id` AS userid,\n `glpi_users`.`realname` AS userrealname,\n `glpi_users`.`firstname` AS userfirstname,\n `glpi_softwareversions`.`name` AS version,\n `glpi_softwareversions`.`id` AS vID,\n `glpi_softwareversions`.`softwares_id` AS sID,\n `glpi_softwareversions`.`name` AS vername,\n `glpi_entities`.`completename` AS entity,\n `glpi_locations`.`completename` AS location,\n `glpi_states`.`name` AS state,\n `glpi_groups`.`name` AS groupe\n FROM `glpi_computers_softwareversions`\n INNER JOIN `glpi_softwareversions`\n ON (`glpi_computers_softwareversions`.`softwareversions_id`\n = `glpi_softwareversions`.`id`)\n INNER JOIN `glpi_computers`\n ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`)\n LEFT JOIN `glpi_entities` ON (`glpi_computers`.`entities_id` = `glpi_entities`.`id`)\n LEFT JOIN `glpi_locations`\n ON (`glpi_computers`.`locations_id` = `glpi_locations`.`id`)\n LEFT JOIN `glpi_states` ON (`glpi_computers`.`states_id` = `glpi_states`.`id`)\n LEFT JOIN `glpi_groups` ON (`glpi_computers`.`groups_id` = `glpi_groups`.`id`)\n LEFT JOIN `glpi_users` ON (`glpi_computers`.`users_id` = `glpi_users`.`id`)\n WHERE (`glpi_softwareversions`.`{$crit}` = '{$searchID}') " . getEntitiesRestrictRequest(' AND', 'glpi_computers') . "\n AND `glpi_computers`.`is_deleted` = '0'\n AND `glpi_computers`.`is_template` = '0'\n AND `glpi_computers_softwareversions`.`is_deleted` = '0'\n ORDER BY {$sort} {$order}\n LIMIT " . intval($start) . "," . intval($_SESSION['glpilist_limit']);
$rand = mt_rand();
if ($result = $DB->query($query)) {
if ($data = $DB->fetch_assoc($result)) {
$softwares_id = $data['sID'];
$soft = new Software();
$showEntity = $soft->getFromDB($softwares_id) && $soft->isRecursive();
$linkUser = User::canView();
$title = $soft->fields["name"];
if ($crit == "id") {
$title = sprintf(__('%1$s - %2$s'), $title, $data["vername"]);
}
Session::initNavigateListItems('Computer', sprintf(__('%1$s = %2$s'), Software::getTypeName(1), $title));
$sort_img = "<img src='" . $CFG_GLPI["root_doc"] . "/pics/" . ($order == "DESC" ? "puce-down.png" : "puce-up.png") . "' alt=''\n title=''>";
if ($canedit) {
$rand = mt_rand();
Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
$massiveactionparams = array('num_displayed' => $number, 'container' => 'mass' . __CLASS__ . $rand, 'specific_actions' => array(__CLASS__ . MassiveAction::CLASS_ACTION_SEPARATOR . 'move_version' => _x('button', 'Move'), 'purge' => _x('button', 'Delete permanently')));
// Options to update version
$massiveactionparams['extraparams']['options']['move']['softwares_id'] = $softwares_id;
if ($crit == 'softwares_id') {
$massiveactionparams['extraparams']['options']['move']['used'] = array();
} else {
$massiveactionparams['extraparams']['options']['move']['used'] = array($searchID);
}
Html::showMassiveActions($massiveactionparams);
}
echo "<table class='tab_cadre_fixehov'>";
$sort_img = "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . ($order == "DESC" ? "puce-down.png" : "puce-up.png") . "\" alt='' title=''>";
$header_begin = "<tr>";
$header_top = '';
$header_bottom = '';
$header_end = '';
if ($canedit) {
$header_begin .= "<th width='10'>";
$header_top .= Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
$header_bottom .= Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
$header_end .= "</th>";
//.........这里部分代码省略.........