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' )
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.
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)
Thank you for your answer, I'm on it !
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 ?)
| <select dojoType="dijit.form.FilteringSelect" id="copyProjectToType" name="copyProjectToType" required class="input" value="" > <?php htmlDrawOptionForReference('idResource', null, null, true); |
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.
Look at how htmlDrawOptionForReference() works.
Something like htmlDrawOptionForReference('idResource', 'idTem', x, true);
whre x is the id of the team.
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 ).
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 :
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.
Look at signature
htmlDrawOptionForReference($col, $selection, $obj=null, $required=false, $critFld=null, $critVal=null, $limitToActiveProjects=true, $limitToActiveOrganizations=true)
so what you look for is rather
<?php htmlDrawOptionForReference('idResource', null, null, false,'idTeam', 1);
It work perfectly, I misunderstood that "critFld" attribute.
Thank you 3000 !
Hello Babynus,
(this is a repost because I saw images don't display well on my last post)
I come to ask your help again because I'm close from the result, but once again im stuck by the complexity of projeQtOr's code.
So since you helped me to display all the ressources in a multi select:
I tried to make it simple using GET or POST method in 2 ways : With a form with as action "alertemail.php" and without an action and writting the php code just below the form.
here is the code that generate the start of form :
Here is alertemail.php :
For now I just want to see that my multi select form is working, but nothing happen when I click.
HERE is the code when I write the php code bellow the input it did not work either, BUT HERE a "pourquoi2" appear just above the submit button:
Code :
So I tried to find out myself why it write "pourquoi2", I looked into the code already written in projeqtor and I've found this :
I don't find the difference.. I'm wondering if I should try it with a client side code ? Is there something I'm missing ?
Thanks again for your time !
The code is not completely displayed.
But you get display of "Pourquoi2" because condition (isset($_GET["submitAlerte"])) is false
This will always be false with a post request...
This mays also always be false with a get request, as you don't have parameters in your url.
So parameters will be passed only with post request.
Try and replace all your $_GET with $_POST or with $_REQUEST (that will work for post and for get) or better, use methods of RequestHandler class...











