} $scheduledImport = SQLIScheduledImport::fetch($importID); if (!$scheduledImport instanceof SQLIScheduledImport) { $scheduledImport = new SQLIScheduledImport($row); } else { $scheduledImport->fromArray($row); } if ($importOptions) { if (is_array($importOptions)) { $scheduledImport->setAttribute('options', SQLIImportHandlerOptions::fromHTTPInput($importOptions)); } else { //backwards compatibility mode : options are set in a textarea $scheduledImport->setAttribute('options', SQLIImportHandlerOptions::fromText($importOptions)); } } $scheduledImport->store(); $Module->redirectToView('scheduledlist'); } else { if ($Params['ScheduledImportID']) { $scheduledImport = SQLIScheduledImport::fetch($Params['ScheduledImportID']); $importID = $Params['ScheduledImportID']; $currentImportHandler = $scheduledImport->attribute('handler'); // Check if user has access to handler alteration $aLimitation = array('SQLIImport_Type' => $currentImportHandler); $hasAccess = SQLIImportUtils::hasAccessToLimitation($Module->currentModule(), 'manageimports', $aLimitation); if (!$hasAccess) { return $Module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel'); } $importOptions = $scheduledImport->attribute('options')->toText(); $nextTime = $scheduledImport->attribute('next'); if (!$nextTime) {