summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashant S2017-03-03 12:15:43 +0530
committerGitHub2017-03-03 12:15:43 +0530
commit1d7b705d8b6d1f9c5fc1d9037b6e56bb18786b2d (patch)
treec3e7a5c4591b3362fca216f0840539545a8fd640
parentacbad6d52bad5b5cc85bc9e8a4f24e3922fe3f4a (diff)
parent10d19cc6eca64805e8a80e8115fc1a740e9c354b (diff)
downloaddwsim_flowsheet-1d7b705d8b6d1f9c5fc1d9037b6e56bb18786b2d.tar.gz
dwsim_flowsheet-1d7b705d8b6d1f9c5fc1d9037b6e56bb18786b2d.tar.bz2
dwsim_flowsheet-1d7b705d8b6d1f9c5fc1d9037b6e56bb18786b2d.zip
Merge pull request #3 from prashantsinalkar/drupal_7.x
New page added for flowsheet details
-rwxr-xr-xdwsim_flowsheet.module16
-rwxr-xr-xemail.inc34
-rwxr-xr-xflowsheet_details.inc70
-rwxr-xr-xproposal.inc11
-rwxr-xr-xupload_code.inc224
5 files changed, 267 insertions, 88 deletions
diff --git a/dwsim_flowsheet.module b/dwsim_flowsheet.module
index e3cdb7e..e687f6e 100755
--- a/dwsim_flowsheet.module
+++ b/dwsim_flowsheet.module
@@ -337,22 +337,22 @@ function dwsim_flowsheet_menu()
'file' => 'full_download.inc'
);
/* COMPLETED dwsim flowsheetS */
- $items['flowsheeting-project/completed-labs'] = array(
- 'title' => 'Completed Labs',
- 'page callback' => 'dwsim_flowsheet_completed_labs_all',
+ $items['flowsheeting-project/completed-flowsheet'] = array(
+ 'title' => 'Completed Flowsheet',
+ 'page callback' => 'dwsim_flowsheet_completed_proposals_all',
'access arguments' => array(
'dwsim flowsheet download code'
),
- 'file' => 'lab_details.inc'
+ 'file' => 'flowsheet_details.inc'
);
/* LABS IN PROGRESS */
- $items['flowsheeting-project/labs-progress'] = array(
- 'title' => 'Labs in Progress',
- 'page callback' => 'dwsim_flowsheet_labs_progress_all',
+ $items['flowsheeting-project/flowsheet-progress'] = array(
+ 'title' => 'Flowsheets in Progress',
+ 'page callback' => 'dwsim_flowsheet_progress_all',
'access arguments' => array(
'dwsim flowsheet download code'
),
- 'file' => 'lab_details.inc'
+ 'file' => 'flowsheet_details.inc'
);
/* DOWNLOAD FOR EVERYONE */
$items['flowsheeting-project/dwsim-flowsheet-run'] = array(
diff --git a/email.inc b/email.inc
index a8b34e1..714d1d3 100755
--- a/email.inc
+++ b/email.inc
@@ -347,39 +347,31 @@ FOSSEE,IIT Bombay', array(
);
break;
/**************************************************************/
- case 'solution_uploaded':
- // $solution_q = db_query("SELECT * FROM {dwsim_flowsheet_solution} WHERE id = %d LIMIT 1", $params['solution_uploaded']['solution_id']);
- $query = db_select('dwsim_flowsheet_solution');
- $query->fields('dwsim_flowsheet_solution');
- $query->condition('id', $params['solution_uploaded']['solution_id']);
- $query->range(0, 1);
- $solution_q = $query->execute();
- $solution_data = $solution_q->fetchObject();
- $query = db_select('dwsim_flowsheet_experiment');
- $query->fields('dwsim_flowsheet_experiment');
- $query->condition('id', $solution_data->experiment_id);
+ case 'abstract_uploaded':
+ // $solution_q = db_query("SELECT * FROM {dwsim_flowsheet_solution} WHERE id = %d LIMIT 1", $params['abstract_uploaded']['solution_id']);
+ $query = db_select('dwsim_flowsheet_proposal');
+ $query->fields('dwsim_flowsheet_proposal');
+ $query->condition('id', $params['abstract_uploaded']['proposal_id']);
$query->range(0, 1);
- $experiment_q = $query->execute();
- $experiment_data = $experiment_q->fetchObject();
- $user_data = user_load($params['solution_uploaded']['user_id']);
- $message['subject'] = t('[!site_name] You have uploaded DWSIM flowsheet solution', array(
+ $proposal_data = $query->execute()->fetchObject();
+
+ $user_data = user_load($params['abstract_uploaded']['user_id']);
+ $message['subject'] = t('[!site_name][Flowsheeting Project] You have uploaded DWSIM flowsheet abstract', array(
'!site_name' => variable_get('site_name', '')
), array(
'language' => $language->language
));
- $message['headers'] = $params['solution_uploaded']['headers'];
+ $message['headers'] = $params['abstract_uploaded']['headers'];
$message['body'] = array(
'body' => t('
Dear !user_name,
-You have uploaded the following solution:
+You have uploaded the following Abstract:
-Experiment Title : ' . $experiment_data->title . '
+Project Title : ' . $proposal_data->project_title . '
-Solution number : ' . $solution_data->code_number . '
-Caption : ' . $solution_data->caption . '
-The solution is under review. You will be notified when it has been approved.
+The abstract is under review. You will be notified when it has been approved.
Best Wishes,
diff --git a/flowsheet_details.inc b/flowsheet_details.inc
new file mode 100755
index 0000000..1626754
--- /dev/null
+++ b/flowsheet_details.inc
@@ -0,0 +1,70 @@
+<?php
+// DWSIM Flowsheet display completed proposals
+function dwsim_flowsheet_completed_proposals_all()
+{
+ $output = "";
+ $query = db_select('dwsim_flowsheet_proposal');
+ $query->fields('dwsim_flowsheet_proposal');
+ $query->condition('approval_status', 3);
+ $query->condition('is_completed', 1);
+ $result = $query->execute();
+ if ($result->rowCount() == 0)
+ {
+ $output .= "Work has been completed for the following flowsheets under Flowsheeting Project<hr>";
+ } //$result->rowCount() == 0
+ else
+ {
+ $output .= "Work has been completed for the following flowsheets under Flowsheeting Project <hr>";
+ $preference_rows = array();
+ $i = 1;
+ while ($row = $result->fetchObject())
+ {
+ $approval_date = date("Y", $row->approval_date);
+ $preference_rows[] = array(
+ $i,
+ l($row->project_title, "flowsheeting-project/dwsim-flowsheet-run/" . $row->id),
+ $row->university,
+ $approval_date
+ );
+ $i++;
+ } //$row = $result->fetchObject()
+ $preference_header = array(
+ 'No',
+ 'Flowsheet Project',
+ 'Institute',
+ 'Year'
+ );
+ $output .= theme('table', array(
+ 'header' => $preference_header,
+ 'rows' => $preference_rows
+ ));
+ }
+ return $output;
+}
+// DWSIM Flowsheet display in progress proposals
+function dwsim_flowsheet_progress_all()
+{
+ $page_content = "";
+ $query = db_select('dwsim_flowsheet_proposal');
+ $query->fields('dwsim_flowsheet_proposal');
+ $query->condition('approval_status', 1);
+ $query->condition('is_completed', 0);
+ $result = $query->execute();
+ if ($result->rowCount() == 0)
+ {
+ $page_content .= "Work is in progress for the following flowsheets under Flowsheeting Project<hr>";
+ } //$result->rowCount() == 0
+ else
+ {
+ $page_content .= "Work is in progress for the following flowsheets under Flowsheeting Project<hr>";
+ $page_content .= "<ol>";
+ while ($row = $result->fetchObject())
+ {
+ $page_content .= "<li>";
+ $page_content .= $row->project_title;
+ $page_content .= "</li>";
+ } //$row = $result->fetchObject()
+ $page_content .= "</ol>";
+ }
+ return $page_content;
+}
diff --git a/proposal.inc b/proposal.inc
index 41a6508..03369ef 100755
--- a/proposal.inc
+++ b/proposal.inc
@@ -14,6 +14,10 @@ Solution Display :
0 - No
1 - Yes
+
+is_completed
+0 - in progress
+1 - Completed
Tables :
dwsim_flowsheet_solution : approval_status
0 - Pending
@@ -628,7 +632,8 @@ function dwsim_flowsheet_proposal_form_submit($form, &$form_state)
process_development_compound_name,
process_development_compound_cas_number,
dwsim_database_compound_name,
- approval_status,
+ approval_status,
+ is_completed,
dissapproval_reason,
creation_date,
approval_date,
@@ -655,7 +660,8 @@ function dwsim_flowsheet_proposal_form_submit($form, &$form_state)
:process_development_compound_name,
:process_development_compound_cas_number,
:dwsim_database_compound_name,
- :approval_status,
+ :approval_status,
+ :is_completed,
:dissapproval_reason,
:creation_date,
:approval_date,
@@ -683,6 +689,7 @@ function dwsim_flowsheet_proposal_form_submit($form, &$form_state)
":process_development_compound_cas_number" => $v['process_development_compound_cas_no'],
":dwsim_database_compound_name" => trim($v['dwsim_database_compound_name']),
":approval_status" => 0,
+ ":is_completed" => 0,
":dissapproval_reason" => "NULL",
":creation_date" => time(),
":approval_date" => 0,
diff --git a/upload_code.inc b/upload_code.inc
index 2b53a89..49f5ed7 100755
--- a/upload_code.inc
+++ b/upload_code.inc
@@ -3,34 +3,126 @@
function dwsim_flowsheet_abstract()
{
global $user;
+ $return_html = "";
$proposal_data = dwsim_flowsheet_get_proposal();
if (!$proposal_data)
{
drupal_goto('');
return;
} //!$proposal_data
- $return_html = '<strong>Title of the Flowsheet Project:</strong><br />' . $proposal_data->project_title . '<br /><br />';
- $return_html .= '<strong>Proposer Name:</strong><br />' . $proposal_data->name_title . ' ' . $proposal_data->student_name . '<br /><br />';
- $return_html .= l('Upload abstract', 'flowsheeting-project/abstract-code/upload') . '<br />';
+
+ //$return_html .= l('Upload abstract', 'flowsheeting-project/abstract-code/upload') . '<br />';
/* get experiment list */
$experiment_rows = array();
//$experiment_q = db_query("SELECT * FROM {dwsim_flowsheet_experiment} WHERE proposal_id = %d ORDER BY number ASC", $proposal_data->id);
- $query = db_select('dwsim_flowsheet_experiment');
- $query->fields('dwsim_flowsheet_experiment');
+
+ $query = db_select('dwsim_flowsheet_submitted_abstracts');
+ $query->fields('dwsim_flowsheet_submitted_abstracts');
$query->condition('proposal_id', $proposal_data->id);
- $query->orderBy('number', 'ASC');
- $experiment_q = $query->execute();
- $experiment_header = array(
- 'No. Uploaded File',
- 'Type',
- 'Status',
- 'Actions'
+ $abstracts_q = $query->execute()->fetchObject();
+
+ $query_pro = db_select('dwsim_flowsheet_proposal');
+ $query_pro->fields('dwsim_flowsheet_proposal');
+ $query_pro->condition('id', $proposal_data->id);
+ $abstracts_pro = $query_pro->execute()->fetchObject();
+
+
+ $query_pdf = db_select('dwsim_flowsheet_submitted_abstracts_file');
+ $query_pdf->fields('dwsim_flowsheet_submitted_abstracts_file');
+ $query_pdf->condition('proposal_id', $proposal_data->id);
+ $query_pdf->condition('filetype', 'A');
+
+ $abstracts_pdf = $query_pdf->execute()->fetchObject();
+
+ if($abstracts_pdf == TRUE){
+ if($abstracts_pdf->filename !="NULL" || $abstracts_pdf->filename != "" ){
+ $abstract_filename = $abstracts_pdf->filename;
+ }else{
+ $abstract_filename = "File not uploaded";
+ }
+ }else{
+ $abstract_filename = "File not uploaded";
+ }
+
+
+ $query_process = db_select('dwsim_flowsheet_submitted_abstracts_file');
+ $query_process->fields('dwsim_flowsheet_submitted_abstracts_file');
+ $query_process->condition('proposal_id', $proposal_data->id);
+ $query_process->condition('filetype', 'S');
+
+ $abstracts_query_process = $query_process->execute()->fetchObject();
+
+
+ if($abstracts_query_process == TRUE){
+ if($abstracts_query_process->filename !="NULL" || $abstracts_query_process->filename != "" ){
+ $abstracts_query_process_filename = $abstracts_query_process->filename;
+ }else{
+ $abstracts_query_process_filename = "File not uploaded";
+ }
+ }else{
+ $abstracts_query_process_filename = "File not uploaded";
+ }
+ if($abstracts_q->is_submitted == ''){
+ $url = l('Upload abstract', 'flowsheeting-project/abstract-code/upload');
+ }
+ else if($abstracts_q->is_submitted == 1){
+ $url= "";
+ }else if($abstracts_q->is_submitted == 0 ){
+ $url= l('Edit abstract', 'flowsheeting-project/abstract-code/edit');
+
+ }
+ if($abstracts_q->unit_operations_used_in_dwsim ==''){
+ $unit_operations_used_in_dwsim = "Not entered";
+ }else{
+
+ $unit_operations_used_in_dwsim = $abstracts_q->unit_operations_used_in_dwsim;
+ }
+
+ if($abstracts_q->thermodynamic_packages_used ==''){
+ $thermodynamic_packages_used = "Not entered";
+ }else{
+
+ $thermodynamic_packages_used = $abstracts_q->thermodynamic_packages_used;
+ }
+ if($abstracts_q->logical_blocks_used ==''){
+ $logical_blocks_used = "Not entered";
+ }else{
+
+ $logical_blocks_used = $abstracts_q->logical_blocks_used;
+ }
+
+ $headers = array(
+ "Name of compound for which process development is carried out",
+ "CAS No."
+ );
+ $rows = array();
+ $item = array(
+ "{$proposal_data->process_development_compound_name}",
+ "{$proposal_data->process_development_compound_cas_number}"
);
- // $return_html .= theme_table($experiment_header, $experiment_rows);
- $return_html .= theme('table', array(
- 'header' => $experiment_header,
- 'rows' => $experiment_rows
+ array_push($rows, $item);
+ $prodata = theme('table', array(
+ 'header' => $headers,
+ 'rows' => $rows
));
+
+ $return_html .= '<strong>Proposer Name:</strong><br />' . $proposal_data->name_title . ' ' . $proposal_data->contributor_name . '<br /><br />';
+
+ $return_html .= '<strong>Title of the Flowsheet Project:</strong><br />' . $proposal_data->project_title . '<br /><br />';
+
+
+ $return_html .= '<strong>DWSIM version:</strong><br />' . $proposal_data->version . '<br /><br />';
+
+ $return_html .= '<strong>Unit Operations used in DWSIM:</strong><br />' . $unit_operations_used_in_dwsim . '<br /><br />';
+ $return_html .= '<strong>Thermodynamic Packages Used:</strong><br />' . $thermodynamic_packages_used . '<br /><br />';
+ $return_html .= '<strong>Logical Blocks used:</strong><br />' . $logical_blocks_used . '<br /><br />';
+ $return_html .= '<strong>Name of compound for which process development is carried out:</strong><br />' .$prodata . '<br />';
+ $return_html .= '<strong>List of compounds from DWSIM Database used in process flowsheet:</strong><br />' . $proposal_data->dwsim_database_compound_name . '<br /><br />';
+ $return_html .= '<strong>List of user defined compounds used in process flowsheet:</strong><br />' . _dwsim_flowsheet_list_of_user_defined_compound($proposal_data->id) . '<br />';
+ $return_html .= '<strong>Uploaded an abstract (brief outline) of the project:</strong><br />' . $abstract_filename . '<br /><br />';
+ $return_html .= '<strong>Upload the DWSIM flowsheet for the developed process:</strong><br />' . $abstracts_query_process_filename . '<br /><br />';
+ $return_html .= $url . '<br />';
+
return $return_html;
}
function dwsim_flowsheet_upload_abstract_code_form($form, &$form_state)
@@ -82,6 +174,7 @@ function dwsim_flowsheet_upload_abstract_code_form($form, &$form_state)
'#title' => t('Unit Operations used in DWSIM'),
'#options' => _df_list_of_unit_operations(),
'#required' => TRUE,
+ '#size' => '20',
'#multiple' => TRUE,
'#description' => t('[You can select multiple options by holding ctrl + left key of mouse]')
);
@@ -90,6 +183,7 @@ function dwsim_flowsheet_upload_abstract_code_form($form, &$form_state)
'#title' => t('Thermodynamic Packages Used'),
'#options' => _df_list_of_thermodynamic_packages(),
'#required' => TRUE,
+ '#size' => '20',
'#multiple' => TRUE,
'#description' => t('[You can select multiple options by holding ctrl + left key of mouse]')
);
@@ -97,30 +191,37 @@ function dwsim_flowsheet_upload_abstract_code_form($form, &$form_state)
'#type' => 'select',
'#title' => t('Logical Blocks used (If any)'),
'#options' => _df_list_of_logical_block(),
- '#required' => TRUE,
'#multiple' => TRUE,
'#description' => t('[You can select multiple options by holding ctrl + left key of mouse]')
);
+ $headers = array(
+ "User defined compound",
+ "CAS No."
+ );
+ $rows = array();
+ $item = array(
+ "{$proposal_data->process_development_compound_name}",
+ "{$proposal_data->process_development_compound_cas_number}"
+ );
+ array_push($rows, $item);
+ $prodata = theme('table', array(
+ 'header' => $headers,
+ 'rows' => $rows
+ ));
$form['process_development_compound_name'] = array(
- '#type' => 'textfield',
+ '#type' => 'item',
'#title' => t('Name of compound for which process development is carried out'),
- '#size' => 50,
- '#description' => t('Mention the compound name with CAS No as shown below:
-Ex: Ethanol (64-17-5)')
+ '#markup' => $prodata
);
+ //var_dump( _df_list_of_dwsim_compound($proposal_data->id));die;
$form['list_of_compounds_from_dwsim_database_used_in_process_flowsheet'] = array(
- '#type' => 'select',
+ '#type' => 'textfield',
'#title' => t('List of compounds from DWSIM Database used in process flowsheet'),
- '#options' => _df_list_of_dwsim_compound(),
- '#multiple' => TRUE,
- '#description' => t('[You can select multiple options by holding ctrl + left key of mouse]')
- );
- $form['user_defined_compounds_used_in_process_flowsheetcompound_name'] = array(
- '#type' => 'textarea',
- '#title' => t('List of user defined compounds used in process flowsheet'),
- '#required' => FALSE,
- '#description' => 'List all user defined compounds with CAS No. as in format - Ex: Ethylene (74-85-1)'
+ '#value' => $proposal_data->dwsim_database_compound_name,
+ '#size' => 20,
+ '#disabled' => TRUE,
);
+
$form['upload_an_abstract'] = array(
'#type' => 'file',
'#title' => t('Upload an abstract (brief outline) of the project.'),
@@ -141,6 +242,7 @@ Ex: Ethanol (64-17-5)')
);
return $form;
}
+
function dwsim_flowsheet_upload_abstract_code_form_validate($form, &$form_state)
{
if ($form_state['values']['unit_operations_used_in_dwsim'])
@@ -153,11 +255,15 @@ function dwsim_flowsheet_upload_abstract_code_form_validate($form, &$form_state)
$thermodynamic_packages_used = implode(", ", $_POST['thermodynamic_packages_used']);
$form_state['values']['thermodynamic_packages_used'] = $thermodynamic_packages_used;
} //$form_state['values']['thermodynamic_packages_used']
- if ($form_state['values']['logical_blocks_used'])
+ if($form_state['values']['logical_blocks_used'] != ""){
+ if ($form_state['values']['logical_blocks_used'])
{
$logical_blocks_used = implode(", ", $_POST['logical_blocks_used']);
$form_state['values']['logical_blocks_used'] = $logical_blocks_used;
} //$form_state['values']['logical_blocks_used']
+ }else{
+ $form_state['values']['logical_blocks_used'] = "Not entered";
+ }
if ($form_state['values']['list_of_compounds_from_dwsim_database_used_in_process_flowsheet'])
{
$list_of_compounds_from_dwsim_database_used_in_process_flowsheet = implode(", ", $_POST['list_of_compounds_from_dwsim_database_used_in_process_flowsheet']);
@@ -221,16 +327,23 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
return;
} //!$proposal_data
$proposal_id = $proposal_data->id;
- $proposal_drectory = $proposal_data->directory_name;
+ $proposal_directory = $proposal_data->directory_name;
/* create proposal folder if not present */
- $dest_path = $proposal_drectory . '/';
+ $dest_path = $proposal_directory . '/';
if (!is_dir($root_path . $dest_path))
mkdir($root_path . $dest_path);
/* creating solution database entry */
- $query = "INSERT INTO {dwsim_flowsheet_submitted_abstracts} (proposal_id, approver_uid, abstract_approval_status, unit_operations_used_in_dwsim, thermodynamic_packages_used, logical_blocks_used, process_development_compound_name, list_of_compounds_from_dwsim_database_used_in_process_flowsheet, user_defined_compounds_used_in_process_flowsheet, abstract_upload_date, abstract_approval_date) VALUES (:proposal_id, :approver_uid, :abstract_approval_status, :unit_operations_used_in_dwsim,
- :thermodynamic_packages_used, :logical_blocks_used, :process_development_compound_name,
- :list_of_compounds_from_dwsim_database_used_in_process_flowsheet,
- :user_defined_compounds_used_in_process_flowsheet, :abstract_upload_date, :abstract_approval_date)";
+ $query = "INSERT INTO {dwsim_flowsheet_submitted_abstracts} (
+ proposal_id,
+ approver_uid,
+ abstract_approval_status,
+ unit_operations_used_in_dwsim,
+ thermodynamic_packages_used,
+ logical_blocks_used,
+ abstract_upload_date,
+ abstract_approval_date,
+ is_submitted) VALUES (:proposal_id, :approver_uid, :abstract_approval_status, :unit_operations_used_in_dwsim,
+ :thermodynamic_packages_used, :logical_blocks_used, :abstract_upload_date, :abstract_approval_date, :is_submitted)";
$args = array(
":proposal_id" => $proposal_id,
":approver_uid" => 0,
@@ -238,11 +351,9 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
":unit_operations_used_in_dwsim" => $v['unit_operations_used_in_dwsim'],
":thermodynamic_packages_used" => $v['thermodynamic_packages_used'],
":logical_blocks_used" => $v['logical_blocks_used'],
- ":process_development_compound_name" => $v['process_development_compound_name'],
- ":list_of_compounds_from_dwsim_database_used_in_process_flowsheet" => $v['list_of_compounds_from_dwsim_database_used_in_process_flowsheet'],
- ":user_defined_compounds_used_in_process_flowsheet" => $v['user_defined_compounds_used_in_process_flowsheetcompound_name'],
":abstract_upload_date" => time(),
- ":abstract_approval_date" => 0
+ ":abstract_approval_date" => 0,
+ ":is_submitted" => 1
);
$submitted_abstract_id = db_query($query, $args, array(
'return' => Database::RETURN_INSERT_ID
@@ -253,30 +364,29 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
if ($file_name)
{
/* checking file type */
- if (strstr($file_form_name, 'source'))
- $file_type = 'S';
- else if (strstr($file_form_name, 'result'))
- $file_type = 'R';
- else if (strstr($file_form_name, 'xcos'))
- $file_type = 'X';
+ if (strstr($file_form_name, 'upload_flowsheet_developed_process'))
+ $file_type = 'S';
+ else if (strstr($file_form_name, 'upload_an_abstract'))
+ $file_type = 'A';
else
$file_type = 'U';
if (file_exists($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]))
{
- drupal_set_message(t("Error uploading file. File !filename already exists.", array(
+ unlink($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]);
+ drupal_set_message(t("File !filename already exists hence overwirtten the exisitng file ", array(
'!filename' => $_FILES['files']['name'][$file_form_name]
)), 'error');
- return;
} //file_exists($root_path . $dest_path . $_FILES['files']['name'][$file_form_name])
/* uploading file */
if (move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name]))
{
/* for uploaded files making an entry in the database */
- $query = "INSERT INTO {dwsim_flowsheet_submitted_abstracts_file} (submitted_abstract_id, proposal_id,approvar_uid, filename, filepath, filemime, filesize, filetype, timestamp)
- VALUES (:submitted_abstract_id, :proposal_id,:approvar_uid, :filename, :filepath, :filemime, :filesize, :filetype, :timestamp)";
+ $query = "INSERT INTO {dwsim_flowsheet_submitted_abstracts_file} (submitted_abstract_id, proposal_id, uid, approvar_uid, filename, filepath, filemime, filesize, filetype, timestamp)
+ VALUES (:submitted_abstract_id, :proposal_id, :uid, :approvar_uid, :filename, :filepath, :filemime, :filesize, :filetype, :timestamp)";
$args = array(
":submitted_abstract_id" => $submitted_abstract_id,
":proposal_id" => $proposal_id,
+ ":uid" => $user->uid,
":approvar_uid" => 0,
":filename" => $_FILES['files']['name'][$file_form_name],
":filepath" => $file_path . $_FILES['files']['name'][$file_form_name],
@@ -294,15 +404,15 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
}
} //$file_name
} //$_FILES['files']['name'] as $file_form_name => $file_name
- drupal_set_message('Solution uploaded successfully.', 'status');
+ drupal_set_message('Abstract uploaded successfully.', 'status');
/* sending email */
$email_to = $user->mail;
$from = variable_get('dwsim_flowsheet_from_email', '');
$bcc = variable_get('dwsim_flowsheet_emails', '');
$cc = variable_get('dwsim_flowsheet_cc_emails', '');
- $params['solution_uploaded']['solution_id'] = $solution_id;
- $params['solution_uploaded']['user_id'] = $user->uid;
- $params['solution_uploaded']['headers'] = array(
+ $params['abstract_uploaded']['submitted_abstract_id'] = $submitted_abstract_id;
+ $params['abstract_uploaded']['user_id'] = $user->uid;
+ $params['abstract_uploaded']['headers'] = array(
'From' => $from,
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes',
@@ -311,7 +421,7 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
'Cc' => $cc,
'Bcc' => $bcc
);
- if (!drupal_mail('dwsim_flowsheet', 'solution_uploaded', $email_to, language_default(), $params, $from, TRUE))
+ if (!drupal_mail('dwsim_flowsheet', 'abstract_uploaded', $email_to, language_default(), $params, $from, TRUE))
drupal_set_message('Error sending email message.', 'error');
drupal_goto('flowsheeting-project/abstract-code');
}