[HOTFIX] - Fix PHP 7.1 edit error

This commit is contained in:
Ivan Diaz 2018-07-06 16:06:51 -03:00
parent 07e68b0a49
commit 254135dbf4
3 changed files with 23 additions and 23 deletions

View File

@ -44,7 +44,7 @@ class StaffEditor extends React.Component {
departments: this.getUserDepartments(),
sendEmailOnNewTicket: this.props.sendEmailOnNewTicket
};
render() {
return (
<div className="staff-editor">
@ -206,7 +206,7 @@ class StaffEditor extends React.Component {
</div>
);
}
renderDelete() {
return (
<div>
@ -290,11 +290,11 @@ class StaffEditor extends React.Component {
path: '/staff/edit',
data: {
staffId: this.props.staffId,
sendEmailOnNewTicket: form.sendEmailOnNewTicket * 1,
email: form.email,
password: form.password,
level: (form.level !== undefined) ? form.level + 1 : null,
departments: departments && JSON.stringify(departments)
sendEmailOnNewTicket: (eventType === 'SEND_EMAIL_ON_NEW_TICKET') ? form.sendEmailOnNewTicket * 1 : null,
email: (eventType === 'EMAIL') ? form.email : null,
password: (eventType === 'PASSWORD') ? form.password : null,
level: (form.level !== undefined && eventType == 'LEVEL') ? form.level + 1 : null,
departments: (eventType === 'DEPARTMENTS') ? (departments && JSON.stringify(departments)) : null,
}
}).then(() => {
window.scrollTo(0,0);
@ -348,4 +348,4 @@ class StaffEditor extends React.Component {
}
}
export default StaffEditor;
export default StaffEditor;

View File

@ -23,7 +23,7 @@ use Respect\Validation\Validator as DataValidator;
* @apiUse NO_PERMISSION
* @apiUse INVALID_STAFF
*
* @apiSuccess {Object} data Empty object
* @apiSuccess {Object} data Empty object
*
*/
@ -56,9 +56,9 @@ class EditStaffController extends Controller {
Response::respondError(ERRORS::NO_PERMISSION);
return;
}
if(Controller::request('departments')) {
$this->updateDepartmentsOwners();
$this->updateDepartmentsOwners();
}
$this->editInformation();
@ -74,11 +74,11 @@ class EditStaffController extends Controller {
if(Controller::request('password')) {
$this->staffInstance->password = Hashing::hashPassword(Controller::request('password'));
}
if(Controller::request('level') && Controller::isStaffLogged(3) && !$this->isModifyingCurrentStaff()) {
$this->staffInstance->level = Controller::request('level');
}
if(Controller::request('departments') && Controller::isStaffLogged(3)) {
$this->staffInstance->sharedDepartmentList = $this->getDepartmentList();
}
@ -86,9 +86,9 @@ class EditStaffController extends Controller {
if($fileUploader = $this->uploadFile(true)) {
$this->staffInstance->profilePic = ($fileUploader instanceof FileUploader) ? $fileUploader->getFileName() : null;
}
if(Controller::request('sendEmailOnNewTicket') !== null && $this->isModifyingCurrentStaff()) {
$this->staffInstance->sendEmailOnNewTicket = Controller::request('sendEmailOnNewTicket') * 1;
if(Controller::request('sendEmailOnNewTicket') !== '' && $this->isModifyingCurrentStaff()) {
$this->staffInstance->sendEmailOnNewTicket = intval(Controller::request('sendEmailOnNewTicket'));
}
$this->staffInstance->store();
@ -145,4 +145,4 @@ class EditStaffController extends Controller {
private function isModifyingCurrentStaff() {
return !Controller::request('staffId') || Controller::request('staffId') === Controller::getLoggedUser()->id;
}
}
}

View File

@ -39,9 +39,9 @@ class GetSettingsController extends Controller {
'reCaptchaKey' => Setting::getSetting('recaptcha-public')->getValue(),
'reCaptchaPrivate' => Setting::getSetting('recaptcha-private')->getValue(),
'time-zone' => Setting::getSetting('time-zone')->getValue(),
'maintenance-mode' => Setting::getSetting('maintenance-mode')->getValue() * 1,
'maintenance-mode' => intval(Setting::getSetting('maintenance-mode')->getValue()),
'layout' => Setting::getSetting('layout')->getValue(),
'allow-attachments' => Setting::getSetting('allow-attachments')->getValue() * 1,
'allow-attachments' => intval(Setting::getSetting('allow-attachments')->getValue()),
'max-size' => Setting::getSetting('max-size')->getValue(),
'url' => Setting::getSetting('url')->getValue(),
'title' => Setting::getSetting('title')->getValue(),
@ -60,16 +60,16 @@ class GetSettingsController extends Controller {
'language' => Setting::getSetting('language')->getValue(),
'reCaptchaKey' => Setting::getSetting('recaptcha-public')->getValue(),
'time-zone' => Setting::getSetting('time-zone')->getValue(),
'maintenance-mode' => Setting::getSetting('maintenance-mode')->getValue() * 1,
'maintenance-mode' => intval(Setting::getSetting('maintenance-mode')->getValue()),
'layout' => Setting::getSetting('layout')->getValue(),
'allow-attachments' => Setting::getSetting('allow-attachments')->getValue() * 1,
'allow-attachments' => intval(Setting::getSetting('allow-attachments')->getValue()),
'max-size' => Setting::getSetting('max-size')->getValue(),
'title' => Setting::getSetting('title')->getValue(),
'registration' => Setting::getSetting('registration')->getValue(),
'departments' => Department::getDepartmentNames(),
'supportedLanguages' => Language::getSupportedLanguages(),
'allowedLanguages' => Language::getAllowedLanguages(),
'user-system-enabled' => Setting::getSetting('user-system-enabled')->getValue() * 1,
'user-system-enabled' => intval(Setting::getSetting('user-system-enabled')->getValue()),
'session-prefix' => Setting::getSetting('session-prefix')
];
}
@ -77,4 +77,4 @@ class GetSettingsController extends Controller {
Response::respondSuccess($settingsList);
}
}
}