Ignore:
Timestamp:
Nov 6, 2015, 8:40:19 PM (9 years ago)
Author:
chronos
Message:
  • Added: Customer support activity table.
  • Added: Show operations for operation group.
File:
1 edited

Legend:

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

    r763 r765  
    16041604}
    16051605
     1606function UpdateTo765($Manager)
     1607{
     1608  $Manager->Execute('CREATE TABLE IF NOT EXISTS `SupportActivity` (
     1609    `Id` int(11) NOT NULL AUTO_INCREMENT,
     1610    `Description` text NOT NULL,
     1611    `Customer` int(11) NOT NULL,
     1612    `User` int(11) NOT NULL,
     1613    `Time` datetime NOT NULL,
     1614    PRIMARY KEY (`Id`),
     1615    KEY `User` (`User`),
     1616    KEY `Customer` (`Customer`)
     1617   ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;');
     1618
     1619  $Manager->Execute('ALTER TABLE `SupportActivity`
     1620ADD CONSTRAINT `SupportActivity_ibfk_1` FOREIGN KEY (`Customer`) REFERENCES `Member` (`Id`),
     1621ADD CONSTRAINT `SupportActivity_ibfk_2` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);');
     1622
     1623  // IS menu item
     1624  $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,
     1625`Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES (
     1626NULL , "", "Zákaznická podpora", "1", "/is/?t=SupportActivity&a=list", NULL , NULL , NULL , "1");');
     1627  $ActionId = $Manager->Database->insert_id;
     1628  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Zákazníci"');
     1629  if($DbResult->num_rows > 0)
     1630  {
     1631    $DbRow = $DbResult->fetch_assoc();
     1632    $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     1633        "VALUES (NULL , 'Zákazická podpora', ".$DbRow['Id'].", '".$ActionId."', '1');");
     1634  }
     1635}
    16061636
    16071637class Updates
     
    16821712      759 => array('Revision' => 762, 'Function' => 'UpdateTo762'),
    16831713      762 => array('Revision' => 763, 'Function' => 'UpdateTo763'),
     1714      763 => array('Revision' => 765, 'Function' => 'UpdateTo765'),
    16841715    ));
    16851716  }
Note: See TracChangeset for help on using the changeset viewer.