Giter Club home page Giter Club logo

sf_event_mgt_extend_demo's Introduction

Event management and registration - Extend Demo

What is it?

This TYPO3 CMS extension is a demo extension to show how to extend sf_event_mgt. The extension has been created with the extension builder and does the following:

  • Extend the event domain model with the new field "Entrance"
  • Extend the registration domain model with the new fields "Hotel room needed" and "Fax"

Additionally, the extension extends the saveRegistrationAction from the EventController to demonstrate how the EventController can be extended using xclass.

Short manual how to extend sf_event_mgt

  1. Create a new extension with the extension builder
  2. Add sf_event_mgt as a dependency for your new extension
  3. Create a new table and add the new properties (fields). For each new table, select "Extend existing model class" and enter the class of the sf_event_mgt table you want to extend (e.g. \DERHANSEN\SfEventMgt\Domain\Model\Event)
  4. Save the extension
  5. Install the extension
  6. Use new fields in backend and frontend

Extending domain model manually

If you extend the event domain model manually, the following steps are required.

  1. Extend tx_sfeventmgt_domain_model_event table in ext_tables.sql of your extension

  2. Create and register required TCA changes using TCA overrides

  3. Create a class in your own extension which extends \DERHANSEN\SfEventMgt\Domain\Model\Event

  4. Map new class to use tx_sfeventmgt_domain_model_event table in Configuration/Extbase/Persistence/Classes.php

    <?php
    
    declare(strict_types=1);
    
    return [
        \DERHANSEN\SfEventMgtExtendDemo\Domain\Model\Event::class => [
            'tableName' => 'tx_sfeventmgt_domain_model_event',
        ],
    ];
    
  5. xclass domain model in ext_localconf.php

    // xclass event domain model
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\DERHANSEN\SfEventMgt\Domain\Model\Event::class] = [
        'className' => \DERHANSEN\SfEventMgtExtendDemo\Domain\Model\Event::class
    ];
    

Versions

Version TYPO3 PHP
0.6.0 12.2+ >= 8.1
0.5.1 11.5 >= 7.4
0.4.0 10.4 7.2 - 7.4
0.3.0 8.7 - 9.5 7.0 - 7.3

Links

sf_event_mgt is available on GitHub at https://github.com/derhansen/sf_event_mgt

sf_event_mgt_extend_demo's People

Contributors

derhansen avatar tmotyl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

macopedia

sf_event_mgt_extend_demo's Issues

Translation not working

I am unable to see any label for my new fields from extend-demo...

i.e. not working:
<f:form.checkbox id="hotelRoomNeeded" property="hotelRoomNeeded" value="1"/> <f:translate key="tx_sfeventmgtextenddemo_domain_model_registration.hotelRoomNeeded"/> <e:registration.isRequiredField settings="{settings}" fieldname="hotelRoomNeeded"> <span class="event-required">*</span> </e:registration.isRequiredField><br> <f:render partial="FormErrors" arguments="{field: 'registration.hotelRoomNeeded'}"/>

I cannot see the english label as well as the german label translated with the translate_locallang extension.

Please extend with Domain/Repository example

Please extend the example with an example of Repository function.

Example:

<code>
        /**
         * Returns number of registrations for the given event where paid=1
         *
         * @param \RedSeadog\SfeventmgtExtend\Domain\Model\Event $event Event
         *
         * @return int
         */
        public function nrOfPaidRegistrations($event)
        {
                // setup $query
                $query = $this->createQuery();

                // search for registrations for this $event where paid=1
                $constraints = [];
                $constraints[] = $query->equals('event',$event);
                $constraints[] = $query->equals('paid',1);
                $query->matching(
                        $query->LogicalAnd($constraints)
                );

                // return result
                return $query->execute()->count();
        }
</code>

unable to save registration

Hi... I tried to use my extension and - after failing - the demo extension. But I always get this error, if I want to save the data in registration process.

"exception":"TYPO3\\CMS\\Extbase\\Property\\Exception\\InvalidTargetException: Property \"hotel_room_needed\" was not found in target object of type \"DERHANSEN\\SfEventMgtExtendDemo\\Domain\\Model\\Registration\".

What do I have to do?

Edit: typo3 10.4.4

No labels in BE

Hi Torben,
thanks for the nice demo to extend sf_event_mgt. The new fields are added in the BE and in the table but there are no labels. I use typo3 8.7.8.

Regards
Hobokens
no lables typo3 cms 8 7 8

Readme: Update existing records

Thanks for this great demo. It helped me a lot in adding my own custom fields.
The only step that gave me a hard time was this section in the README.md:

Update existing records

If your TYPO3 installation does already contain events or registrations, make sure to update existing records so the new field "Record type" is set.

Not being very involved with adding new fields in Extbase extensions, I had problems to figure out what field "Record type" would mean. In fact I found out that the field in the table is called "tx_extbase_type".

Here is a proposal for a replacement text that would IMHO make things clearer:

Update existing records

If your TYPO3 installation does already contain events or registrations, make sure to update existing records so the new field "tx_extbase_type" (the so called "Record type") is set in each table that you extend.
Use a database management tool like phpMyAdmin to adjust the field. The value needed depends on the name of your extension and the extended model. For this demo extension the correct values are:
For the Events table: "Tx_SfEventMgtExtendDemo_Event"
For the Registrations table: "Tx_SfEventMgtExtendDemo_Registration"
The easiest way to derived the correct value for your table is to create one new record and to look the value up in the "tx_extbase_type" field of this record. Then copy it to all existing records.

New fields not available in Frontend

Hi Torben,

I am luckily using your extension sf_event_mgt. (running TYPO3 7.6.2)
I tried adding some fields with your demo extension.
This works perfectly in the backend, but the new fields (e.g. "entrance") are not available in the frontend.

Could you give me a clue?

Thanks a lot,
Robert Pietschmann

Unable to deploy additional fields

Hi,

I have extended your extension about a year ago. Now, I need two more fields. I edited the files and uploaded the changes.

But for some reason the fields are not created. Do I have to do more than that? I cannot find issues in my files.

Regards,
Marcel

TYPO3 10.4 compatible version available soon?

Hi,

the demo leads to error in conjunction with TYPO3 10.4 and sf_event_mgt 5.0 - probablily because the demoversion 0.3.0 is not suitable to TYPO3 10.

do you plan to do release a adapted version in the near future?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.