summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashant P. Shah2012-05-29 11:39:37 +0530
committerPrashant P. Shah2012-05-29 11:39:37 +0530
commitc1f99140690e298d4c23ef0f972c85a37e68a427 (patch)
treef97cb76d2e6ca22c079aad47f7e9fbdfeb1f580e
parentee732ad29657ee92e295b70276b9583d930cf59a (diff)
downloadscilab_lab_migration-c1f99140690e298d4c23ef0f972c85a37e68a427.tar.gz
scilab_lab_migration-c1f99140690e298d4c23ef0f972c85a37e68a427.tar.bz2
scilab_lab_migration-c1f99140690e298d4c23ef0f972c85a37e68a427.zip
adds automatic folder creation during installation
Signed-off-by: Prashant P. Shah <pshah.mumbai@gmail.com>
-rwxr-xr-xdependency.inc2
-rwxr-xr-x[-rw-r--r--]email.inc10
-rwxr-xr-xlab_migration.install46
-rwxr-xr-xlab_migration.module2
-rwxr-xr-xlatex.inc3
-rwxr-xr-xmanage_proposal.inc12
-rwxr-xr-xmanage_solution_proposal.inc2
-rwxr-xr-xproposal.inc4
-rwxr-xr-xsolution_proposal.inc2
-rwxr-xr-xupload_code.inc2
10 files changed, 65 insertions, 20 deletions
diff --git a/dependency.inc b/dependency.inc
index 9343f46..a8aaaf0 100755
--- a/dependency.inc
+++ b/dependency.inc
@@ -151,7 +151,7 @@ function upload_dependency_form_submit($form, &$form_state) {
$dependency_names[] = $_FILES['files']['name'][$file_form_name];
$file_upload_counter++;
} else {
- drupal_set_message('Error uploading dependency : ' . $dest_path . '/' . $_FILES['files']['name'][$file_form_name], 'error');
+ drupal_set_message('Error uploading dependency : ' . $dest_path . $_FILES['files']['name'][$file_form_name], 'error');
}
}
}
diff --git a/email.inc b/email.inc
index cdee979..2ee24bd 100644..100755
--- a/email.inc
+++ b/email.inc
@@ -47,7 +47,7 @@ We have received your following Lab migration proposal:
Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->name . '
Email : ' . $user_data->mail . '
-Contact Phone : ' . $proposal_data->contact_ph . '
+Contact No. : ' . $proposal_data->contact_ph . '
Department/Branch : ' . $proposal_data->department . '
University/Institute : ' . $proposal_data->university . '
@@ -104,7 +104,7 @@ Reason for disapproval: ' . $proposal_data->message . '
Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->name . '
Email : ' . $user_data->mail . '
-Contact Phone : ' . $proposal_data->contact_ph . '
+Contact No. : ' . $proposal_data->contact_ph . '
Department/Branch : ' . $proposal_data->department . '
University/Institute : ' . $proposal_data->university . '
@@ -157,7 +157,7 @@ Your following Lab migration proposal has been approved:
Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->name . '
Email : ' . $user_data->mail . '
-Contact Phone : ' . $proposal_data->contact_ph . '
+Contact No. : ' . $proposal_data->contact_ph . '
Department/Branch : ' . $proposal_data->department . '
University/Institute : ' . $proposal_data->university . '
@@ -213,7 +213,7 @@ Following Lab migration has been completed sucessfully :
Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->name . '
Email : ' . $user_data->mail . '
-Contact Phone : ' . $proposal_data->contact_ph . '
+Contact No. : ' . $proposal_data->contact_ph . '
Department/Branch : ' . $proposal_data->department . '
University/Institute : ' . $proposal_data->university . '
@@ -264,7 +264,7 @@ We have received your proposal for solution for following Lab migration :
Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->name . '
Email : ' . $user_data->mail . '
-Contact Phone : ' . $proposal_data->contact_ph . '
+Contact No. : ' . $proposal_data->contact_ph . '
Department/Branch : ' . $proposal_data->department . '
University/Institute : ' . $proposal_data->university . '
diff --git a/lab_migration.install b/lab_migration.install
index 8bdad94..6589a42 100755
--- a/lab_migration.install
+++ b/lab_migration.install
@@ -13,6 +13,15 @@ function lab_migration_install() {
variable_set('lab_migration_dependency_extensions', '');
variable_set('lab_migration_result_extensions', '');
variable_set('lab_migration_xcos_extensions', '');
+
+ // create uploads folder
+ $upload_path = $_SERVER['DOCUMENT_ROOT'] . base_path() . 'lab_migration_uploads';
+ if (!is_dir($upload_path))
+ mkdir($upload_path);
+ if (!is_dir($upload_path . '/latex'))
+ mkdir($upload_path . '/latex');
+ if (!is_dir($upload_path . '/DEPENDENCIES'))
+ mkdir($upload_path . '/DEPENDENCIES');
}
/**
@@ -35,7 +44,7 @@ function lab_migration_uninstall() {
*/
function lab_migration_schema() {
- /* proposal */
+ /* proposal */
$schema['lab_migration_proposal'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
@@ -130,12 +139,47 @@ function lab_migration_schema() {
'type' => 'int',
'not null' => TRUE,
),
+ 'expected_completion_date' => array(
+ 'description' => t('TODO: please describe this field!'),
+ 'type' => 'int',
+ 'not null' => TRUE,
+ ),
'message' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'text',
'size' => 'medium',
'not null' => TRUE,
),
+ 'solution_provider_name_title' => array(
+ 'description' => t('TODO: please describe this field!'),
+ 'type' => 'varchar',
+ 'length' => '5',
+ 'not null' => TRUE,
+ ),
+ 'solution_provider_name' => array(
+ 'description' => t('TODO: please describe this field!'),
+ 'type' => 'varchar',
+ 'length' => '255',
+ 'not null' => TRUE,
+ ),
+ 'solution_provider_contact_ph' => array(
+ 'description' => t('TODO: please describe this field!'),
+ 'type' => 'varchar',
+ 'length' => '15',
+ 'not null' => TRUE,
+ ),
+ 'solution_provider_department' => array(
+ 'description' => t('TODO: please describe this field!'),
+ 'type' => 'varchar',
+ 'length' => '255',
+ 'not null' => TRUE,
+ ),
+ 'solution_provider_university' => array(
+ 'description' => t('TODO: please describe this field!'),
+ 'type' => 'varchar',
+ 'length' => '255',
+ 'not null' => TRUE,
+ ),
),
'primary key' => array('id'),
);
diff --git a/lab_migration.module b/lab_migration.module
index b3bde09..2117482 100755
--- a/lab_migration.module
+++ b/lab_migration.module
@@ -426,7 +426,7 @@ function check_code_number($number = '') {
}
function lab_migration_path() {
- return $_SERVER['DOCUMENT_ROOT'] . base_path() . 'lab_migration/uploads/';
+ return $_SERVER['DOCUMENT_ROOT'] . base_path() . 'lab_migration_uploads/';
}
/************************* USER VERIFICATION FUNCTIONS ************************/
diff --git a/latex.inc b/latex.inc
index c8b4140..9af828b 100755
--- a/latex.inc
+++ b/latex.inc
@@ -193,8 +193,7 @@ function _latex_run_script($lab_filename, $solution_provider_filename, $latex_fi
{
$root_path = lab_migration_path();
$ret = 0;
- chdir("lab_migration");
- chdir("uploads");
+ chdir("lab_migration_uploads");
chdir("latex");
$sh_command = "./pdf_creator.sh " . $lab_filename . " " . $solution_provider_filename . " " . $latex_filename . " " . $latex_dep_filename;
diff --git a/manage_proposal.inc b/manage_proposal.inc
index 4a72198..50fa39f 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -30,7 +30,7 @@ function _proposal_pending_solution()
$pending_q = db_query("SELECT * FROM {lab_migration_proposal} WHERE approval_status = 1 ORDER BY id DESC");
while ($pending_data = db_fetch_object($pending_q))
{
- $pending_rows[$pending_data->id] = array(date('d-m-Y', $pending_data->creation_date), l($pending_data->name, 'user/' . $pending_data->uid), $pending_data->lab_title, $pending_data->department, l('Status', 'lab_migration/manage_proposal/status/' . $pending_data->id));
+ $pending_rows[$pending_data->id] = array(date('d-m-Y', $pending_data->creation_date), date('d-m-Y', $pending_data->approval_date), l($pending_data->name, 'user/' . $pending_data->uid), $pending_data->lab_title, $pending_data->department, l('Status', 'lab_migration/manage_proposal/status/' . $pending_data->id));
}
/* check if there are any pending proposals */
@@ -40,7 +40,7 @@ function _proposal_pending_solution()
return '';
}
- $pending_header = array('Date of Submission', 'Name', 'Title of the Lab', 'Department', 'Action');
+ $pending_header = array('Date of Submission', 'Date of Approval', 'Name', 'Title of the Lab', 'Department', 'Action');
$output = theme_table($pending_header, $pending_rows);
return $output;
}
@@ -149,7 +149,7 @@ function proposal_approval_form($form_state)
$form['contact_ph'] = array(
'#type' => 'item',
'#value' => $proposal_data->contact_ph,
- '#title' => t('Contact Phone No.'),
+ '#title' => t('Contact No.'),
);
$form['department'] = array(
'#type' => 'item',
@@ -333,7 +333,7 @@ function proposal_status_form($form_state)
$form['contact_ph'] = array(
'#type' => 'item',
'#value' => $proposal_data->contact_ph,
- '#title' => t('Contact Phone No.'),
+ '#title' => t('Contact No.'),
);
$form['department'] = array(
'#type' => 'item',
@@ -541,7 +541,7 @@ function proposal_edit_form($form_state)
);
$form['contact_ph'] = array(
'#type' => 'textfield',
- '#title' => t('Contact Phone No.'),
+ '#title' => t('Contact No.'),
'#size' => 30,
'#maxlength' => 15,
'#required' => TRUE,
@@ -812,7 +812,7 @@ function category_edit_form($form_state)
$form['contact_ph'] = array(
'#type' => 'item',
'#value' => $proposal_data->contact_ph,
- '#title' => t('Contact Phone No.'),
+ '#title' => t('Contact No.'),
);
$form['department'] = array(
'#type' => 'item',
diff --git a/manage_solution_proposal.inc b/manage_solution_proposal.inc
index f6acbd7..09c23a8 100755
--- a/manage_solution_proposal.inc
+++ b/manage_solution_proposal.inc
@@ -63,7 +63,7 @@ function solution_proposal_approval_form($form_state)
$form['contact_ph'] = array(
'#type' => 'item',
'#value' => $proposal_data->contact_ph,
- '#title' => t('Contact Phone No.'),
+ '#title' => t('Contact No.'),
);
$form['department'] = array(
'#type' => 'item',
diff --git a/proposal.inc b/proposal.inc
index 44e6435..8be96e8 100755
--- a/proposal.inc
+++ b/proposal.inc
@@ -62,7 +62,7 @@ function lab_migration_proposal_form($form_state)
);
$form['contact_ph'] = array(
'#type' => 'textfield',
- '#title' => t('Contact Phone No.'),
+ '#title' => t('Contact No.'),
'#size' => 30,
'#maxlength' => 15,
'#required' => TRUE,
@@ -114,6 +114,7 @@ function lab_migration_proposal_form($form_state)
'#options' => array('1' => 'Yes', '2' => 'No'),
'#required' => TRUE,
'#default_value' => '1',
+ '#description' => 'If you dont want to provide the solution then it will be opened for the community, anyone may come forward and provide the solution.',
);
$form['solution_display'] = array(
@@ -122,6 +123,7 @@ function lab_migration_proposal_form($form_state)
'#options' => array('1' => 'Yes', '2' => 'No'),
'#required' => TRUE,
'#default_value' => '1',
+ '#description' => 'If yes, solutions will be made available to everyone for downloading.',
);
$form['submit'] = array(
diff --git a/solution_proposal.inc b/solution_proposal.inc
index 04c473e..3ddb024 100755
--- a/solution_proposal.inc
+++ b/solution_proposal.inc
@@ -76,7 +76,7 @@ function lab_migration_solution_proposal_form($form_state)
);
$form['solution_provider_contact_ph'] = array(
'#type' => 'textfield',
- '#title' => t('Contact Phone No.'),
+ '#title' => t('Contact No.'),
'#size' => 30,
'#maxlength' => 15,
'#required' => TRUE,
diff --git a/upload_code.inc b/upload_code.inc
index 71bb8c8..6b79fad 100755
--- a/upload_code.inc
+++ b/upload_code.inc
@@ -475,7 +475,7 @@ function upload_code_form_submit($form, &$form_state) {
);
drupal_set_message($file_name . ' uploaded successfully.', 'status');
} else {
- drupal_set_message('Error uploading file : ' . $dest_path . '/' . $file_name, 'error');
+ drupal_set_message('Error uploading file : ' . $dest_path . $file_name, 'error');
}
}
}