Table view set to owner permission problem

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
devedix
Veteran Member
Posts: 30
Joined: 2021-04-20 10:44

Table view set to owner permission problem

Post by devedix » 2021-05-10 07:44

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
Regards,
Edix

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Table view set to owner permission problem

Post by onoehring » 2021-05-10 09:31

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

devedix
Veteran Member
Posts: 30
Joined: 2021-04-20 10:44

Re: Table view set to owner permission problem

Post by devedix » 2021-05-10 11:01

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?
Regards,
Edix

devedix
Veteran Member
Posts: 30
Joined: 2021-04-20 10:44

Re: Table view set to owner permission problem

Post by devedix » 2021-05-10 11:03

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);
Regards,
Edix

devedix
Veteran Member
Posts: 30
Joined: 2021-04-20 10:44

Re: Table view set to owner permission problem

Post by devedix » 2021-05-10 11:07

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?
Regards,
Edix

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Table view set to owner permission problem

Post by onoehring » 2021-05-10 16:14

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

devedix
Veteran Member
Posts: 30
Joined: 2021-04-20 10:44

Re: Table view set to owner permission problem

Post by devedix » 2021-05-11 02:48

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.
Regards,
Edix


Post Reply