summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdownload.inc1
-rwxr-xr-xom_pssp.module10
-rwxr-xr-xpssp_details.inc12
-rwxr-xr-xrun.inc8
4 files changed, 21 insertions, 10 deletions
diff --git a/download.inc b/download.inc
index a59bd63..60774a1 100755
--- a/download.inc
+++ b/download.inc
@@ -34,6 +34,7 @@ function om_pssp_project_files() {
$query = db_select('om_pssp_submitted_abstracts_file');
$query->fields('om_pssp_submitted_abstracts_file');
$query->condition('proposal_id', $proposal_id);
+ $query->condition('filetype', A);
$result = $query->execute();
$om_pssp_project_files = $result->fetchObject();
//var_dump($om_pssp_project_files);die;
diff --git a/om_pssp.module b/om_pssp.module
index 3f19e4a..fc4da49 100755
--- a/om_pssp.module
+++ b/om_pssp.module
@@ -182,6 +182,16 @@ function om_pssp_menu()
'type' => MENU_CALLBACK,
'file' => 'download.inc'
);
+ $items['powersystems/pssp/download/abstract-file'] = array(
+ 'title' => 'Download abstract file',
+ 'description' => 'Download abstract file',
+ 'page callback' => 'om_pssp_project_files',
+ 'access arguments' => array(
+ 'om pssp download code'
+ ),
+ 'type' => MENU_CALLBACK,
+ 'file' => 'download.inc'
+ );
$items['powersystems/pssp/download/file'] = array(
'title' => 'Code Download',
'description' => 'Code Download',
diff --git a/pssp_details.inc b/pssp_details.inc
index 80c689f..5188c8d 100755
--- a/pssp_details.inc
+++ b/pssp_details.inc
@@ -5,7 +5,7 @@ function om_pssp_completed_proposals_all()
$query = db_select('om_pssp_proposal');
$query->fields('om_pssp_proposal');
$query->condition('approval_status', 3);
- $query->orderBy('actual_completion_date', 'ASC');
+ $query->orderBy('actual_completion_date', 'DESC');
//$query->condition('is_completed', 1);
$result = $query->execute();
@@ -28,24 +28,22 @@ function om_pssp_completed_proposals_all()
$query1->condition('proposal_id', $proposal_id);
$project_files = $query1->execute();
$project_abstract = $project_files->fetchObject();
- $approval_date = date("Y", $row->actual_completion_date);
+ $completion_date = date("Y", $row->actual_completion_date);
$preference_rows[] = array(
$i,
l($row->project_title, "powersystems/pssp/om-pssp-run/" . $row->id),
- l('Download', "powersystems/pssp/download/resource-file/" . $row->id),
$row->contributor_name,
$row->university,
- $approval_date
+ $completion_date
);
$i++;
} //$row = $result->fetchObject()
$preference_header = array(
'No',
'Power System Simulation Project',
- 'Abstract File',
'Contributor Name',
- 'Institute',
- 'Year'
+ 'University / Institute',
+ 'Year of Completion'
);
$output .= theme('table', array(
'header' => $preference_header,
diff --git a/run.inc b/run.inc
index afa7a29..54696f4 100755
--- a/run.inc
+++ b/run.inc
@@ -19,7 +19,7 @@ function om_pssp_run_form($form, &$form_state)
$form = array();
$form['om_pssp'] = array(
'#type' => 'select',
- '#title' => t('Title of the OM PSSP'),
+ '#title' => t('Title of the Power System Simulation'),
'#options' => _list_of_om_pssp(),
'#default_value' => $selected,
'#ajax' => array(
@@ -44,7 +44,8 @@ function om_pssp_run_form($form, &$form_state)
);
$form['selected_om_pssp'] = array(
'#type' => 'item',
- '#markup' => '<div id="ajax_selected_om_pssp">' . l('Download Power System Simulation', 'powersystems/pssp/full-download/project/' . $om_pssp_default_value) . '</div>'
+ '#markup' => '<div id="ajax_selected_om_pssp">' . l('Download Abstract', "powersystems/pssp/download/abstract-file/" . $om_pssp_default_value)
+ . '<br>' . l('Download Power System Simulation', 'powersystems/pssp/full-download/project/' . $om_pssp_default_value) . '</div>'
);
}
return $form;
@@ -58,7 +59,8 @@ function om_pssp_project_details_callback($form, $form_state)
$om_pssp_details = _om_pssp_information($om_pssp_default_value);
$provider = user_load($om_pssp_details->uid);
if ($om_pssp_details->uid > 0) {
- $commands[] = ajax_command_html('#ajax_selected_om_pssp', l('Download Power System Simulation', 'powersystems/pssp/full-download/project/' . $om_pssp_default_value));
+ $commands[] = ajax_command_html('#ajax_selected_om_pssp', l('Download Abstract', "powersystems/pssp/download/abstract-file/" . $om_pssp_default_value)
+ . '<br>' . l('Download Power System Simulation', 'powersystems/pssp/full-download/project/' . $om_pssp_default_value));
} //$om_pssp_details->uid > 0
else {
$commands[] = ajax_command_html('#ajax_selected_om_pssp', '');