pedro fonseca Posted March 24, 2011 Share Posted March 24, 2011 (œuvres, mais le produit apparaît dans le front office et ne devrait pas. Où est l'erreur?)line 1443 of admin/tabs/AdminProducts.php: $link = new Link(); pour: $link = new Link(); $employee = new Employee(intval($cookie->id_employee)); $profile = 0; if (Validate::isLoadedObject($employee)) $profile = intval($employee->id_profile); line 1507: <input style="float:left;" type="radio" name="active" id="active_on" value="1" '.($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> pour: <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"' : '').'/> line 1510: <input style="float:left;" type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> pour: <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"' : '').'/> Link to comment Share on other sites More sharing options...
Broceliande Posted March 24, 2011 Share Posted March 24, 2011 parce que ça ... : (($profile == 2 OR !$this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '') C'est une logique inversée , tu disabled le bouton si $profile <> 2 , ça c'est ok , mais tu fixe la valeur du bouton radio si à checked si $profile = 2 ... qu'il soit active ou non , donc ton produit reste actif quelque soit le profile.Il te faut juste : <input style="float:left;" type="radio" name="active" id="active_on" value="1" '.($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').($profile == 2 ? ' disabled="disabled"' : '').'/> et <input style="float:left;" type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').($profile == 2 ? ' disabled="disabled"' : '').'/> Link to comment Share on other sites More sharing options...
pedro fonseca Posted March 25, 2011 Author Share Posted March 25, 2011 J'ai testé et continue à apparaître in front-office. (displayed on). '.$this->l('Status:').' <input style="float:left;" type="radio" name="active" id="active_on" value="1" '.($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').($profile == 2 ? ' disabled="disabled"' : '').'/> l('Enabled').'" title="'.$this->l('Enabled').'" style="float:left; padding:0px 5px 0px 5px;" />'.$this->l('Enabled').' <input style="float:left;" type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').($profile == 2 ? ' disabled="disabled"' : '').'/> l('Disabled').'" title="'.$this->l('Disabled').'" style="float:left; padding:0px 5px 0px 5px" />'.$this->l('Disabled').' 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