Changeset 527
- Timestamp:
- Apr 21, 2013, 11:24:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Version.php
r526 r527 1 1 <?php 2 2 3 $Revision = 52 6; // Subversion revision4 $DatabaseRevision = 52 6; // SQL structure revision3 $Revision = 527; // Subversion revision 4 $DatabaseRevision = 527; // SQL structure revision 5 5 $ReleaseTime = '2013-04-21'; 6 6 -
trunk/Modules/IS/IS.php
r524 r527 15 15 return('Nemáte oprávnění'); 16 16 17 $DbResult = $this->Database->select('ISMenuItem', '*', '1 ORDER BY Parent,Name'); 17 $DbResult = $this->Database->query('SELECT `MenuItem`.`Id`, `MenuItem`.`Name`, `MenuItem`.`Parent`, `Action`.`URL` AS `URL`, `ActionIcon`.`Name` AS `IconName` FROM `MenuItem` '. 18 'LEFT JOIN `Action` ON `Action`.`Id` = `MenuItem`.`Action` '. 19 'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '. 20 'ORDER BY `MenuItem`.`Parent`,`MenuItem`.`Name`'); 18 21 while($DbRow = $DbResult->fetch_assoc()) 19 22 { … … 260 263 { 261 264 $LinkTitle = $MenuItem['Name']; 262 if($MenuItem['Table'] != '') $LinkTitle = MakeLink('?t='.$MenuItem['Table'].'&a=list', $LinkTitle); 265 if($MenuItem['URL'] != '') 266 { 267 if(substr($MenuItem['URL'], 0, 4) != 'http') $MenuItem['URL'] = $this->System->Link($MenuItem['URL']); 268 $LinkTitle = MakeLink($MenuItem['URL'], $LinkTitle); 269 } 263 270 if($MenuItem['IconName'] != '') $Image = '<img src="../images/favicons/'.$MenuItem['IconName'].'"/> '; 264 271 else $Image = ''; -
trunk/admin/Updates.php
r526 r527 275 275 } 276 276 277 function UpdateTo527($Manager) 278 { 279 $Manager->Execute("RENAME TABLE `ISMenuItem` TO `MenuItem` ;"); 280 $Manager->Execute("CREATE TABLE IF NOT EXISTS `Menu` ( 281 `Id` int(11) NOT NULL AUTO_INCREMENT, 282 `Name` varchar(255) NOT NULL, 283 PRIMARY KEY (`Id`) 284 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 285 $Manager->Execute("INSERT INTO `Menu` (`Id` ,`Name`)VALUES (NULL , 'IS');"); 286 $Manager->Execute("ALTER TABLE `MenuItem` ADD `Menu` INT NOT NULL , ADD INDEX ( `Menu` )"); 287 $Manager->Execute("UPDATE `MenuItem` SET `Menu` = 1"); 288 $Manager->Execute("ALTER TABLE `MenuItem` ADD FOREIGN KEY ( `Menu` ) REFERENCES `Menu` (". 289 "`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 290 $Manager->Execute("ALTER TABLE `Action` CHANGE `Group` `Group` INT( 11 ) NULL "); 291 $Manager->Execute("INSERT INTO `Action` (SELECT NULL AS `Id`, '' AS `Name`, `Name` AS `Title`, 1 AS `Type`, CONCAT('/is/?t=', `Table`, '&a=list') AS `URL`, NULL AS `Group`, NULL AS `Icon`, NULL AS `PermisionModule`, NULL AS `PermissionOperation`, 1 AS `Enable` FROM `MenuItem` WHERE `Parent` IS NOT NULL)"); 292 $Manager->Execute("ALTER TABLE `MenuItem` DROP `IconName`"); 293 $Manager->Execute("UPDATE `MenuItem` SET `Table` = (SELECT `Id` FROM `Action` WHERE `Action`.`URL` = CONCAT('/is/?t=', `MenuItem`.`Table`, '&a=list')) WHERE `MenuItem`.`Table` != ''"); 294 $Manager->Execute("ALTER TABLE `MenuItem` CHANGE `Table` `Action` INT NULL"); 295 $Manager->Execute("UPDATE `MenuItem` SET `Action` = NULL WHERE `Action` = 0"); 296 $Manager->Execute("ALTER TABLE `MenuItem` ADD INDEX ( `Action` ) "); 297 $Manager->Execute("ALTER TABLE `MenuItem` ADD FOREIGN KEY ( `Action` ) REFERENCES `Action` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 298 $Manager->Execute("INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionModule` ,`PermissionOperation` ,`Enable`)". 299 "VALUES (NULL , '', 'Nabídky', '1', '/is/?t=Menu&a=list', NULL , NULL , '', '', '1');"); 300 $ActionId = $Manager->Database->insert_id; 301 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 302 "VALUES (NULL , 'Nabídky', '23', '".$ActionId."', '1');"); 303 304 } 305 277 306 $Updates = array( 278 307 491 => array('Revision' => 493, 'Function' => 'UpdateTo493'), … … 289 318 515 => array('Revision' => 517, 'Function' => 'UpdateTo517'), 290 319 517 => array('Revision' => 526, 'Function' => 'UpdateTo526'), 320 526 => array('Revision' => 527, 'Function' => 'UpdateTo527'), 291 321 ); 292 322 -
trunk/form_classes.php
r526 r527 19 19 { 20 20 $FormManager->Classes = array( 21 'MenuItem' => array( 22 'Title' => 'Položky nabídky', 23 'Table' => 'MenuItem', 24 'Items' => array( 25 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 26 'Parent' => array('Type' => 'TMenuItem', 'Caption' => 'Rodič', 'Default' => '', 'Null' => true), 27 'Action' => array('Type' => 'TAction', 'Caption' => 'Akce', 'Default' => ''), 28 'Menu' => array('Type' => 'TMenu', 'Caption' => 'Nabídka', 'Default' => ''), 29 'Items' => array('Type' => 'TMenuItemListParent', 'Caption' => 'Položky'), 30 ), 31 ), 32 'Menu' => array( 33 'Title' => 'Nabídky', 34 'Table' => 'Menu', 35 'Items' => array( 36 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 37 'Items' => array('Type' => 'TMenuItemListMenu', 'Caption' => 'Položky'), 38 ), 39 ), 21 40 'Action' => array( 22 41 'Title' => 'Akce', 23 42 'Table' => 'Action', 24 43 'Items' => array( 25 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''),44 //'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 26 45 'Title' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 27 46 'URL' => array('Type' => 'Hyperlink', 'Caption' => 'Odkaz', 'Default' => ''), 28 'Icon' => array('Type' => 'TActionIcon', 'Caption' => 'Ikony', 'Default' => '' ),47 'Icon' => array('Type' => 'TActionIcon', 'Caption' => 'Ikony', 'Default' => '', 'Null' => true), 29 48 'Type' => array('Type' => 'TActionType', 'Caption' => 'Typ', 'Default' => ''), 30 'Group' => array('Type' => 'TActionGroup', 'Caption' => 'Skupina', 'Default' => '' ),49 'Group' => array('Type' => 'TActionGroup', 'Caption' => 'Skupina', 'Default' => '', 'Null' => true), 31 50 'PermissionModule' => array('Type' => 'String', 'Caption' => 'Modul oprávnění', 'Default' => ''), 32 51 'PermissionOperation' => array('Type' => 'String', 'Caption' => 'Operace oprávnění', 'Default' => ''), … … 39 58 'Items' => array( 40 59 'Name' => array('Type' => 'String', 'Caption' => 'Název souboru', 'Default' => ''), 60 'Items' => array('Type' => 'TActionListIcon', 'Caption' => 'Položky', 'Default' => ''), 41 61 ), 42 62 ), … … 46 66 'Items' => array( 47 67 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 68 'Items' => array('Type' => 'TActionListGroup', 'Caption' => 'Položky', 'Default' => ''), 48 69 ), 49 70 ), … … 53 74 'Items' => array( 54 75 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 76 'Items' => array('Type' => 'TActionListType', 'Caption' => 'Položky', 'Default' => ''), 55 77 ), 56 78 ), … … 1135 1157 'Filter' => '1', 1136 1158 ), 1159 'TAction' => array( 1160 'Type' => 'Reference', 1161 'Table' => 'Action', 1162 'Id' => 'Id', 1163 'Name' => 'Title', 1164 'Filter' => '1', 1165 ), 1137 1166 'TActionIcon' => array( 1138 1167 'Type' => 'Reference', … … 1212 1241 'Filter' => '1', 1213 1242 ), 1243 'TMenuItem' => array( 1244 'Type' => 'Reference', 1245 'Table' => 'MenuItem', 1246 'Id' => 'Id', 1247 'Name' => 'Name', 1248 'Filter' => '1', 1249 ), 1250 'TMenu' => array( 1251 'Type' => 'Reference', 1252 'Table' => 'Menu', 1253 'Id' => 'Id', 1254 'Name' => 'Name', 1255 'Filter' => '1', 1256 ), 1214 1257 'TFinanceInvoice' => array( 1215 1258 'Type' => 'Reference', … … 1371 1414 'Id' => 'Id', 1372 1415 'Ref' => 'Subject', 1416 'Filter' => '1', 1417 ), 1418 'TMenuItemListMenu' => array( 1419 'Type' => 'ManyToOne', 1420 'Table' => 'MenuItem', 1421 'Id' => 'Id', 1422 'Ref' => 'Menu', 1423 'Filter' => '1', 1424 ), 1425 'TMenuItemListParent' => array( 1426 'Type' => 'ManyToOne', 1427 'Table' => 'MenuItem', 1428 'Id' => 'Id', 1429 'Ref' => 'Parent', 1430 'Filter' => '1', 1431 ), 1432 'TActionListGroup' => array( 1433 'Type' => 'ManyToOne', 1434 'Table' => 'Action', 1435 'Id' => 'Id', 1436 'Ref' => 'Group', 1437 'Filter' => '1', 1438 ), 1439 'TActionListIcon' => array( 1440 'Type' => 'ManyToOne', 1441 'Table' => 'Action', 1442 'Id' => 'Id', 1443 'Ref' => 'Icon', 1444 'Filter' => '1', 1445 ), 1446 'TActionListType' => array( 1447 'Type' => 'ManyToOne', 1448 'Table' => 'Action', 1449 'Id' => 'Id', 1450 'Ref' => 'Type', 1373 1451 'Filter' => '1', 1374 1452 ),
Note:
See TracChangeset
for help on using the changeset viewer.