summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202019-01-03 14:55:19 +0530
committerSashi202019-01-03 14:55:19 +0530
commit357e59106d1839417a0f5ec3b97aa83c9aac717f (patch)
treeb039dc8e056730551882ba50a650567bb150dd2f
parentc3f0071e8267ea15768d61bce2753c8e443fd854 (diff)
downloadom_pssp-357e59106d1839417a0f5ec3b97aa83c9aac717f.tar.gz
om_pssp-357e59106d1839417a0f5ec3b97aa83c9aac717f.tar.bz2
om_pssp-357e59106d1839417a0f5ec3b97aa83c9aac717f.zip
Added validation to project title field to check for same project title
-rwxr-xr-xproposal.inc12
-rwxr-xr-xpssp_details.inc6
2 files changed, 15 insertions, 3 deletions
diff --git a/proposal.inc b/proposal.inc
index 97fa93b..3021700 100755
--- a/proposal.inc
+++ b/proposal.inc
@@ -320,6 +320,18 @@ 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'];
+ $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'));
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),