"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "install/update_91_911.php" between
glpi-9.3.3.tgz and glpi-9.4.0.tgz

About: GLPI is an IT and asset management software (Information Resource Manager).

update_91_911.php  (glpi-9.3.3.tgz):update_91_911.php  (glpi-9.4.0.tgz)
skipping to change at line 52 skipping to change at line 52
$updateresult = true; $updateresult = true;
$ADDTODISPLAYPREF = []; $ADDTODISPLAYPREF = [];
//TRANS: %s is the number of new version //TRANS: %s is the number of new version
$migration->displayTitle(sprintf(__('Update to %s'), '9.1.1')); $migration->displayTitle(sprintf(__('Update to %s'), '9.1.1'));
$migration->setVersion('9.1.1'); $migration->setVersion('9.1.1');
$backup_tables = false; $backup_tables = false;
// table already exist but deleted during the migration // table already exist but deleted during the migration
// not table created during the migration // not table created during the migration
// not table created during the migration
$newtables = []; $newtables = [];
foreach ($newtables as $new_table) { foreach ($newtables as $new_table) {
// rename new tables if exists ? // rename new tables if exists ?
if ($DB->tableExists($new_table)) { if ($DB->tableExists($new_table)) {
$migration->dropTable("backup_$new_table"); $migration->dropTable("backup_$new_table");
$migration->displayWarning("$new_table table already exists. ". $migration->displayWarning("$new_table table already exists. ".
"A backup have been done to backup_$new_tabl e."); "A backup have been done to backup_$new_tabl e.");
$backup_tables = true; $backup_tables = true;
$query = $migration->renameTable("$new_table", "backup_$new_tab le"); $query = $migration->renameTable("$new_table", "backup_$new_tab le");
} }
} }
if ($backup_tables) { if ($backup_tables) {
$migration->displayWarning("You can delete backup tables if you have no ne ed of them.", $migration->displayWarning("You can delete backup tables if you have no ne ed of them.",
true); true);
} }
// rectify missing right in 9.1 update // rectify missing right in 9.1 update
if (countElementsInTable("glpi_profilerights", ['name' => 'license']) == 0) { if (countElementsInTable("glpi_profilerights", ['name' => 'license']) == 0) {
foreach ($DB->request("glpi_profilerights", "`name` = 'software'") as $pro foreach ($DB->request("glpi_profilerights", ["name" => 'software']) as $pr
frights) { ofrights) {
$query = "INSERT INTO `glpi_profilerights` $DB->insertOrDie("glpi_profilerights", [
(`id`, `profiles_id`, `name`, `rights`) 'id' => null,
VALUES (NULL, '".$profrights['profiles_id']."', 'license', 'profiles_id' => $profrights['profiles_id'],
'".$profrights['rights']."')"; 'name' => "license",
$DB->queryOrDie($query, "9.1 add right for softwarelicense"); 'rights' => $profrights['rights']
],
"9.1 add right for softwarelicense"
);
} }
} }
//put you migration script here //put you migration script here
// ************ Keep it at the end ************** // ************ Keep it at the end **************
$migration->executeMigration(); $migration->executeMigration();
return $updateresult; return $updateresult;
} }
 End of changes. 2 change blocks. 
7 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)