Anc lib timetables backend: Unterschied zwischen den Versionen
Aus Vosp.info
V (Diskussion | Beiträge) |
V (Diskussion | Beiträge) (→etc) |
||
Zeile 25: | Zeile 25: | ||
=== etc === | === etc === | ||
../etc/config.xml | ../etc/config.xml | ||
+ | <source lang="xml"> | ||
+ | <?xml version="1.0"?> | ||
+ | <config> | ||
+ | <modules> | ||
+ | <Anc_Lib> | ||
+ | <version>0.1.0</version> | ||
+ | </Anc_Lib> | ||
+ | </modules> | ||
+ | <global> | ||
+ | <models> | ||
+ | <anc_lib> | ||
+ | <class>Anc_Lib_Model</class> | ||
+ | <resourceModel>anc_lib_resource</resourceModel> | ||
+ | </anc_lib> | ||
+ | <anc_lib_resource> | ||
+ | <class>Anc_Lib_Model_Resource_Mysql4</class> | ||
+ | <!-- entitie's mit s hier können mehrere Tabellen(namen) untergebracht werden --> | ||
+ | <entities> | ||
+ | <timetable> | ||
+ | <table>anc_lib_timetable</table> | ||
+ | </timetable> | ||
+ | </entities> | ||
+ | </anc_lib_resource> | ||
+ | </models> | ||
+ | <resources> | ||
+ | <!-- hier verbirgt sich das installationsskript um die datenbanktabellen zu erstellen --> | ||
+ | <anc_lib_setup> | ||
+ | <setup> | ||
+ | <module>Anc_Lib</module> | ||
+ | <class>Mage_Sales_Model_Mysql4_Setup</class> | ||
+ | </setup> | ||
+ | <connection> | ||
+ | <use>core_setup</use> | ||
+ | </connection> | ||
+ | </anc_lib_setup> | ||
+ | <!-- datenbank verbindungen --> | ||
+ | <anc_lib_write> | ||
+ | <connection> | ||
+ | <use>core_write</use> | ||
+ | </connection> | ||
+ | </anc_lib_write> | ||
+ | <anc_lib_read> | ||
+ | <connection> | ||
+ | <use>core_read</use> | ||
+ | </connection> | ||
+ | </anc_lib_read> | ||
+ | </resources> | ||
+ | |||
+ | <blocks> | ||
+ | <anc_lib> | ||
+ | <class>Anc_Lib_Block</class> | ||
+ | </anc_lib> | ||
+ | <anc_lib_adminhtml> | ||
+ | <class>Anc_Lib_Block_Adminhtml</class> | ||
+ | </anc_lib_adminhtml> | ||
+ | <customer> | ||
+ | <rewrite> | ||
+ | <account_navigation>Anc_Lib_Block_Account_Navigation</account_navigation> | ||
+ | </rewrite> | ||
+ | </customer> | ||
+ | </blocks> | ||
+ | <helpers> | ||
+ | <anc_lib> | ||
+ | <class>Anc_Lib_Helper</class> | ||
+ | </anc_lib> | ||
+ | </helpers> | ||
+ | </global> | ||
+ | <admin> | ||
+ | <routers> | ||
+ | <anc_lib> | ||
+ | <use>admin</use> | ||
+ | <args> | ||
+ | <module>Anc_Lib</module> | ||
+ | <frontName>lib</frontName> | ||
+ | </args> | ||
+ | </anc_lib> | ||
+ | </routers> | ||
+ | </admin> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <adminhtml> | ||
+ | <menu> | ||
+ | <Anc_Anc module="anc_lib"> | ||
+ | <title>ANC</title> | ||
+ | <sort_order>71</sort_order> | ||
+ | <children> | ||
+ | <item2 module="anc_lib"> | ||
+ | <title>Playlists</title> | ||
+ | <sort_order>2</sort_order> | ||
+ | <action>site/adminhtml_playlist/list</action> | ||
+ | <children> | ||
+ | <item2b module="anc_lib"> | ||
+ | <title>Timetables</title> | ||
+ | <sort_order>3</sort_order> | ||
+ | |||
+ | <action>lib/adminhtml_timetable/list</action> | ||
+ | </item2b> | ||
+ | </children> | ||
+ | </item2> | ||
+ | </children> | ||
+ | </Anc_Anc> | ||
+ | </menu> | ||
+ | |||
+ | </adminhtml> | ||
+ | </config> | ||
+ | |||
+ | </source> | ||
../etc/adminhtml.xml | ../etc/adminhtml.xml | ||
+ | <source lang="xml"> | ||
+ | <?xml version="1.0"?> | ||
+ | <config> | ||
+ | <acl> | ||
+ | <resources> | ||
+ | <all> | ||
+ | <title>Allow Everything</title> | ||
+ | </all> | ||
+ | <admin> | ||
+ | <children> | ||
+ | <Anc_Anc module="anc_site"> | ||
+ | <title>ANC</title> | ||
+ | <sort_order>71</sort_order> | ||
+ | <children> | ||
+ | <item2 module="anc_site"> | ||
+ | <title>Playlists</title> | ||
+ | <sort_order>2</sort_order> | ||
+ | <action>site/adminhtml_site/index</action> | ||
+ | <children> | ||
+ | <item2b module="anc_lib"> | ||
+ | <title>Timetables</title> | ||
+ | <sort_order>3</sort_order> | ||
+ | <action>lib/adminhtml_timetable/list</action> | ||
+ | </item2b> | ||
+ | </children> | ||
+ | </item2> | ||
+ | </children> | ||
+ | </Anc_Anc> | ||
+ | |||
+ | <system> | ||
+ | <children> | ||
+ | <config> | ||
+ | <children> | ||
+ | <site translate="title"> | ||
+ | <title>Lib</title> | ||
+ | <sort_order>101</sort_order> | ||
+ | </site> | ||
+ | </children> | ||
+ | </config> | ||
+ | </children> | ||
+ | </system> | ||
+ | </children> | ||
+ | </admin> | ||
+ | </resources> | ||
+ | </acl> | ||
+ | |||
+ | </config> | ||
+ | </source> | ||
=== sql=== | === sql=== |
Version vom 31. Mai 2014, 08:35 Uhr
Inhaltsverzeichnis
Struktur
Blöcke
../Block/Adminhtml/Timetables.php ../Block/Adminhtml/Timetables ../Block/Adminhtml/Timetables/Grid.php ../Block/Adminhtml/Timetables/Edit.php ../Block/Adminhtml/Timetables/Edit ../Block/Adminhtml/Timetables/Edit/Form.php ../Block/Adminhtml/Timetables/Edit/Tabs.php ../Block/Adminhtml/Timetables/Edit/Tab ../Block/Adminhtml/Timetables/Edit/Tab/Form.php ../Block/Adminhtml/Timetables/Edit/Tab/Content.php
Helper
../Helper/Data.php
Model
../Model/Resource/Mysql4/Timetable/Collection.php ../Model/Resource/Mysql4/Timetable.php
Controller.php
../controllers/Adminhtml/TimetableController.php
etc
../etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Anc_Lib>
<version>0.1.0</version>
</Anc_Lib>
</modules>
<global>
<models>
<anc_lib>
<class>Anc_Lib_Model</class>
<resourceModel>anc_lib_resource</resourceModel>
</anc_lib>
<anc_lib_resource>
<class>Anc_Lib_Model_Resource_Mysql4</class>
<!-- entitie's mit s hier können mehrere Tabellen(namen) untergebracht werden -->
<entities>
<timetable>
<table>anc_lib_timetable</table>
</timetable>
</entities>
</anc_lib_resource>
</models>
<resources>
<!-- hier verbirgt sich das installationsskript um die datenbanktabellen zu erstellen -->
<anc_lib_setup>
<setup>
<module>Anc_Lib</module>
<class>Mage_Sales_Model_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</anc_lib_setup>
<!-- datenbank verbindungen -->
<anc_lib_write>
<connection>
<use>core_write</use>
</connection>
</anc_lib_write>
<anc_lib_read>
<connection>
<use>core_read</use>
</connection>
</anc_lib_read>
</resources>
<blocks>
<anc_lib>
<class>Anc_Lib_Block</class>
</anc_lib>
<anc_lib_adminhtml>
<class>Anc_Lib_Block_Adminhtml</class>
</anc_lib_adminhtml>
<customer>
<rewrite>
<account_navigation>Anc_Lib_Block_Account_Navigation</account_navigation>
</rewrite>
</customer>
</blocks>
<helpers>
<anc_lib>
<class>Anc_Lib_Helper</class>
</anc_lib>
</helpers>
</global>
<admin>
<routers>
<anc_lib>
<use>admin</use>
<args>
<module>Anc_Lib</module>
<frontName>lib</frontName>
</args>
</anc_lib>
</routers>
</admin>
<adminhtml>
<menu>
<Anc_Anc module="anc_lib">
<title>ANC</title>
<sort_order>71</sort_order>
<children>
<item2 module="anc_lib">
<title>Playlists</title>
<sort_order>2</sort_order>
<action>site/adminhtml_playlist/list</action>
<children>
<item2b module="anc_lib">
<title>Timetables</title>
<sort_order>3</sort_order>
<action>lib/adminhtml_timetable/list</action>
</item2b>
</children>
</item2>
</children>
</Anc_Anc>
</menu>
</adminhtml>
</config>
../etc/adminhtml.xml
<?xml version="1.0"?>
<config>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<Anc_Anc module="anc_site">
<title>ANC</title>
<sort_order>71</sort_order>
<children>
<item2 module="anc_site">
<title>Playlists</title>
<sort_order>2</sort_order>
<action>site/adminhtml_site/index</action>
<children>
<item2b module="anc_lib">
<title>Timetables</title>
<sort_order>3</sort_order>
<action>lib/adminhtml_timetable/list</action>
</item2b>
</children>
</item2>
</children>
</Anc_Anc>
<system>
<children>
<config>
<children>
<site translate="title">
<title>Lib</title>
<sort_order>101</sort_order>
</site>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
sql
../sql/anc_lib_setup/install-0.1.0.php
<?php
$installer = $this;
$installer->startSetup();
$tableName = $installer->getTable('anc_lib/timetable');
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Id')
->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'Name')
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'comment')
->addColumn('admin_user_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0',), 'Who Created frontend')
->addColumn('start', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'Start Date as Timestamp')
->addColumn('stop', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'End Date as Timestamp')
->addColumn('starthour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Hour')
->addColumn('stophour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '23'),'Daily stop Hour')
->addColumn('startmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Min')
->addColumn('stopmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '59'),'Daily stop Min')
->addColumn('monday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Mondays')
->addColumn('tuesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Tuesday')
->addColumn('wednesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Wednesday')
->addColumn('thursday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Thursday')
->addColumn('friday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Friday')
->addColumn('saturday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Saturday')
->addColumn('sunday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Sunday')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When beginn')
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When updated')
->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array('default' => '0'), 'Deleted')
;
$installer->getConnection()->createTable($table);
}
$installer->endSetup();
?>