summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202019-01-04 16:26:53 +0530
committerGitHub2019-01-04 16:26:53 +0530
commiteb845474255dfba5875421b3aa1f9bffc1e4a49c (patch)
tree5c3e9d33ac02414feb2055c8d0693f9f97a4f4bc
parent87245eabf40f9ab78597e154415a1183eabdc84a (diff)
parenta012a3b1054ab1947a6302b8808285601e97974c (diff)
downloadom_pssp-eb845474255dfba5875421b3aa1f9bffc1e4a49c.tar.gz
om_pssp-eb845474255dfba5875421b3aa1f9bffc1e4a49c.tar.bz2
om_pssp-eb845474255dfba5875421b3aa1f9bffc1e4a49c.zip
Merge pull request #5 from Sashi20/master
Modifications in the proposal and manage proposal interface
-rwxr-xr-xmanage_proposal.inc8
-rwxr-xr-xproposal.inc26
-rwxr-xr-xpssp_details.inc6
3 files changed, 32 insertions, 8 deletions
diff --git a/manage_proposal.inc b/manage_proposal.inc
index 0a421f2..8f8f08a 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -828,6 +828,14 @@ else{
'#required' => TRUE,
'#default_value' => $proposal_data->project_title
);
+ $form['description'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Description of the Project'),
+ '#size' => 250,
+ '#maxlength' => 250,
+ '#required' => TRUE,
+ '#default_value' => $proposal_data->description
+ );
$form['reference'] = array(
'#type' => 'textarea',
'#title' => t('Reference'),
diff --git a/proposal.inc b/proposal.inc
index 97fa93b..d574127 100755
--- a/proposal.inc
+++ b/proposal.inc
@@ -75,7 +75,8 @@ function om_pssp_proposal_form($form, &$form_state, $no_js_use = FALSE)
'placeholder' => t('Enter your full name.....')
),
'#maxlength' => 250,
- '#required' => TRUE
+ '#required' => TRUE,
+ '#description' => t('<span style="color:red;">Kindly enter the names (maximum three) in the following format: Name1, Name2 and Name3</span>'),
);
$form['contributor_contact_no'] = array(
'#type' => 'textfield',
@@ -259,8 +260,8 @@ function om_pssp_proposal_form($form, &$form_state, $no_js_use = FALSE)
$form['description'] = array(
'#type' => 'textarea',
'#title' => t('Description of Proposed Simulation'),
- '#size' => 120,
- '#description' => t('Maximum character limit is 120, minimum 60'),
+ '#size' => 250,
+ '#description' => t('Maximum character limit is 250, minimum 60'),
'#required' => TRUE
);
$form['reference'] = array(
@@ -320,6 +321,21 @@ function om_pssp_proposal_form($form, &$form_state, $no_js_use = FALSE)
}
function om_pssp_proposal_form_validate($form, &$form_state)
{
+ $project_title = $form_state['values']['project_title'];
+ /*$proposar_name = $form_state['values']['name_title'] . ' ' . $form_state['values']['contributor_name'];
+ $directory_name = _df_dir_name($project_title, $proposar_name);*/
+ //var_dump($directory_name);die;
+ $query = db_select('om_pssp_proposal');
+ $query->fields('om_pssp_proposal');
+ $query->condition('project_title', $project_title);
+ //$query->condition('id', $pref_id);
+ $result = $query->execute()->rowCount();
+ //var_dump($result);die;
+ if ($result >= 1)
+ {
+ form_set_error('project_title', t('Project title name already exists'));
+ return;
+ }
if ($form_state['values']['term_condition'] == '1')
{
form_set_error('term_condition', t('Please check the terms and conditions'));
@@ -393,9 +409,9 @@ function om_pssp_proposal_form_validate($form, &$form_state)
$form_state['values']['description'] = trim($form_state['values']['description']);
if ($form_state['values']['description'] != '')
{
- if (strlen($form_state['values']['description']) > 120)
+ if (strlen($form_state['values']['description']) > 250)
{
- form_set_error('description', t('Maximum charater limit is 120 charaters only, please check the length of the description'));
+ form_set_error('description', t('Maximum charater limit is 250 charaters only, please check the length of the description'));
} //strlen($form_state['values']['project_title']) > 250
else if (strlen($form_state['values']['description']) < 60)
{
diff --git a/pssp_details.inc b/pssp_details.inc
index 28810fa..dc25c14 100755
--- a/pssp_details.inc
+++ b/pssp_details.inc
@@ -26,9 +26,9 @@ function om_pssp_completed_proposals_all()
$query1->fields('om_pssp_submitted_abstracts_file');
$query1->condition('file_approval_status', 1);
$query1->condition('proposal_id', $proposal_id);
- $esim_project_files = $query1->execute();
- $esim_project_abstract = $esim_project_files->fetchObject();
- $approval_date = date("Y", $row->approval_date);
+ $project_files = $query1->execute();
+ $project_abstract = $project_files->fetchObject();
+ $approval_date = date("Y", $row->actual_completion_date);
$preference_rows[] = array(
$i,
l($row->project_title, "powersystems/pssp/om-pssp-run/" . $row->id),