summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashantsinalkar2017-03-15 16:15:59 +0530
committerprashantsinalkar2017-03-15 16:15:59 +0530
commit9709a8e6f2c21b5590dd5af488943acb506ccf6e (patch)
treee4f159be7e26a5a3d8c0aa5f3e848f3e88a47fd9
parent7eeb3c6db5f25eba0fd60845526ae285a3ac0360 (diff)
downloaddwsim_flowsheet-9709a8e6f2c21b5590dd5af488943acb506ccf6e.tar.gz
dwsim_flowsheet-9709a8e6f2c21b5590dd5af488943acb506ccf6e.tar.bz2
dwsim_flowsheet-9709a8e6f2c21b5590dd5af488943acb506ccf6e.zip
fixed email issues
-rwxr-xr-xabstract_bulk_approval.inc1
-rwxr-xr-xdwsim_flowsheet.module2
-rwxr-xr-xemail.inc6
-rwxr-xr-xmanage_proposal.inc55
4 files changed, 31 insertions, 33 deletions
diff --git a/abstract_bulk_approval.inc b/abstract_bulk_approval.inc
index 7c3a6b0..1362fee 100755
--- a/abstract_bulk_approval.inc
+++ b/abstract_bulk_approval.inc
@@ -1,4 +1,5 @@
<?php
+
function dwsim_flowsheet_abstract_bulk_approval_form($form, &$form_state)
{
$options_first = _bulk_list_of_flowsheet_project();
diff --git a/dwsim_flowsheet.module b/dwsim_flowsheet.module
index 683e94b..f47b35e 100755
--- a/dwsim_flowsheet.module
+++ b/dwsim_flowsheet.module
@@ -956,7 +956,7 @@ function _dwsim_flowsheet_list_of_user_defined_compound($proposal_id)
'rows' => $rows
));
}else{
- $data .= "Not entered";
+ $data .= "Not entered";
}
return $data;
}
diff --git a/email.inc b/email.inc
index 714d1d3..0cd2030 100755
--- a/email.inc
+++ b/email.inc
@@ -218,10 +218,10 @@ FOSSEE,IIT Bombay', array(
/* initializing data */
$query = db_select('dwsim_flowsheet_proposal');
$query->fields('dwsim_flowsheet_proposal');
- $query->condition('id', $params['dwsim_flowsheet_proposal_approved']['proposal_id']);
+ $query->condition('id', $params['dwsim_flowsheet_proposal_completed']['proposal_id']);
$query->range(0, 1);
$proposal_data = $query->execute()->fetchObject();
- $user_data = user_load($params['dwsim_flowsheet_proposal_approved']['user_id']);
+ $user_data = user_load($params['dwsim_flowsheet_proposal_completed']['user_id']);
if ($proposal_data->project_guide_name == "NULL" || $proposal_data->project_guide_name == "")
{
$project_guide_name = "Not Entered";
@@ -238,7 +238,7 @@ FOSSEE,IIT Bombay', array(
{
$project_guide_email_id = $proposal_data->project_guide_email_id;
}
- $message['headers'] = $params['dwsim_flowsheet_proposal_approved']['headers'];
+ $message['headers'] = $params['dwsim_flowsheet_proposal_completed']['headers'];
$message['subject'] = t('[!site_name][Flowsheeting Project] Your DWSIM Flowsheeting Project proposal has been completed', array(
'!site_name' => variable_get('site_name', '')
), array(
diff --git a/manage_proposal.inc b/manage_proposal.inc
index e87fdd6..b1a7a92 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -578,12 +578,31 @@ function dwsim_flowsheet_proposal_status_form($form, &$form_state)
'#title' => t('List of compounds from DWSIM Database used in process flowsheet'),
'#markup' => $proposal_data->dwsim_database_compound_name
);
- if ($proposal_data->user_defined_compounds_used_in_process != "" || $proposal_data->user_defined_compounds_used_in_process != NULL)
+ $proposal_status = '';
+ switch ($proposal_data->approval_status)
+ {
+ case 0:
+ $proposal_status = t('Pending');
+ break;
+ case 1:
+ $proposal_status = t('Approved');
+ break;
+ case 2:
+ $proposal_status = t('Dis-approved');
+ break;
+ case 3:
+ $proposal_status = t('Completed');
+ break;
+ default:
+ $proposal_status = t('Unkown');
+ break;
+ } //$proposal_data->approval_status
+ if (_dwsim_flowsheet_list_of_user_defined_compound($proposal_data->id) != "Not entered")
{
$form['user_defined_compounds_used_in_process_flowsheetcompound_name'] = array(
'#type' => 'item',
'#title' => t('List of user defined compounds used in process flowsheet'),
- '#markup' => $proposal_data->user_defined_compounds_used_in_process
+ '#markup' => _dwsim_flowsheet_list_of_user_defined_compound($proposal_data->id)
);
} //$proposal_data->user_defined_compounds_used_in_process != "" || $proposal_data->user_defined_compounds_used_in_process != NULL
else
@@ -594,7 +613,7 @@ function dwsim_flowsheet_proposal_status_form($form, &$form_state)
'#markup' => "Not entered"
);
}
- if ($proposal_data->user_defined_compound_filepath != "")
+ if ($proposal_data->user_defined_compound_filepath != "" && $proposal_data->user_defined_compound_filepath != "NULL")
{
$form['user_defined_compound_filepath'] = array(
'#type' => 'item',
@@ -610,25 +629,6 @@ function dwsim_flowsheet_proposal_status_form($form, &$form_state)
'#markup' => "Not uploaded<br><br>"
);
}
- $proposal_status = '';
- switch ($proposal_data->approval_status)
- {
- case 0:
- $proposal_status = t('Pending');
- break;
- case 1:
- $proposal_status = t('Approved');
- break;
- case 2:
- $proposal_status = t('Dis-approved');
- break;
- case 3:
- $proposal_status = t('Completed');
- break;
- default:
- $proposal_status = t('Unkown');
- break;
- } //$proposal_data->approval_status
$form['proposal_status'] = array(
'#type' => 'item',
'#markup' => $proposal_status,
@@ -719,9 +719,9 @@ function dwsim_flowsheet_proposal_status_form_submit($form, &$form_state)
$from = variable_get('dwsim_flowsheet_from_email', '');
$bcc = $user->mail . ', ' . variable_get('dwsim_flowsheet_emails', '');
$cc = variable_get('dwsim_flowsheet_cc_emails', '');
- $params['proposal_completed']['proposal_id'] = $proposal_id;
- $params['proposal_completed']['user_id'] = $proposal_data->uid;
- $params['proposal_completed']['headers'] = array(
+ $params['dwsim_flowsheet_proposal_completed']['proposal_id'] = $proposal_id;
+ $params['dwsim_flowsheet_proposal_completed']['user_id'] = $proposal_data->uid;
+ $params['dwsim_flowsheet_proposal_completed']['headers'] = array(
'From' => $from,
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes',
@@ -730,11 +730,8 @@ function dwsim_flowsheet_proposal_status_form_submit($form, &$form_state)
'Cc' => $cc,
'Bcc' => $bcc
);
- if (!drupal_mail('dwsim_flowsheet', 'proposal_completed', $email_to, language_default(), $params, $from, TRUE))
+ if (!drupal_mail('dwsim_flowsheet', 'dwsim_flowsheet_proposal_completed', $email_to, language_default(), $params, $from, TRUE))
drupal_set_message('Error sending email message.', 'error');
- /*$email_to = $user->mail . ', ' . variable_get('dwsim_flowsheet_emails', '');;
- if (!drupal_mail('dwsim_flowsheet', 'proposal_completed', $email_to , language_default(), $params, variable_get('dwsim_flowsheet_from_email', NULL), TRUE))
- drupal_set_message('Error sending email message.', 'error');*/
drupal_set_message('Congratulations! DWSIM flowsheeting proposal has been marked as completed. User has been notified of the completion.', 'status');
} //$form_state['values']['completed'] == 1
drupal_goto('flowsheeting-project/manage-proposal');