Ignore:
Timestamp:
Jul 26, 2014, 11:15:46 AM (10 years ago)
Author:
chronos
Message:
  • Přidáno: Oblíbené položky v nabídce.
  • Přidáno: Popis a povolení příjmu zpráv u kontaktů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Setup/Updates.php

    r677 r678  
    848848}
    849849
     850function UpdateTo678($Manager)
     851{
     852  $Manager->Execute('ALTER TABLE `Contact` ADD `Description` VARCHAR( 255 ) NOT NULL ;');
     853  $Manager->Execute('ALTER TABLE `Contact` ADD `Receive` BOOLEAN NOT NULL ;');
     854
     855  $Manager->Execute('CREATE TABLE IF NOT EXISTS `MenuItemFavorite` (
     856  `Id` int(11) NOT NULL AUTO_INCREMENT,
     857  `User` int(11) NOT NULL,
     858  `MenuItem` int(11) NOT NULL,
     859  PRIMARY KEY (`Id`),
     860  KEY `User` (`User`),
     861  KEY `MenuItem` (`MenuItem`)
     862) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     863
     864  $Manager->Execute('ALTER TABLE `MenuItemFavorite`
     865  ADD CONSTRAINT `MenuItemFavorite_ibfk_2` FOREIGN KEY (`MenuItem`) REFERENCES `MenuItem` (`Id`),
     866  ADD CONSTRAINT `MenuItemFavorite_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);');
     867
     868  $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,
     869`Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES (
     870NULL , "", "Oblíbené položky nabídky", "1", "/is/?t=MenuItemFavorite&a=list", NULL , NULL , NULL , "1");');
     871  $ActionId = $Manager->Database->insert_id;
     872  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Nabídky"');
     873  if($DbResult->num_rows > 0)
     874  {
     875        $DbRow = $DbResult->fetch_assoc();
     876    $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     877      "VALUES (NULL , 'Oblíbené položky nabídky', ".$DbRow['Id'].", '".$ActionId."', '1');");
     878  }
     879}
     880
    850881class Updates
    851882{
     
    894925      671 => array('Revision' => 674, 'Function' => 'UpdateTo674'),
    895926      674 => array('Revision' => 676, 'Function' => 'UpdateTo676'),
     927      676 => array('Revision' => 678, 'Function' => 'UpdateTo678'),
    896928    ));
    897929  }
Note: See TracChangeset for help on using the changeset viewer.