Hi Babynus,
Thank you for your reply,
I will introduce myself a bit more to give you a better context in our discussion
I am currently a student following a part-time (enterprise / school) developper formation (3rd year), and I'm working on ProjeQtOr for my society.
This said,
I had help from my technical service wich configured me the IMAP access so I was able to test your "note from mail" functionality with my ticket-dedicated mailbox.
Works great !
After this,
I tried to adapt your functionality to create tickets (I copied the initial function / mecanism and modified it in order to have this running onto the cron)
Brasically I rushed it, mays not be very "clean" code. a lot of things are "hardcoded" because i didn't have the time to create and understand totally the "parameters" way of working. I just wanted a result to show my tutor before returning to school next week.
So I told myself that it could be useful if I gave you what I did, in order for you to gain time (perhaps not)
Here is everything I'm able to tell you :
I added a new private attribute to the cron objet : $checkMailTicket
I added a new public function : getCheckMailTicket() (didn't create a new parameter as I said, the value is hardcoded)
I added the gesture on the cron::run() function for my new treatment :
- The checkMailticket() gesture
- The test to see if the functionality is "enabled" (> 0)
Finally,
I did a new function for the cron object : checkMailTicket() - wich is the update of your previous mails treatment function for notes, does the same thing but with tickets
I kept all the parsing / mail reading part and updated the object creation part.
First, I tested if the sender was a "user" or a "contact"
With this, I can chose between "idUser" or "idContact" for the criterias and return all his affectations.
As we mentionned, If there is only one affectation, then I have his project. If there are severals then I give him a hardcoded "dummy projet" : TO DEFINE
I detailed my modifications with commentarys in the code.
I couldn't go further with attachments / images or forwardings ... Because I'm doing other tasks and I'm going back to school on Monday for 2 weeks.
I really hope that It can gain you time, and I apologise if it doesn't, I'm not yet comfortable with all the ProjeQtOr code/mecanisms and I don't know every developpment concepts yet as I didn't finished my formation (plus I'm the only one doing PHP at work here).
If you want to communicate a bit more with me on the subject (or everything elese) here's my professional email :
This email address is being protected from spambots. You need JavaScript enabled to view it.
Here is the pastebin with code pieces from "/model/cron.php" :
pastebin.com/2atwBF5E
Huge thanks for your time and consideration,
Best regards