function saveExportPeekAction() { $translate = DevblocksPlatform::getTranslationService(); $params = array(); @($id = DevblocksPlatform::importGPC($_POST['id'], 'integer')); @($view_id = DevblocksPlatform::importGPC($_POST['view_id'], 'string')); @($delete = DevblocksPlatform::importGPC($_POST['do_delete'], 'integer', 0)); @($disabled = DevblocksPlatform::importGPC($_POST['export_type_is_disabled'], 'integer', 0)); @($export_type_name = DevblocksPlatform::importGPC($_POST['export_type_name'], 'string', "")); @($export_type_recipient_type = DevblocksPlatform::importGPC($_POST['export_type_recipient_type'], 'integer', 0)); @($params_ids = DevblocksPlatform::importGPC($_POST['params_ids'], 'array', array())); $export_type_params = DAO_ExportTypeParams::getAll(); foreach ($params_ids as $params_id) { // 1 = Yes/No, 2 = 255 Char input switch ($export_type_params[$params_id]->type) { case 1: @($params[$params_id] = DevblocksPlatform::importGPC($_POST['export_type_params_' . $params_id], 'integer', 0)); break; case 2: @($params[$params_id] = DevblocksPlatform::importGPC($_POST['export_type_params_' . $params_id], 'string', '')); break; default: @($params[$params_id] = DevblocksPlatform::importGPC($_POST['export_type_params_' . $params_id], 'string', '')); break; } } $fields = array(DAO_ExportType::NAME => $export_type_name, DAO_ExportType::RECIPIENT_TYPE => $export_type_recipient_type, DAO_ExportType::IS_DISABLED => $disabled, DAO_ExportType::PARAMS => $params); if ($id == 0) { // Create New Export $id = $status = DAO_ExportType::create($fields); } else { // Update Existing Import $status = DAO_ExportType::update($id, $fields); } if (!empty($view_id)) { $view = Feg_AbstractViewLoader::getView($view_id); $view->render(); } //DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('setup','workers'))); }
function doBulkUpdate($filter, $do, $ids = array()) { @set_time_limit(0); $change_fields = array(); // Make sure we have actions if (empty($do)) { return; } // Make sure we have checked items if we want a checked list if (0 == strcasecmp($filter, "checks") && empty($ids)) { return; } if (is_array($do)) { foreach ($do as $k => $v) { switch ($k) { // [TODO] Used for bulk update // $change_fields[DAO_ExportType::ID] = intval($v); // $change_fields[DAO_ExportType::NAME] = intval($v); // $change_fields[DAO_ExportType::RECIPIENT_TYPE] = intval($v); // $change_fields[DAO_ExportType::IS_DISABLED] = intval($v); // $change_fields[DAO_ExportType::PARAMS_JSON] = intval($v); // [TODO] Implement actions // case 'example': //$change_fields[DAO_ExportType::EXAMPLE] = 'some value'; // break; default: break; } } } $pg = 0; if (empty($ids)) { do { list($objects, $null) = DAO_ExportType::search($this->params, 100, $pg++, SearchFields_ExportType::ID, true, false); $ids = array_merge($ids, array_keys($objects)); } while (!empty($objects)); } $batch_total = count($ids); for ($x = 0; $x <= $batch_total; $x += 100) { $batch_ids = array_slice($ids, $x, 100); DAO_ExportType::update($batch_ids, $change_fields); unset($batch_ids); } unset($ids); }
function run() { $logger = DevblocksPlatform::getConsoleLog(); $logger->info("[SNPP Exporting] Starting SNPP Export Task"); $export_type_snpp = DAO_ExportType::getByType(2); foreach ($export_type_snpp as $export_type_id => $export_type) { $logger->info('[Fax Exporter] Now processing export number: ' . $export_type->id . " export name: " . $export_type->name); self::ExportSnpp($export_type); } $logger->info('[SNPP Exporting] finished.'); }
function showRecipientTypeAction() { @($type = DevblocksPlatform::importGPC($_REQUEST['type'], 'integer', 0)); @($selected_type = DevblocksPlatform::importGPC($_REQUEST['selected_type'], 'integer', 0)); $tpl = DevblocksPlatform::getTemplateService(); $tpl->assign('path', $this->_TPL_PATH); $tpl->assign('type', $type); $tpl->assign('selected_type', $selected_type); $export_type = DAO_ExportType::getAll(); $tpl->assign('export_type', $export_type); $tpl->display('file:' . $this->_TPL_PATH . 'customer/tabs/recipient/select_export_type.tpl'); }