pedro fonseca Posted March 21, 2011 Share Posted March 21, 2011 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 More sharing options...
rocky Posted March 25, 2011 Share Posted March 25, 2011 I was in a rush and made a mistake in the code I gave you. I see now that the code will make all new products disabled. I've had another look at the code and I think I've come up with a solution. See the attached file. Code changes.txt Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now