Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions application/controllers/Datadeposit.php
Original file line number Diff line number Diff line change
Expand Up @@ -1953,25 +1953,29 @@ public function confirm($id)
$this->load->helper('form');
$project = $this->DD_project_model->project_id($id, $this->session->userdata('email'));

if (!$this->DD_project_model->has_access($project[0]->id, $this->session->userdata('email')))
if (! $this->DD_project_model->has_access($project[0]->id, $this->session->userdata('email')))
{
redirect('datadeposit/projects');
$this->session->set_flashdata('error', t('delete_not_owner_error'));
redirect('datadeposit/projects');
}

if ($project[0]->access != 'owner')
{
redirect('datadeposit/projects');
$this->session->set_flashdata('error', t('delete_not_owner_error'));
redirect('datadeposit/projects');
}

if ($project[0]->status != 'draft')
{
$this->session->set_flashdata('error', t('delete_already_submitted_error'));
redirect('datadeposit/projects');
}

if ($this->input->post('submit') == 'Yes')
{
$this->DD_project_model->delete($id);
$this->_write_history_entry("Project deleted", $project[0]->id, $project[0]->status);
$this->session->set_flashdata('message', t('project_deleted'));
redirect('datadeposit/projects');
}
else if ($this->input->post('cancel') == 'No')
Expand Down
4 changes: 3 additions & 1 deletion application/language/base/dd_help_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@
$lang['no_files_uploaded']='No files uploaded';
$lang['no_citations_attached']='No citations';


$lang['delete_not_owner_error']='Only owner can delete this project.';
$lang['delete_already_submitted_error']='You can\'t delete project already submitted.';
$lang['project_deleted'] = "Project deleted successfully!";


/* End of file help_lang.php */
Expand Down