mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
179
apps/atlbiomed/modules/messages/actions/actions.class.php
Executable file
179
apps/atlbiomed/modules/messages/actions/actions.class.php
Executable file
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* messages actions.
|
||||
*
|
||||
* @package atlbiomed
|
||||
* @subpackage messages
|
||||
* @author Your name here
|
||||
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
|
||||
*/
|
||||
class messagesActions extends sfActions
|
||||
{
|
||||
/**
|
||||
* Executes index action
|
||||
*
|
||||
*/
|
||||
public function executeIndex()
|
||||
{
|
||||
$userId = $this->getUser()->getAttribute('userId');
|
||||
|
||||
$user = UserPeer::retrieveByPk ($userId);
|
||||
if($user){
|
||||
$email = $user->getEmail();
|
||||
$firstName = $user->getFirstName();
|
||||
}
|
||||
$signed_info = $firstName."||".$email;
|
||||
|
||||
|
||||
|
||||
if($this->getRequest()->getMethod() == sfRequest::POST && !empty($userId)){
|
||||
|
||||
|
||||
|
||||
$for = $this->getRequestParameter('for');
|
||||
$name = $this->getRequestParameter('name');
|
||||
$company = $this->getRequestParameter('company');
|
||||
$phone = "(".$this->getRequestParameter('phone').")".$this->getRequestParameter('phone-2')."-".$this->getRequestParameter('phone-3');
|
||||
$ext = "ext. ".$this->getRequestParameter('ext');
|
||||
$time_to_call = $this->getRequestParameter('time_to_call');
|
||||
$mobile = "(".$this->getRequestParameter('mobile').")".$this->getRequestParameter('mobile-2')."-".$this->getRequestParameter('mobile-3');
|
||||
$time_to_call_mobile = $this->getRequestParameter('time_to_call_mobile');
|
||||
$fax = "(".$this->getRequestParameter('fax').")".$this->getRequestParameter('fax-2')."-".$this->getRequestParameter('fax-3');
|
||||
$telephoned = $this->getRequestParameter('telephoned');
|
||||
$came_to_see_you = $this->getRequestParameter('came_to_see_you');
|
||||
$wants_to_see_you = $this->getRequestParameter('wants_to_see_you');
|
||||
$returned_your_call = $this->getRequestParameter('returned_your_call');
|
||||
$please_call = $this->getRequestParameter('please_call');
|
||||
$will_call_again = $this->getRequestParameter('will_call_again');
|
||||
$rush = $this->getRequestParameter('rush');
|
||||
$special_attention = $this->getRequestParameter('special_attention');
|
||||
$callers_message = $this->getRequestParameter('callers_message');
|
||||
$signed_data = explode('||',$signed_info);
|
||||
|
||||
//$signed = $_POST['signed'];
|
||||
//$from = $_POST['signed'];
|
||||
$signed = $signed_data[0];
|
||||
$from = $signed_data[0];
|
||||
$reply_to = $signed_data[1];
|
||||
|
||||
|
||||
|
||||
|
||||
$date = "Time of call: ".date("F j, Y, g:i a");
|
||||
$time = date("F j, Y, g:i a");
|
||||
|
||||
if($ext == 'ext. ')
|
||||
$ext = '';
|
||||
else $ext = $ext;
|
||||
|
||||
if($time_to_call != '')
|
||||
$time_to_call = 'Time to call: '.$time_to_call;
|
||||
|
||||
if($mobile != '()-')
|
||||
$mobile = 'Mobile: '.$mobile;
|
||||
else $mobile = '';
|
||||
|
||||
if($time_to_call_mobile != '')
|
||||
$time_to_call_mobile = 'Time to call mobile: '.$time_to_call_mobile;
|
||||
|
||||
if($fax != '()-')
|
||||
$fax = 'Fax: '.$fax;
|
||||
else $fax = '';
|
||||
|
||||
if($telephoned == 'on')
|
||||
$telephoned = 'Telephoned';
|
||||
else $telephoned = '';
|
||||
|
||||
if($came_to_see_you == 'on')
|
||||
$came_to_see_you = 'Came to see you';
|
||||
else $came_to_see_you = '';
|
||||
|
||||
if($wants_to_see_you == 'on')
|
||||
$wants_to_see_you = 'Wants to see you';
|
||||
else $wants_to_see_you = '';
|
||||
|
||||
if($returned_your_call == 'on')
|
||||
$returned_your_call = 'Returned your call';
|
||||
else $returned_your_call = '';
|
||||
|
||||
if($please_call == 'on')
|
||||
$please_call = 'Please call';
|
||||
else $please_call = '';
|
||||
|
||||
if($will_call_again == 'on')
|
||||
$will_call_again = 'Will call again';
|
||||
else $will_call_again = '';
|
||||
|
||||
if($rush == 'on')
|
||||
$rush = 'Rush';
|
||||
else $rush = '';
|
||||
|
||||
if($special_attention == 'on')
|
||||
$special_attention = 'Special Attention';
|
||||
else $special_attention = '';
|
||||
|
||||
if($callers_message != '')
|
||||
$callers_message = 'Message: '.$callers_message;
|
||||
|
||||
if($signed != '')
|
||||
$signed = 'Signed: '.$signed;
|
||||
|
||||
$body = "$date
|
||||
|
||||
Name: $name
|
||||
Company: $company
|
||||
|
||||
Phone: $phone $ext
|
||||
|
||||
";
|
||||
|
||||
if($time_to_call != '')
|
||||
$body .= $time_to_call;
|
||||
|
||||
if($mobile != '')
|
||||
$body .= $mobile;
|
||||
if($time_to_call_mobile != '')
|
||||
$body .= $time_to_call_mobile;
|
||||
|
||||
if($fax != '')
|
||||
$body .= $fax;
|
||||
|
||||
if($telephoned != '' || $came_to_see_you != '' || $wants_to_see_you != '' || $returned_your_call != '' || $please_call != '' || $will_call_again != '' || $rush != '' || $special_attention != '')
|
||||
$body .= "
|
||||
|
||||
Please:
|
||||
";
|
||||
|
||||
if($telephoned != '')
|
||||
$body .= $telephoned."\n";
|
||||
if($came_to_see_you != '')
|
||||
$body .= $came_to_see_you."\n";
|
||||
if($wants_to_see_you != '')
|
||||
$body .= $wants_to_see_you."\n";
|
||||
if($returned_your_call != '')
|
||||
$body .= $returned_your_call."\n";
|
||||
if($please_call != '')
|
||||
$body .= $please_call."\n";
|
||||
if($will_call_again != '')
|
||||
$body .= $will_call_again."\n";
|
||||
if($rush != '')
|
||||
$body .= $rush."\n";
|
||||
if($special_attention != '')
|
||||
$body .= $special_attention."\n";
|
||||
|
||||
$body .= "
|
||||
|
||||
$callers_message
|
||||
|
||||
$signed";
|
||||
|
||||
$subject = "Important Message From " . $name ." - ". $time;
|
||||
|
||||
//mail($for, $subject, $body, 'from: messages@atlanticbiomedical.com');
|
||||
mail($for, $subject, $body, "from: $reply_to");
|
||||
$this->redirect('messages/index');
|
||||
//header('Location: /messages/index.php');
|
||||
}
|
||||
}
|
||||
}
|
3
apps/atlbiomed/modules/messages/config/view.yml
Executable file
3
apps/atlbiomed/modules/messages/config/view.yml
Executable file
@ -0,0 +1,3 @@
|
||||
indexSuccess:
|
||||
stylesheets: [messages]
|
||||
javascripts: ['scriptaculous/lib/prototype.js', 'scriptaculous/src/effects.js', validation, autotab]
|
140
apps/atlbiomed/modules/messages/templates/indexSuccess.php
Executable file
140
apps/atlbiomed/modules/messages/templates/indexSuccess.php
Executable file
@ -0,0 +1,140 @@
|
||||
|
||||
<script type="text/javascript" src="/sf/prototype/js/prototype.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/sf/calendar/calendar.js"></script>
|
||||
<script type="text/javascript" src="/sf/calendar/lang/calendar-en.js"></script>
|
||||
<script type="text/javascript" src="/sf/calendar/calendar-setup.js"></script>
|
||||
<link href="style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="autotab.js"></script>
|
||||
<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
|
||||
<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="validation.js"></script>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/client.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/user.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/theme.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/sf/calendar/skins/aqua/theme.css" />
|
||||
|
||||
|
||||
<div id="main">
|
||||
<center>
|
||||
<br/>
|
||||
|
||||
<?php echo form_tag('messages/index', array('id'=>'test')) ?>
|
||||
<fieldset>
|
||||
|
||||
<label for="for">For </label>
|
||||
<select name="for" class="half">
|
||||
<option value="allison.wolcott@atlanticbiomedical.com">Allison Wolcott</option>
|
||||
<option value="caendres1@gmail.com">Carl Endres</option>
|
||||
<option value="chris.endres@atlanticbiomedical.com" selected="selected">Chris Endres</option>
|
||||
<!--
|
||||
|
||||
<option value="niles.armstrong@atlanticbiomedical.com">Niles Armstrong</option>
|
||||
<option value="eric.frasse@atlanticbiomedical.com">Eric Frasse</option>
|
||||
-->
|
||||
<option value="ryan.foley@atlanticbiomedical.com">Ryan Foley</option>
|
||||
<option value="will.turner@atlanticbiomedical.com">Will Turner</option>
|
||||
<option value="kelli.kirk@atlanticbiomedical.com">Kelli Kirk</option>
|
||||
</select>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="name" class="name">Name </label>
|
||||
<input type="text" name="name" id="name" class="validate-name half" />
|
||||
<div class="form-row-ff"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="company">Company </label>
|
||||
<input type="text" name="company" class="validate-company" />
|
||||
<div class="form-row-ff"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-row"><span id="bug">
|
||||
<label for="phone">Phone </label>
|
||||
<input type="text" name="phone" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="validate-phone phone" />
|
||||
<input type="text" name="phone-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="validate-phone phone" />
|
||||
<input type="text" name="phone-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="validate-phone phone3" />
|
||||
<label for="ext" class="ext">ext. </label>
|
||||
<input type="text" name="ext" size="4" class="phone" />
|
||||
<label for="time_to_call" class="time">Time To Call</label>
|
||||
<input type="text" name="time_to_call" class="phone" /></span>
|
||||
</div>
|
||||
|
||||
<span style="display:inline-block"><label for="mobile">Mobile </label>
|
||||
<input type="text" name="mobile" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
|
||||
<input type="text" name="mobile-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
|
||||
<input type="text" name="mobile-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="phone3" />
|
||||
<label for="time_to_call_mobile" class="time2">Time To Call</label>
|
||||
<input type="text" name="time_to_call_mobile" class="phone" /></span>
|
||||
|
||||
<span style="display:inline-block"><label for="fax">Fax </label>
|
||||
<input type="text" name="fax" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
|
||||
<input type="text" name="fax-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
|
||||
<input type="text" name="fax-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="phone3" /></span>
|
||||
|
||||
<span style="display:inline-block"><div id="checkboxes">
|
||||
<label for="telephoned" class="row1_label">Telephoned </label>
|
||||
<input type="checkbox" name="telephoned" />
|
||||
|
||||
<label for="came_to_see_you" class="row2_label">Came To See You </label>
|
||||
<input type="checkbox" name="came_to_see_you" />
|
||||
|
||||
<label for="wants_to_see_you" class="row3_label">Wants To See You </label>
|
||||
<input type="checkbox" name="wants_to_see_you" />
|
||||
|
||||
<label for="returned_your_call" class="row1_label">Returned Your Call </label>
|
||||
<input type="checkbox" name="returned_your_call" />
|
||||
|
||||
<label for="please_call" class="row2_label">Please Call </label>
|
||||
<input type="checkbox" name="please_call" />
|
||||
|
||||
<label for="will_call_again" class="row3_label">Will Call Again </label>
|
||||
<input type="checkbox" name="will_call_again" />
|
||||
|
||||
<label for="rush" class="row1_label">Rush </label>
|
||||
<input type="checkbox" name="rush" />
|
||||
|
||||
<label for="special_attention" class="row2_label">Special Attention </label>
|
||||
<input type="checkbox" name="special_attention" />
|
||||
</div></span>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="callers_message" id="message">Message </label>
|
||||
<textarea name="callers_message" cols="10" rows="10" class="validate-message"></textarea>
|
||||
<div class="form-row-ff"></div>
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Submit Message" class="button" />
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-row-ff"></div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var valid = new Validation('test', {immediate : true});
|
||||
|
||||
Validation.addAllThese([
|
||||
['validate-name', 'A name is required.', function(v){
|
||||
return !Validation.get('IsEmpty').test(v);
|
||||
}],
|
||||
['validate-company', 'A company is required.', function(v){
|
||||
return !Validation.get('IsEmpty').test(v);
|
||||
}],
|
||||
['validate-phone', 'A phone number is required.', function(v){
|
||||
return !Validation.get('IsEmpty').test(v);
|
||||
}],
|
||||
['validate-message', 'A message is required.', function(v){
|
||||
return !Validation.get('IsEmpty').test(v);
|
||||
}]
|
||||
]);
|
||||
|
||||
</script>
|
||||
</center><br/>
|
||||
</div>
|
Reference in New Issue
Block a user