<?php
$_db_migration_to = '23.05'; // 7.2 beta 2
if (!isset($migrations) || !is_object($migrations))
	die("This file cannot be executed directly");
$migrations->CheckValid($_db_migration_to);
//===========================================================================================



$migrations->Run('01_delete_usr_rank.php', <<<'DB_UPDATE_FILE'
<?

$db->query("DELETE FROM ERMS_metadata_field WHERE name=str:name", 'usr_rank');

?>

DB_UPDATE_FILE
);


$migrations->Run('02_admin_css_class.php', <<<'DB_UPDATE_FILE'
<?

$db->AddColumn("panels", "css_class", "VARCHAR(255) DEFAULT NULL");

$css_classes = array (
  'system' => 'icon-cogwheels',
  'docs' => 'icon-file',
  'people' => 'icon-address_book',
  'forum' => 'icon-comments',
  'comms' => 'icon-bullhorn',
  'publish' => 'icon-global',
  'audit' => 'icon-security_camera',
  'rb' => 'icon-clock',
  'workflow' => 'icon-retweet',
  'holidays' => 'icon-airplane',
  'courses' => 'icon-book_open',
  'company_links' => 'icon-link',
  'backup' => 'icon-hdd',
  'helpdesk' => 'icon-random',
  'diagram' => 'icon-dashboard',
  'webmail' => 'icon-envelope',
  'webcatalogue' => 'icon-shopping_cart',
  'surveys' => 'icon-inbox_in',
  'claro_wiki' => 'icon-notes',
  'image_gallery' => 'icon-picture',
  'metadata' => 'icon-more',
  'compliances' => 'icon-circle_ok',
  'bookshelf' => 'icon-book',
  'calendar' => 'icon-calendar',
  'extranet' => 'icon-sort',
  'tags' => 'icon-tags',
  'stat' => 'icon-stats',
  'auditman' => 'icon-history',
  'search' => 'icon-search',
  'ideaspaces' => 'icon-lightbulb',
  'innovate' => 'icon-conversation',
  'knowledgebase' => 'icon-tree_deciduous',
  'crm' => 'icon-group',
  'pc' => 'icon-left_indent',
);

foreach ($css_classes as $pn=>$css)
{
	$db->query("UPDATE panels SET css_class=str:css WHERE symname=str:pn", $css, $pn);
}

?>
DB_UPDATE_FILE
);


//===========================================================================================
$migrations->SetVersion('23.05');
