Boulette Posted March 22, 2012 Share Posted March 22, 2012 Bonjour, L'onglet "5. Caractéristiques" comporte un tableau avec 3 colonnes. Comme plusieurs personnes vont s'activer sur le site, je souhaite supprimer la colonne "Valeur prédéfinie" pour ne laisser que le choix d'entrer manuellement les données. J'ai bien trouvé les lignes concernées dans AdminProducts.php mais je n'arrive pas à supprimer proprement le bout concerné. Si je supprime <td>...</td> ou juste son contenu, le texte inséré dans la dernière colonne (Valeur personnalisée) ne s'enregistre pas. Quand on veut "Sauvegarder les modifications", les champs se vident. Merci pour votre aide. // Listing if ($nb_feature) { echo ' <table cellpadding="5" style="width: 900px; margin-top: 10px">'; foreach ($feature AS $tab_features) { $current_item = false; $custom = true; foreach ($obj->getFeatures() as $tab_products) if ($tab_products['id_feature'] == $tab_features['id_feature']) $current_item = $tab_products['id_feature_value']; $featureValues = FeatureValue::getFeatureValuesWithLang((int)$cookie->id_lang, (int)$tab_features['id_feature']); echo ' <tr> <td>'.$tab_features['name'].'</td> <td style="width: 30%">'; if (sizeof($featureValues)) { echo ' <select id="feature_'.$tab_features['id_feature'].'_value" name="feature_'.$tab_features['id_feature'].'_value" onchange="$(\'.custom_'.$tab_features['id_feature'].'_\').val(\'\');"> <option value="0">--- </option>'; foreach ($featureValues AS $value) { if ($current_item == $value['id_feature_value']) $custom = false; echo '<option value="'.$value['id_feature_value'].'"'.(($current_item == $value['id_feature_value']) ? ' selected="selected"' : '').'>'.substr($value['value'], 0, 40).(Tools::strlen($value['value']) > 40 ? '...' : '').' </option>'; } echo '</select>'; } else echo '<input type="hidden" name="feature_'.$tab_features['id_feature'].'_value" value="0" /><span style="font-size: 10px; color: #666;">'.$this->l('N/A').' - <a href="index.php?tab=AdminFeatures&addfeature_value&id_feature='.(int)$tab_features['id_feature'].'&token='.Tools::getAdminToken('AdminFeatures'.(int)(Tab::getIdFromClassName('AdminFeatures')).(int)($cookie->id_employee)).'" style="color: #666; text-decoration: underline;">'.$this->l('Add pre-defined values first').'</a></span>'; echo ' </td> <td style="width:40%" class="translatable">'; $tab_customs = ($custom ? FeatureValue::getFeatureValueLang($current_item) : array()); foreach ($this->_languages as $language) echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;"> <textarea class="custom_'.$tab_features['id_feature'].'_" name="custom_'.$tab_features['id_feature'].'_'.$language['id_lang'].'" cols="40" rows="1" onkeyup="if (isArrowKey(event)) return ;$(\'#feature_'.$tab_features['id_feature'].'_value\').val(0);" >'.htmlentities(Tools::getValue('custom_'.$tab_features['id_feature'].'_'.$language['id_lang'], FeatureValue::selectLang($tab_customs, $language['id_lang'])), ENT_COMPAT, 'UTF-8').'</textarea> </div>'; echo ' </td> </tr>'; } echo ' <tr> <td style="height: 50px; text-align: center;" colspan="3"><input type="submit" name="submitProductFeature" id="submitProductFeature" value="'.$this->l('Save modifications').'" class="button" /></td> </tr>'; } echo '</table> 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