View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Create Emails on event automatically - ProjeQtOr
 
 

Create Emails on event automatically

More
18 Apr 2019 10:02 - 18 Apr 2019 15:30 #1 by Gaspard
Hello everyone,

I have to develop projeQtor, and because it's a very large program, I woud ask your help to find out some function in the code that you might know the name.
The global idea is : when you copy a project (we have a model of project so we dont have to start from 0 to make new one), email on event will be also copied, or created (and receivers will be adjustable).
So my developement goal is that : everytime a project is copied, once the user clicked on "OK", I would like that a 2nd windows popup like this one: (I cant add image on the post their is a red 'FORBIDEN' )
http://prntscr.com/ndjppx
And so the user will be able to select which ressources can receive certains post-scripted events alerts.

Actually I think I can do that (not without pain), I will modify some code in the Tool/CopyProjectTo.php and DynamycDialogCopy.php, to add the second window, because I think it's the file that manage the copy project.

What I have no idea of is the code which generate email on event alert (I'm looking for it since few days now).
If you could give me some explanations about the generation of email on event processus so I'll try to generate that automatically and the user won't have to create 3 differents alert everytime a project is created.

To resume : where can I find the constructor of Mails On Event ?

If I can achieve that, and if you find it usefull, I'd be glad to give the code back, to contribute to your software :)

Thank you for your help.
Last edit: 18 Apr 2019 15:30 by Gaspard.

Please Log in or Create an account to join the conversation.

More
19 Apr 2019 15:08 #2 by babynus

To resume : where can I find the constructor of Mails On Event ?

model/StatusMail.php or in your case model/StatusMailPerProject.php
(name is not very accurate as it was first designed for change of status)

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
19 Apr 2019 15:14 #3 by Gaspard
Thank you for your answer, I'm on it !

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 17:04 #4 by Gaspard
Hello Babynus,
So I developed the basics, which means the form to get the infos.



In order to make the use easy as possible I will make a DropDown list with multiple choice, which display all the members of a team (in this example let's take the Commercial team) I'll seek in dojo doc to do that multiple choice dropdown list.

I've found how to make request to get info from the DB but i'm stuck with one thing:
Where can I set a "where" because i would like that only "Commercial" team being display in this dropdown list (in this ex, only "Nom d'un commercial" will be display).
I saw there is an attribute 'idTeam' in the table Ressources, so maybe I could specify 'where idTeam=Commercial.idTeam' something like that.

Here is how I get the info (I guess there is only this function to get info from DB, am I right ?)
<table>
        <tr>
          <td>
            <select dojoType="dijit.form.FilteringSelect" <?php echo autoOpenFilteringSelect();?> id="copyProjectToType" name="copyProjectToType" required class="input" value="" >
             <?php htmlDrawOptionForReference('idResource', null, null, true); 
            </select>
          </td>
        </tr>
      </table>
I've check the code of "htmlDrawOptionForReference" function in html.php, but I'm afraid if I change something the rest will not follow..
So do you know if there is a way to set a simple 'where' ?
Also I might ask you later how can I give emails adress to Mail On event Constructor. Because actually I already knew the existence of model/StatusMailPerProject.php, but I don't understand how it's working.. But it's not the matter for now, and if it bother you I'll understand.

Thank you very much for your time.
Attachments:

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 22:13 #5 by babynus
Look at how htmlDrawOptionForReference() works.
Something like htmlDrawOptionForReference('idResource', 'idTem', x, true);
whre x is the id of the team.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
26 Apr 2019 16:41 #6 by Gaspard
Hello and thank you for your answer and your time,

So I tried to find out how display ressources only from Commercial team thanks to your indications but when I set those parameters :
<?php htmlDrawOptionForReference('idResource', 1, 'idTeam', true);
.
I get nothing (the multiSelect Window is white http://prntscr.com/nh8tsg).
I tried to switch the spot of 1 and 'idTeam'. I also tried weird things to try to get only the resource where idTeam = 1 (which is commercial team id ofc), but same white result, so it doesn't work.

In fact I don't think it can work with idResource, because Resource table doesn't contain an 'idResource' element, it only contains 'id'.
So I tried to get all the resources from resource table, in order to extract the email from them, but 'id' alone doesn't give result as well..
I used htmlDrawOptionForReference() function again, but from what I've seen, this function haven't got a parameter to select which table you want to use for the SQL request.

So I'm thinking about just displaying all the ressources. Actually for little company it's OK, but I wished to do that for everyone including bigger companies. For now my best result is : http://prntscr.com/nh8zgy
So if you have any ideas to help me I'd be glad to hear them. Else I'll try to create my own request, but then I have to import this code on a terminal and re-write it with Vi so I'm trying to do that with less code as possible.

Thank you again for your help.

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.048 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.