Page 1 of 1
Table view set to owner permission problem
Posted: 2021-05-10 07:44
by devedix
Hi all,
I have a problem with the table view when I set it to show only owner record and I add some code in the table_name-dv.js file,
I get this error:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 0, 10' at line 1
Can anyone help?
Thanks
Re: Table view set to owner permission problem
Posted: 2021-05-10 09:31
by onoehring
Hi,
what version of AG are you using?
Did you actually change only the -ds.js file?
Did you try to remove the -ds.js file .... what happens then? Does it work?
Did you change some SQL in your code (hooks/tablename.php)? If so, please post your SQL.
What is the error message if you are logged in as admin? Does it show the SQL query?
Olaf
Re: Table view set to owner permission problem
Posted: 2021-05-10 11:01
by devedix
Hi Olaf,
I'm currently using version 5,95.
When I comment out the code in the table_name-dv.js file or I set the permission to all then the error disappears.
Any idea what's wrong?
Re: Table view set to owner permission problem
Posted: 2021-05-10 11:03
by devedix
This is the code inside my -dv.js file
Code: Select all
// file: hooks/TABLENAME-dv.js
var dv = AppGiniHelper.DV;
new AppGiniLayout([6, 6])
.add(1, ["jf_no", "jf_date", "po_no", "start_date", "end_date", "amountJF", "totalPR","revenue", "urgent"])
.add(2, ["noPol", "unitType", "route", "customer", "namePIC", "phonePIC", "specialRequirement", "attachment"]);
var actionbuttons = dv.actionbuttons;
var grp = actionbuttons .addGroup();
var id = dv.getSelectedId();
var href = "operationTrucking_view.php?addNew_x=1&filterer_noJF=" + id;
grp.addLink("Operation", href, Variation.default);
Re: Table view set to owner permission problem
Posted: 2021-05-10 11:07
by devedix
In the hooks/table_name.php file, I put the default filter
Code: Select all
function truckingJobfile_init(&$options, $memberInfo, &$args) {
/* Apply a default filter only if no filter is already applied by the user */
if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1]){
addFilter(1, 'and', 20, 'equal-to', 'False');
}
return TRUE;
}
Could this be the problem?
Re: Table view set to owner permission problem
Posted: 2021-05-10 16:14
by onoehring
Hi,
please check this thread (and the links in my first entry there): Does this (changing datalist.php) solve your problem?
viewtopic.php?f=11&t=4143
Also check this:
viewtopic.php?f=11&t=4285
Olaf
Re: Table view set to owner permission problem
Posted: 2021-05-11 02:48
by devedix
Hi Olaf,
Thank you very much for your help and response.
I see that you really actively helping other members with their problems, people like you that make this community thriving.
Thanks again.
Re: Table view set to owner permission problem
Posted: 2021-05-11 10:12
by onoehring
Hi,
thank you for your kind words, I hope, mine are helpful for you.
Olaf