Almost 2 month without a question from me... maybe this is a indicator that my php and sql knowledge is getting continuously better.
But for the following problem I need your help.
In my application i have a custom action "order"
Everything works fine when i use this in list mode or edit mode, because this action is based on the cursor.
When I use this action in find mode the cursor position is not the same as in list mode because then the cursor depends on the list generated by the find button
Example URL Parameters:
List mode
- Code: Select all
/dataface-0.7.1/partner/index.php?-sort=datum+desc&-table=neu_fragen&-action=browse&-cursor=1&-skip=0&-limit=30&-mode=list
find mode:
- Code: Select all
/dataface-0.7.1/partner/index.php?-action=list&-sort=datum+desc&-table=neu_fragen&-cursor=0&-skip=0&-limit=30&-mode=list&-edit=1&kundenname=Stein
somewhere in my custom action I have an order button:
- Code: Select all
echo "<b>Order online:</b><br><br><a href=\"$PHP_SELF?-action=order_action&-cursor=".$_GET['-cursor']."&a=1\">click here</a><br><br>";
I have two Ideas to prevent this:
the most simple way would be to remove the order button in "find mode"...
the action.ini for thiis button looks like this:
- Code: Select all
[order_action]
label = nachbestellen
description = per e-mail
url = "{$this->url('-action=order_action')}"
accessKey = n
category = table_actions
icon = "{$dataface_url}/images/email-open-orange.gif"
mode = list
permission = view
order=5
condition = "$query['-table'] == 'neu_fragen'"
like this it shows up in details, list and find.
What do i have to change to make it only show up in list and details but not in find mode?
Another option would be to get the real cursor number of the record instead of the Cursor number of the found set
But this seems more difficult to me. but maybe you have a good idea?
My main problem was that the URL Parameters always change in find mode depending on the form field and search term...
cheers and thanks in advance
Martin