customize custom field Access level
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
I didn't totally understood what you wanted to do so can you give me more information about your issue ?but I want customize it and use configuration mode for each custom field created. configuration Access level mode this is:
Note that you'll just have to go through each custom field configuration page and use the "Access level" option.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
There is no way to restrict the managing of each field based on user groups in HikaShop with the options available.
It would require custom code development.
Please Log in or Create an account to join the conversation.
If you help me I can code development. Which files edit for this program?
Please Log in or Create an account to join the conversation.
You'll want to edit the file "form" of the view "field" via the menu Display>Views in order to add the selection of the ACL for each custom field. You'll want to add a new column in the hikashop_field table in order to store that new data for each field.
Then, you'll want to modify the file administrator/components/com_hikashop/controllers/field.php in order to add a check on the store and the remove processes so that the system doesn't allow for it based on the data from the new setting that you added in the form view file.
Please Log in or Create an account to join the conversation.
This method for config access options in config view
now I want know which table in database this method save data?
Please Log in or Create an account to join the conversation.
This method loads an instance of the class of the file administrator/components/com_hikashop/types/acltable.php
Then, this class has a method to display the ACL selector.
It doesn't save anything. The save is usually handled by the saveForm/save functions of the class file of the element you're editing.
So if you're saving a custom field, it's the file administrator/components/com_hikashop/classes/field.php where the saveForm function stores the ACLs displayed by the type.acltable
Please Log in or Create an account to join the conversation.
I can display the ACL selector with this method in custom field view.
are you have sample code for function stores the ACLs displayed by the type.acltable ?
thank you
Please Log in or Create an account to join the conversation.
You can look at the store function of the file administrator/components/com_hikashop/controllers/config.php
That's where the configuration page is saved and thus, where the ACL settings are saved from the type.acltable used on the configuration page.
Here is more specifically the code used:
Please Log in or Create an account to join the conversation.
thank you.
I'm display ACL in custom field in administrator/components/com_hikashop/views/field/tmpl/form.php by this code:
and try save in store method in this file administrator/components/com_hikashop/controllers/field.php
and my store method this is:
Please check my code how can save it? what is my problem?
thank you so much.
Please Log in or Create an account to join the conversation.
To get the field data, you should do like that:
$formData = JRequest::getVar( 'data', array(), '', 'array' );
Please Log in or Create an account to join the conversation.
I'm use this code:
what is my problem in my codes?
Please Log in or Create an account to join the conversation.
You need to do the saving of your new option yourself in the database where you want to store it. So you could add a MySQL query.
I don't see any in your code.
Please Log in or Create an account to join the conversation.
in the custom filed view when echo var_dump $formData no display custom ACL data value which user group selected view manage or delete
but in config view when echo var_dump $formData I see in output selected ACL data.
in config view when save ACL and echo var_dump($formData) see output this:
and
how can get custom ACL data in custom field view?
thank you so much
Please Log in or Create an account to join the conversation.
It's up to you to get data of your HTML checkboxes in $_POST, and it's up to do to store that data in new columns of the hikashop_field table, and it's up to you to then use this data in the controllers/field.php file (and other files) to allow/block the edition of the custom fields based on that data.
We're talking about custom coding here. So you're supposed to do that on your end. I can't provide you all the changes to do where. First it depends on how you want to do it, and second custom coding is not part of the support we offer. I'm happy to give hints on how it should be done (like I already did) and answer questions, but in the end it's up to you.
Please Log in or Create an account to join the conversation.
thank you for your supporting. If I was asked because Hikashop classes is regular and I wanted use this classes first and not use other php class. But now I can programing it and it is work very good. I created a new method type in types folder and rename it type.aclfield and use it because type.acltable work with hikashop config. My program now work very good and store my data in custom field table and not have problem.
thank you.
Please Log in or Create an account to join the conversation.