Jump to content

AirMail 3.0


simpilot

Recommended Posts

  • 2 weeks later...
  • Administrators

How can I have so a pilot can view a pilots profile and click on a link to sent that pilot a PM?

That is something that can be integrated into the next version. Right now there is nothing to hook into the user list and start an airmail from there. Great idea though.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • Administrators

simpilot at airmail has any chance to put in first the new messages and then the rest?

I am not sure exactly what you are asking. I think you are trying to order the mail items in the inbox from newest to oldest instead of the other way around. If I am right, open /core/common/MailData.class.php and find line 21

ORDER BY date ASC";

and change it to

ORDER BY date DESC";

Save the file and it should now order the mail from newest to oldest.

Link to comment
Share on other sites

  • Administrators

One more question: 06/20/2012 12:24pm

This is displayed time, how I switch to my time zone at phpVMS?

You need to set the time zone for your server in a php.ini file or you can add

date_default_timezone_set('America/Los_Angeles');

to your local config. You can find the available time zones in php here -> http://php.net/manual/en/timezones.php

is possible to change date format?

You can change the date format for phpvms globaly in the local config file, I am not sure if I used the phpvms default date format in this addon or not, if not you will have to change it inthe template files.

Great addon !!

I am just missing the images... can someone post it so that i can upload it and have everything complete?

Or maybe i need to download it somewhere?

Thanks !

Lucas

You can find the mages here -> https://github.com/DavidJClark/phpVMS-AirMail/tree/master/core/modules/Mail/assets

Link to comment
Share on other sites

  • 3 months later...

Here is one that has just came up on me. A pilot is now saying that he opted to get emails when someone sends him and AIRMail. So he gets emails as he chose to and it says he has airmail waiting. He logs on to the site and he has no Airmail in his inbox.

This happened to him when I sent out NOTAMS. I sent two notams and he received 2 emails. Issue is, he never got the notams. Running the latest AIRMail from the git repository and the latest version of phpvms with security fix.

Link to comment
Share on other sites

  • 3 weeks later...
  • Administrators

Here is one that has just came up on me. A pilot is now saying that he opted to get emails when someone sends him and AIRMail. So he gets emails as he chose to and it says he has airmail waiting. He logs on to the site and he has no Airmail in his inbox.

This happened to him when I sent out NOTAMS. I sent two notams and he received 2 emails. Issue is, he never got the notams. Running the latest AIRMail from the git repository and the latest version of phpvms with security fix.

Does he get non-notam airmails in his inbox that are just sent to him?

Link to comment
Share on other sites

hello every one, I am using this module, it's useful but some bugy! as you know there is a bug with NOTAM !

Finally I got the solution. but first of all , the bug seems to appear when some pilot change his/her AIRMAIL setting to GET the notification EMAIL!

so when you send a NOTAM to ALL PILOTS , the script starts to send the NOTAM via AIRMAIL , one by one , to ALL PILOTS...BUT the script ends when the NOTAM wants to be send to a pilot who selected YES to recive the notification E-Mail! just it!

so to just ignore this (NOT TO SOLVE THE PROB!) you can remove the script that send the notification Email , just for the NOTAM , and not for regular Airmail. to do so , remove the red code below from your MAIL.php file (in line 124) :

if($who_to == 'all')

{

$notam = 0;

$pilots=(PilotData::findPilots(array('p.retired' => '0')));

foreach ($pilots as $pilot) {

$notam = $notam+1;

MailData::send_new_mail($pilot->pilotid, $who_from, $subject, $message, $notam, $thread_id);

if(MailData::send_email($pilot->pilotid) === TRUE)

{

$email = $pilot->email;

$sub = 'You have reveived a new message at '.SITE_NAME;

$message = 'You received a new message with the subject ('.$subject.') in your pilot\'s message inbox on '.date('m/d/Y', time());

Util::SendEmail($email, $sub, $message);

}

}

}

I say again, we just can ignore the NOTIFICATION EMAIL feature with this solution...

so I ask from the publisher of this module to present a new code to have also the NOTIFICATION EMAIL feature , thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry Dave for the slow reply. I got off the beaten path for a short while with life.

As I was made to believe, he was getting an email saying he had a NOTAM but when checking his inbox, he had nothing. I ran into an issue similar as well. I set mine to get emails to notify me and all of a sudden I stopped getting anything but I did get emails saying I had AIRMail.

I am 100% sure I have the latest version installed. What I am going to do is to do an uninstall and do a reinstall of the module just to make 100% sure it wasn't something user created. I will let you know how it goes.

Ray

Link to comment
Share on other sites

  • 1 month later...
  • Administrators

You can change what is displayed in the template - mail_check.tpl

echo '<img src="'.SITE_URL.'/core/modules/Mail/mailimages/new_mail.gif" border="0" /><br />';
  echo 'You Have Mail';

You can remove the image link and just leave the "You Have Mail" text. You should be able to have the number of messages in the $items variable, maybe something like this will work for what you are wanting.

echo 'You Have '.$items.' New Messages';

Link to comment
Share on other sites

I have noticed that when writing PM's to people, that the text is all one line. Even if you start a new paragraph when you compose the message. Is there a way to fix that?

Someone here posted a workaround for that and I know it works because I tried it. If I can find the link to the thread I will post it for you.

  • Like 1
Link to comment
Share on other sites

Here's a quick piece of code which will display the user's mailbox on their profile, however with just the date, subject and who from:

1. First, create the file mail_profile.tpl in core/templates/mail and paste the following code:

<table width="100%" cellpadding="2">
<?php if(!$mail){
 echo '<tr><td align="center" colspan="3">No NOTAMs available</td></tr>';
 }
 else {
	 foreach($mail as $data) {
 ?>
	 <?php $user = PilotData::GetPilotData($data->who_from);?>
	 <tr>
	 <td width="25%" align="center"><?php echo date(DATE_FORMAT.' H:i', strtotime($data->date)); ?></td>
	 <td><?php echo $user->firstname.' '.$user->lastname;?></td>
	 <td>
	 <?php
	 if ($data->read_state=='0') { ?>
 <b><a href="http://www.freshjetvirtual.com/index.php/Mail/item/<?php echo $data->thread_id;?>"><?php echo $data->subject; ?></a></b>
 <?php
 }
 else
 {
 ?>
 <a href="http://www.freshjetvirtual.com/index.php/Mail/item/<?php echo $data->thread_id;?>"><?php echo $data->subject; ?></a>
 <?php
 }
 ?>
 </td>
 </tr>
<?php
}

}
?>
</table>

2. Add the following code to core/modules/Mail/Mail.php :

public function GetProfileMail(){
 $pid = Auth::$userinfo->pilotid;
 $this->set('mail', MailData::getallmail($pid));
 $this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid));
 $this->show('mail/mail_profile.tpl');
 }

3. In your profile_main.tpl (or wherever else you want):

<?php MainController::Run('Mail', 'GetProfileMail', 5);?>

The number at the end can be changed to suit how many items you wish to display as per usual.

Enjoy :)

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I'm trying to display a modal box when a pilot receives a new message, however I can't get it to work, so that the button links to the unread mail message and resets the $items variable to zero, so the modal disappears.

Here's the form code...

<form name="loginform">

					<p>You have new unread mail in your inbox. Press 'Mail' button to access your inbox.</p>

					<input type="hidden" name="redir" value="" />
					<input type="hidden" name="action" value="mail" />
					<input type="submit" name="submit" value="Mail" onclick="<?php echo url('/Mail/item/'.$mail->thread_id.'');?>" />

				</form>

Link to comment
Share on other sites

  • 1 month later...

Hello All,

Yesterday we had a come together with the VA and they had a request.

People would like to have option to read back at the messages they have sent to other people.

At this moment the can´t.

Did somebody manage to let it work.

Happy Easter,

Cor

Link to comment
Share on other sites

Yes. Ironic to get on here and see your post. Just worked on that tonight and, yes, that feature is partially working at my site wingsonair.net along with several other new features. Too much to get the codes in order for posting, but I soon will. One of the features created was a folders page where you can view folders as icons and edit, create or delete them from that page. So to add to the ability of reading the mails from the sent folder found that when choosing to move them to a folder, which you can do, they appear as received from yourself. With time permitting, I should have that working before the end of the week. Several innovations, an email template for the mail.php file both for regular AIRMails and NOTAMS; addon for messaging pilot from their profile which ads a 3rd type of message and separate action.php file so when the notice is receive to the pilot that they have an email a different template for that email can be use to notify the pilot the message came specifically from their profile; ability to save drafts; ability to cc another pilot, and ccc; when mail is open ability to view next and previous "unread" mails -- and much more. As for the mail templates, I can post those now: Just look for the familiar lines in Mail.php located inside your core/mail folder and paste the code. Be sure you are placing it correctly. Our mail.php file has been modified so much that I'm not sure if I'm giving code we wrote or not.

 $pilots=(PilotData::findPilots(array('p.retired' => '0')));
foreach ($pilots as $pilot) {
$notam = $notam+1;
MailData::send_new_mail($pilot->pilotid, $who_from, $subject, $message, $notam, $thread_id);
if(MailData::send_email($pilot->pilotid) === TRUE){
$pilot = PilotData::getPilotData($who_to);
$sender = PilotData::getPilotData($who_from);
$email = $pilot->email;
$sub = 'AIRMail NOTAM Received From '.SITE_NAME;
$message = '[url="http://wingsonair.net"][img=http://wingsonair.net/woa/lib/skins/wingsonair/images/airmail/mail/airmail_mail_notam.png][/url]



Hello, '.$pilot->firstname.'.



You received a new AIRMail NOTAM message with the subject ([b][b][color="#FA0707"]'.$subject.'[/color][/b][/b]) in your pilot\'s message inbox on



'.date('m/d/Y', time()).'.



This Message was sent via Wings On AIRMail from [b][b][color="#FA0707"]'.$sender->firstname.' '.$sender->lastname.'[/color][/b][/b].



Click [b][b][color="#FA0707"][url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]HERE[/url][/color][/b][/b] or below, or copy the link below and paste it into your browser to view this message!:



[url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]http://wingsonair.net/index.php#Mail/item/'.$thread_id.'[/url]



Thank You,



WOAVA Support';
Util::SendEmail($email, $sub, $message);
}
}
}
else
{
MailData::send_new_mail($who_to, $who_from, $subject, $message, '0', $thread_id);
if(MailData::send_email($who_to) === TRUE){
$pilot = PilotData::getPilotData($who_to);
$pilot = PilotData::getPilotData($who_to);
$sender = PilotData::getPilotData($who_from);
$email = $pilot->email;
$sub = 'AIRMail Message Received From '.SITE_NAME;
$message = '[url="http://wingsonair.net"][img=http://wingsonair.net/woa/lib/skins/wingsonair/images/airmail/mail/airmail_mail_received.png][/url]



Hello, '.$pilot->firstname.'.



You received a new AIRMail message with the subject ([b][b][color="#FA0707"]'.$subject.'[/color][/b][/b]) in your pilot\'s message inbox on



'.date('m/d/Y', time()).'.



This Message was sent via Wings On AIRMail from [b][b][color="#FA0707"]'.$sender->firstname.' '.$sender->lastname.'[/color][/b][/b].



Click [b][b][color="#FA0707"][url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]HERE[/url][/color][/b][/b] or below, or copy the link below and paste it into your browser to view this message!:



[url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]http://wingsonair.net/index.php#Mail/item/'.$thread_id.'[/url]



Thank You,



WOAVA Support';
Util::SendEmail($email, $sub, $message);
}
}

$this->set('message', '
AIRMail Message Sent!
');
$this->message();

Link to comment
Share on other sites

hello every one, I am using this module, it's useful but some bugy! as you know there is a bug with NOTAM !

Finally I got the solution. but first of all , the bug seems to appear when some pilot change his/her AIRMAIL setting to GET the notification EMAIL!

so when you send a NOTAM to ALL PILOTS , the script starts to send the NOTAM via AIRMAIL , one by one , to ALL PILOTS...BUT the script ends when the NOTAM wants to be send to a pilot who selected YES to recive the notification E-Mail! just it!

so to just ignore this (NOT TO SOLVE THE PROB!) you can remove the script that send the notification Email , just for the NOTAM , and not for regular Airmail. to do so , remove the red code below from your MAIL.php file (in line 124) :

if($who_to == 'all')

{

$notam = 0;

$pilots=(PilotData::findPilots(array('p.retired' => '0')));

foreach ($pilots as $pilot) {

$notam = $notam+1;

MailData::send_new_mail($pilot->pilotid, $who_from, $subject, $message, $notam, $thread_id);

if(MailData::send_email($pilot->pilotid) === TRUE)

{

$email = $pilot->email;

$sub = 'You have reveived a new message at '.SITE_NAME;

$message = 'You received a new message with the subject ('.$subject.') in your pilot\'s message inbox on '.date('m/d/Y', time());

Util::SendEmail($email, $sub, $message);

}

}

}

I say again, we just can ignore the NOTIFICATION EMAIL feature with this solution...

so I ask from the publisher of this module to present a new code to have also the NOTIFICATION EMAIL feature , thanks.

Iva, the problem isn't there in red. That code is fine. The problem is on the mail_settings.php file we left the code the way it was on the mail.php but on the mail_settings.php we found the options lines and well, here's the code:

ON the mail_settings.php --

<option value="0"<?php if(MailData::send_email(Auth::$userinfo->pilotid) === TRUE){echo 'selected="seclected"';} ?>>Yes</option>
<option value="1"<?php if(MailData::send_email(Auth::$userinfo->pilotid) === FALSE){echo 'selected="seclected"';} ?>>No</option>

On the mail.php we designed our own template --

if($who_to == 'all')
{
$notam = 0;
$pilots=(PilotData::findPilots(array('p.retired' => '0')));
foreach ($pilots as $pilot) {
$notam = $notam+1;
MailData::send_new_mail($pilot->pilotid, $who_from, $subject, $message, $notam, $thread_id);
if(MailData::send_email($pilot->pilotid) === TRUE){
$pilot = PilotData::getPilotData($who_to);
$sender = PilotData::getPilotData($who_from);
$email = $pilot->email;
$sub = 'AIRMail NOTAM Received From '.SITE_NAME;
$message = '[url="http://wingsonair.net"][img=http://wingsonair.net/woa/lib/skins/wingsonair/images/airmail/mail/airmail_mail_notam.png][/url]



Hello, '.$pilot->firstname.'.



You received a new AIRMail NOTAM message with the subject ([b][b][color="#FA0707"]'.$subject.'[/color][/b][/b]) in your pilot\'s message inbox on



'.date('m/d/Y', time()).'.



This Message was sent via Wings On AIRMail from [b][b][color="#FA0707"]'.$sender->firstname.' '.$sender->lastname.'[/color][/b][/b].



Click [b][b][color="#FA0707"][url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]HERE[/url][/color][/b][/b] or below, or copy the link below and paste it into your browser to view this message!:



[url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]http://wingsonair.net/index.php#Mail/item/'.$thread_id.'[/url]



Thank You,



WOAVA Support';
Util::SendEmail($email, $sub, $message);
}
}
}
else
{
MailData::send_new_mail($who_to, $who_from, $subject, $message, '0', $thread_id);
if(MailData::send_email($who_to) === TRUE){
$pilot = PilotData::getPilotData($who_to);
$pilot = PilotData::getPilotData($who_to);
$sender = PilotData::getPilotData($who_from);
$email = $pilot->email;
$sub = 'AIRMail Message Received From '.SITE_NAME;
$message = '[url="http://wingsonair.net"][img=http://wingsonair.net/woa/lib/skins/wingsonair/images/airmail/mail/airmail_mail_received.png][/url]



Hello, '.$pilot->firstname.'.



You received a new AIRMail message with the subject ([b][b][color="#FA0707"]'.$subject.'[/color][/b][/b]) in your pilot\'s message inbox on



'.date('m/d/Y', time()).'.



This Message was sent via Wings On AIRMail from [b][b][color="#FA0707"]'.$sender->firstname.' '.$sender->lastname.'[/color][/b][/b].



Click [b][b][color="#FA0707"][url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]HERE[/url][/color][/b][/b] or below, or copy the link below and paste it into your browser to view this message!:



[url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]http://wingsonair.net/index.php#Mail/item/'.$thread_id.'[/url]



Thank You,



WOAVA Support';
Util::SendEmail($email, $sub, $message);
}
}

$this->set('message', '
AIRMail Message Sent!
');
$this->message();
}

In the templates above you all might notice a couple of goodies!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...