Commit 6514254b authored by Johan Cwiklinski's avatar Johan Cwiklinski

Merge branch '9.5/bugfixes'

parents a130a83b ff8d56d5
......@@ -351,7 +351,7 @@ class Location extends CommonTreeDropdown {
$criteria = [
'SELECT' => [
"$table.id",
"$crit AS type"
new \QueryExpression($DB->quoteValue($crit) . ' AS ' . $DB->quoteName('type')),
],
'FROM' => $table,
'WHERE' => [
......@@ -366,7 +366,7 @@ class Location extends CommonTreeDropdown {
$union->addQuery([
'SELECT' => [
'id',
new \QueryExpression("'$type' AS type")
new \QueryExpression($DB->quoteValue($type) . ' AS ' . $DB->quoteName('type')),
],
'FROM' => $table,
'WHERE' => [
......
......@@ -481,7 +481,7 @@ class Search {
break;
case 'sort':
$p[$key] = intval($val);
if ($p[$key] <= 0) {
if ($p[$key] < 0) {
$p[$key] = 1;
}
break;
......
......@@ -562,8 +562,6 @@ class Software extends CommonDBTM {
'datatype' => 'bool'
];
$tab = array_merge($tab, SoftwareLicense::rawSearchOptionsToAdd());
$tab[] = [
'id' => '80',
'table' => 'glpi_entities',
......@@ -609,6 +607,8 @@ class Software extends CommonDBTM {
'massiveaction' => false
];
$tab = array_merge($tab, SoftwareLicense::rawSearchOptionsToAdd());
$name = _n('Version', 'Versions', Session::getPluralNumber());
$tab[] = [
'id' => 'versions',
......@@ -1057,7 +1057,7 @@ class Software extends CommonDBTM {
);
$DB->update(
'glpi_computers_softwareversions', [
'glpi_softwarelicenses', [
'softwareversions_id_use' => $dest['id']
], [
'softwareversions_id_use' => $from['id']
......@@ -1129,4 +1129,10 @@ class Software extends CommonDBTM {
}
static function getDefaultSearchRequest() {
return [
'sort' => 0
];
}
}
......@@ -906,7 +906,7 @@ class Transfer extends CommonDBTM {
'glpi_contacts' => [
'ON' => [
'glpi_contacts_suppliers' => 'contacts_id',
'glpi_suppliers' => 'id'
'glpi_contacts' => 'id'
]
]
],
......
......@@ -8133,7 +8133,7 @@ CREATE TABLE `glpi_softwarelicenses` (
KEY `softwarelicensetypes_id` (`softwarelicensetypes_id`),
KEY `softwareversions_id_use` (`softwareversions_id_use`),
KEY `date_mod` (`date_mod`),
KEY `softwares_id_expire` (`softwares_id`,`expire`),
KEY `softwares_id_expire_number` (`softwares_id`,`expire`, `number`),
KEY `locations_id` (`locations_id`),
KEY `users_id_tech` (`users_id_tech`),
KEY `users_id` (`users_id`),
......
......@@ -107,6 +107,14 @@ function update94to95() {
$migration->addConfig(['timezone' => null]);
/** /Timezones */
// Fix search Softwares performance
$migration->dropKey('glpi_softwarelicenses', 'softwares_id_expire_number');
$migration->addKey('glpi_softwarelicenses', [
'softwares_id',
'expire',
'number'
], 'softwares_id_expire_number');
// ************ Keep it at the end **************
$migration->executeMigration();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment