Skip to content

Commit

Permalink
Email body function
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobmarin committed Nov 14, 2014
1 parent 8c2908b commit 7064aae
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,5 @@ package org.bigbluebutton.clientcheck.model

sortData();
}

public function getAllDataAsString():String {
var data:String="";

for (var i:int=0; i < _dataProvider.length; i++)
{
data += _dataProvider.getItemAt(i).Item + " : " + _dataProvider.getItemAt(i).Result + " : " + _dataProvider.getItemAt(i).Status + "\n";
}

return data;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ package org.bigbluebutton.clientcheck.model
function addData(obj:Object):void;
function getData():ArrayCollection;
function updateData(obj:Object):void;
function getAllDataAsString():String;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ package org.bigbluebutton.clientcheck.view.mainview
import flash.net.URLRequestMethod;
import flash.net.navigateToURL;

import mx.resources.ResourceManager;
import mx.collections.ArrayCollection;

import org.bigbluebutton.clientcheck.model.IXMLConfig;
import org.bigbluebutton.clientcheck.model.IDataProvider;

Expand Down Expand Up @@ -56,11 +59,33 @@ package org.bigbluebutton.clientcheck.view.mainview
{
var mailMsg:URLRequest = new URLRequest('mailto:' + config.getMail());
var variables:URLVariables = new URLVariables();
variables.subject = "BigBlueButton Client Check";
variables.body = dp.getAllDataAsString();
variables.subject = signWithVersion(ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.title'));
variables.body = buildMailBody(dp.getData());
mailMsg.data = variables;
mailMsg.method = URLRequestMethod.GET;
navigateToURL(mailMsg, "_self");
}

/**
* Concatenate with the client-check version
*/
private function signWithVersion(value:String):String
{
return value + " " + config.getVersion();
}

public function buildMailBody(data:ArrayCollection):String {
var body:String = "";
var status:String = "";

for (var i:int = 0; i < data.length; i++)
{
if (data.getItemAt(i).Status != status)
body += "\n" + data.getItemAt(i).Status + "\n";
body += data.getItemAt(i).Item + ":\t\t" + data.getItemAt(i).Result + "\n";
}

return body;
}
}
}

0 comments on commit 7064aae

Please sign in to comment.