-------- Message original --------
Sujet:  Re: [Dolibarr-dev] propriété introuvable dans la classe actioncomm
Date :  Mon, 03 Feb 2014 15:48:58 +0100
De :    Michaël Parchet <mparc...@sunrise.ch>
Pour : Destailleur Laurent <e...@destailleur.fr>, florian.he...@open-concept.pro



Bonjour,

Merci Laurant. Il n'y a plus d'erreur. Comme j'ai été formé en java, j'ai dû oublié qu'en php $db ne veux pas dire $this->db

Malheureusement, dans la table llx_actioncomm, il y a toujours une valeur incorrect dans le champ tms à savoir "0000-00-00 00:00:00" en lieu et place de la date est l'heure actuelle.

pourquoi ?

Merci pour votre réponse.

Salutations

Michaël Parchet

Le 03. 02. 14 13:58, Destailleur Laurent a écrit :
Dans ton code, tu as fait
$agenda = new ActionComm($db);

Hors $db est une variable qui n'existe pas.
Fait plutot
$agenda = new ActionComm($this->db);


Le 3 février 2014 12:08, Michaël Parchet <mparc...@sunrise.ch <mailto:mparc...@sunrise.ch>> a écrit :

    Bonjour Florian et Laurant

    Désolé ça ne fonctionne toujours pas,

    Voilà le trace :

    [Sun Feb 02 22:13:08 2014] [error] [client 127.0.0.1] PHP Stack
    trace:, referer:
    http://localhost/dolibarr/commande/fiche.php?id=26&action=validate
    [Sun Feb 02 22:13:08 2014] [error] [client 127.0.0.1] PHP   1.
    {main}() /usr/share/dolibarr/htdocs/commande/fiche.php:0, referer:
    http://localhost/dolibarr/commande/fiche.php?id=26&action=validate
    [Sun Feb 02 22:13:08 2014] [error] [client 127.0.0.1] PHP   2.
    Commande->valid()
    /usr/share/dolibarr/htdocs/commande/fiche.php:947, referer:
    http://localhost/dolibarr/commande/fiche.php?id=26&action=validate
    [Sun Feb 02 22:13:08 2014] [error] [client 127.0.0.1] PHP   3.
    Interfaces->run_triggers()
    /usr/share/dolibarr/htdocs/commande/class/commande.class.php:302,
    referer:
    http://localhost/dolibarr/commande/fiche.php?id=26&action=validate
    [Sun Feb 02 22:13:08 2014] [error] [client 127.0.0.1] PHP   4.
    InterfaceEventLinker->run_trigger()
    /usr/share/dolibarr/htdocs/core/class/interfaces.class.php:153,
    referer:
    http://localhost/dolibarr/commande/fiche.php?id=26&action=validate
    [Sun Feb 02 22:13:08 2014] [error] [client 127.0.0.1] PHP   5.
    ActionComm->update()
    
/usr/share/dolibarr/htdocs/core/triggers/interface_01_modCommande_EventLinker.class.php:263,
    referer:
    http://localhost/dolibarr/commande/fiche.php?id=26&action=validate
    [Sun Feb 02 22:19:02 2014] [error] [client 127.0.0.1] PHP Fatal
    error:  Call to a member function begin() on a non-object in
    /usr/share/dolibarr/htdocs/comm/action/class/actioncomm.class.php
    on line 461, referer:
    http://localhost/dolibarr/commande/fiche.php?id=27&action=validate
    [Sun Feb 02 22:19:02 2014] [error] [client 127.0.0.1] PHP Stack
    trace:, referer:
    http://localhost/dolibarr/commande/fiche.php?id=27&action=validate
    [Sun Feb 02 22:19:02 2014] [error] [client 127.0.0.1] PHP   1.
    {main}() /usr/share/dolibarr/htdocs/commande/fiche.php:0, referer:
    http://localhost/dolibarr/commande/fiche.php?id=27&action=validate
    [Sun Feb 02 22:19:02 2014] [error] [client 127.0.0.1] PHP   2.
    Commande->valid()
    /usr/share/dolibarr/htdocs/commande/fiche.php:947, referer:
    http://localhost/dolibarr/commande/fiche.php?id=27&action=validate
    [Sun Feb 02 22:19:02 2014] [error] [client 127.0.0.1] PHP   3.
    Interfaces->run_triggers()
    /usr/share/dolibarr/htdocs/commande/class/commande.class.php:302,
    referer:
    http://localhost/dolibarr/commande/fiche.php?id=27&action=validate
    [Sun Feb 02 22:19:02 2014] [error] [client 127.0.0.1] PHP   4.
    InterfaceEventLinker->run_trigger()
    /usr/share/dolibarr/htdocs/core/class/interfaces.class.php:153,
    referer:
    http://localhost/dolibarr/commande/fiche.php?id=27&action=validate
    [Sun Feb 02 22:19:02 2014] [error] [client 127.0.0.1] PHP   5.
    ActionComm->update()
    
/usr/share/dolibarr/htdocs/core/triggers/interface_01_modCommande_EventLinker.class.php:263,
    referer:
    http://localhost/dolibarr/commande/fiche.php?id=27&action=validate

    Il semble y avoir un problème à la ligne

            $this->db->begin();
    de la classe ActionComm

    à l'appel suivant depuis mon code.
            $agenda->update($user);

    Est-ce que la ligne   ($this->db->begin();) pourrait éventuellemnt
    poser problème dont je ne connais pas la cause ?

    Il me semble que mon code est correcte mais je ne suis pas certain
    d'utiliser un bon numéro de priorité pour mon trigger. Je ne
    connais pas le nombre de trigger pour la classe commande mais je
    veux simplement rajouter une fonctionnalité en dernier sans
    écraser un trigger existant.


    Merci pour votre aide et conseil.

    Salutations

    Michaël Parchet



    Le 29. 01. 14 13:11, Florian Henry a écrit :
    Cela veux dire que le trigger plante, avez vous regarder dans les
    log d'apache, ou avez vous utilise dol_syslog pour faire des
    trace de debug (voir utiliser FirePHP) ?
    Le fonctionnement que vous voulez mettre en place est tout a fait
    possible mais avez vous des compétences de développement PHP ou
    êtes vous un intégrateur ?
    Je vais peut être paraître un peu rude, mais faire du
    developement avec Dolibarr, ce n'est pas juste un copier coller
    du wiki, il faut que vous compreniez le code que vous écrivez.
    Peux être quand commençant par le début, comprendre la
    programmation objet par exemple, vous vous éviterez beaucoup de
    temps perdue et de cheveux en moins
    par exemple : dans votre trigger vous faite
    $object->actiontypecode=xxxx. Posez vous la question de qui est
    $object (ne faudrait 'il pas plus ecrire
    $agenda->actiontypecode=xxx)?
    Votre trigger ne retourne aucune valeur, il devrait retourné 1 si
    tout va bien et -1 en cas d'erreur avec affectation the
    $this->error avec un message cohérent, regardez et surtout
    comprenez comment sont fait les trigger core de dolibarr et le
    code qui l'execute dans les classes appelantent.

    Bon courage.

    ------- In English

    Your trigger do not work properly. Put some trace to debug where
    it do not work.
    Not translated directly but something like : learn to code and
    understand what your code do, do not just copy paste so part of
    wiki code....

    Check how the core trigger work, trigger must return a value, 1
    if ok, -1 if error....

    Regards

    Florian HENRY
    florian.he...@open-concept.pro  <mailto:florian.he...@open-concept.pro>
    +33 6 03 76 48 07  <tel:%2B33%206%2003%2076%2048%2007>
    http://www.open-concept.pro
    Twitter : @_Open_Concept_
    Le 28/01/2014 22:29, Michaël Parchet a écrit :
    Bonjour,

    Désolé Florian ça ne marche pas encore. Quand je valide ma
    commande, soit au moment ou mon trigger devrait se déclencher,
    j'obtiens une page blanche.

    Voici des fichiers ci-joint qui vous permettront je l'espère de
    m'aider à débugger mon code.

    Salutations

    Michaël Parchet

    Le 23. 01. 14 09:23, Florian Henry a écrit :
    Bonjour,

        Il te manque un $action->update($user).

    Cdt.
    ------

    Hi,

        missing  the call to $action->update($user).

    Regards
    Florian HENRY
    florian.he...@open-concept.pro  <mailto:florian.he...@open-concept.pro>
    +33 6 03 76 48 07  <tel:%2B33%206%2003%2076%2048%2007>
    http://www.open-concept.pro
    Twitter : @_Open_Concept_
    Le 23/01/2014 00:05, Michaël Parchet a écrit :
    Bonjour,


    J'essaie de créer un trigger qui lie une commande à un
    rendez-vous en mettant le numéro de cette dernière dans la
    table actioncome.fkelemente et commande dans elementtype.

    Malheureusement, malgré tous mes efforts, la valeur du champs
    tms reste à 0000-00-00 00:00:00.

    Je joint à ce mail mon trigger en espérant que vous pouvez
    m'aider a déboguer ça car je ne comprends pas la raison de
    cette valeur et j'ai pourtant tout essayer pour mettre la date
    et l'heure du moment de l'insertion dans le champ tms de la
    table. Ce qui me semble étrange. C'est qu'il n'y a pas de
    champ tms dans la classe correspondante.
    Pourquoi ?

    Merci pour votre aide.

    Michaël Parchet


    _______________________________________________
    Dolibarr-dev mailing list
    Dolibarr-dev@nongnu.org  <mailto:Dolibarr-dev@nongnu.org>
    https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



    _______________________________________________
    Dolibarr-dev mailing list
    Dolibarr-dev@nongnu.org  <mailto:Dolibarr-dev@nongnu.org>
    https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



    _______________________________________________
    Dolibarr-dev mailing list
    Dolibarr-dev@nongnu.org  <mailto:Dolibarr-dev@nongnu.org>
    https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



    _______________________________________________
    Dolibarr-dev mailing list
    Dolibarr-dev@nongnu.org  <mailto:Dolibarr-dev@nongnu.org>
    https://lists.nongnu.org/mailman/listinfo/dolibarr-dev





_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à