Changeset 718


Ignore:
Timestamp:
Jan 1, 2015, 3:22:27 PM (10 years ago)
Author:
chronos
Message:
  • Added: New table Company for representation of currecnt selected subject to work with.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r717 r718  
    11<?php
    22
    3 $Revision = 717; // Subversion revision
    4 $DatabaseRevision = 715; // SQL structure revision
     3$Revision = 718; // Subversion revision
     4$DatabaseRevision = 718; // SQL structure revision
    55$ReleaseTime = strtotime('2015-01-01');
  • trunk/Common/Setup/Updates.php

    r715 r718  
    10011001        $Manager->Execute('ALTER TABLE `Member` DROP `NetworkSegment`');
    10021002        $Manager->Execute('DROP TABLE `NetworkSegment`');
     1003        $Manager->Execute('DELETE FROM `MenuItem` WHERE `Name`="Úseky sítě"');
     1004        $Manager->Execute('DELETE FROM `Action` WHERE `Title`="Úseky sítě"');
     1005}
     1006
     1007function UpdateTo718($Manager)
     1008{       
     1009  $Manager->Execute('CREATE TABLE IF NOT EXISTS `Company` (
     1010`Id` int(11) NOT NULL,
     1011`Name` varchar(255) NOT NULL,
     1012`Subject` int(11) NOT NULL
     1013) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     1014  $Manager->Execute('ALTER TABLE `Company`
     1015ADD PRIMARY KEY (`Id`), ADD KEY `Subject` (`Subject`);');
     1016  $Manager->Execute('ALTER TABLE `Company`
     1017MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;');
     1018  $Manager->Execute('ALTER TABLE `Company`
     1019ADD CONSTRAINT `Company_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);');
     1020
     1021  // IS menu item
     1022  $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,
     1023`Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES (
     1024NULL , "", "Firmy", "1", "/is/?t=Company&a=list", NULL , NULL , NULL , "1");');
     1025  $ActionId = $Manager->Database->insert_id;
     1026  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Finance"');
     1027  if($DbResult->num_rows > 0)
     1028  {
     1029        $DbRow = $DbResult->fetch_assoc();
     1030    $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     1031      "VALUES (NULL , 'Firmy', ".$DbRow['Id'].", '".$ActionId."', '1');");
     1032  }
    10031033}
    10041034
     
    10571087      697 => array('Revision' => 707, 'Function' => 'UpdateTo707'),
    10581088      710 => array('Revision' => 715, 'Function' => 'UpdateTo715'),
     1089      715 => array('Revision' => 718, 'Function' => 'UpdateTo718'),
    10591090    ));
    10601091  }
  • trunk/Modules/Finance/Finance.php

    r716 r718  
    320320      'BeforeInsert' => array($this, 'BeforeInsertFinanceOperation'),
    321321    ));
     322    $this->System->FormManager->RegisterClass('Company', array(
     323      'Title' => 'Firma',
     324      'Table' => 'Company',
     325      'Items' => array(
     326        'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => '0'),
     327        'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => '0'),
     328      ),
     329    ));
    322330    $this->System->FormManager->RegisterClass('FinanceInvoiceItem', array(
    323331      'Title' => 'Položka faktury',
Note: See TracChangeset for help on using the changeset viewer.