Re: [Tiki-devel] Tiki Item link preselect parameters

Victor Emanouilov via TikiWiki-devel <[email protected]>
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <[email protected]>
Bernard,

It is in 22.x:

https://gitlab.com/tikiwiki/tiki/-/blob/22.x/lib/core/Math/Formula/Function/PregReplace.php

Not sure what you are doing with git but maybe not the right thing :)

Is it possible that worker tag is an item link? What is the real string 
value of Month | Worker tag in your database?

Regards,
Victor

On 8/16/21 4:16 PM, Bsfez Tiki wrote:
> Ok (posting here so other people get the info)
>
>
> For some reason preg-replace is not in Tiki22 from gitlab.
>
> I found your commit and grab the file from the commit: 
> https://gitlab.com/tikiwiki/tiki/-/blob/6a417614c4fce34dd3221767d6d0d75b46fd1358/lib/core/Math/Formula/Function/PregReplace.php 
> <https://gitlab.com/tikiwiki/tiki/-/blob/6a417614c4fce34dd3221767d6d0d75b46fd1358/lib/core/Math/Formula/Function/PregReplace.php>
> Copied it on y Tiki.
>
> But I still don’t have the expected results:
>
> *Month | Worker tag:* June 2021 | נאסר
> *Name: *5632
>
> *Name* should be "נאסר".
>
> 😢
>
> Bernard
>
>> On 16 Aug 2021, at 12:02 , Bsfez Tiki via TikiWiki-devel 
>> <[email protected] 
>> <mailto:[email protected]>> wrote:
>>
>> Ha ha !
>> That’s explain why I couldn’t see it !!! 😂
>>
>> Thank you very much, I’ll test, document and add samples.
>>
>> Appreciate teamwork. 😉
>>
>>
>> Regards,
>> Bernard
>>
>> PS: If you know more undocumented stuff that I can help document 
>> don’t hesitate.
>>
>>> On 16 Aug 2021, at 09:51 , Victor Emanouilov <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>>
>>> Bernard,
>>>
>>> Ah, that's easy but unfortunately, I don't see a documentation about 
>>> it, maybe you can add one :)
>>>
>>> Math formula to get the user: (preg-replace (str /^.*?\|/) (str ) 
>>> fieldMonthAndUser)
>>>
>>> Math formula to get the month: (preg-replace (str /\|.*$/) (str ) 
>>> fieldMonthAndUser)
>>>
>>> Regards,
>>> Victor
>>>
>>> On 8/15/21 10:49 AM, Bsfez Tiki wrote:
>>>> Hi Victor,
>>>>
>>>>> Maybe you need 2 additional fields (Month) and (User) in the same 
>>>>> tracker, both Math fields with calculation to extract that info 
>>>>> from the Month|User field and the match other items based on the 
>>>>> new fields?
>>>>>
>>>> I thought also about a calculation field to split the Month|User 
>>>> and have 2 separate field I can use separately but I couldn’t find 
>>>> how to do it : https://doc.tiki.org/Calculations 
>>>> <https://doc.tiki.org/Calculations>
>>>>
>>>> Thanks for guidance,
>>>> Bernard
>>>>
>>>>
>>>>> On 13 Aug 2021, at 13:30 , Victor Emanouilov <[email protected] 
>>>>> <mailto:[email protected]>> wrote:
>>>>>
>>>>> Yes, it is a trial and error, unfortunately. I am not sure 
>>>>> Trackers natively support your use-case where you have 2 different 
>>>>> values Month and User in one field and want to restrict items from 
>>>>> other trackers based on part of the field. Maybe you need 2 
>>>>> additional fields (Month) and (User) in the same tracker, both 
>>>>> Math fields with calculation to extract that info from the 
>>>>> Month|User field and the match other items based on the new fields?
>>>>>
>>>>> Regards,
>>>>> Victor
>>>>>
>>>>> On 8/13/21 12:14 AM, Bsfez Tiki wrote:
>>>>>> Thanks Victor,
>>>>>>
>>>>>> I’m trying to have items generated and populate automatically 
>>>>>> from other trackers just using the "Month | User" field only.
>>>>>> For this I’m trying to use the "Month" part with a filter based 
>>>>>> on date range (so I can make it each with each end of the month) 
>>>>>> and the user part to auto-select the user linked with the item 
>>>>>> list (hours) generated by the "Month | User" field.
>>>>>>
>>>>>> That’s why I wanted "August | Victor" to be used as filter for 
>>>>>> the user Victor and select it.
>>>>>>
>>>>>>
>>>>>> From what I remember (but will re-teste as usual):
>>>>>>>
>>>>>>> - check out the cross-select option
>>>>>>>
>>>>>> = Empty dropdown
>>>>>>
>>>>>>> why don't you try with a Dynamic items list field?
>>>>>>>
>>>>>> = blank disable dropdown
>>>>>>
>>>>>> I’ll dig more… after I update to Tiki23.
>>>>>>
>>>>>> Thanks 🙏
>>>>>>
>>>>>> B
>>>>>>
>>>>>>
>>>>>>> On 12 Aug 2021, at 16:34 , Victor Emanouilov via TikiWiki-devel 
>>>>>>> <[email protected] 
>>>>>>> <mailto:[email protected]>> wrote:
>>>>>>>
>>>>>>> Bernard,
>>>>>>>
>>>>>>> I also don't fully understand this preselection but have the 
>>>>>>> following suggestions:
>>>>>>>
>>>>>>> - check out the cross-select option
>>>>>>>
>>>>>>> - check if Month | Worker tag field contains the same values as 
>>>>>>> the ones you are trying to preselect
>>>>>>>
>>>>>>> If all you need to do is selecting the user out of Month | User 
>>>>>>> kind of field, why don't you try with a Dynamic items list field?
>>>>>>>
>>>>>>> Regards,
>>>>>>> Victor
>>>>>>>
>>>>>>> On 8/12/21 10:24 AM, Michael Finko wrote:
>>>>>>>> looks like that's the lowest value on the list, so essentially 
>>>>>>>> is using the 'first' value?
>>>>>>>>
>>>>>>>> On Wed, Aug 11, 2021 at 7:26 PM Bsfez Tiki via TikiWiki-devel 
>>>>>>>> <[email protected] 
>>>>>>>> <mailto:[email protected]>> wrote:
>>>>>>>>
>>>>>>>>     Hi Victor ;-)
>>>>>>>>
>>>>>>>>>     UserSelector field actually stores usernames (which could
>>>>>>>>>     be email addresses depending on your Tiki setup)
>>>>>>>>
>>>>>>>>     I don’t use email.
>>>>>>>>
>>>>>>>>
>>>>>>>>     Field 179 is the item link with the preselect rule, and it
>>>>>>>>     stay locked on the first item found (lower id)
>>>>>>>>
>>>>>>>>     <Screen Shot 2021-08-11 at 19.10.24 .png>
>>>>>>>>
>>>>>>>>
>>>>>>>>     <Screen Shot 2021-08-11 at 19.13.46 .png>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     Shouldn’t it work ?
>>>>>>>>
>>>>>>>>     Bernard
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>     On 11 Aug 2021, at 17:14 , Victor Emanouilov
>>>>>>>>>     <[email protected] <mailto:[email protected]>> wrote:
>>>>>>>>>
>>>>>>>>>     Hi Bernard,
>>>>>>>>>
>>>>>>>>>     UserSelector field actually stores usernames (which could
>>>>>>>>>     be email addresses depending on your Tiki setup), so if
>>>>>>>>>     you preselect something, that should be based on
>>>>>>>>>     usernames, not actual user ID values. Otherwise, some kind
>>>>>>>>>     of mapping must be done between usernames and user ID values.
>>>>>>>>>
>>>>>>>>>     Regards,
>>>>>>>>>     Victor
>>>>>>>>>
>>>>>>>>>     On 8/11/21 4:28 PM, Bsfez Tiki wrote:
>>>>>>>>>>     Hello (Victor ;-)),
>>>>>>>>>>
>>>>>>>>>>     I finally understood why I couldn’t work anything using
>>>>>>>>>>     the item link preselect thing.
>>>>>>>>>>
>>>>>>>>>>     It seems it work with a text field something I never
>>>>>>>>>>     attempt or needed.
>>>>>>>>>>
>>>>>>>>>>     I always tried to use it with user selector field where I
>>>>>>>>>>     guess it can’t "find" the other tracker value (the string
>>>>>>>>>>     in the field) but the look through the "link reference"
>>>>>>>>>>     values list.
>>>>>>>>>>
>>>>>>>>>>     IE: looking for "123" instead of  "Bernard".
>>>>>>>>>>     <option value="123" selected="selected">Bernard</option>
>>>>>>>>>>
>>>>>>>>>>     Does anyone has a trick so the preselect is made using a
>>>>>>>>>>     user selector ?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     Bernard
>>>>>>>>
>>>>>>>>     _______________________________________________
>>>>>>>>     TikiWiki-devel mailing list
>>>>>>>>     [email protected]
>>>>>>>>     <mailto:[email protected]>
>>>>>>>>     https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>>>>>>>     <https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> TikiWiki-devel mailing list
>>>>>>>> [email protected]
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>>>>>> _______________________________________________
>>>>>>> TikiWiki-devel mailing list
>>>>>>> [email protected] 
>>>>>>> <mailto:[email protected]>
>>>>>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>>>>>
>>>>
>>
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [email protected] 
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>

_______________________________________________
TikiWiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.