Jump to content

Profile restricted


pedro fonseca

Recommended Posts

Save, but the product appear in front office. *Displayed.

Suggestions (thanks Rocky).


///changing line 1443 of admin/tabs/AdminProducts.php from:

$link = new Link();


to:

$link = new Link();
$employee = new Employee(intval($cookie->id_employee));
$profile = 0;
if (Validate::isLoadedObject($employee))
$profile = intval($employee->id_profile);



and line 1507 from:

<input style="float:left;" type="radio" name="active" id="active_on" value="1" '.($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>



to:

<input style="float:left;" type="radio" name="active" id="active_on" value="1" '.(($profile != 2 AND $this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '').($profile == 2 ? ' disabled="disabled"' : '').'/>



and line 1510 from:

<input style="float:left;" type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>



to:

<input style="float:left;" type="radio" name="active" id="active_off" value="0" '.(($profile == 2 OR !$this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '').($profile == 2 ? ' disabled="disabled"' : '').'/>




Change 2 to the ID of the restricted profile. When an employee with profile 2 tries to add a product or edit an existing one, the product cannot be enabled, except by another employee profile.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...