Change All fields to Read only

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
bescott53

Change All fields to Read only

Post by bescott53 » 2018-12-18 09:56

Hi everyone, i want to change all fields to read only, after a field is set to complete. I tried updating the membership_userrecords but this will not work for me. is there another way to complete this?

sjohn
Veteran Member
Posts: 86
Joined: 2018-05-23 09:32

Re: Change All fields to Read only

Post by sjohn » 2018-12-18 12:09

If you ( in admin area ) set the acces to the table to : create new records=allowed edit records=not allowed, then the user can create a new record. The user can also fill in all the fields, and save the record.
But the user is not allowed to edit any of the fields after that.

Another group could have access to edit the data, but not create new records.

This will be a kind of read only, but with the possibility for a user to fill in data.
Was it something like this you meant?

sjohn
Veteran Member
Posts: 86
Joined: 2018-05-23 09:32

Re: Change All fields to Read only

Post by sjohn » 2018-12-18 12:17

Just to be sure : What I describe requires no hooks or coding. It is just about setting the credentials for a table in the admin-area for a group.

bescott53

Re: Change All fields to Read only

Post by bescott53 » 2018-12-18 13:06

thanks sjohn, i had run through this but the way i have set up (I have a supervisor who can see the group) who authorises, doing it your way is not possible as supervisor would still need to view but can only be in 1 group and not more than 1 group.

sjohn
Veteran Member
Posts: 86
Joined: 2018-05-23 09:32

Re: Change All fields to Read only

Post by sjohn » 2018-12-18 16:37

Is it not possible to make a supervisor-group, that has the credentials needed for supervisors?
Or - let the supervisor login as supervisor when he should be supervisor, and log in as "normal" user when/if he should be a normal use?

I am just guessing - to suggest a proper solution, requires that one understand what it is all about - and I think I know too little of the structure in your project, to be of any help. Collecting information, and afterwards specifying solutions ready to code has been my job for many years - but I am not a coder. You could say I am an architect - not a craftsman.

Alisson
Veteran Member
Posts: 81
Joined: 2017-02-25 20:32

Re: Change All fields to Read only

Post by Alisson » 2018-12-18 23:01

Not sure if this will work for you. But I've made this work using CSS.
I've added this to the bootstrap.css

Code: Select all

.completed {
  cursor: not-allowed;
  pointer-events: none;
  cursor: default;
  }
  
And this to the tablename.php in the hooks folder

Code: Select all

<script>
\$j(function(){
	\$j('td.tablename-status').each(function(){ 
		if(\$j(this).text() == 'Completed'){\$j(this).parent().addClass('completed');}
         })
});
</script>
Is not the perfect solution because if you type the Id of the record in the address bar you can still view it, but this will prevent the row to be clicked.

bescott53

Re: Change All fields to Read only

Post by bescott53 » 2018-12-20 12:45

thanks Alisson, this might work will give it a go

Post Reply