summaryrefslogtreecommitdiff
path: root/manage_proposal.inc
diff options
context:
space:
mode:
authorPrashant S2017-03-16 12:20:38 +0530
committerGitHub2017-03-16 12:20:38 +0530
commitef1ed8a0a9d393daab5f1fe96ae420c617494a41 (patch)
tree4b23d2281ac57c186be9e652b5272ddfe451d3f0 /manage_proposal.inc
parent1d7b705d8b6d1f9c5fc1d9037b6e56bb18786b2d (diff)
parent22a26fe3a2019031246601a3c8e2b33d85384ab4 (diff)
downloaddwsim_flowsheet-ef1ed8a0a9d393daab5f1fe96ae420c617494a41.tar.gz
dwsim_flowsheet-ef1ed8a0a9d393daab5f1fe96ae420c617494a41.tar.bz2
dwsim_flowsheet-ef1ed8a0a9d393daab5f1fe96ae420c617494a41.zip
Merge pull request #4 from prashantsinalkar/drupal_7.x
flowsheeting project reviewer/user interface
Diffstat (limited to 'manage_proposal.inc')
-rwxr-xr-xmanage_proposal.inc63
1 files changed, 33 insertions, 30 deletions
diff --git a/manage_proposal.inc b/manage_proposal.inc
index 3e07608..b1a7a92 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -205,6 +205,11 @@ function dwsim_flowsheet_proposal_approval_form($form, &$form_state)
'#markup' => user_load($proposal_data->uid)->mail,
'#title' => t('Email')
);
+ $form['contributor_contact_no'] = array(
+ '#title' => t('Contact No.'),
+ '#type' => 'item',
+ '#markup' => $proposal_data->contact_no,
+ );
$form['month_year_of_degree'] = array(
'#type' => 'date_popup',
'#title' => t('Month and year of award of degree'),
@@ -294,12 +299,13 @@ function dwsim_flowsheet_proposal_approval_form($form, &$form_state)
'#title' => t('List of compounds from DWSIM Database used in process flowsheet'),
'#markup' => $proposal_data->dwsim_database_compound_name
);
+
$form['user_defined_compounds_used_in_process_flowsheetcompound_name'] = array(
'#type' => 'item',
'#title' => t('List of user defined compounds used in process flowsheet'),
'#markup' => _dwsim_flowsheet_list_of_user_defined_compound($proposal_id)
);
- 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',
@@ -572,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
@@ -588,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',
@@ -604,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,
@@ -713,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',
@@ -724,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');