summaryrefslogtreecommitdiff
path: root/manage_proposal.inc
diff options
context:
space:
mode:
authorSashi202020-10-23 11:55:58 +0530
committerGitHub2020-10-23 11:55:58 +0530
commit5da0716b6cd5639380e85d3668b9e61815e7288c (patch)
tree03330c71c78f7bb4b3c5afc594d2e613094e9788 /manage_proposal.inc
parent291539fd4129bc4b15ca5c080b1b4f17ac534649 (diff)
parent4a1112c54ebbef6733f882b5bc825406c3f39c83 (diff)
downloadr_textbook_companion-5da0716b6cd5639380e85d3668b9e61815e7288c.tar.gz
r_textbook_companion-5da0716b6cd5639380e85d3668b9e61815e7288c.tar.bz2
r_textbook_companion-5da0716b6cd5639380e85d3668b9e61815e7288c.zip
Merge pull request #45 from Sashi20/drupal_7.x
Fix issue with renaming directory in manage proposal
Diffstat (limited to 'manage_proposal.inc')
-rwxr-xr-xmanage_proposal.inc20
1 files changed, 12 insertions, 8 deletions
diff --git a/manage_proposal.inc b/manage_proposal.inc
index 0357a6a..6590419 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -1324,7 +1324,8 @@ function proposal_edit_form_submit($form, &$form_state)
));
$query->condition('id', $preference1_id);
$num_updated = $query->execute();
- }
+ }
+ CreateReadmeFileTextbookCompanion($proposal_id);
drupal_set_message(t('Proposal Updated'), 'status');
}
/*function default_value_for_selections($id)
@@ -1787,17 +1788,20 @@ function RenameDir($preference_id, $dir_name)
':preference_id' => $preference_id
));
$result = $query->fetchObject();
+ //var_dump($result->id);die;
if ($result != NULL) {
$files = scandir(textbook_companion_path());
- $files_id_dir = textbook_companion_path() . $result->id;
- $file_dir = textbook_companion_path() . $result->directory_name;
- if (is_dir($file_dir)) {
- $new_directory_name = rename(textbook_companion_path() . $result->directory_name, textbook_companion_path() . $dir_name);
- CreateReadmeFileTextbookCompanion($result->proposal_id);
+ //$files_id_dir = textbook_companion_path() . $result->id;
+ $old_file_dir = textbook_companion_path() . $result->directory_name;
+ $new_file_dir = textbook_companion_path() . $dir_name;
+ //var_dump('Old dir:' . $old_file_dir . ' New dir' . $new_file_dir);die;
+ if (is_dir($old_file_dir)) {
+ $new_directory_name = rename($old_file_dir, $new_file_dir);
+ //var_dump($new_directory_name);die;
return $new_directory_name;
} else if (is_dir($files_id_dir)) {
- $new_directory_name = rename(textbook_companion_path() . $result->id, textbook_companion_path() . $dir_name);
- CreateReadmeFileTextbookCompanion($result->proposal_id);
+ $new_directory_name = rename($files_id_dir, textbook_companion_path() . $dir_name);
+ //CreateReadmeFileTextbookCompanion($result->proposal_id);
return $new_directory_name;
} else {
drupal_set_message('Can not rename the directory. If you are editing proposal before approving the proposal directory is not present because the code has been not uploaded yet. For more information please contact to administrator');