function saveAccountFormatFailurePeekAction() { $translate = DevblocksPlatform::getTranslationService(); @($id = DevblocksPlatform::importGPC($_POST['id'], 'integer')); @($view_id = DevblocksPlatform::importGPC($_POST['view_id'], 'string')); @($message_account_id = DevblocksPlatform::importGPC($_POST['message_account_id'], 'integer', 0)); $fields = array(DAO_Message::ACCOUNT_ID => $message_account_id); $status = DAO_CustomerRecipient::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(); $custom_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) { // $change_fields[DAO_CustomerRecipient::ID] = intval($v); // $change_fields[DAO_CustomerRecipient::ACCOUNT_ID] = intval($v); // $change_fields[DAO_CustomerRecipient::EXPORT_TYPE] = intval($v); // $change_fields[DAO_CustomerRecipient::TYPE] = intval($v); // $change_fields[DAO_CustomerRecipient::ADDRESS] = intval($v); // $change_fields[DAO_CustomerRecipient::ADDRESS_TO] = intval($v); // $change_fields[DAO_CustomerRecipient::SUBJECT] = intval($v); // [TODO] Implement actions case 'is_disabled': $change_fields[DAO_CustomerRecipient::IS_DISABLED] = intval($v); break; default: // Custom fields if (substr($k, 0, 3) == "cf_") { $custom_fields[substr($k, 3)] = $v; } } } } $pg = 0; if (empty($ids)) { do { list($objects, $null) = DAO_CustomerRecipient::search(array(), $this->params, 100, $pg++, SearchFields_CustomerRecipient::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_CustomerRecipient::update($batch_ids, $change_fields); // Custom Fields self::_doBulkSetCustomFields(FegCustomFieldSource_CustomerRecipient::ID, $custom_fields, $batch_ids); unset($batch_ids); } unset($ids); }
function saveRecipientPeekAction() { $translate = DevblocksPlatform::getTranslationService(); @($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['recipient_is_disabled'], 'integer', 0)); @($recipient_type = DevblocksPlatform::importGPC($_POST['recipient_type'], 'integer', 0)); @($recipient_account_id = DevblocksPlatform::importGPC($_POST['recipient_account_id'], 'integer', 0)); @($recipient_address_to = DevblocksPlatform::importGPC($_POST['recipient_address_to'], 'string', "")); @($recipient_subject = DevblocksPlatform::importGPC($_POST['recipient_subject'], 'string', "")); @($recipient_export_type = DevblocksPlatform::importGPC($_POST['recipient_export_type'], 'integer', 0)); if ($recipient_type == 255) { @($recipient_address = DevblocksPlatform::importGPC($_POST['recipient_slave_account_id'], 'string', "")); } else { @($recipient_address = DevblocksPlatform::importGPC($_POST['recipient_address'], 'string', "")); } $fields = array(DAO_CustomerRecipient::ACCOUNT_ID => $recipient_account_id, DAO_CustomerRecipient::EXPORT_TYPE => $recipient_export_type, DAO_CustomerRecipient::IS_DISABLED => $disabled, DAO_CustomerRecipient::TYPE => $recipient_type, DAO_CustomerRecipient::ADDRESS_TO => $recipient_address_to, DAO_CustomerRecipient::ADDRESS => $recipient_address, DAO_CustomerRecipient::SUBJECT => $recipient_subject); if ($id == 0) { // Create Customer Recipients $id = $status = DAO_CustomerRecipient::create($fields); } else { // Update Customer Recipients $status = DAO_CustomerRecipient::update($id, $fields); } if (!empty($view_id)) { $view = Feg_AbstractViewLoader::getView($view_id); $view->render(); } //DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('setup','workers'))); }