Jump to content

Disable theme and language options in my Preferences


Recommended Posts

Hello,

 

does anybody know how to Disable theme and language options in my Preferencs. I'd like to creat a new Admin theme but without a theme and language option, located in my Preferences.

 

Please help.

 

Thank you

Link to comment
Share on other sites

Do you want to make theme for yourself and your other employees?

 

Can't you just make a new (or edit an existing) employee type and give them the permissions you want to give them (and thus deselecting the preferences-Themes and language item?)?

Link to comment
Share on other sites

go to the:

 

controllers/admin/AdminEployeesController and from $this->fields_form

 

remove the:


array(
'type' => 'select',
'label' => $this->l('Language:'),
'name' => 'id_lang',
'required' => true,
'options' => array(
'query' => Language::getLanguages(false),
'id' => 'id_lang',
'name' => 'name'
)
),
array(
 'type' => 'select_theme',
 'label' => $this->l('Theme:'),
 'name' => 'bo_theme',
 'options' => array('query' => $this->themes),
 'desc' => $this->l('Back Office theme')
   ),

Link to comment
Share on other sites

go to the:

 

controllers/admin/AdminEployeesController and from $this->fields_form

 

remove the:


array(
'type' => 'select',
'label' => $this->l('Language:'),
'name' => 'id_lang',
'required' => true,
'options' => array(
'query' => Language::getLanguages(false),
'id' => 'id_lang',
'name' => 'name'
)
),
array(
 'type' => 'select_theme',
 'label' => $this->l('Theme:'),
 'name' => 'bo_theme',
 'options' => array('query' => $this->themes),
 'desc' => $this->l('Back Office theme')
),

 

That's what I want but this action remov themes and language option from all themes and I'd like to remove it only from "employee" theme.

Link to comment
Share on other sites

Do you want to make theme for yourself and your other employees?

 

Can't you just make a new (or edit an existing) employee type and give them the permissions you want to give them (and thus deselecting the preferences-Themes and language item?)?

 

It doesn't help. I mean to disable themes and languages in

Administration separator_breadcrumb.png Employees Editseparator_breadcrumb.png

Link to comment
Share on other sites

That's what I want but this action remov themes and language option from all themes and I'd like to remove it only from "employee" theme.

 

Well, admin of the store is also employee ;) So, what you want is to remove it only for non-admin employee? Am i right?

Link to comment
Share on other sites

Well, admin of the store is also employee ;) So, what you want is to remove it only for non-admin employee? Am i right?

 

Right. Easy to say, the default theme will stay the same and in every other I'll able to disable the option.

Link to comment
Share on other sites

Well, admin of the store is also employee ;) So, what you want is to remove it only for non-admin employee? Am i right?

 

And it would be good to remove the:

 

 

Customers > Groups > Edit

Module restrictions:

 

Customers > Customer Service

Customer service options

 

as well.

Link to comment
Share on other sites

i checked sources, it's not as simple as it seems :(

 

it's very complicated, i checked the sources and there is a lot of work...

i've got solution but it's a huge modification :/

 

If it would be easy I wouldn't ask for help. ;)

Link to comment
Share on other sites

If it would be easy I wouldn't ask for help. ;)

 

I spent over one hour on this.

 

i attached code below:

 

this is AdminOrdersController.php file. Copy this to controllers/admin/

 

don't forget about backup!

 

let me know if it works

Link to comment
Share on other sites

I spent over one hour on this.

 

i attached code below:

 

this is AdminOrdersController.php file. Copy this to controllers/admin/

 

don't forget about backup!

 

let me know if it works

 

I'm not sure I'm testing right. I can see options but I'm not able to save changes. Not even in SuperAdmin.

Link to comment
Share on other sites

I downloaded the latest 1.5.4.1 version, and I've got it on my localhost.

 

hello

 

so, my code works well? Please let me know, i tested it in several installations (1.5.4.1) and it worked good

 

waiting for your reply

Link to comment
Share on other sites

hello

 

so, my code works well? Please let me know, i tested it in several installations (1.5.4.1) and it worked good

 

waiting for your reply

 

 

I was asking for:

 

- disable themes and language option for employees

- disable Module restrictions:in Customers > Groups > Edit

- disable Customer service options in Customers > Customer Service

 

I've overwrited the AdminOrdersController.php with your code but in required parts was everything without change.

Sorry, I do not know what your code does.

 

Everything was tested on fresh the latest version 1.5.4.1

Link to comment
Share on other sites

i created modification for your first question here: "Disable theme and language options in my Preferences" i spent on this many hours. Modifications that you want to develop need many changes in the controllers.

 

As we talked, I changed the AdminEployeesController.php file located in controllers/admin/ directory.

 

what I change? A lot of the code.

 

i modified" fields in $this->fields_form

(fields depends on this->context->employee->id)

 

if ($this->context->employee->id==1){
		  $language=array(
 'type' => 'select',
 'label' => $this->l('Language:'),
 'name' => 'id_lang',
 'required' => true,
 'options' => array(
  'query' => Language::getLanguages(false),
  'id' => 'id_lang',
  'name' => 'name'
 )
   );
		    $theme=array(
 'type' => 'select_theme',
 'label' => $this->l('Theme:'),
 'name' => 'bo_theme',
 'options' => array('query' => $this->themes),
 'desc' => $this->l('Back Office theme')
   );
    } else {
	    $language=array(
 'type' => 'radio',
 'label' => $this->l('Language:'),
 'name' => 'id_lang',
 'required' => true,
 'values' => array(
  array(
   'id' => 'id_lang',
   'value' => $this->context->employee->id_lang,
   'label' => $this->l('Enabled')
  )
 )
  );
	    $theme=array('type' => 'blocked',
 'label' => $this->l(''),
			    'required' => false,				   
 'name' => ' ',
			    'values' => $this->context->employee->id_lang);
    }

 

here is the effect for theme and language in my preferences:

 

TRwxvYP.png

 

i was logged as employee (not admin - admin has got possibility to use all features)

 

 

 

here is the adminemplyeecontroller.php once again:

AdminEmployeesController.txt

Link to comment
Share on other sites

i created modification for your first question here: "Disable theme and language options in my Preferences" i spent on this many hours. Modifications that you want to develop need many changes in the controllers.

 

As we talked, I changed the AdminEployeesController.php file located in controllers/admin/ directory.

 

what I change? A lot of the code.

 

i modified" fields in $this->fields_form

(fields depends on this->context->employee->id)

 

if ($this->context->employee->id==1){
		  $language=array(
 'type' => 'select',
 'label' => $this->l('Language:'),
 'name' => 'id_lang',
 'required' => true,
 'options' => array(
  'query' => Language::getLanguages(false),
  'id' => 'id_lang',
  'name' => 'name'
 )
);
			$theme=array(
 'type' => 'select_theme',
 'label' => $this->l('Theme:'),
 'name' => 'bo_theme',
 'options' => array('query' => $this->themes),
 'desc' => $this->l('Back Office theme')
);
	} else {
		$language=array(
 'type' => 'radio',
 'label' => $this->l('Language:'),
 'name' => 'id_lang',
 'required' => true,
 'values' => array(
  array(
   'id' => 'id_lang',
   'value' => $this->context->employee->id_lang,
   'label' => $this->l('Enabled')
  )
 )
  );
		$theme=array('type' => 'blocked',
 'label' => $this->l(''),
				'required' => false,				  
 'name' => ' ',
				'values' => $this->context->employee->id_lang);
	}

 

here is the effect for theme and language in my preferences:

 

TRwxvYP.png

 

i was logged as employee (not admin - admin has got possibility to use all features)

 

 

 

here is the adminemplyeecontroller.php once again:

 

Excellent job. It works great. Thank you.

 

I was confused because you wrote

 

"I spent over one hour on this.

 

i attached code below:

 

this is AdminOrdersController.php file. Copy this to controllers/admin/

 

don't forget about backup!

 

let me know if it works"

Link to comment
Share on other sites

Excellent job. It works great. Thank you.

 

I was confused because you wrote

 

"I spent over one hour on this.

 

i attached code below:

 

this is AdminOrdersController.php file. Copy this to controllers/admin/

 

don't forget about backup!

 

let me know if it works"

 

OMG you've got right! I was tired of this probably haha :P

sorry it was my mistake :/

Link to comment
Share on other sites

OMG you've got right! I was tired of this probably haha :P

sorry it was my mistake :/

 

 

No problem. Thank you again.

What else I'm worried about is that employee can modify:

 

Customers > Groups > Edit

Module restrictions:

 

Customers > Customer Service

Customer service options

Link to comment
Share on other sites

No problem. Thank you again.

What else I'm worried about is that employee can modify:

 

Customers > Groups > Edit

Module restrictions:

 

Customers > Customer Service

Customer service options

 

hello

 

i created employee account with:

 

wyQXi4k.png

 

and employee hasn't got ability to enter to customer service

Link to comment
Share on other sites

hello

 

i created employee account with:

 

wyQXi4k.png

 

and employee hasn't got ability to enter to customer service

 

:) yes, I know this is the easiest way but employee should be able to use this option and help me to be in touch with customers, or ...?

Link to comment
Share on other sites

  • 4 months later...

HI. ..

 

 I m using Prestashop 1.5.3 version . How can I change  store front page  language ?  Its not taking effect even if I changed employee language from administrator in backoffice.

 

Any suggestions?

 

your question isn't related to main case in this topic. please create new thread with your question.

employee language is only for employee back office language.

Link to comment
Share on other sites

×
×
  • Create New...