Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • How to access assigned_to id in the elgg core file comments/add.php file ? I need the id of assigned_to, when the owner of task comments.
  • Anant replied on the discussion topic How to notify assigned member if task owner comments.
    sorry, because of my english. I, understood what are you trying to tell. But I tried all of this(mrans restructuring the code) But I am not able to notify the assigned member when task owner comments . Please review my notify function and the if... view reply
  • Anant replied on the discussion topic How to notify assigned member if task owner comments.
    I am trying this, Please tell me my mistake   if (trim($comment_text) !== "") { // If posting the comment was successful, say so if ($entity->annotate('generic_comment',$comment_text,$entity->access_id, $_SESSION['guid'])) {//... view reply
  • Anant replied on the discussion topic How to notify assigned member if task owner comments.
    Please someone reply view reply
  • Anant added a new discussion topic How to notify assigned member if task owner comments. in the group Plugin Development
    When a task is created assigned member is getting notification, when assigned member is commenting task owner is getting notification.  But we task owner writes comments notification is not going to assigned user. I have to send...
    • I'm not fully understanding what you are trying to do and what exactly is not working as intented as your English is very difficult to follow (sorry to say that...). When looking at the code I see one thing that seems maybe not as intended though. You have two indendent if-clauses (which might result in two annotations getting created) that check for logged in user != entity->owner and then logged in user = entity->owner. How about this structure:

      if ($entity->annotate('generic_comment',$comment_text,$entity->access_id, $_SESSION['guid'])) {

          if ($entity->owner_guid != elgg_get_logged_in_user_guid()) {

                  ...

          } else if ($entity->owner_guid == elgg_get_logged_in_user_guid()) {

                  ...

          } else

            register_error(elgg_echo("generic_comment:failure"));

          }
      }

      Maybe restructuring the code this way will also solve the problem you have.

    • sorry, because of my english.

      I, understood what are you trying to tell. But I tried all of this(mrans restructuring the code)

      But I am not able to notify the assigned member when task owner comments .

      Please review my notify function and the if condition to check if task owner comments.

      if ($entity->annotate('generic_comment',$comment_text,$entity->access_id, $_SESSION['guid'])) {

       if ($entity->owner_guid != elgg_get_logged_in_user_guid()) {     

      notify_user($entity->assigned_to, $_SESSION['user']->getGUID(), elgg_echo('generic_comment:email:subject'),

       sprintf(

                      elgg_echo('generic_comment:email:body'),

                      $entity->title,

                      $_SESSION['user']->name,

                      $comment_text, $entity->getURL(),

                      $_SESSION['user']->name,

                      $_SESSION['user']->getURL()

      )

      ); 

      system_message(elgg_echo("generic_comment:posted")); //add to river add_to_river('annotation/annotate','comment',$_SESSION['user']->guid,$entity->guid);           
       }  

       

    • $entity->assigned_to is something I don't know anything about. As I said in your other post assigned_to seems not to be used anywhere in Elgg core. If this attribute is defined and used in your plugin it has to get assigned the correct value before using it within the notify_user() function. This function expects the first parameter to be the GUID of the user that should receive the notification. I don't know what happens in the code before the part you posted or in any other files of this plugin.

  • Anant joined the group Plugin Development
  • Anant joined the group Beginning Developers