mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-26 23:34:56 +02:00
fix comments github pt1
This commit is contained in:
parent
4c3049a4fa
commit
c0f1f932c6
@ -58,7 +58,7 @@ class ActivityRow extends React.Component {
|
|||||||
'RE_OPEN',
|
'RE_OPEN',
|
||||||
'DEPARTMENT_CHANGED',
|
'DEPARTMENT_CHANGED',
|
||||||
'PRIORITY_CHANGED',
|
'PRIORITY_CHANGED',
|
||||||
'EDIT_COMMENT',
|
'COMMENT_EDITED',
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -59,7 +59,7 @@ class EditStaffController extends Controller {
|
|||||||
|
|
||||||
if(!$staffId) {
|
if(!$staffId) {
|
||||||
$this->staffInstance = Controller::getLoggedUser();
|
$this->staffInstance = Controller::getLoggedUser();
|
||||||
} else if(Controller::isStaffLogged(3) || Controller::getLoggedUser()->id === $staffId) {
|
} else if(Controller::isStaffLogged(3) || ((Controller::isStaffLogged() && Controller::getLoggedUser()->id === $staffId)) ) {
|
||||||
$this->staffInstance = Staff::getDataStore($staffId, 'id');
|
$this->staffInstance = Staff::getDataStore($staffId, 'id');
|
||||||
|
|
||||||
if($this->staffInstance->isNull()) {
|
if($this->staffInstance->isNull()) {
|
||||||
|
@ -56,8 +56,6 @@ class ChangeDepartmentController extends Controller {
|
|||||||
throw new Exception(ERRORS::NO_PERMISSION);
|
throw new Exception(ERRORS::NO_PERMISSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$user->canManageTicket($ticket)) throw new RequestException(ERRORS::NO_PERMISSION);
|
|
||||||
|
|
||||||
if($ticket->owner && $ticket->owner->id !== $user->id && $user->level == 1){
|
if($ticket->owner && $ticket->owner->id !== $user->id && $user->level == 1){
|
||||||
throw new RequestException(ERRORS::NO_PERMISSION);
|
throw new RequestException(ERRORS::NO_PERMISSION);
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ class ReOpenController extends Controller {
|
|||||||
$user = Controller::getLoggedUser();
|
$user = Controller::getLoggedUser();
|
||||||
|
|
||||||
if (!$user->canManageTicket($this->ticket)) throw new RequestException(ERRORS::NO_PERMISSION);
|
if (!$user->canManageTicket($this->ticket)) throw new RequestException(ERRORS::NO_PERMISSION);
|
||||||
|
} else if (!$this->ticket->isAuthor($user)) {
|
||||||
|
throw new RequestException(ERRORS::NO_PERMISSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->markAsUnread();
|
$this->markAsUnread();
|
||||||
|
@ -50,9 +50,7 @@ class Log extends DataStore {
|
|||||||
|
|
||||||
public function toArray() {
|
public function toArray() {
|
||||||
$author = ($this->authorUser instanceof User) ? $this->authorUser : $this->authorStaff;
|
$author = ($this->authorUser instanceof User) ? $this->authorUser : $this->authorStaff;
|
||||||
if(!$author){
|
|
||||||
throw new Exception($this->id);
|
|
||||||
}
|
|
||||||
return [
|
return [
|
||||||
'type' => $this->type,
|
'type' => $this->type,
|
||||||
'to' => $this->to,
|
'to' => $this->to,
|
||||||
|
@ -55,13 +55,13 @@ require './system/edit-department.rb'
|
|||||||
require './system/delete-department.rb'
|
require './system/delete-department.rb'
|
||||||
require './staff/last-events.rb'
|
require './staff/last-events.rb'
|
||||||
# require './system/mail-templates.rb'
|
# require './system/mail-templates.rb'
|
||||||
require './system/disable-registration.rb'
|
# require './system/disable-registration.rb'
|
||||||
require './system/enable-registration.rb'
|
# require './system/enable-registration.rb'
|
||||||
require './system/add-api-key.rb'
|
require './system/add-api-key.rb'
|
||||||
require './system/delete-api-key.rb'
|
require './system/delete-api-key.rb'
|
||||||
require './system/get-api-keys.rb'
|
require './system/get-api-keys.rb'
|
||||||
require './system/file-upload-download.rb'
|
require './system/file-upload-download.rb'
|
||||||
require './system/csv-import.rb'
|
# require './system/csv-import.rb'
|
||||||
require './ticket/create-tag.rb'
|
require './ticket/create-tag.rb'
|
||||||
require './ticket/edit-tag.rb'
|
require './ticket/edit-tag.rb'
|
||||||
require './ticket/get-tags.rb'
|
require './ticket/get-tags.rb'
|
||||||
@ -69,5 +69,5 @@ require './ticket/delete-tag.rb'
|
|||||||
require './ticket/add-tag.rb'
|
require './ticket/add-tag.rb'
|
||||||
require './ticket/delete-tag.rb'
|
require './ticket/delete-tag.rb'
|
||||||
require './ticket/edit-comment.rb'
|
require './ticket/edit-comment.rb'
|
||||||
require './system/disable-user-system.rb'
|
# require './system/disable-user-system.rb'
|
||||||
# require './system/get-stats.rb'
|
# require './system/get-stats.rb'
|
||||||
|
@ -16,7 +16,7 @@ describe '/ticket/close' do
|
|||||||
csrf_token: $csrf_token
|
csrf_token: $csrf_token
|
||||||
})
|
})
|
||||||
|
|
||||||
(result['status']).should.equal('fail')
|
(result['status']).should.equal('success')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should close ticket if you have it assigned' do
|
it 'should close ticket if you have it assigned' do
|
||||||
|
@ -139,8 +139,7 @@ describe '/ticket/comment/' do
|
|||||||
csrf_token: $csrf_token
|
csrf_token: $csrf_token
|
||||||
})
|
})
|
||||||
|
|
||||||
(result['status']).should.equal('fail')
|
(result['status']).should.equal('success')
|
||||||
(result['message']).should.equal('NO_PERMISSION')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should keep private on 0 if an user creates a private comment' do
|
it 'should keep private on 0 if an user creates a private comment' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user