16 if (!defined(
'IN_PEEL')) {
27 $result[
'menu_items'][
'products_attributes'][
$GLOBALS[
'wwwroot_in_admin'] .
'/modules/attributs/administrer/nom_attributs.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_ATTRIBUTES"];
28 $result[
'menu_items'][
'products_attributes'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/attributs/administrer/attributs.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_OPTIONS"];
41 FROM peel_nom_attributs
44 $nom_attrib =
query($sql_n);
47 $GLOBALS[
'attribut_infos_array'][$this_attribut[
'id']] = $this_attribut;
48 $result[
'product_field_names'][] = $this_attribut[
'nom_' .
$_SESSION[
'session_langue']] .
'#' . $this_attribut[
'id'];
62 $query_produits_attributs =
query(
"SELECT ppa.nom_attribut_id, pa.id, pa.descriptif_" .
$_SESSION[
'session_langue'] .
" AS descriptif
63 FROM peel_produits_attributs ppa
64 LEFT JOIN peel_attributs pa ON pa.id=ppa.attribut_id AND pa.id_nom_attribut=ppa.nom_attribut_id AND " .
get_filter_site_cond(
'attributs',
'pa').
"
65 WHERE produit_id='" . intval($params[
'id']) .
"'");
66 while ($this_attribut =
fetch_assoc($query_produits_attributs)) {
67 if (!empty($attribut_infos_array[$this_attribut[
'nom_attribut_id']])) {
68 if ($attribut_infos_array[$this_attribut[
'nom_attribut_id']][
'upload'] == 1) {
70 $this_value =
'0#__upload';
71 }
elseif ($attribut_infos_array[$this_attribut[
'nom_attribut_id']][
'texte_libre'] == 1) {
73 $this_value =
'0#__texte_libre';
75 $this_value = $this_attribut[
'id'] .
'#' . $this_attribut[
'descriptif'];
77 $result[
$GLOBALS[
'attribut_infos_array'][$this_attribut[
'nom_attribut_id']][
'nom_' .
$_SESSION[
'session_langue']] .
'#' . $this_attribut[
'nom_attribut_id']][] = $this_value;
94 $frm[
'texte_libre'] = 0;
96 $frm[
'mandatory'] = 0;
97 $frm[
'technical_code'] =
"";
98 $frm[
'show_description'] = 1;
99 if (empty(
$frm[
'type_affichage_attribut'])) {
102 $frm[
'type_affichage_attribut'] = 3;
104 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
105 $frm[
'nom_' . $lng] =
"";
108 $frm[
'nouveau_mode'] =
"insere";
126 $qid =
query(
"SELECT *
127 FROM peel_nom_attributs
132 $frm[
"nouveau_mode"] =
"maj";
133 $frm[
"titre_bouton"] =
$GLOBALS[
'STR_ADMIN_FORM_SAVE_CHANGES'];
146 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/attributsAdmin_formulaire_nom.tpl');
148 $tpl->assign(
'mode',
$frm[
"nouveau_mode"]);
149 $tpl->assign(
'id', intval(
$frm[
'id']));
151 $tpl->assign(
'texte_libre',
vb(
$frm[
'texte_libre']));
153 $tpl->assign(
'titre_bouton',
vb(
$frm[
"titre_bouton"]));
154 $tpl->assign(
'type_affichage_attribut',
vn(
$frm[
"type_affichage_attribut"]));
155 $tpl->assign(
'technical_code',
vb(
$frm[
"technical_code"]));
156 $tpl->assign(
'show_description',
vb(
$frm[
"show_description"]));
157 $tpl->assign(
'mandatory',
vn(
$frm[
"mandatory"]));
159 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
161 'value' =>
$frm[
'nom_' . $lng]
166 $tpl->assign(
'STR_ADMIN_WEBSITE',
$GLOBALS[
'STR_ADMIN_WEBSITE']);
167 $tpl->assign(
'STR_ADMIN_ACTIVATED',
$GLOBALS[
'STR_ADMIN_ACTIVATED']);
168 $tpl->assign(
'STR_ADMIN_DEACTIVATED',
$GLOBALS[
'STR_ADMIN_DEACTIVATED']);
169 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
170 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_UPDATE_TITLE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_UPDATE_TITLE']);
174 $tpl->assign(
'STR_ADMIN_MANDATORY',
$GLOBALS[
'STR_ADMIN_MANDATORY']);
175 $tpl->assign(
'STR_ADMIN_LANGUAGES_SECTION_HEADER',
$GLOBALS[
'STR_ADMIN_LANGUAGES_SECTION_HEADER']);
176 $tpl->assign(
'STR_ADMIN_NAME',
$GLOBALS[
'STR_ADMIN_NAME']);
177 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_PARAMETERS',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_PARAMETERS']);
178 $tpl->assign(
'STR_ADMIN_TECHNICAL_CODE',
$GLOBALS[
'STR_ADMIN_TECHNICAL_CODE']);
179 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_OPTIONS_LIST_ATTRIBUTE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_OPTIONS_LIST_ATTRIBUTE']);
180 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_FREE_TEXT_ATTRIBUTE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_FREE_TEXT_ATTRIBUTE']);
181 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_UPLOAD_ATTRIBUTE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_UPLOAD_ATTRIBUTE']);
182 $tpl->assign(
'STR_ADMIN_ATTRIBUT_STYLE_LINK',
$GLOBALS[
'STR_ADMIN_ATTRIBUT_STYLE_LINK']);
183 $tpl->assign(
'STR_ADMIN_LANGUAGES_SECTION_HEADER',
$GLOBALS[
'STR_ADMIN_LANGUAGES_SECTION_HEADER']);
184 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_DISPLAY_MODE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_DISPLAY_MODE']);
185 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_SELECT_MENU',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_SELECT_MENU']);
186 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_RADIO_BUTTONS',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_RADIO_BUTTONS']);
187 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_CHECKBOX',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_CHECKBOX']);
188 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_DEFAULT_DISPLAY_MODE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_DEFAULT_DISPLAY_MODE']);
201 FROM peel_nom_attributs
204 query(
"DELETE FROM peel_produits_attributs WHERE nom_attribut_id = '" . intval(
$id) .
"'");
217 $frm[
'texte_libre'] = 0;
220 if (
vn(
$frm[
'attribut_type']) == 1) {
221 $frm[
'texte_libre'] = 1;
225 $sql =
"INSERT INTO peel_nom_attributs (
230 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
231 $sql .=
", nom_" . $lng;
233 $sql .=
", texte_libre, upload, technical_code, type_affichage_attribut, show_description
234 ) VALUES ('" . intval(
$frm[
'etat']) .
"'
236 , '" . intval(
$frm[
'mandatory']) .
"'";
237 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
254 $frm[
'texte_libre'] = 0;
257 if (
vn(
$frm[
'attribut_type']) == 1) {
258 $frm[
'texte_libre'] = 1;
262 $sql =
"UPDATE peel_nom_attributs
263 SET etat='" . intval(
$frm[
'etat']) .
"'";
264 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
268 , mandatory = '" . intval(
$frm[
'mandatory']) .
"'
269 , texte_libre ='" . intval(
$frm[
'texte_libre']) .
"'
270 , upload ='" . intval(
vn(
$frm[
'upload'])) .
"'
277 if (!empty(
$frm[
'texte_libre'])) {
278 $sql =
"SELECT DISTINCT produit_id
279 FROM peel_produits_attributs
280 WHERE nom_attribut_id = '" . intval(
$id) .
"'";
282 $sql =
"DELETE FROM peel_attributs WHERE id_nom_attribut = '" . intval(
$id) .
"'";
284 $sql =
"DELETE FROM peel_produits_attributs WHERE nom_attribut_id = '" . intval(
$id) .
"'";
287 $sql =
query(
"INSERT INTO peel_produits_attributs (`produit_id`,`nom_attribut_id`,`attribut_id`) VALUES ('" . intval($produit[
'produit_id']) .
"','" . intval(
$id) .
"','0');");
300 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/attributsAdmin_liste_nom.tpl');
301 $tpl->assign(
'add_src',
$GLOBALS[
'administrer_url'] .
'/images/add.png');
303 $tpl->assign(
'drop_src',
$GLOBALS[
'administrer_url'] .
'/images/b_drop.png');
304 $tpl->assign(
'edit_src',
$GLOBALS[
'administrer_url'] .
'/images/b_edit.png');
305 $result =
query(
"SELECT id, nom_" .
$_SESSION[
'session_langue'] .
", etat, texte_libre, upload, show_description, site_id
306 FROM peel_nom_attributs
308 ORDER BY nom_" .
$_SESSION[
'session_langue'] .
"");
310 $tpl->assign(
'num_results', $nr);
311 $tpl_results = array();
315 $tpl_results[] = array(
'tr_rollover' => tr_rollover(
$i,
true),
316 'nom' => (!empty($ligne[
'nom_' .
$_SESSION[
'session_langue']])?$ligne[
'nom_' . $_SESSION[
'session_langue']]:
'['.$ligne[
'id'].
']'),
317 'drop_href' =>
get_current_url(
false) .
'?mode=suppr&id=' . $ligne[
'id'],
318 'edit_href' =>
get_current_url(
false) .
'?mode=modif&id=' . $ligne[
'id'],
319 'texte_libre' => $ligne[
'texte_libre'],
320 'texte_libre_href' =>
$GLOBALS[
'wwwroot_in_admin'] .
'/modules/attributs/administrer/attributs.php?mode=liste&attid=' . $ligne[
'id'],
321 'upload' => $ligne[
'upload'],
322 'etat_onclick' =>
'change_status("attributs", "' . $ligne[
'id'] .
'", this, "'.
$GLOBALS[
'administrer_url'] .
'")',
323 'etat_src' => $GLOBALS[
'administrer_url'] .
'/images/' . (empty($ligne[
'etat']) ?
'puce-blanche.gif' :
'puce-verte.gif'),
329 $tpl->assign(
'results', $tpl_results);
330 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_TITLE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_TITLE']);
331 $tpl->assign(
'STR_ADMIN_WEBSITE',
$GLOBALS[
'STR_ADMIN_WEBSITE']);
332 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_EXPLAIN',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_EXPLAIN']);
333 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_CREATE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_CREATE']);
334 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_NOTHING_FOUND',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_NOTHING_FOUND']);
335 $tpl->assign(
'STR_ADMIN_ACTION',
$GLOBALS[
'STR_ADMIN_ACTION']);
336 $tpl->assign(
'STR_ADMIN_NAME',
$GLOBALS[
'STR_ADMIN_NAME']);
339 $tpl->assign(
'STR_ADMIN_CONFIRM_JAVASCRIPT',
$GLOBALS[
'STR_ADMIN_CONFIRM_JAVASCRIPT']);
341 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_HANDLE_OPTIONS',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_HANDLE_OPTIONS']);
342 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_UPLOAD_FIELD',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_UPLOAD_FIELD']);
343 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_CUSTOM_TEXT',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_CUSTOM_TEXT']);
344 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_UPDATE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_UPDATE']);
345 $tpl->assign(
'STR_ADMIN_UPDATE',
$GLOBALS[
'STR_ADMIN_UPDATE']);
358 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
359 $frm[
'descriptif_' . $lng] =
"";
363 $frm[
'mandatory'] = 0;
364 $frm[
'position'] = 0;
366 $frm[
'nouveau_mode'] =
"insere";
367 $frm[
"titre_soumet"] =
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_CREATE_THIS_OPTION"];
380 $qid =
query(
"SELECT *
385 $frm[
"nouveau_mode"] =
"maj";
386 $frm[
"titre_soumet"] =
$GLOBALS[
'STR_ADMIN_FORM_SAVE_CHANGES'];
398 $id = intval($_GET[
'id']);
400 $qid =
query(
"SELECT descriptif_" .
$_SESSION[
'session_langue'] .
" AS descriptif
405 query(
"DELETE FROM peel_attributs WHERE id='" . intval(
$id) .
"'");
406 query(
"DELETE FROM peel_produits_attributs WHERE nom_attribut_id='" . intval(
$id) .
"'");
423 $sql =
"INSERT INTO peel_attributs (id_nom_attribut, image, prix, prix_revendeur, position, mandatory, site_id";
424 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
425 $sql .=
", descriptif_" . $lng;
428 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
446 $sql =
"UPDATE peel_attributs
447 SET id_nom_attribut = '" . intval(
$id) .
"'
451 , mandatory = '" . intval(
$frm[
'mandatory']) .
"'
453 , position = '" . intval(
$frm[
'position']) .
"'";
454 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
471 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
472 $frm[
'nom_' . $lng] =
"";
474 $frm[
"nouveau_mode"] =
"insere";
489 $sql =
"SELECT id, nom_" .
$_SESSION[
'session_langue'] .
" AS nom
490 FROM peel_nom_attributs
491 WHERE id='" . intval(
vn($_GET[
'attid'])) .
"' AND texte_libre = 0 AND upload = 0 AND " .
get_filter_site_cond(
'nom_attributs', null,
true) .
"";
494 if (trim($nom_att->nom) ==
'') {
495 $nom_att->nom =
'[' . $nom_att->id .
']';
497 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/attributsAdmin_liste.tpl');
498 $tpl->assign(
'nom', $nom_att->nom);
499 $tpl->assign(
'add_src',
$GLOBALS[
'administrer_url'] .
'/images/add.png');
503 WHERE id_nom_attribut = '" . intval($_GET[
'attid']) .
"' AND " .
get_filter_site_cond(
'attributs', null,
true).
"
504 ORDER BY descriptif_" .
$_SESSION[
'session_langue'];
507 $tpl->assign(
'num_results', $nr);
508 $tpl_results = array();
512 $tpl_results[] = array(
'tr_rollover' => tr_rollover(
$i,
true),
513 'drop_href' =>
get_current_url(
false) .
'?mode=suppr&id=' . $DescAtt[
'id'] .
'&attid=' . $_GET[
'attid'],
514 'drop_src' =>
$GLOBALS[
'administrer_url'] .
'/images/b_drop.png',
515 'edit_href' =>
get_current_url(
false) .
'?mode=modif&id=' . $DescAtt[
'id'] .
'&attid=' . $_GET[
'attid'],
516 'descriptif' => $DescAtt[
'descriptif_' .
$_SESSION[
'session_langue']],
517 'prix' =>
fprix($DescAtt[
'prix'],
true,
$GLOBALS[
'site_parameters'][
'code'],
false),
518 'img_src' => (!empty($DescAtt[
'image']) ?
$GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($DescAtt[
'image'], 100, 100,
"fit") :
''),
524 $tpl->assign(
'results', $tpl_results);
526 $tpl->assign(
'STR_ADMIN_WEBSITE',
$GLOBALS[
'STR_ADMIN_WEBSITE']);
527 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_ATTRIBUTE_OPTIONS_LIST',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_ATTRIBUTE_OPTIONS_LIST']);
528 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_ATTRIBUTE_OPTIONS_LIST_EXPLAIN',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_ATTRIBUTE_OPTIONS_LIST_EXPLAIN']);
529 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_CREATE_OPTION',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_CREATE_OPTION']);
530 $tpl->assign(
'STR_ADMIN_ACTION',
$GLOBALS[
'STR_ADMIN_ACTION']);
534 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_NO_OPTION_DEFINED',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_NO_OPTION_DEFINED']);
535 $tpl->assign(
'STR_ADMIN_DELETE_WARNING',
$GLOBALS[
'STR_ADMIN_DELETE_WARNING']);
551 $res =
query(
"SELECT nom_" .
$_SESSION[
'session_langue'] .
" AS nom
552 FROM peel_nom_attributs
553 WHERE id = '" . intval($_GET[
'attid']) .
"' AND " .
get_filter_site_cond(
'nom_attributs', null,
true) .
"");
555 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/attributsAdmin_formulaire.tpl');
557 $tpl->assign(
'mode',
$frm[
"nouveau_mode"]);
558 $tpl->assign(
'prix_revendeur',
vn($prix_revendeur));
559 $tpl->assign(
'mandatory',
vn(
$frm[
"mandatory"]));
560 $tpl->assign(
'id',
vn($_GET[
'id']));
561 $tpl->assign(
'nom', $nom_att->nom);
563 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
565 'descriptif' =>
vn(
$frm[
'descriptif_' . $lng]),
571 if (!empty(
$frm[
"image"])) {
576 $tpl->assign(
'prix_revendeur',
fprix(
vn(
$frm[
'prix_revendeur']),
false,
$GLOBALS[
'site_parameters'][
'code'],
false));
577 $tpl->assign(
'symbole',
$GLOBALS[
'site_parameters'][
'symbole']);
578 $tpl->assign(
'position', intval(
$frm[
'position']));
579 $tpl->assign(
'titre_soumet',
$frm[
"titre_soumet"]);
580 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
581 $tpl->assign(
'STR_ADMIN_WEBSITE',
$GLOBALS[
'STR_ADMIN_WEBSITE']);
584 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_CREATE_OPTION',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_CREATE_OPTION']);
585 $tpl->assign(
'STR_ADMIN_LANGUAGES_SECTION_HEADER',
$GLOBALS[
'STR_ADMIN_LANGUAGES_SECTION_HEADER']);
587 $tpl->assign(
'STR_ADMIN_VARIOUS_INFORMATION_HEADER',
$GLOBALS[
'STR_ADMIN_VARIOUS_INFORMATION_HEADER']);
589 $tpl->assign(
'STR_ADMIN_FILE_NAME',
$GLOBALS[
'STR_ADMIN_FILE_NAME']);
590 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_OVERCOST',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_OVERCOST']);
591 $tpl->assign(
'STR_ADMIN_DELETE_IMAGE',
$GLOBALS[
'STR_ADMIN_DELETE_IMAGE']);
592 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_OVERCOST_RESELLER',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_OVERCOST_RESELLER']);
593 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_OVERCOST',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_OVERCOST']);
594 $tpl->assign(
'STR_ADMIN_POSITION',
$GLOBALS[
'STR_ADMIN_POSITION']);
595 $tpl->assign(
'STR_ADMIN_MANDATORY',
$GLOBALS[
'STR_ADMIN_MANDATORY']);
618 WHERE id = '" . intval(
$id) .
"'";
621 query(
"UPDATE peel_attributs
623 WHERE id = '" . intval(
$id) .
"'");
627 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_RUBRIQUES_MSG_DELETED_OK'], $file[
'image'])))->fetch();
637 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/attributsAdmin_choix_nom.tpl');
639 FROM peel_nom_attributs
640 WHERE texte_libre = 0 AND upload = 0 AND " .
get_filter_site_cond(
'nom_attributs', null,
true) .
"
641 ORDER BY nom_" .
$_SESSION[
'session_langue'];
645 if (trim($att[
'nom_' .
$_SESSION[
'session_langue']]) ==
'') {
646 $att[
'nom_' . $_SESSION[
'session_langue']] =
'[' . $att[
'id'] .
']';
649 'issel' => $att[
'id'] ==
vb($_GET[
'attid']),
650 'name' => $att[
'nom_' . $_SESSION[
'session_langue']]
654 $tpl->assign(
'wwwroot_in_admin',
$GLOBALS[
'wwwroot_in_admin']);
656 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_SEARCH_TITLE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_SEARCH_TITLE']);
657 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_SEARCH_CHOOSE_ATTRIBUTE',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_SEARCH_CHOOSE_ATTRIBUTE']);
658 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
659 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_SEARCH_UPDATE_LIST',
$GLOBALS[
'STR_MODULE_ATTRIBUTS_ADMIN_SEARCH_UPDATE_LIST']);
675 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/attributsAdmin_liste_by_id.tpl');
676 $tpl->assign(
'wwwroot_in_admin',
$GLOBALS[
'wwwroot_in_admin']);
677 $tpl->assign(
'product_id',
$id);
679 $tpl->assign(
'product_revenir_href',
$GLOBALS[
'administrer_url'] .
'/produits.php?mode=modif&id=' .
$id);
680 $tpl->assign(
'product_liste_revenir_href',
$GLOBALS[
'administrer_url'] .
'/produits.php');
684 $product_attributs_array =
$product_object->get_possible_attributs(
'rough',
false, 0,
false,
false,
false,
false,
false,
false);
685 $tpl_results = array();
687 if (!empty($all_attributs_array)) {
690 foreach ($all_attributs_array as $this_nom_attribut_id => $this_attribut_values_array) {
691 $tpl_sub_res = array();
692 foreach ($this_attribut_values_array as $this_attribut_id => $this_attribut_infos) {
693 if (!empty($this_attribut_id) || $this_attribut_id === 0) {
695 $this_attribut_infos[
'descriptif'] =
'['.$this_attribut_id.
'] ';
697 $tpl_sub_res[] = array(
'value' => intval($this_attribut_id),
698 'issel' => !empty($product_attributs_array[$this_nom_attribut_id]) && !empty($product_attributs_array[$this_nom_attribut_id][$this_attribut_id]),
700 'prix' =>
fprix($this_attribut_infos[
'prix'],
true,
$GLOBALS[
'site_parameters'][
'code'],
false)
705 $tpl_results[] = array(
'tr_rollover' => tr_rollover(
$i,
true),
706 'nom' => $this_attribut_infos[
'nom'],
707 'id' => $this_nom_attribut_id,
708 'texte_libre' => $this_attribut_infos[
'texte_libre'],
709 'upload' => $this_attribut_infos[
'upload'],
710 'issel' => !empty($product_attributs_array[$this_nom_attribut_id]),
711 'sub_res' => $tpl_sub_res
716 $tpl->assign(
'results', $tpl_results);
717 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_TITLE',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_TITLE"]);
718 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_BACK_TO_PRODUCT',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_BACK_TO_PRODUCT"]);
719 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_BACK_TO_PRODUCTS_LIST',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_BACK_TO_PRODUCTS_LIST"]);
720 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_EXPLAIN_SELECT',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_EXPLAIN_SELECT"]);
721 $tpl->assign(
'STR_ADMIN_ATTRIBUTE',
$GLOBALS[
"STR_ADMIN_ATTRIBUTE"]);
722 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTIONS_ASSOCIATED',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTIONS_ASSOCIATED"]);
723 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_OVERCOST',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_OVERCOST"] );
724 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_ASSOCIATE_ATTRIBUTE',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_ASSOCIATE_ATTRIBUTE"]);
725 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_ADD_UPLOAD',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_ADD_UPLOAD"]);
726 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_FREE_TEXT',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_OPTION_FREE_TEXT"]);
727 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_NO_OPTION',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_NO_OPTION"]);
728 $tpl->assign(
'STR_MODULE_ATTRIBUTS_ADMIN_LIST_MANAGE_LINK',
$GLOBALS[
"STR_MODULE_ATTRIBUTS_ADMIN_LIST_MANAGE_LINK"]);
741 $output_array = array();
746 $output_array[] =
$result[
'nom'];
748 return $output_array;
get_site_name($site_ids, $skip_rights_check=false)
Retourne le nom d'un ou de plusieurs sites à partir de l'id.
static strip_tags($string, $allowed_tags=null)
String::strip_tags()
affiche_liste_nom_attribut($start)
affiche_liste_nom_attribut()
if(!empty($GLOBALS['site_parameters']['order_specific_field_titles'])) if(check_if_module_active('socolissimo')&&!empty($_REQUEST)&&!empty($_REQUEST['PUDOFOID'])&&!empty($_REQUEST['CEEMAIL'])&&!empty($_REQUEST['SIGNATURE'])&&!empty($_REQUEST['ORDERID'])) elseif(!empty($_POST)) elseif(check_if_module_active('socolissimo')&&!empty($_SESSION['session_commande']['is_socolissimo_order'])) foreach(array('bill'=> 1, 'ship'=> 2) as $address_type=> $session_commande_address_id) $frm['societe1']
insere_nom_attribut($frm)
Ajoute l'attribut dans la table attribut.
affiche_formulaire_liste_attribut($id, &$frm)
Affiche un formulaire de attributs vide.
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
maj_attribut($id, $frm)
maj_attribut()
affiche_formulaire_nom_attribut(&$frm)
affiche_formulaire_nom_attribut()
get_attributs_names($lang)
Retourne un tableau contenant la liste des noms des attributs disponibles sur le site.
get_site_id_select_options($selected_site_id=null, $selected_site_name=null, $display_first_option=null, $select_current_site_id_by_default=false)
Créer les options pour le select qui liste les noms de sites configurés en back office.
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
attributs_hook_export_products_get_line_infos_array(&$params)
Génération d'informations pour l'export de produits.
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
insere_attribut($id, $frm)
insere_attribut()
affiche_formulaire_modif_nom_attribut($id, &$frm)
Affiche le formulaire de modification pour l'attribut sélectionné
affiche_choix_nom_attribut()
affiche_choix_nom_attribut()
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
affiche_liste_attribut($frm)
affiche_liste_attribut()
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
if(!defined('IN_PEEL')) $GLOBALS['page_types_array']
if(empty($_GET['id'])) if(!empty($GLOBALS['site_parameters']['allow_multiple_product_url_with_category'])) $product_object
if(!defined('IN_PEEL')) thumbs($source_filename, $width, $height, $method= 'fit', $source_folder=null, $thumb_folder=null, $thumb_rename=true, $return_absolute_path=false)
Charge l'image dont le nom est $source_filename dans le répertoire d'upload, et crée une vignette pou...
if(isset($_POST['pays_zone'])) elseif(empty($_SESSION['session_caddie']->zoneId)&&!empty($GLOBALS['site_parameters']['default_delivery_zone_id'])) if(isset($_POST['type'])) elseif(empty($_SESSION['session_caddie']->typeId)&&!empty($GLOBALS['site_parameters']['default_delivery_type_id'])) if(!empty($_POST['code_promo'])) if(!empty($_GET['code_promo'])&&$_GET['code_promo']== 'delete') $form_error_object
affiche_formulaire_attribut(&$frm, &$form_error_object)
affiche_formulaire_attribut()
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
affiche_formulaire_modif_attribut(&$frm, &$form_error_object)
Charge les infos de la attributs.
supprime_attribut()
supprime_attribut()
get_uploaded_file_infos($field_name, $file, $delete_url, $logo_width=100, $logo_height=100)
Remplit un tableau d'informations pour le template d'upload HTML.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
num_rows($query_result)
num_rows()
get_possible_attributs($product_id=null, $return_mode= 'rough', $get_attributes_with_multiple_options_only=true, $get_attributes_with_single_options_only=false, $attributs_list=null)
get_possible_attributs()
delete_uploaded_file_and_thumbs($filename)
delete_uploaded_file_and_thumbs()
fetch_object($query_result)
fetch_object()
if(!defined('IN_PEEL')) attributs_hook_admin_menu_items($params)
Renvoie les éléments de menu affichables.
fetch_assoc($query_result)
fetch_assoc()
affiche_formulaire_ajout_nom_attribut(&$frm)
Affiche un formulaire vierge pour ajouter un attribut.
supprime_nom_attribut($id)
Supprime l'attribut spécifié par $id.
get_site_id_sql_set_value($site_ids)
Retourne la valeur SQL d'un champ INT ou SET suivant que ce soit un entier ou un tableau.
supprime_attribut_image($id, $file)
Supprime le produit spécifié par $id.
affiche_liste_attributs_by_id($id)
affiche_liste_attributs_by_id()
fprix($price, $display_currency=false, $currency_code_or_default=null, $convertion_needed_into_currency=true, $currency_rate=null, $display_iso_currency_code=false, $format=true, $force_format_separator=null, $add_rdfa_properties=false, $round_even_if_no_format=false)
fprix formatte le prix donné en le convertissant si nécessaire au préalable et en ajoutant éventuelle...
attributs_hook_export_products_get_configuration_array(&$params)
Génération d'informations pour l'exportde produits.
maj_nom_attribut($id, $frm)
Met à jour l'attribut $id avec de nouvelles valeurs.
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
affiche_formulaire_ajout_attribut(&$frm, &$form_error_object)
Fonctions d'attributs.php.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']