[TYPO3-calendar] Show in Legend only categories used this month

PM patrickm87 at gmx.de
Wed Jan 16 14:45:33 CET 2013


Am 16.01.2013 10:01, schrieb PM:
> Am 15.01.2013 19:14, schrieb Mario Matzulla:
>> Am 15.01.13 14:52, schrieb PM:
>>> Am 15.01.2013 11:22, schrieb PM:
>>>> Am 14.01.2013 20:05, schrieb Mario Matzulla:
>>>>> Hi Patrick,
>>>>>
>>>>> Am 14.01.13 07:37, schrieb PM:
>>>>>> Am 12.01.2013 11:17, schrieb Mario Matzulla:
>>>>>>> Hi Patrick,
>>>>>>>
>>>>>>> Am 11.01.13 11:30, schrieb PM:
>>>>>>>> Hi Mario
>>>>>>>>
>>>>>>>> Am 10.01.2013 18:14, schrieb Mario Matzulla:
>>>>>>>>> Hi Patrick,
>>>>>>>>>>
>>>>>>>>> I see what you intend to do. And I think the module__marker
>>>>>>>>> described in
>>>>>>>>> the other thread is what you are looking for: a custom way to
>>>>>>>>> configure
>>>>>>>>> the category and calendar legend :)
>>>>>>>>
>>>>>>>> Is there also a function that returns all the categories of
>>>>>>>> events of
>>>>>>>> the current month (or of any other defined period of time) ?
>>>>>>>
>>>>>>> Nope, else it would be easy ;)
>>>>>>> I guess you have to walk through all events of the master_array and
>>>>>>> get
>>>>>>> their categories.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Mario
>>>>>>>
>>>>>>> BTW: if you place the module__marker inside the day,week or month
>>>>>>> template you should get the corresponding view object, which extends
>>>>>>> the
>>>>>>> base_view, which has all you need: $this->master_array and the
>>>>>>> getCategorySelectionTree function.
>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>> Mario
>>>>>>
>>>>>> Okay found the events in the master_array. But I only need the
>>>>>> events of
>>>>>> the month thats currently selected.
>>>>>> So to choose these events I have to know which month the user
>>>>>> currently
>>>>>> has selected.
>>>>>> But I didn't find the selected month in the master_array.
>>>>>> Can you tell me how I can get it?
>>>>>
>>>>> It's in the configuration array of the base_service:
>>>>> $conf['getdate'] =>
>>>>> a string value like YYYYMMDD.
>>>>
>>>> Thanks for that, works fine for the month view.
>>>>
>>>> If I want to use my module in the month template and in the year view
>>>> template, how can I find out which template/view is calling my module?
>>>>
>>>
>>> I found out was wrong when I told everything works fine.
>>>
>>> There is another problem:
>>> The Arrays:
>>>
>>> $moduleCaller->master_array
>>> and also $moduleCaller->event_array
>>>
>>> consist only of events of categories that are selected.
>>>
>>> How can I get a list of the events of categories that are deselected.
>>>
>>> Example:
>>> Event1 -> Cat1
>>> Event2 -> Cat1
>>> Event3 -> Cat3
>>>
>>> If I have only the Categorie Cat1 selected, then there are Event1 and
>>> Event2 in $moduleCaller->master_array.
>>>
>>> But I also need Event3. Where can I find it?
>>>
>> Well, I guess there is an easy, but time consuming solution (1) and a
>> solution that needs some coding, but is fast (2):
>>
>> 1) You could use the $modelObj (tx_cal_model_controller) from the base
>> service to find all events (findEventsWithin)
>>
>> 2) You use a TYPO3 backend (and cal-frontend hook - if needed) and catch
>> event manipulations. Than store the categories of those events per month
>> and calendar in a database.
>> In your module__marker you query the correct month(s) with the available
>> categories.
>>
>> Sorry, but it really looks like there is no simple solution.
>>
>> Regards,
>> Mario
>
>
>
>
> (2) sounds to be to complicated for me.
>
> So I'll try (1).
> There is the problem that findEventsWithin finally ends at
> findAllWithin(...) in class.tx_cal_event_service.php which uses
> $this->conf['category'] to put a where with the categories in the
> db-select.
>
> Questions:
> A.) So I have to set $this->conf['category'] to the correct values
> before calling findEventsWithin(...) right?
>
>
> B.)But the values for $this->conf['category'] should be in the second
> call only the categories not used before. (less memory usages cause I
> already have the other events)
> So my question: How can I get all categories that exist? (then I can
> compare the two lists (existing without used categories = needed cat.)
>
> C.)  Maybe you haven't seen this question: If I want to use my module in
> the month template and in the year view template, how can I find out
> which template/view is calling my module?
>
>
> Thanks for answering every day :-)


B) Okay I found the answer to B):
I am using:
$categoryArray = 
$this->modelObj->findAllCategories('','',$this->conf['pidList']);

A.)If I do as I wrote in A) everything works. Is there a reason not to 
set this config variable to another value?

C.) Q still open

D.) Is there a plugin/module collection site where I can upload the code 
s.t. someone else can use/develop it further?




More information about the TYPO3-project-calendar mailing list