Display a message between a date range in velocity language - velocity

I want to display a message between a date range in Velocity language. Like from 1/3/2023 to 23/3/2023. How can I do that.
I tried to put condition but it's not working.
#set($user = SpermissionChecker.getUser() if (Guser.female)
#set($genre = "Madame")
#else
#set($genre = "Monsieur")
#end
#get (fact-Suser.getExpandoBridge ().getAttribute("active_"))
if("$/act"=="RESILIE"}
Suite à la résiliation de votre contrat, l'acces
contenu est limité à 6 mois, nous vous conseillons de sauvegarder vos documer
#set ($timete dateUtil.getCurrentDate ("dd/MM/yyyy", Locale))
#end
#if($timet =="03/12/2022" && $timet =="10/12/2022")
Rapprochement des banques du Groupe Crédit du Nord et portail et votre application mobile Santé évoluent </span

Related

insertion dans une base de données Rpostgres [closed]

Closed. This question is not written in English. It is not currently accepting answers.
Stack Overflow is an English-only site. The author must be able to communicate in English to understand and engage with any comments and/or answers their question receives. Don't translate this post for the author; machine translations can be inaccurate, and even human translations can alter the intended meaning of the post.
Closed 5 days ago.
Improve this question
Bonjour à tous, je vous écris ici car j'ai un soucis j'apprend a utiliser R et Postgres je ne sais pas si je suis au bon endroit .
j'ai importé plusieurs fichiers cvs dans R et j'ai essayé d'inserer leurs données dans Postgres . La première insertion a marché
mais toutes les autres tentatives d'enregistrement ne marchent pas.
files<-scale
files
# INSERTION DANS LA BASE DE DONNEES
# Pour chaque ligne de données
for (i in 1:nrow(files)) {
# Vérification si la ligne existe déjà dans la table
result <- dbGetQuery(con, paste0("SELECT * FROM scale WHERE scale_code = '",
files[i,1], "' " ))
# Si la ligne n'existe pas déjà, l'insérer
if (nrow(result) == 0) {
dbGetQuery(con, paste0("INSERT INTO scale (scale_code, scale_name, scale_type, scale_level) VALUES ('",
files[i,1], "', '",files[i,2], "','",files[i,3], "','",files[i,4], "' )"))
}
}
je n'ai aucune erreur mais en consultant la table scale aucune données n'est ajoutée. Que faire?

Microsoft Graph "Access is denied. Check credentials and try again" in WEBDEV

The code below is used to get calendar from my email account through Microsoft Graph. But I keep getting an error. I can get the list of places and user information, but I can´t get the calendar.
I´ve tried this code:
CODE :
gsO365_ClientID est une chaîne = "..."
gsO365_ClientSecret est une chaîne = ".."
dGdO365_ClientSecret_Expiration est une Date = ".."
gsO365_Tenant est une chaîne = ".."
gsO365_URICallBack_WEB est une chaîne = "http://localhost/inscription/WD260AWP/WD260Awp.exe/OAUTH2_RETOUR"
gsO365_URICallBack_WEB_Test est une chaîne = "http://localhost/WD250AWP/WD250Awp.exe/OAUTH2_RETOUR"
sGsO365_URICallBack_APP est une chaîne = ".."
OAuth2Params est OAuth2Paramètres
OAuth2Params..ClientID = gsO365_ClientID
OAuth2Params..URLAuth = "https://login.microsoftonline.com/[%gsO365_Tenant%]/oauth2/v2.0/authorize"
OAuth2Params..URLToken = "https://login.microsoftonline.com/[%gsO365_Tenant%]/oauth2/v2.0/token"
OAuth2Params..ParamètresSupplémentaires = "force_reapprove=false"
OAuth2Params..Scope = "offline_access Calendars.Read"
MonToken est un AuthToken = AuthIdentifie(OAuth2Params)
oRequête est une httpRequête
oRequête.Méthode = httpGet
oRequête.URL = "https://graph.microsoft.com/v1.0/me/calendar/events"
oRequête.ContentType = "application/json"
oRequête.AuthToken = MonToken
Réponse est une httpRéponse
jsRéponse est un JSON
Réponse = HTTPEnvoie(oRequête)
SI ErreurDétectée ALORS
Erreur("La requête HTTP à Office 365 a échouée"+RC+ErreurInfo())
RENVOYER Faux
SINON
jsRéponse = Réponse..Contenu
Trace(Réponse..Contenu)
// Le serveur a renvoyé une erreur
SI jsRéponse.Error..Existe ALORS
Erreur("La requête à Office 365 a échouée"+RC+jsRéponse.Error.Message)
SINON
Trace(jsRéponse)
FIN
FIN
Are you sure you add the follow autorisations on the API permissions page :
Calendars.Read, Calendars.ReadWrite

Threading App crash ntdll.dll every 2 or 3 days

I have an app running on a client machine, that uses threading, and is working fine, until the problem arrives.
The app crash every 2 or 3 days, and I have to restart it.
This is the error information I can get from the Event Viewer on the client machine.
Nombre de la aplicación con errores: SEM.CCQ.exe, versión: 1.15.0.0, marca de tiempo: 0x5b4488d8
Nombre del módulo con errores: ntdll.dll, versión: 6.1.7601.24094, marca de tiempo: 0x5abee643
Código de excepción: 0xc0000374
Desplazamiento de errores: 0x00000000000bf6b2
Id. del proceso con errores: 0x18700
Hora de inicio de la aplicación con errores: 0x01d41a9f081a1380
Ruta de acceso de la aplicación con errores: C:\SEM.CCQ\SEM.CCQ.exe
Ruta de acceso del módulo con errores: C:\Windows\SYSTEM32\ntdll.dll
Id. del informe: 1fa3b455-8919-11e8-9638-ec8eb5708651
It's crazy to try to locate the problem. Don't know how to start as the problem is not coming very often.
Is there any way to debug/catch this kind of problem to try to solve it?
Any help will be appreciated.

How can i display multiple views with ModuleFrontController in PS 1.6

With my Module Front Controller, i need to initialize it to display a form (formulaire.tpl) that the customer has to fill. Then the controller processes the data posted from the form using methods defines in my model (Formulaire.php) and then i would like to make it display another view (recapitulatif.tpl) that displays a reminder of data sent, an add to cart button for example or the possibility to fill the form in again.
As i would like to implement it the MVC way, i don't want to create a new php page to redirect my customer to but i would like to display somehow this second template after processing the data. Is there any way to do so with the controller? Here below, you can find my code, it doesn't work and it displays my first template and below my second..
class FormulaireModuleDefaultModuleFrontController extends ModuleFrontController
{
public $ssl = true;
private $done_traitement = false;
public function postProcess()
{
//On vérifie le bouton submit du formulaire
if(Tools::isSubmit('bouton'))
{
// On va commencer en premier par récupérer l'id customer avec la variable cookie
// et vérifier que la personnes est bien loggée
global $cookie;
if(!isset($cookie->id_customer))
{
$message='Aucun client loggé';
}
else
{
$errors=array();
$id_cart=$this->context->cart->id;
$customer=$cookie->id_customer;
//On récupère les valeurs du formulaire
$prix=Tools::getValue('resultat');
$titre='porte_test';
$desc='Largeur de passage de '.Tools::getValue('largeur_passage').' mm, hauteur de passage de '.Tools::getValue('hauteur_passage')
.' mm, hauteur de linteau de '.Tools::getValue('hauteur_linteau').' mm, ecoinçon gauche de '.Tools::getValue('ecoincon_gauche')
.' mm, ecoincon_droit de '.Tools::getValue('ecoincon_droit'). ' mm, motif en '.Tools::getValue('motif_porte').' et de couleur '
.Tools::getValue('couleur_porte');
//On va vérifier les champs obligatoires
//Les champs sont remplis, on va faire le traitement des données.
$idprod=Formulaire::creerProduct($titre,0,13,$prix,$desc, 'mod_100',$customer);
Formulaire::addProduitauPanier($idprod);
$this->done_traitement=true;
}
//On envoie le message si il existe:
if(isset($message))self::$smarty->assign('message',$message);
if(isset($errors))self::$smarty->assign('erreurs',$errors);
}
}
public function initContent()
{
parent::initContent();
if($this->done_traitement)
$this->display(__FILE__,'recapitulatif.tpl');
}
public function init(){
$this->display_column_left = false;
$this->display_column_right = false;
$this->page_name = 'Configurateur';
parent::init();
$this->setTemplate('formulaire.tpl');
}
}
Thanks in advance for your help !
EDIT :
Ok sorry for the question. It just took me 2 minutes to figure it out after posting the question. I only needed to change:
$this->display(__FILE__,'recapitulatif.tpl');
by :
$this->setTemplate('recapitulatif.tpl');
And now it works. Sorry for the inconvenience !

Set the WebView content

Am consuming a JSON rest service from the web. That JSON has a property called "content", wich is a HTML content, so the JSON file is something like:
[{
"id":"4205",
"title":"SomeTitle",
"author":"Homero Simpson",
"content":"<html><head></head><body>Había una vez un molinero cuya única herencia para sus tres hijos eran su molino, su <a href='biblioSonidos://soundID=67'>asno</a> y su <a href='biblioSonidos://soundID=69'>gato</a>. Pronto se hizo la repartición sin necesitar de un clérigo ni de un abogado, pues ya habían consumido todo el pobre patrimonio. Al mayor le tocó el molino, al segundo el asno, y al menor el gato que quedaba. El pobre joven amigo estaba bien inconforme por haber recibido tan poquito. 'Mis hermanos' dijo él, 'pueden hacer una bonita vida juntando sus bienes, pero por mi parte, después de haberme comido al gato, y hacer unas sandalias con su piel, entonces no me quedará más que morir de hambre.' El gato, que oyó todo eso, pero no lo tomaba así, le dijo en un tono firme y serio: 'No te preocupes tanto, mi buen amo. Si me das un bolso, y me tienes un par de botas para mí, con las que yo pueda atravesar lodos y zarzales, entonces verás que no eres tan pobre conmigo como te lo imaginas.'</body></html>"
}]
I need to create a WebView with the code in the "content" property.
So, my question is:
How can set the WebView content from this JSON property?
Is that possible?
Use JSONSerialization to convert the JSON file to a foundation object (which will be an NSDictionary). Then use loadHTMLString to load the value for the content key:
NSError *jsonError = nil;
id json = [NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfFile:pathToTheJSONFile] options:0 error:&jsonError];
if (json) {
[webView loadHTMLString:[(NSDictionary *)json objectForKey:#"content"] baseURL:nil];
} else {
NSLog(#"Error loading JSON: %#", jsonError);
}
(Pass whatever's appropriate for baseURL instead of nil if you want relative links in the content to work.)