本文整理汇总了PHP中RGFormsModel::delete_notes方法的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel::delete_notes方法的具体用法?PHP RGFormsModel::delete_notes怎么用?PHP RGFormsModel::delete_notes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RGFormsModel
的用法示例。
在下文中一共展示了RGFormsModel::delete_notes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lead_detail_page
//.........这里部分代码省略.........
if (rgpost('gentry_email_notes_to')) {
GFCommon::log_debug('GFEntryDetail::lead_detail_page(): Preparing to email entry notes.');
$email_to = $_POST['gentry_email_notes_to'];
$email_from = $current_user->user_email;
$email_subject = stripslashes($_POST['gentry_email_subject']);
$body = stripslashes($_POST['new_note']);
$headers = "From: \"{$email_from}\" <{$email_from}> \r\n";
GFCommon::log_debug("GFEntryDetail::lead_detail_page(): Emailing notes - TO: {$email_to} SUBJECT: {$email_subject} BODY: {$body} HEADERS: {$headers}");
$is_success = wp_mail($email_to, $email_subject, $body, $headers);
$result = is_wp_error($is_success) ? $is_success->get_error_message() : $is_success;
GFCommon::log_debug("GFEntryDetail::lead_detail_page(): Result from wp_mail(): {$result}");
if (!is_wp_error($is_success) && $is_success) {
GFCommon::log_debug('GFEntryDetail::lead_detail_page(): Mail was passed from WordPress to the mail server.');
} else {
GFCommon::log_error('GFEntryDetail::lead_detail_page(): The mail message was passed off to WordPress for processing, but WordPress was unable to send the message.');
}
if (has_filter('phpmailer_init')) {
GFCommon::log_debug(__METHOD__ . '(): The WordPress phpmailer_init hook has been detected, usually used by SMTP plugins, it can impact mail delivery.');
}
do_action('gform_post_send_entry_note', $result, $email_to, $email_from, $email_subject, $body, $form, $lead);
}
break;
case 'add_quick_note':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead['id'], $current_user->ID, $user_data->display_name, stripslashes($_POST['quick_note']));
break;
case 'bulk':
check_admin_referer('gforms_update_note', 'gforms_update_note');
if ($_POST['bulk_action'] == 'delete') {
if (!GFCommon::current_user_can_any('gravityforms_edit_entry_notes')) {
die(esc_html__("You don't have adequate permission to delete notes.", 'gravityforms'));
}
RGFormsModel::delete_notes($_POST['note']);
}
break;
case 'trash':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead['id'], 'status', 'trash');
$lead = RGFormsModel::get_lead($lead['id']);
break;
case 'restore':
case 'unspam':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead['id'], 'status', 'active');
$lead = RGFormsModel::get_lead($lead['id']);
break;
case 'spam':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead['id'], 'status', 'spam');
$lead = RGFormsModel::get_lead($lead['id']);
break;
case 'delete':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
if (!GFCommon::current_user_can_any('gravityforms_delete_entries')) {
die(esc_html__("You don't have adequate permission to delete entries.", 'gravityforms'));
}
RGFormsModel::delete_lead($lead['id']);
?>
<script type="text/javascript">
document.location.href = '<?php
echo 'admin.php?page=gf_entries&view=entries&id=' . absint($form['id']);
?>
';
</script>
<?php
示例2: lead_detail_page
//.........这里部分代码省略.........
//Loading files that have been uploaded to temp folder
$files = GFCommon::json_decode(stripslashes(RGForms::post("gform_uploaded_files")));
if (!is_array($files)) {
$files = array();
}
GFFormsModel::$uploaded_files[$form_id] = $files;
GFFormsModel::save_lead($form, $lead);
do_action("gform_after_update_entry", $form, $lead["id"]);
do_action("gform_after_update_entry_{$form["id"]}", $form, $lead["id"]);
$lead = RGFormsModel::get_lead($lead["id"]);
$lead = GFFormsModel::set_entry_meta($lead, $form);
break;
case "add_note":
check_admin_referer('gforms_update_note', 'gforms_update_note');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead["id"], $current_user->ID, $user_data->display_name, stripslashes($_POST["new_note"]));
//emailing notes if configured
if (rgpost("gentry_email_notes_to")) {
$email_to = $_POST["gentry_email_notes_to"];
$email_from = $current_user->user_email;
$email_subject = stripslashes($_POST["gentry_email_subject"]);
$headers = "From: \"{$email_from}\" <{$email_from}> \r\n";
$result = wp_mail($email_to, $email_subject, stripslashes($_POST["new_note"]), $headers);
}
break;
case "add_quick_note":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead["id"], $current_user->ID, $user_data->display_name, stripslashes($_POST["quick_note"]));
break;
case "bulk":
check_admin_referer('gforms_update_note', 'gforms_update_note');
if ($_POST["bulk_action"] == "delete") {
RGFormsModel::delete_notes($_POST["note"]);
}
break;
case "trash":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead["id"], "status", "trash");
$lead = RGFormsModel::get_lead($lead["id"]);
break;
case "restore":
case "unspam":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead["id"], "status", "active");
$lead = RGFormsModel::get_lead($lead["id"]);
break;
case "spam":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead["id"], "status", "spam");
$lead = RGFormsModel::get_lead($lead["id"]);
break;
case "delete":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
if (!GFCommon::current_user_can_any("gravityforms_delete_entries")) {
die(__("You don't have adequate permissions to delete entries.", "gravityforms"));
}
RGFormsModel::delete_lead($lead["id"]);
?>
<script type="text/javascript">
document.location.href='<?php
echo "admin.php?page=gf_entries&view=entries&id=" . absint($form["id"]);
?>
';
</script>
<?php
示例3: delete_note_sidebar
function delete_note_sidebar($notes)
{
RGFormsModel::delete_notes($notes);
}
示例4: lead_detail_page
public static function lead_detail_page()
{
global $wpdb;
global $current_user;
if (!GFCommon::ensure_wp_version()) {
return;
}
echo GFCommon::get_remote_message();
$form = RGFormsModel::get_form_meta($_GET["id"]);
$lead_id = rgget('lid');
$filter = rgget("filter");
$status = in_array($filter, array("trash", "spam")) ? $filter : "active";
$search = rgget("s");
$position = rgget('pos') ? rgget('pos') : 0;
$sort_direction = rgget('dir') ? rgget('dir') : 'DESC';
$sort_field = empty($_GET["sort"]) ? 0 : $_GET["sort"];
$sort_field_meta = RGFormsModel::get_field($form, $sort_field);
$is_numeric = $sort_field_meta["type"] == "number";
$star = $filter == "star" ? 1 : null;
$read = $filter == "unread" ? 0 : null;
// added status as an optional parameter to get_lead_count because the counts are inaccurate without using the status
$lead_count = RGFormsModel::get_lead_count($form['id'], $search, $star, $read, null, null, $status);
$prev_pos = !rgblank($position) && $position > 0 ? $position - 1 : false;
$next_pos = !rgblank($position) && $position < $lead_count - 1 ? $position + 1 : false;
// unread filter requires special handling for pagination since entries are filter out of the query as they are read
if ($filter == 'unread') {
$next_pos = $position;
if ($next_pos + 1 == $lead_count) {
$next_pos = false;
}
}
// get the lead
$leads = RGFormsModel::get_leads($form['id'], $sort_field, $sort_direction, $search, $position, 1, $star, $read, $is_numeric, null, null, $status);
if (!$lead_id) {
$lead = !empty($leads) ? $leads[0] : false;
} else {
$lead = RGFormsModel::get_lead($lead_id);
}
if (!$lead) {
_e("Oops! We couldn't find your lead. Please try again", "gravityforms");
return;
}
RGFormsModel::update_lead_property($lead["id"], "is_read", 1);
switch (RGForms::post("action")) {
case "update":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::save_lead($form, $lead);
do_action("gform_after_update_entry", $form, $lead["id"]);
do_action("gform_after_update_entry_{$form["id"]}", $form, $lead["id"]);
$lead = RGFormsModel::get_lead($lead["id"]);
break;
case "add_note":
check_admin_referer('gforms_update_note', 'gforms_update_note');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead["id"], $current_user->ID, $user_data->display_name, stripslashes($_POST["new_note"]));
//emailing notes if configured
if (rgpost("gentry_email_notes_to")) {
$email_to = $_POST["gentry_email_notes_to"];
$email_from = $current_user->user_email;
$email_subject = stripslashes($_POST["gentry_email_subject"]);
$headers = "From: \"{$email_from}\" <{$email_from}> \r\n";
$result = wp_mail($email_to, $email_subject, stripslashes($_POST["new_note"]), $headers);
}
break;
case "add_quick_note":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead["id"], $current_user->ID, $user_data->display_name, stripslashes($_POST["quick_note"]));
break;
case "bulk":
check_admin_referer('gforms_update_note', 'gforms_update_note');
if ($_POST["bulk_action"] == "delete") {
RGFormsModel::delete_notes($_POST["note"]);
}
break;
case "trash":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead["id"], "status", "trash");
$lead = RGFormsModel::get_lead($lead["id"]);
break;
case "restore":
case "unspam":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead["id"], "status", "active");
$lead = RGFormsModel::get_lead($lead["id"]);
break;
case "spam":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead["id"], "status", "spam");
$lead = RGFormsModel::get_lead($lead["id"]);
break;
case "delete":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::delete_lead($lead["id"]);
?>
<script type="text/javascript">
document.location.href='<?php
echo "admin.php?page=gf_entries&view=entries&id=" . absint($form["id"]);
?>
';
//.........这里部分代码省略.........
示例5: lead_detail_page
//.........这里部分代码省略.........
if (!is_wp_error($is_success) && $is_success) {
GFCommon::log_debug('GFEntryDetail::lead_detail_page(): Mail was passed from WordPress to the mail server.');
} else {
GFCommon::log_error('GFEntryDetail::lead_detail_page(): The mail message was passed off to WordPress for processing, but WordPress was unable to send the message.');
}
if (has_filter('phpmailer_init')) {
GFCommon::log_debug(__METHOD__ . '(): The WordPress phpmailer_init hook has been detected, usually used by SMTP plugins, it can impact mail delivery.');
}
/**
* Fires after a note is attached to an entry and sent as an email
*
* @param string $result The Error message or success message when the entry note is sent
* @param string $email_to The email address to send the entry note to
* @param string $email_from The email address from which the email is sent from
* @param string $email_subject The subject of the email that is sent
* @param mixed $body The Full body of the email containing the message after the note is sent
* @param array $form The current form object
* @param array $lead The Current lead object
*/
do_action('gform_post_send_entry_note', $result, $email_to, $email_from, $email_subject, $body, $form, $lead);
}
break;
case 'add_quick_note':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead['id'], $current_user->ID, $user_data->display_name, stripslashes($_POST['quick_note']));
break;
case 'bulk':
check_admin_referer('gforms_update_note', 'gforms_update_note');
if ($_POST['bulk_action'] == 'delete') {
if (!GFCommon::current_user_can_any('gravityforms_edit_entry_notes')) {
die(esc_html__("You don't have adequate permission to delete notes.", 'gravityforms'));
}
RGFormsModel::delete_notes($_POST['note']);
}
break;
case 'trash':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead['id'], 'status', 'trash');
$lead = RGFormsModel::get_lead($lead['id']);
self::set_current_entry($lead);
break;
case 'restore':
case 'unspam':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead['id'], 'status', 'active');
$lead = RGFormsModel::get_lead($lead['id']);
self::set_current_entry($lead);
break;
case 'spam':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::update_lead_property($lead['id'], 'status', 'spam');
$lead = RGFormsModel::get_lead($lead['id']);
self::set_current_entry($lead);
break;
case 'delete':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
if (!GFCommon::current_user_can_any('gravityforms_delete_entries')) {
die(esc_html__("You don't have adequate permission to delete entries.", 'gravityforms'));
}
RGFormsModel::delete_lead($lead['id']);
?>
<script type="text/javascript">
document.location.href = '<?php
echo 'admin.php?page=gf_entries&view=entries&id=' . absint($form['id']);
?>
示例6: lead_detail_page
public static function lead_detail_page()
{
global $wpdb;
global $current_user;
if (!GFCommon::ensure_wp_version()) {
return;
}
echo GFCommon::get_remote_message();
$form = RGFormsModel::get_form_meta($_GET["id"]);
$lead = RGFormsModel::get_lead($_GET["lid"]);
if (!$lead) {
_e("OOps! We couldn't find your lead. Please try again", "gravityforms");
return;
}
RGFormsModel::update_lead_property($lead["id"], "is_read", 1);
$search_qs = empty($_GET["s"]) ? "" : "&s=" . $_GET["s"];
$sort_qs = empty($_GET["sort"]) ? "" : "&sort=" . $_GET["sort"];
$dir_qs = empty($_GET["dir"]) ? "" : "&dir=" . $_GET["dir"];
$page_qs = empty($_GET["paged"]) ? "" : "&paged=" . absint($_GET["paged"]);
switch (RGForms::post("action")) {
case "update":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::save_lead($form, $lead);
$lead = RGFormsModel::get_lead($_GET["lid"]);
break;
case "add_note":
check_admin_referer('gforms_update_note', 'gforms_update_note');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead["id"], $current_user->ID, $user_data->display_name, stripslashes($_POST["new_note"]));
//emailing notes if configured
if (rgpost("gentry_email_notes_to")) {
$email_to = $_POST["gentry_email_notes_to"];
$email_from = $current_user->user_email;
$email_subject = stripslashes($_POST["gentry_email_subject"]);
$headers = "From: \"{$email_from}\" <{$email_from}> \r\n";
$result = wp_mail($email_to, $email_subject, stripslashes($_POST["new_note"]), $headers);
}
break;
case "add_quick_note":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
$user_data = get_userdata($current_user->ID);
RGFormsModel::add_note($lead["id"], $current_user->ID, $user_data->display_name, stripslashes($_POST["quick_note"]));
break;
case "bulk":
check_admin_referer('gforms_update_note', 'gforms_update_note');
if ($_POST["bulk_action"] == "delete") {
RGFormsModel::delete_notes($_POST["note"]);
}
break;
case "delete":
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
RGFormsModel::delete_lead($lead["id"]);
?>
<div id="message" class="updated fade" style="background-color: rgb(255, 251, 204); margin-top:50px; padding:50px;">
<?php
_e("Entry has been deleted.", "gravityforms");
?>
<a href="<?php
echo esc_url("admin.php?page=gf_entries&view=entries&id=" . absint($form["id"]) . $search_qs . $sort_qs . $dir_qs . $page_qs);
?>
"><?php
_e("Back to entries list", "gravityforms");
?>
</a>
</div>
<?php
exit;
break;
}
$mode = empty($_POST["screen_mode"]) ? "view" : $_POST["screen_mode"];
?>
<link rel="stylesheet" href="<?php
echo GFCommon::get_base_url();
?>
/css/admin.css" />
<script type="text/javascript">
function DeleteFile(leadId, fieldId){
if(confirm(<?php
_e("'Would you like to delete this file? \\'Cancel\\' to stop. \\'OK\\' to delete'", "gravityforms");
?>
)){
var mysack = new sack("<?php
echo admin_url("admin-ajax.php");
?>
");
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar( "action", "rg_delete_file" );
mysack.setVar( "rg_delete_file", "<?php
echo wp_create_nonce("rg_delete_file");
?>
" );
mysack.setVar( "lead_id", leadId );
mysack.setVar( "field_id", fieldId );
mysack.encVar( "cookie", document.cookie, false );
mysack.onError = function() { alert('<?php
echo esc_js(__("Ajax error while deleting field.", "gravityforms"));
?>
//.........这里部分代码省略.........