summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdwsim_flowsheet.module16
-rwxr-xr-xflowsheet_details.inc70
-rwxr-xr-xproposal.inc11
3 files changed, 87 insertions, 10 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/flowsheet_details.inc b/flowsheet_details.inc
new file mode 100755
index 0000000..e85f03b
--- /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();
+ //$result = db_query($query);
+ if ($result->rowCount() == 0)
+ {
+ $output .= "No completed flowsheet proposal available";
+ }
+ else
+ {
+ $preference_rows = array();
+ $i = 1;
+ while ($row = $result->fetchObject())
+ {
+ $approval_date = date("Y", $row->approval_date);
+ $preference_rows[] = array(
+ $i,
+ $row->university,
+ l($row->project_title, "lab-migration/lab-migration-run/" . $row->id),
+ $approval_date
+ );
+ $i++;
+ }
+ $preference_header = array(
+ 'No',
+ 'Institute',
+ 'Flowsheet Project',
+ '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 .= "Currently no proposals in progress";
+ }
+ else
+ {
+ //$result = db_query($query);
+ $page_content .= "<ol>";
+ while ($row = $result->fetchObject())
+ {
+ $page_content .= "<li>";
+ $page_content .= $row->project_title;
+ $page_content .= "</li>";
+ }
+ $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,