Initial commit

This commit is contained in:
2020-11-02 15:46:52 +01:00
commit 17f974127c
13788 changed files with 1921656 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type adresse */
function substitadresse($texte){
global $adresse;
$tadresse = new Adresse();
if ($tadresse->charger(intval($adresse))) {
$raisondesc = new Raisondesc();
$raisondesc->charger($tadresse->raison);
$paysdesc = new Paysdesc();
$paysdesc->charger($tadresse->pays);
$texte = str_replace("#ADRESSE_RAISONID", $tadresse->raison, $texte);
$texte = str_replace("#ADRESSE_IDPAYS", $tadresse->pays, $texte);
$texte = str_replace("#ADRESSE_ID", $tadresse->id, $texte);
$texte = str_replace("#ADRESSE_LIBELLE", $tadresse->libelle, $texte);
$texte = str_replace("#ADRESSE_RAISON", $raisondesc->long, $texte);
$texte = str_replace("#ADRESSE_ENTREPRISE", $tadresse->entreprise, $texte);
$texte = str_replace("#ADRESSE_NOM", $tadresse->nom, $texte);
$texte = str_replace("#ADRESSE_PRENOM", $tadresse->prenom, $texte);
$texte = str_replace("#ADRESSE_ADRESSE1", $tadresse->adresse1, $texte);
$texte = str_replace("#ADRESSE_ADRESSE2", $tadresse->adresse2, $texte);
$texte = str_replace("#ADRESSE_ADRESSE3", $tadresse->adresse3, $texte);
$texte = str_replace("#ADRESSE_CPOSTAL", $tadresse->cpostal, $texte);
$texte = str_replace("#ADRESSE_VILLE", $tadresse->ville, $texte);
$texte = str_replace("#ADRESSE_PAYS", $paysdesc->titre, $texte);
$texte = str_replace("#ADRESSE_TEL", $tadresse->tel, $texte);
}
$texte = str_replace("#ADRESSE_ACTIVE", "" . $_SESSION['navig']->adresse . "", $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,35 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type caracteristique */
function substitcaracteristique($texte){
global $caracteristique, $caracdisp, $caracval;
$texte = str_replace("#CARACTERISTIQUE_ID", "$caracteristique", $texte);
$texte = str_replace("#CARACTERISTIQUE_DISP", "$caracdisp", $texte);
$texte = str_replace("#CARACTERISTIQUE_VAL", "$caracval", $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,67 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type client */
function substitclient($texte){
// Les #CLIENT_RAISONnF
$raisons = CacheBase::getCache()->query("select id from raison");
if ($raisons) foreach($raisons as $raison) {
$sel = ($_SESSION['navig']->client->raison == $raison->id) ? 'selected="selected"' : '';
$texte = str_replace("#CLIENT_RAISON".$raison->id."F", $sel, $texte);
}
$paysdesc = new Paysdesc();
$paysdesc->charger($_SESSION['navig']->client->pays);
$raisondesc = new Raisondesc();
$raisondesc->charger($_SESSION['navig']->client->raison);
$texte = str_replace("#CLIENT_IDPAYS", $_SESSION['navig']->client->pays, $texte);
$texte = str_replace("#CLIENT_ID", intval($_SESSION['navig']->client->id), $texte);
$texte = str_replace("#CLIENT_REF", $_SESSION['navig']->client->ref, $texte);
$texte = str_replace("#CLIENT_RAISONID", $_SESSION['navig']->client->raison, $texte);
$texte = str_replace("#CLIENT_RAISON", $raisondesc->long, $texte);
$texte = str_replace("#CLIENT_ENTREPRISE", $_SESSION['navig']->client->entreprise, $texte);
$texte = str_replace("#CLIENT_SIRET", $_SESSION['navig']->client->siret, $texte);
$texte = str_replace("#CLIENT_INTRACOM", $_SESSION['navig']->client->intracom, $texte);
$texte = str_replace("#CLIENT_NOM", $_SESSION['navig']->client->nom, $texte);
$texte = str_replace("#CLIENT_PRENOM", $_SESSION['navig']->client->prenom, $texte);
$texte = str_replace("#CLIENT_ADRESSE1", $_SESSION['navig']->client->adresse1, $texte);
$texte = str_replace("#CLIENT_ADRESSE2", $_SESSION['navig']->client->adresse2, $texte);
$texte = str_replace("#CLIENT_ADRESSE3", $_SESSION['navig']->client->adresse3, $texte);
$texte = str_replace("#CLIENT_CPOSTAL", $_SESSION['navig']->client->cpostal, $texte);
$texte = str_replace("#CLIENT_VILLE", $_SESSION['navig']->client->ville, $texte);
$texte = str_replace("#CLIENT_PAYS", $paysdesc->titre, $texte);
$texte = str_replace("#CLIENT_EMAIL", $_SESSION['navig']->client->email, $texte);
$texte = str_replace("#CLIENT_TELFIXE", $_SESSION['navig']->client->telfixe, $texte);
$texte = str_replace("#CLIENT_TELPORT", $_SESSION['navig']->client->telport, $texte);
$texte = str_replace("#CLIENT_TYPE", $_SESSION['navig']->client->type, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,47 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type commande */
function substitcommande($texte) {
global $commande;
if ($commande)
$refs = $commande;
else
$refs = $_SESSION['navig']->commande->ref;
$texte = str_replace("#COMMANDE_TRANSPORT", $_SESSION['navig']->commande->transport, $texte);
$tcommande = new Commande();
$tcommande->charger_ref($refs);
$texte = str_replace("#COMMANDE_ID", $tcommande->id, $texte);
$texte = str_replace("#COMMANDE_REF", $tcommande->ref, $texte);
$texte = str_replace("#COMMANDE_TRANSACTION", $tcommande->transaction, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,52 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type contenu */
function substitcontenu($texte){
global $motcle, $id_contenu;
$tcontenu = new Contenu();
$tcontenudesc = new Contenudesc();
$url = "";
if($id_contenu){
if ($tcontenu->charger($id_contenu)) {
$tcontenudesc->charger($tcontenu->id);
$url = $tcontenudesc->getUrl();
}
}
$texte = str_replace("#CONTENU_URL", $url, $texte);
$texte = str_replace("#CONTENU_ID", "$id_contenu", $texte);
$texte = str_replace("#CONTENU_MOTCLE", "$motcle", $texte);
$texte = str_replace("#CONTENU_NOM", $tcontenudesc->titre, $texte);
$texte = str_replace("#CONTENU_CHAPO", $tcontenudesc->chapo, $texte);
$texte = str_replace("#CONTENU_DESCRIPTION", $tcontenudesc->description, $texte);
$texte = str_replace("#CONTENU_POSTSCRIPTUM", $tcontenudesc->postscriptum, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,35 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type declinaison */
function substitdeclinaison($texte){
global $declinaison, $declidisp, $declival, $declistock;
$texte = str_replace("#DECLINAISON_ID", "$declinaison", $texte);
$texte = str_replace("#DECLINAISON_DISP", "$declidisp", $texte);
$texte = str_replace("#DECLINAISON_STOCKMINI", "$declistockmini", $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,59 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type dossier */
function substitdossier($texte){
global $id_dossier;
$tdossier = new Dossier();
$tdossierdesc = new Dossierdesc();
$url = "";
if($id_dossier) {
if ($tdossier->charger($id_dossier)) {
$tdossierdesc->charger($tdossier->id);
$url = $tdossierdesc->getUrl();
}
}
$racine = new Dossier();
$racine->charger($tdossier->id);
while($racine->parent)
$racine->charger($racine->parent);
$texte = str_replace("#DOSSIER_URL", $url, $texte);
$texte = str_replace("#DOSSIER_CHAPO", "$tdossierdesc->chapo", $texte);
$texte = str_replace("#DOSSIER_DESCRIPTION", "$tdossierdesc->description", $texte);
$texte = str_replace("#DOSSIER_POSTSCRIPTUM", "$tdossierdesc->postscriptum", $texte);
$texte = str_replace("#DOSSIER_ID", "$tdossier->id", $texte);
$texte = str_replace("#DOSSIER_NOM", "$tdossierdesc->titre", $texte);
$texte = str_replace("#DOSSIER_PARENT", "$tdossier->parent", $texte);
$texte = str_replace("#DOSSIER_RACINE", "$racine->id", $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,35 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type image */
function substitimage($texte){
global $id_image;
$texte = str_replace("#IMAGE_ID", $id_image, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,50 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
function substitlang($texte){
/*
* roadster31: Ne sert a rien et casse l'internationalisation des PDFs dans le B.O.
* Un test isset($GLOBALS['dicotpl']) suffit.
global $lang, $reptpl;
if(! file_exists(realpath(__DIR__) . "/../../$reptpl/lang/" . $lang . ".php"))
return $texte;
*/
if (isset($GLOBALS['dicotpl']) && is_array($GLOBALS['dicotpl'])) {
$cle = array_keys($GLOBALS['dicotpl'] );
$valeur = array_values($GLOBALS['dicotpl'] );
$count = count($cle);
for($idx = 0; $idx < $count; $idx++) $cle[$idx] = "::".$cle[$idx]."::";
$texte = str_replace($cle, $valeur, $texte);
}
return $texte;
}
?>

View File

@@ -0,0 +1,62 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type message */
function substitmessage($texte){
preg_match_all("`\#MESSAGE_([^\(]+)\(([^\)]+)\)`", $texte, $cut);
$tab1 = "";
$tab2 = "";
for($i=0; $i<count($cut[1]); $i++){
$message = new Message();
$message->charger($cut[2][$i]);
$messagedesc = new Messagedesc();
$messagedesc->charger($message->id);
if($cut[1][$i] == "TITRE") {
$tab1[$i] = "#MESSAGE_" . $cut[1][$i] . "(" . $cut[2][$i] . ")";
$tab2[$i] = $messagedesc->titre;
}
else if($cut[1][$i] == "CHAPO") {
$tab1[$i] = "#MESSAGE_" . $cut[1][$i] . "(" . $cut[2][$i] . ")";
$tab2[$i] = $messagedesc->chapo;
}
else if($cut[1][$i] == "DESCRIPTION") {
$tab1[$i] = "#MESSAGE_" . $cut[1][$i] . "(" . $cut[2][$i] . ")";
$tab2[$i] = $messagedesc->description;
}
}
$texte = str_replace($tab1, $tab2, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,33 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type page */
function substitpage($texte){
global $page;
$texte = str_replace("#PAGE_CUR", $page, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,115 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutionss de type panier */
function substitpanier($texte){
$total = 0;
$totalht = 0;
$totaleco = 0;
$totaltaxe = 0;
$allItemCount = $nb_article = 0;
if($_SESSION['navig']->adresse){
$adr = new Adresse();
$adr->charger($_SESSION['navig']->adresse);
$idpays = $adr->pays;
} else {
$idpays = $_SESSION['navig']->client->pays;
}
$pays = new Pays();
$pays->charger($idpays);
$total = $_SESSION['navig']->panier->total();
$totalht = $_SESSION['navig']->panier->total(0);
$totaleco = $_SESSION['navig']->panier->totalecotaxe();
$tva = $total - $totalht;
$nb_article = $_SESSION['navig']->panier->nbart;
foreach($_SESSION['navig']->panier->tabarticle as $anItem){
$allItemCount += $anItem->quantite;
}
unset($anItem);
$port = port();
if($port<0)
$port = 0;
$totcmdport = $total + $port;
$remise = $remise_client = $remise_promo = 0;
if($_SESSION['navig']->client->pourcentage>0) $remise_client = $total * $_SESSION['navig']->client->pourcentage / 100;
$remise_promo += calc_remise($total);
$remise = $remise_promo + $remise_client;
$totcmdport -= $remise;
$totremise = $total-$remise;
if($totcmdport<$port)
$totcmdport = $port;
$totcmdportht = $totalht+$port;
$totalht = formatter_somme($totalht);
$total = formatter_somme($total);
$totaleco = formatter_somme($totaleco);
$totaltaxe = formatter_somme($totaltaxe);
$port = formatter_somme($port);
$totcmdport = formatter_somme($totcmdport);
$remise = formatter_somme($remise);
$totremise = formatter_somme($totremise);
$totcmdportht = formatter_somme($totcmdportht);
$tva = formatter_somme($tva,2,".","");
$remise_client = formatter_somme($remise_client);
$remise_promo = formatter_somme($remise_promo);
$totpoids = $_SESSION['navig']->panier->poids();
$texte = str_replace("#PANIER_TOTALHT", "$totalht", $texte);
$texte = str_replace("#PANIER_TOTALECO","$totaleco",$texte);
$texte = str_replace("#PANIER_TOTALTVA","$tva",$texte); // total TVA du panier = #PANIER_TVA
$texte = str_replace("#PANIER_TOTAL", "$total", $texte);
$texte = str_replace("#PANIER_PORT", "$port", $texte);
$texte = str_replace("#PANIER_TOTPORTHT", "$totcmdportht", $texte);
$texte = str_replace("#PANIER_TOTPORT", "$totcmdport", $texte);
$texte = str_replace("#PANIER_TOTREMISE","$totremise",$texte);
$texte = str_replace("#PANIER_REMISE_CLIENT", "$remise_client", $texte);
$texte = str_replace("#PANIER_REMISE_PROMO", "$remise_promo", $texte);
$texte = str_replace("#PANIER_REMISE", "$remise", $texte);
$texte = str_replace("#PANIER_NBART_TOTAL", $allItemCount, $texte);
$texte = str_replace("#PANIER_NBART", "" . $nb_article . "", $texte);
$texte = str_replace("#PANIER_POIDS", "$totpoids", $texte);
$texte = str_replace("#PANIER_TVA","$tva",$texte); // total TVA du panier
return $texte;
}
?>

View File

@@ -0,0 +1,37 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type parrain */
function substitparrain($texte){
global $id_parrain;
$client = new Client();
$client->charger_id($id_parrain);
$texte = str_replace("#PARRAIN_EMAIL", "$client->email", $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,65 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type produits */
function substitproduits($texte){
global $ref, $reforig, $motcle, $id_produit, $classement, $prixmin, $prixmax, $nouveaute, $promo, $stockmini;
$tproduit = new Produit();
$tproduitdesc = new Produitdesc();
$url = "";
if($ref)
$tproduit->charger($ref);
else if($id_produit)
$tproduit->charger_id($id_produit);
if( $ref || $id_produit) {
$tproduitdesc->charger($tproduit->id);
$url = $tproduitdesc->getUrl();
}
$texte = str_replace("#PRODUIT_URL", $url, $texte);
$texte = str_replace("#PRODUIT_ID", $tproduit->id, $texte);
$texte = str_replace("#PRODUIT_NOM", $tproduitdesc->titre, $texte);
$texte = str_replace("#PRODUIT_CHAPO", $tproduitdesc->chapo, $texte);
$texte = str_replace("#PRODUIT_DESCRIPTION", $tproduitdesc->description, $texte);
$texte = str_replace("#PRODUIT_POSTSCRIPTUM", $tproduitdesc->postscriptum, $texte);
$texte = str_replace("#PRODUIT_RUBRIQUE", $tproduit->rubrique, $texte);
$texte = str_replace("#PRODUIT_CLASSEMENT", "$classement", $texte);
$texte = str_replace("#PRODUIT_STOCKMINI", "$stockmini", $texte);
$texte = str_replace("#PRODUIT_PRIXMIN", "$prixmin", $texte);
$texte = str_replace("#PRODUIT_PRIXMAX", "$prixmax", $texte);
$texte = str_replace("#PRODUIT_NOUVEAUTE", "$nouveaute", $texte);
$texte = str_replace("#PRODUIT_PROMO", "$promo", $texte);
$texte = str_replace("#PRODUIT_MOTCLE", $motcle, $texte);
$texte = str_replace("#PRODUIT_REFORIG", "$reforig", $texte);
$texte = str_replace("#PRODUIT_REF", $tproduit->ref, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,32 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
function substitpromo($texte){
$texte = str_replace("#PROMO_CODE",$_SESSION["navig"]->promo->code,$texte);
return $texte;
}
?>

View File

@@ -0,0 +1,63 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type rubrique */
function substitrubriques($texte){
global $id_rubrique;
$trubrique = new Rubrique();
$trubriquedesc = new Rubriquedesc();
$url = "";
if($id_rubrique) {
if ($trubrique->charger($id_rubrique)) {
$trubriquedesc->charger($trubrique->id);
$url = $trubriquedesc->getUrl();
}
}
$racine = new Rubrique();
$racine->charger($trubrique->id);
while($racine->parent)
$racine->charger($racine->parent);
$texte = str_replace("#RUBRIQUE_CHAPO", "$trubriquedesc->chapo", $texte);
$texte = str_replace("#RUBRIQUE_DESCRIPTION", "$trubriquedesc->description", $texte);
$texte = str_replace("#RUBRIQUE_POSTSCRIPTUM", "$trubriquedesc->postscriptum", $texte);
$texte = str_replace("#RUBRIQUE_ID", "$trubrique->id", $texte);
$texte = str_replace("#RUBRIQUE_LIEN", "$trubrique->lien", $texte);
$texte = str_replace("#RUBRIQUE_NOM", "$trubriquedesc->titre", $texte);
$texte = str_replace("#RUBRIQUE_PARENT", "$trubrique->parent", $texte);
$texte = str_replace("#RUBRIQUE_RACINE", "$racine->id", $texte);
$texte = str_replace("#RUBRIQUE_REWRITEURL", $url, $texte);
$texte = str_replace("#RUBRIQUE_URL", $url, $texte);
return $texte;
}
?>

View File

@@ -0,0 +1,38 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
/* Substitutions de type variable */
function substitvariable($texte){
$matches = array();
if (preg_match_all("`\#VARIABLE\(([^\)]+)\)`", $texte, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
$texte = str_replace($match[0], Variable::lire($match[1]), $texte);
}
}
return $texte;
}
?>