summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcfd_case_study_details.inc2
-rwxr-xr-xmanage_proposal.inc22
-rwxr-xr-xproposal.inc28
3 files changed, 49 insertions, 3 deletions
diff --git a/cfd_case_study_details.inc b/cfd_case_study_details.inc
index 751965d..99254f0 100755
--- a/cfd_case_study_details.inc
+++ b/cfd_case_study_details.inc
@@ -34,6 +34,7 @@ function cfd_case_study_completed_proposals_all()
$preference_rows[] = array(
$i,
l($row->project_title, "case-study-project/case-study-run/" . $row->id),
+ $row->solver_used,
l('Download', "case-study-project/download/project-file/" . $row->id),
$row->contributor_name,
$row->university,
@@ -44,6 +45,7 @@ function cfd_case_study_completed_proposals_all()
$preference_header = array(
'No',
'Case Study Project',
+ 'Solver used',
'Abstract File',
'Contributor Name',
'Institute',
diff --git a/manage_proposal.inc b/manage_proposal.inc
index 90e732f..74c663b 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -195,6 +195,11 @@ function cfd_case_study_proposal_approval_form($form, &$form_state)
'#markup' => $proposal_data->project_title,
'#title' => t('Title of the Case Study Project')
);
+ $form['solver_used'] = array(
+ '#type' => 'item',
+ '#markup' => $proposal_data->solver_used,
+ '#title' => t('Solver used')
+ );
$form['date_of_proposal'] = array(
'#type' => 'textfield',
'#title' => t('Date of Proposal'),
@@ -437,6 +442,11 @@ function cfd_case_study_proposal_status_form($form, &$form_state)
'#markup' => $proposal_data->project_title,
'#title' => t('Title of the Case Study Project')
);
+ $form['solver_used'] = array(
+ '#type' => 'item',
+ '#markup' => $proposal_data->solver_used,
+ '#title' => t('Solver used')
+ );
/************************** reference link filter *******************/
$url = '~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i';
$reference = preg_replace($url, '<a href="$0" target="_blank" title="$0">$0</a>', $proposal_data->reference);
@@ -614,7 +624,6 @@ function cfd_case_study_proposal_edit_form($form, &$form_state)
'Dr' => 'Dr',
'Prof' => 'Prof',
'Mr' => 'Mr',
- 'Mrs' => 'Mrs',
'Ms' => 'Ms'
),
'#required' => TRUE,
@@ -754,6 +763,14 @@ function cfd_case_study_proposal_edit_form($form, &$form_state)
'#required' => TRUE,
'#default_value' => $proposal_data->project_title
);
+ $form['solver_used'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Solver to be used'),
+ '#size' => 50,
+ '#maxlength' => 50,
+ '#required' => TRUE,
+ '#default_value' => $proposal_data->solver_used
+ );
$form['date_of_proposal'] = array(
'#type' => 'textfield',
'#title' => t('Date of Proposal'),
@@ -838,6 +855,7 @@ function cfd_case_study_proposal_edit_form_submit($form, &$form_state)
/* update proposal */
$v = $form_state['values'];
$project_title = $v['project_title'];
+ $solver_used = $v['solver_used'];
$proposar_name = $v['name_title'] . ' ' . $v['contributor_name'];
$university = $v['university'];
$directory_names = _df_dir_name($project_title, $proposar_name);
@@ -857,6 +875,7 @@ function cfd_case_study_proposal_edit_form_submit($form, &$form_state)
pincode=:pincode,
state=:state,
project_title=:project_title,
+ solver_used=:solver_used,
directory_name=:directory_name
WHERE id=:proposal_id";
$args = array(
@@ -867,6 +886,7 @@ function cfd_case_study_proposal_edit_form_submit($form, &$form_state)
':pincode' => $v['pincode'],
':state' => $v['all_state'],
':project_title' => $project_title,
+ ":solver_used" => $solver_used,
':directory_name' => $directory_name,
':proposal_id' => $proposal_id
);
diff --git a/proposal.inc b/proposal.inc
index 3728ff9..ba174a3 100755
--- a/proposal.inc
+++ b/proposal.inc
@@ -58,7 +58,6 @@ function cfd_case_study_proposal_form($form, &$form_state, $no_js_use = FALSE)
'Dr' => 'Dr',
'Prof' => 'Prof',
'Mr' => 'Mr',
- 'Mrs' => 'Mrs',
'Ms' => 'Ms'
),
'#required' => TRUE
@@ -207,6 +206,13 @@ function cfd_case_study_proposal_form($form, &$form_state, $no_js_use = FALSE)
'#description' => t('Maximum character limit is 250'),
'#required' => TRUE
);
+ $form['solver_used'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Solver to be used'),
+ '#size' => 50,
+ '#description' => t('Maximum character limit is 50'),
+ '#required' => TRUE
+ );
$form['abstract_file'] = array(
'#type' => 'fieldset',
'#title' => t('Submit an Abstract'),
@@ -216,7 +222,7 @@ function cfd_case_study_proposal_form($form, &$form_state, $no_js_use = FALSE)
$form['abstract_file']['abstract_file_path'] = array(
'#type' => 'file',
'#size' => 48,
- '#description' => t('Upload filenames with allowed extensions only. No spaces or any special characters allowed in filename.') . '<br />' . t('<span style="color:red;">Allowed file extensions : ') . variable_get('resource_upload_extensions', '') . '</span>'
+ '#description' => t('<span style="color:red;">Upload filenames with allowed extensions only. No spaces or any special characters allowed in filename.</span>') . '<br />' . t('<span style="color:red;">Allowed file extensions : ') . variable_get('resource_upload_extensions', '') . '</span>'
);
$form['date_of_proposal'] = array(
'#type' => 'date_popup',
@@ -324,6 +330,21 @@ function cfd_case_study_proposal_form_validate($form, &$form_state)
{
form_set_error('project_title', t('Project title shoud not be empty'));
}
+ if ($form_state['values']['solver_used'] != '')
+ {
+ if (strlen($form_state['values']['solver_used']) > 50)
+ {
+ form_set_error('solver_used', t('Maximum charater limit is 50 charaters only, please check the length of the solver used'));
+ } //strlen($form_state['values']['project_title']) > 250
+ else if (strlen($form_state['values']['solver_used']) < 7)
+ {
+ form_set_error('project_title', t('Minimum charater limit is 7 charaters, please check the length of the solver used'));
+ } //strlen($form_state['values']['project_title']) < 10
+ } //$form_state['values']['project_title'] != ''
+ else
+ {
+ form_set_error('solver_used', t('Solver used cannot be empty'));
+ }
if(strtotime(date($form_state['values']['expected_date_of_completion'])) < time())
{
form_set_error('expected_date_of_completion', t('Completion date should not be earlier than proposal date'));
@@ -385,6 +406,7 @@ function cfd_case_study_proposal_form_submit($form, &$form_state)
state,
country,
project_title,
+ solver_used,
directory_name,
approval_status,
is_completed,
@@ -406,6 +428,7 @@ function cfd_case_study_proposal_form_submit($form, &$form_state)
:state,
:country,
:project_title,
+ :solver_used,
:directory_name,
:approval_status,
:is_completed,
@@ -427,6 +450,7 @@ function cfd_case_study_proposal_form_submit($form, &$form_state)
":state" => $v['all_state'],
":country" => $v['country'],
":project_title" => $v['project_title'],
+ ":solver_used" => $v['solver_used'],
":directory_name" => $directory_name,
":approval_status" => 0,
":is_completed" => 0,