summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202020-05-20 16:33:26 +0530
committerSashi202020-05-20 16:33:26 +0530
commit119891e3f4c85cdbc3fe6a480ed41eeaf2e16a58 (patch)
treec8f1a9a89312723bcf8d2d06bd1d783978055c7e
parent6d7dd27bb952db535ae095b5b27b33eeb993a034 (diff)
downloadarduino_projects_blog-119891e3f4c85cdbc3fe6a480ed41eeaf2e16a58.tar.gz
arduino_projects_blog-119891e3f4c85cdbc3fe6a480ed41eeaf2e16a58.tar.bz2
arduino_projects_blog-119891e3f4c85cdbc3fe6a480ed41eeaf2e16a58.zip
Modify the file uplaod field type in my proposal form
-rwxr-xr-xarduino_projects_blog.module4
-rwxr-xr-xmanage_proposal.inc54
-rw-r--r--my_proposals.inc2
3 files changed, 22 insertions, 38 deletions
diff --git a/arduino_projects_blog.module b/arduino_projects_blog.module
index 744829e..17d3d3d 100755
--- a/arduino_projects_blog.module
+++ b/arduino_projects_blog.module
@@ -1,8 +1,8 @@
<?php
// $Id$
-error_reporting(E_ALL);
+/*error_reporting(E_ALL);
ini_set('display_errors', TRUE);
-ini_set('display_startup_errors', TRUE);
+ini_set('display_startup_errors', TRUE);*/
require_once('general_deletion.inc');
require_once('email.inc');
/**
diff --git a/manage_proposal.inc b/manage_proposal.inc
index 5dbb985..0eefd43 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -15,7 +15,8 @@ function arduino_projects_blog_proposal_pending()
date('d-m-Y', $pending_data->creation_date),
l($pending_data->contributor_name, 'user/' . $pending_data->uid),
$pending_data->project_title,
- l('View', 'arduino-projects/manage-proposal/approve/' . $pending_data->id) . ' | ' . l('Edit', 'arduino-projects/manage-proposal/edit/' . $pending_data->id)
+ l('View', 'arduino-projects/manage-proposal/approve/' . $pending_data->id)
+ //l('View', 'arduino-projects/manage-proposal/approve/' . $pending_data->id) . ' | ' . l('Edit', 'arduino-projects/manage-proposal/edit/' . $pending_data->id)
);
} //$pending_data = $pending_q->fetchObject()
/* check if there are any pending proposals */
@@ -83,7 +84,8 @@ function arduino_projects_blog_proposal_all()
$proposal_data->project_title,
$actual_completion_date,
$approval_status,
- l('Status', 'arduino-projects/manage-proposal/status/' . $proposal_data->id) . ' | ' . l('Edit', 'arduino-projects/manage-proposal/edit/' . $proposal_data->id)
+ l('Status', 'arduino-projects/manage-proposal/status/' . $proposal_data->id)
+ //l('Status', 'arduino-projects/manage-proposal/status/' . $proposal_data->id) . ' | ' . l('Edit', 'arduino-projects/manage-proposal/edit/' . $proposal_data->id)
);
} //$proposal_data = $proposal_q->fetchObject()
/* check if there are any pending proposals */
@@ -455,7 +457,7 @@ function arduino_projects_blog_proposal_status_form($form, &$form_state)
}
$form['contributor_name'] = array(
'#type' => 'item',
- '#markup' => l($proposal_data->name_title . ' ' . $proposal_data->contributor_name, 'user/' . $proposal_data->uid),
+ '#markup' => l($proposal_data->contributor_name, 'user/' . $proposal_data->uid),
'#title' => t('Student name')
);
$form['student_email_id'] = array(
@@ -503,40 +505,12 @@ function arduino_projects_blog_proposal_status_form($form, &$form_state)
'#markup' => $proposal_data->pincode,
'#title' => t('Pincode/Postal code')
);
- $form['project_guide_name'] = array(
- '#type' => 'item',
- '#title' => t('Project guide'),
- '#markup' => $proposal_data->project_guide_name
- );
- $form['project_guide_email_id'] = array(
- '#type' => 'item',
- '#title' => t('Project guide email'),
- '#markup' => $proposal_data->project_guide_email_id
- );
$form['project_title'] = array(
'#type' => 'item',
'#markup' => $proposal_data->project_title,
'#title' => t('Title of the Project')
);
- if (($proposal_data->samplefilepath != "") && ($proposal_data->samplefilepath != 'NULL'))
- {
- $str = substr($proposal_data->samplefilepath,strrpos($proposal_data->samplefilepath, '/'));
- $resource_file =ltrim($str, '/');
-
- $form['samplefilepath'] = array(
- '#type' => 'item',
- '#title' => t('Abstract file '),
- '#markup' => l($resource_file, 'arduino-projects/download/resource-file/' . $proposal_id) . ""
- );
- } //$proposal_data->user_defined_compound_filepath != ""
- else
- {
- $form['samplefilepath'] = array(
- '#type' => 'item',
- '#title' => t('Abstract file '),
- '#markup' => "Not uploaded<br><br>"
- );
- }
+
/************************** 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);
@@ -556,6 +530,9 @@ function arduino_projects_blog_proposal_status_form($form, &$form_state)
$proposal_status = t('Approved');
break;
case 2:
+ $proposal_status = t('Marked for Resubmission');
+ break;
+ case 4:
$proposal_status = t('Dis-approved');
break;
case 3:
@@ -586,14 +563,21 @@ function arduino_projects_blog_proposal_status_form($form, &$form_state)
'#description' => t('Check if user has provided all the required files and pdfs.')
);
} //$proposal_data->approval_status == 1
- if ($proposal_data->approval_status == 2)
+ else if ($proposal_data->approval_status == 2)
{
$form['message'] = array(
'#type' => 'item',
- '#markup' => $proposal_data->message,
- '#title' => t('Reason for disapproval')
+ '#markup' => $proposal_data->resubmit_comment,
+ '#title' => t('Reason for resubmission')
);
} //$proposal_data->approval_status == 2
+ else if($proposal_data->approval_status == 4){
+ $form['message'] = array(
+ '#type' => 'item',
+ '#markup' => $proposal_data->dissapproval_reason,
+ '#title' => t('Reason for Dis-approval')
+ );
+ }
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit')
diff --git a/my_proposals.inc b/my_proposals.inc
index d79a55f..4c3ff5f 100644
--- a/my_proposals.inc
+++ b/my_proposals.inc
@@ -233,7 +233,7 @@ else{
$temp_no = $i;
$form['reference_files'][$i]['image'] = array(
//'#title' => t('Add Event Image'),
- '#type' => 'managed_file',
+ '#type' => 'file',
'#weight' => '5',
'#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('reference_image_extensions', '') . '</span>',
// We need this to know which file element this is.