You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2015-06-08 08:39:31

fabien.herve
Member
Registered: 2013-12-17
Posts: 20

Notifications: champs manquants

Bonjour,

Je rencontre un problème avec mes notifications, j'utilise le modèle standard Français, cependant certains champs n'apparaissent pas. Voici le corps du modèle:

===============================
##lang.contract.entity## : ##contract.entity##

##FOREACHcontracts##
##lang.contract.name## : ##contract.name##
##lang.contract.number## : ##contract.number##
##lang.contract.time## : ##contract.time##
##IFcontract.type####lang.contract.type## : ##contract.type####ENDIFcontract.type##
##contract.url##
##ENDFOREACHcontracts##
=============================
Et voici le résultat que j'obtiens dans mes notifications:

845375captureGLPI.jpg

Je suis en version 0.85.4, j'avais déjà le souci sous 0.85.3

Merci d'avance,

Fabien

Last edited by fabien.herve (2015-06-09 13:40:04)

Offline

#2 2015-08-03 17:46:15

blerohellec
Member
From: Paris
Registered: 2015-04-08
Posts: 84

Re: Notifications: champs manquants

Bonjour,
je confirme : le problème est spécifiquement sur la notification 'Fin de période' (ça fonctionne bien pour les notifs Fin & Préavis).
Des erreurs PHP sont générées (extrait ci-après). Les erreurs correspondent bien à l'absence du nom, numéro et type de contrat dans la notif
En 0.85.4 et 0.90

2015-08-03 16:26:48 [2@debian]
  *** PHP Notice(8): Undefined index: name
  Backtrace :
  inc/notificationtargetcontract.class.php:69       
  inc/notificationtarget.class.php:1069              NotificationTargetContract->getDatasForTemplate()
  inc/notificationtemplate.class.php:236             NotificationTarget->getForTemplate()
  inc/notificationevent.class.php:166                NotificationTemplate->getTemplateByLanguage()
  inc/contract.class.php:1136                        NotificationEvent::raiseEvent()
  :                                                  Contract::cronContract()
  inc/crontask.class.php:796                         call_user_func()
  front/crontask.form.php:46                         CronTask::launch()
2015-08-03 16:26:48 [2@debian]
  *** PHP Notice(8): Undefined index: num
  Backtrace :
  inc/notificationtargetcontract.class.php:70       
  inc/notificationtarget.class.php:1069              NotificationTargetContract->getDatasForTemplate()
  inc/notificationtemplate.class.php:236             NotificationTarget->getForTemplate()
  inc/notificationevent.class.php:166                NotificationTemplate->getTemplateByLanguage()
  inc/contract.class.php:1136                        NotificationEvent::raiseEvent()
  :                                                  Contract::cronContract()
  inc/crontask.class.php:796                         call_user_func()
  front/crontask.form.php:46                         CronTask::launch()
2015-08-03 16:26:48 [2@debian]
  *** PHP Notice(8): Undefined index: contracttypes_id
  Backtrace :
  inc/notificationtargetcontract.class.php:72       
  inc/notificationtarget.class.php:1069              NotificationTargetContract->getDatasForTemplate()
  inc/notificationtemplate.class.php:236             NotificationTarget->getForTemplate()
  inc/notificationevent.class.php:166                NotificationTemplate->getTemplateByLanguage()
  inc/contract.class.php:1136                        NotificationEvent::raiseEvent()
  :                                                  Contract::cronContract()
  inc/crontask.class.php:796                         call_user_func()
  front/crontask.form.php:46                         CronTask::launch()


Benoit Le Rohellec
blerohellec@tlsconsulting.eu
www.tlsconsulting.eu

Offline

#3 2015-08-04 09:53:59

blerohellec
Member
From: Paris
Registered: 2015-04-08
Posts: 84

Re: Notifications: champs manquants

Dans contract.class.php, j'ai ajouté les 2 lignes suivantes en L1111, afin d'initialiser les données du contrat.

$data['items'] = Contract_Item::getItemsForContract($data['id'],$entity);
$contract_infos[$type][$entity][$data['id']] = $data;

Ca fonctionne bien mieux : plus d'erreur php, et la notification est complète.
Je ne garantis pas que ce soit la solution définitive.


Benoit Le Rohellec
blerohellec@tlsconsulting.eu
www.tlsconsulting.eu

Offline

#4 2015-08-06 09:59:33

fabien.herve
Member
Registered: 2013-12-17
Posts: 20

Re: Notifications: champs manquants

Bonjour,

Merci pour cette réponse, je teste et je fais un retour des que possible.

Fabien

Offline

#5 2015-08-06 15:05:58

fabien.herve
Member
Registered: 2013-12-17
Posts: 20

Re: Notifications: champs manquants

Rebonjour,

J'ai pu tester le correctif, il apporte bien une correction sur ce problème, mais en crée d'autres pour le coup:

Avant:
=================================
Entité : SILA


Nom :
Numéro :
Contrat dans le préavis pour la période ocurante depuis le : 30-09-2015

http://srv-gp/glpi/index.php?redirect=Contract_15&noAUTO=1
=================================


Maintenant
=================================
Entité : SILA


Nom : TEST_APRES_MODIF
Numéro :
Contrat dans le préavis pour la période ocurante depuis le : ##contract.time##

http://srv-gp/glpi/index.php?redirect=Contract_92&noAUTO=1
=================================

Du coup j'ai perdu le contract.time, et le numéro de contrat n'apparait pas (peu important).

Last edited by fabien.herve (2015-08-06 15:06:22)

Offline

#6 2015-08-15 12:03:25

blerohellec
Member
From: Paris
Registered: 2015-04-08
Posts: 84

Re: Notifications: champs manquants

Bjr,
Pouvez-vous indiquer les données de ce dernier contrat : date début, durée, préavis, périodicité, reconduction, alerte par courriel. Bref, tout ce qui est utilisé par les alertes.
Entretemps, j'ouvre un ticket pour correction.


Benoit Le Rohellec
blerohellec@tlsconsulting.eu
www.tlsconsulting.eu

Offline

#7 2015-08-17 11:34:52

fabien.herve
Member
Registered: 2013-12-17
Posts: 20

Re: Notifications: champs manquants

Bonjour blerohellec,

Merci pour vos réponses, voici une capture d'écran avec les détails du contrat (j'ai modifié les dates entre temps pour tester à nouveau.)

6KC5olv.jpg

Fabien

Last edited by fabien.herve (2015-08-17 11:35:12)

Offline

#8 2017-03-07 12:14:08

evab
Member
Registered: 2016-05-18
Posts: 32

Re: Notifications: champs manquants

Bonjour,
Je rencontre le même soucis (modèle français) en version 9.1.1 > une idée ?

##FOREACHcontracts##


##lang.contract.name## : ##contract.name##
##lang.contract.number## : ##contract.number##
##lang.contract.time## : ##contract.time##
##IFcontract.type####lang.contract.type## : ##contract.type## ##ENDIFcontract.type##
##contract.url##

##ENDFOREACHcontracts##

et

##FOREACHcontracts##

##contract.action##
##contract.entity##

##contract.time##

##contract.url##

##lang.contract.number##

##lang.contract.time##

##lang.contract.type##

##ENDFOREACHcontracts##

résultat :


[ok ca marche] Fin de période Nom Numéro

Alerte contrats - Périodicité
xxxx

08-03-2016
http://support.xxxxr/index.php?redirect … 5&noAUTO=1
Numéro
Contrat en fin de période depuis le
Type


Objet : [ok ca marche] Alerte contrats - Préavis (l'entité s'affiche)

Entité : (l'entité s'affiche)

Nom : ##contract.name##
Numéro : ##contract.number##
Contrat en préavis depuis le : ##contract.time##

##contract.url##


merci pour votre aide

eva

Last edited by evab (2017-03-07 12:20:19)

Offline

Board footer

Powered by FluxBB