Commit realizado el 12:13:52 08-04-2024

This commit is contained in:
Pagina Web Monito
2024-04-08 12:13:55 -04:00
commit 0c33094de9
7815 changed files with 1365694 additions and 0 deletions

View File

@@ -0,0 +1,126 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?> <style type="text/css">
.crm_fields_table{
width: 100%; margin-top: 30px;
}.crm_fields_table .crm_field_cell1 label{
font-weight: bold; font-size: 14px;
}
.crm_fields_table .clear{
clear: both;
}
.crm_fields_table .crm_field{
margin: 20px 0px;
}
.crm_fields_table .crm_text{
width: 100%;
}
.crm_fields_table .crm_field_cell1{
width: 20%; min-width: 100px; float: left; display: inline-block;
line-height: 26px;
}
.crm_fields_table .crm_field_cell2{
width: 80%; float: left; display: inline-block;
}
.vxc_alert{
padding: 10px 20px;
}
.vx_icons{
color: #888;
}
.vx_green{
color:rgb(0, 132, 0);
}
#tiptip_content{
max-width: 200px;
}
.vx_tr{
display: table; width: 100%;
}
.vx_td{
display: table-cell; width: 90%;
}
.vx_td2{
display: table-cell;
}
.crm_field .vx_td2 .vx_toggle_btn{
margin: 0 0 0 10px; vertical-align: baseline; width: 80px;
}
.submit{
display: none;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function($){
$(".vx_tabs_radio").click(function(){
$(".vx_tabs").hide();
$("#tab_"+this.id).show();
});
$(".sf_login").click(function(e){
if($("#vx_custom_app_check").is(":checked")){
var client_id=$(this).data('id');
var new_id=$("#app_id").val();
if(client_id!=new_id){
e.preventDefault();
alert("<?php esc_html_e('HubSpot Client ID Changed.Please save new changes first','contact-form-hubspot-crm') ?>");
}
}
})
$("#vx_custom_app_check").click(function(){
if($(this).is(":checked")){
$("#vx_custom_app_div").show();
}else{
$("#vx_custom_app_div").hide();
}
});
$(document).on('click','#vx_revoke',function(e){
if(!confirm('<?php esc_html_e('Notification - Remove Connection?','contact-form-hubspot-crm'); ?>')){
e.preventDefault();
}
});
});
</script>
<div class="vx_wrap">
<form method="post" id="mainform">
<?php wp_nonce_field("vx_nonce") ?>
<h2 class="vx_img_head"><img alt="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" title="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" src="<?php echo $this->get_base_url()?>images/hubspot-crm-logo.png?ver=1" /> <?php
if(empty($id)){
esc_html_e("HubSpot Accounts", 'contact-form-hubspot-crm');
}else{
esc_html_e("HubSpot Account #", 'contact-form-hubspot-crm'); echo $id;
}
if(empty($id) || $new_account_id != $id){
?> <a href="<?php echo $new_account ?>" class="add-new-h2" title="<?php esc_html_e('Add New Account','contact-form-hubspot-crm'); ?>"><?php esc_html_e('Add New Account','contact-form-hubspot-crm'); ?></a>
<?php
}if(!empty($id)){
?>
<a href="<?php echo $page_link ?>" class="add-new-h2" title="<?php esc_html_e('Back to Accounts','contact-form-hubspot-crm'); ?>"><?php esc_html_e('Back to Accounts','contact-form-hubspot-crm'); ?></a>
<?php
}
?>
</h2>
<p style="text-align: left;"> <?php echo sprintf(esc_html__("If you don't have a HubSpot account, you can %ssign up for one here%s.", 'contact-form-hubspot-crm'), "<a href='http://www.hubspot.com/' target='_blank' title='".__('Sign Up for HubSpot CRM','contact-form-hubspot-crm')."'>" , "</a>") ?> </p>
<?php
$this->show_msgs($msgs);
if(!empty($id)){
$name=$this->post('name',$info);
include_once(self::$path . "templates/setting.php");
}else{
include_once(self::$path . "templates/settings-table.php");
}
do_action('vx_plugin_upgrade_notice_'.$this->type);
?>
<div>
</div>
</form>
</div>

View File

@@ -0,0 +1,26 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$comments=false;
if( is_array($log_entry) && count($log_entry)>0){
$log=$this->verify_log($log_entry);
$comments=true;
echo $this->format_log_msg($log);
}
if(isset($_GET['vx_debug'])){
?>
<input type="hidden" name="vx_debug" value="<?php echo esc_attr($_REQUEST['vx_debug']); ?>">
<?php
}
?>
<div class="box_btns_div">
<button class="button" type="submit" name="<?php echo esc_attr($this->id) ?>_send_btn" value="yes"><?php echo esc_html__("Send to Hubspot",'contact-form-hubspot-crm')?></button>
<?php
if($comments ){
?>
<a href="<?php echo esc_url($log_url); ?>" class="button"><?php echo esc_html__("Go to Logs",'contact-form-hubspot-crm')?></a>
<?php
}
?>
</div>

View File

@@ -0,0 +1,45 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;" charset="UTF-8" />
</head>
<body style="margin: 0px; background-color: #FFFFFF; font-family: Helvetica, Arial, sans-serif; font-size:12px;" text="#444444" bgcolor="#FFFFFF" link="#21759B" alink="#21759B" vlink="#21759B" marginheight="0" topmargin="0" marginwidth="0" leftmargin="0"><table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable" style="margin: 0;padding: 0;background-color: #EBEBEB;height: 100% !important;width: 100% !important;">
<tbody><tr>
<td align="center" valign="top">
<!-- // End Template Preheader \\ -->
<table border="0" cellpadding="0" cellspacing="0" width="600" style="border-top: 5px solid #C35050;" id="templateContainer">
<tbody><tr>
<td align="center" valign="top" id="templateHeader" style="background-color: #FFFFFF;border-top: 0;border-bottom: 0px solid #D9D9D9;">
<!-- // Begin Template Header \\ -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td class="headerContent" style="color: #C35050;font-family: Helvetica;font-size: 20px;font-weight: bold;line-height: 100%;padding: 20px;text-align: left;vertical-align: middle; border-top:1px solid #B24747;">
<span style="color:#C35050;"><span style="font-size:24px">{title}</span></span>
</td>
</tr>
<tr><td> <p style="padding-left: 10px; padding-bottom: 20px;color: #303030;font-family: Helvetica;font-size: 15px;line-height: 150%;text-align: left;">{msg}</p>
</tbody></table>
<!-- // End Template Header \\ -->
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- // Begin Template Body \\ -->
<table border="0" cellpadding="0" cellspacing="0" width="600" id="templateBody" style="background-color: #FFFFFF;border-top: 0;border-bottom: 1px solid #CACACA;">
<tbody>
{sf_contents}
<tr><td valign="top" style="padding: 40px"></td></tr>
</tbody></table>
<!-- // End Template Body \\ -->
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</body>

View File

@@ -0,0 +1,896 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?> <style type="text/css">
label span.howto { cursor: default; }
.vx_required{color:red; font-weight: normal;}
.vx_contents *{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.vx_div{
padding: 10px 0px 0px 0px;
}
.vx_head{
font-size: 14px;
background: #f4f4f4;
font-weight: bold;
border: 1px solid #e4e4e4;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
.vx_head:hover , .crm_panel_head2:hover{
background: #f0f0f0;
}
.vx_group{
border: 1px dashed #ccc;
border-top-width: 0px ;
padding: 14px;
background: #fff;
}
.vx_row{
padding: 10px 0px;
}
.vx_col1{float:left; width: 25%; padding-right: 20px; font-weight: bold;}
.vx_col2{float:left; width: 75%; padding-right: 20px;}
@media screen and (max-width: 782px) {
.vx_col1{float:none; width: 100%;}
.vx_col2{float:none; width: 100%}
}
.alert_danger {
background: #ca5952;
padding: 5px;
font-size: 12px;
font-weight: bold;
color: #fff;
text-align: center;
margin-top: 10px;
}
.crm_sel{
min-width: 220px;
}
.vx_wrapper{
border: 0px solid #e5e5e5;
margin: 20px auto;
width: 100%;
}
.vx_contents{
padding-top: 8px;
}
.vx_heading{
font-size: 18px;
padding: 10px 20px;
border-bottom: 1px dashed #ccc;
}
/*********custom fields***************/
.vx_filter_div{
border: 1px solid #eee;
padding: 10px;
background: #f3f3f3;
border-radius: 4px;
}
.vx_filter_field{
float: left;
}
.vx_filter_field1{
width: 32%;
}
.vx_filter_field2{
width: 30%;
}
.vx_filter_field3{
width: 30%;
}
.vx_filter_field4{
width: 8%;
}
.vx_filter_field select{
width:90%; display: block;
}
.vx_btn_div{
padding: 10px 0px;
}
.vx_filter_label{
padding: 3px;
}
.vxc_filter_text{
max-width: 98%;
width: 96%;
}
.vx_trash_or{
color: #D20000;
margin-left: 10px;
}
.vx_trash_or:hover{
color: #C24B4B;
}
.vx_icons{
font-size: 16px;
vertical-align: middle;
cursor: pointer;
color: #999;
}
.vx_icons-s{
font-size: 12px;
vertical-align: middle;
}
.vx_icons-h{
font-size: 16px;
line-height: 28px;
vertical-align: middle;
cursor: pointer;
}
.vx_icons:hover , .vx_icons-h:hover{
color: #333;
}
.reg_proc{
display: none;
}
/*******fields boxes****************/
.crm_panel * {
-webkit-box-sizing: border-box; /* Safari 3.0 - 5.0, Chrome 1 - 9, Android 2.1 - 3.x */
-moz-box-sizing: border-box; /* Firefox 1 - 28 */
box-sizing: border-box;
}
.crm_panel_100{
margin: 10px 0;
}
.crm_panel_50{
width: 48%;
margin: 1%;
min-width: 300px;
float: left;
}
.crm_panel_head{
background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(229, 229, 229, 1) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
border: 1px solid #ddd;
}
.crm_panel_head2{
background: #f6f6f6;
border: 1px solid #e8e8e8;
font-weight: bold;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
.crm_panel_head {
font-size: 14px; color:#666; font-weight: bold;
}
.crm_head_div{
float: left;
width: 80%; padding: 8px 20px;
}
.crm_panel_content{
border: 1px solid #e8e8e8;
border-top: 0px;
display: block;
padding: 12px;
background: #fff;
overflow: auto;
}
.crm-block-content{
height: 200px;
overflow: auto;
}
.crm_btn_div{
float: right;
width:20%; padding: 8px 20px;
text-align: right;
}
.vx_action_btn:hover{
color: #333;
}
.crm_panel .vx_action_btn{
color: #777; cursor: pointer;
vertical-align: middle;
font-size: 16px;
}
.vx_remove_btn{
margin-right: 7px;
}
.vx_input_100{
width: 100%;
}
.crm_clear{
clear: both;
}
.entry_row {
margin: 7px auto;
}
.entry_col1 {
float: left;
width: 25%;
padding: 0px 7px;
text-align: left;
}
.entry_col2 {
float: left;
width: 75%;
padding-left: 7px;
}
.vx_margin{
margin-top: 10px;
}
.vx_red{
color: #E31230;
}
.vx_label{
font-weight: bold;
}
.vx_error{
background: #ca5952;
padding: 10px;
font-size: 14px;
margin: 1% 2%;
color: #fff;
}
.crm_panel .vx_error{
margin: 0;
}
.vxc_field_value{
margin-bottom: 7px;
}
.vxcf_options_row .howto{
display: none;
}
</style>
<?php
if(is_array($msgs) && count($msgs)>0){
foreach($msgs as $msg){
if(isset($msg['class']) && $msg['class'] !=""){
?>
<div class="fade below-h2 <?php echo $msg['class'] ?> notice is-dismissible">
<p><?php echo wp_kses_post($msg['msg']); ?></p>
</div>
<?php
} }
}
?>
<div class="vx_wrap">
<h2 class="vx_img_head"><img alt="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" title="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" src="<?php echo $this->get_base_url()?>images/hubspot-crm-logo.png?ver=1" /> <?php
echo sprintf(esc_html__('Edit HubSpot Feed # %d','contact-form-hubspot-crm') ,$fid);
if(empty($id) || $new_account_id != $id){
?> <a href="<?php echo esc_url($new_feed_link) ?>" class="add-new-h2"><?php esc_html_e("Add New Feed",'contact-form-hubspot-crm'); ?></a>
<?php
}
?>
<a href="<?php echo esc_url($feeds_link) ?>" class="add-new-h2"><?php esc_html_e("Back to Feeds",'contact-form-hubspot-crm'); ?></a>
</h2>
<?php
//
$feed_name=$this->post('name',$feed);
if(empty($feed_name)){
$feed_name="Feed #".$fid;
}
//ensures valid credentials were entered in the settings page
if(!empty($info) && !$this->api_is_valid($info)) {
?>
<div class="error" id="message" style="margin-top:20px;"><?php echo wpautop(sprintf(esc_html__("We are unable to login to HubSpot with the provided API token. Please make sure they are valid in the %sSettings Page%s", 'contact-form-hubspot-crm'), "<a href='".esc_url($this->link_to_settings())."'>", "</a>")); ?></div>
<?php
// return;
}
?>
<div class="vx_contents">
<form method="post" action="">
<input type="hidden" name="id" id="vx_id" value="<?php echo esc_html($fid) ?>"/>
<?php wp_nonce_field("vx_nonce") ?>
<div class="vx_div">
<div class="vx_head">
<div class="crm_head_div"> <?php esc_html_e('1. Enter feed name', 'contact-form-hubspot-crm' ); ?></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"><i class="fa crm_toggle_btn vx_action_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_row">
<div class="vx_col1">
<label for="vx_name" class="left_header"><?php esc_html_e("Feed Name", 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip("vx_feed_name") ?>
</label>
</div>
<div class="vx_col2">
<input type="text" id="vx_name" class="vx_input_100" name="name" autocomplete="off" value="<?php echo esc_attr($feed_name); ?>" >
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="vx_div">
<div class="vx_head">
<div class="crm_head_div"> <?php esc_html_e('2. Select HubSpot Account.', 'contact-form-hubspot-crm'); ?></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"><i class="fa crm_toggle_btn vx_action_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_row">
<div class="vx_col1">
<label for="vx_account" class="left_header"><?php esc_html_e("HubSpot Account", 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip("vx_sel_object") ?>
</label>
</div>
<div class="vx_col2">
<select id="vx_account" class="crm_sel load_object" name="account" autocomplete="off">
<option value=""><?php esc_html_e("Select a HubSpot Account", 'contact-form-hubspot-crm'); ?></option>
<?php
$this->account=$account=$this->post('account',$feed);
$account_found=false;
foreach ($accounts as $k=>$v){
$sel='';
if($account == $v['id']){
$sel='selected="selected"';
$account_found=true;
}
?>
<option value="<?php echo esc_attr($v['id']) ?>" <?php echo $sel; ?>><?php echo esc_html($v['name']) ?></option>
<?php
}
?>
</select>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="vx_div">
<div class="vx_head">
<div class="crm_head_div"> <?php esc_html_e('3. Select Contact Form.', 'contact-form-hubspot-crm'); ?></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"><i class="fa crm_toggle_btn vx_action_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_row">
<div class="vx_col1">
<label for="vx_form_id" class="left_header"><?php esc_html_e("Contact Form Form", 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip("vx_sel_form") ?>
</label>
</div>
<div class="vx_col2">
<select id="vx_form_id" class="crm_sel load_object" name="form_id" autocomplete="off">
<option value=""><?php esc_html_e("Select a Form", 'contact-form-hubspot-crm'); ?></option>
<?php
foreach($forms as $f_key=>$platform){
if(isset($platform['label'])){
?>
<optgroup label="<?php echo esc_attr($platform['label']) ?>">
<?php
if(isset($platform['forms']) && is_array($platform['forms'])){
foreach($platform['forms'] as $form_id_=>$form_title){
$sel="";
$form_id_arr=$f_key.'_'.$form_id_;
if($form_id == $form_id_arr)
$sel="selected='selected'";
echo "<option value='".esc_attr($form_id_arr)."' $sel>".esc_html($form_title)."</option>";
}
}
?>
</optgroup>
<?php
} }
?>
</select>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div id="crm_ajax_div_object" style="display:none; text-align: center; line-height: 100px;"><i> <?php esc_html_e('Loading, Please Wait...','contact-form-hubspot-crm'); ?></i></div>
<div id="crm_object_div" style="<?php if(empty($info) || empty($form_id)) {echo 'display:none';} ?>">
<?php
if(!empty($info) && !empty($form_id)){
$this->field_map_object($account,$form_id,$feed,$info);
}
?>
</div>
</form>
</div>
</div>
<script type="text/javascript">
var vx_crm_ajax='<?php echo wp_create_nonce("vx_crm_ajax") ?>';
var vx_form_id='<?php echo esc_attr($form_id); ?>';
var vx_ajax=false;
jQuery(document).ready(function($) {
$(document).on("change",".vxc_field_type",function(e){
e.preventDefault();
var div=$(this).parents('.crm_panel');
var val=$(this).val();
div.find('.vxc_fields').hide();
div.find('.vxc_field_'+val).show();
if(val){
var input=div.find('.vxc_field_input');
if(!input.val()){
var option=div.find('.vxc_field_option').val();
if(option){ input.val("{"+option+"}"); }
}
}
if(div.find('.vxcf_options_row').length){
if(!val){
div.find('.vxc_field_option').show();
}else{
div.find('.vxc_field_option').hide();
}
}
});
$(document).on("change",".vxc_field_option",function(e){
var col=$(this).parents('.entry_col2');
var val=$(this).val();
var input=col.find('.vxc_field_input');
if(input.is(':visible')){
var input_val=input.val();
input_val+=' {'+val+'}';
input_val=$.trim(input_val);
input.val(input_val);
}
});
$(document).on("click",".vx_refresh_btn",function(e){
var check=$(this);
if(check.is(':checked')){
var box=check.parents('.vx_group');
box.find('.vx_refresh_data').trigger('click');
}
});
$(document).on("click","#toggle_camp",function(e){
e.preventDefault();
var btn=$(this);
var ok=btn.find(".reg_ok");
var proc=btn.find(".reg_proc");
var sel=$("#crm_sel_camp");
var input=$("#crm_camp_id");
var camp_type=$("#crm_camp_type");
if(ok.is(":visible")){
//
ok.hide();
proc.show();
input.show();
sel.hide();
camp_type.val('input');
}else{
button_state_vx("ok",btn);
input.hide();
sel.show();
camp_type.val('');
ok.show();
proc.hide();
}
});
$(document).on("click",".vx_refresh_data",function(e){
e.preventDefault();
var btn=$(this);
var action=$(this).data('id');
var account=$("#vx_account").val();
button_state_vx("ajax",btn);
$.post(ajaxurl,{action:'refresh_data_<?php echo esc_attr($this->id) ?>',vx_crm_ajax:vx_crm_ajax,vx_action:action,account:account},function(res){
var re=$.parseJSON(res);
button_state_vx("ok",btn);
if(re.status){
if(re.status == "ok"){
$.each(re.data,function(k,v){
if($("#"+k).length){
$("#"+k).html(v);
}
})
}else{
if(re.error && re.error!=""){
alert(re.error);
}
}
}
});
});
//toggle boxes
$(document).on("click",".crm_toggle_btn",function(e){
e.preventDefault();
var btn=jQuery(this);
if(btn.hasClass("vx_btn_inner")){
var panel=btn.parents(".crm_panel");
var div=panel.find(".crm_panel_content");
}else{
var panel=btn.parents(".vx_div");
var div=panel.find(".vx_group");
}
div.slideToggle('fast',function(){
if(div.is(":visible")){
btn.removeClass('fa-plus');
btn.addClass('fa-minus');
}else{
btn.addClass('fa-plus');
btn.removeClass('fa-minus');
}
});
});
$(document).on("dblclick",".vx_head,.crm_panel_head2",function(e){
e.preventDefault();
$(this).find('.crm_toggle_btn').trigger('click');
});
//post validation
$("form").submit(function(e){
if($(".vx_required").length){
$(".vx_required").each(function(){
var value="";
if($(this).hasClass('vx_req_parent')){
var panel=$(this).parents(".vx_div");
var attach_error=field_div=group=panel.find('.vx_group');
var head=panel.find('.vx_head');
var input=group.find(".crm_toggle_check");
if(input.is(":checked")){
var input=group.find("select");
value=input.val();
}
}else{
var panel=$(this).parents(".crm_panel");
var parent=panel.parents(".vx_div");
var field_div=panel.find(".crm_panel_content");
var group=parent.find('.vx_group');
var head=parent.find('.vx_head');
var attach_error=panel.find(".vx_margin");
var field=panel.find(".vxc_field_type").val();
var row=panel.find(".vxc_field_"+field);
var input=row.find(":input");
value=input.val();
}
panel.find(".vx_entry_error").remove();
if(value == ""){
e.preventDefault();
if(!group.is(":visible")){
head.find(".crm_toggle_btn").trigger('click');
setTimeout(function(){ input.focus();},500);
}else{
input.focus();
}
if(field_div.is(":hidden")){
panel.find(".crm_toggle_btn").trigger('click');
}
attach_error.append('<div class="entry_row vx_entry_error"><div class="vx_error"><i class="fa fa-warning"></i> <?php esc_html_e('This is a required field','contact-form-hubspot-crm') ?></div></div>');
return false;
}
})
}
})
$(document).on("click",".crm_toggle_check",function(e){
var id=$(this).attr('id');
var div=$("#"+id+"_div");
if(this.checked){
div.show();
add_note_sel();
}else{
div.hide();
}
})
$(document).on("click","#vx_refresh_fields",function(e){
e.preventDefault();
load_fields(true);
});
$(document).on("click","#vx_refresh_objects",function(e){
e.preventDefault();
var button=$(this);
var select=$("#vx_module");
var account=$("#vx_account").val();
var object=select.val();
button_state_vx('ajax',button);
$.post(ajaxurl,{action:'get_objects_<?php echo esc_attr($this->id) ?>',account:account,vx_crm_ajax:vx_crm_ajax,object:object},function(res){
button_state_vx('ok',button);
if(res!=""){
select.html(res);
}
})
});
$(document).on("change",".load_form",function(e){
e.preventDefault();
load_fields(false);
});
$(document).on("change",".load_object",function(e){
load_object();
});
$(document).on("click",".vx_remove_btn",function(e){
e.preventDefault();
if(!confirm('<?php esc_html_e('Are you sure to remove ?','contact-form-hubspot-crm') ?>')){
return;
}
var temp=$(this).parents(".crm_panel");
temp.find('.crm-desc-name').removeClass('crm-desc-name');
mark_del(temp);
update_fields_sel_vx();
});
//
$(document).on("click","#xv_add_custom_field",function(e){
var temp=$("#vx_field_temp .vx_fields").clone();
var field_name_select=$('#vx_add_fields_select');
if(field_name_select.length){
var field_name=id=field_name_select.val();
if(field_name == '' || crm_fields[field_name] == ''){
alert('<?php esc_html_e('Please Select Field Name','contact-form-hubspot-crm') ?>');
return;
}
var field=crm_fields[field_name];
if(field.type){
temp.find('.crm-desc-type').text(field.type);
}else{
temp.find('.crm-desc-type-div').remove();
}
//
if(field.name){
temp.find('.crm-desc-name').text(field.name);
}else{
temp.find('.crm-desc-name-div').remove();
}
//
if(field.maxlength){
temp.find('.crm-desc-len').text(field.maxlength);
}else{
temp.find('.crm-desc-len-div').remove();
}//
if(field.eg){
temp.find('.crm-eg').text(field.eg);
}else{
temp.find('.crm-eg-div').remove();
}
//
if(field.label){
temp.find('.crm_text_label').text(field.label);
}
}else{
var id=rand();
}
temp.find(":input").each(function(){
var name=$(this).attr('name');
if(name){
$(this).attr('name','meta[map]['+id+']['+name+']');
}
});
verify_options(temp);
$("#vx_field_temp").before(temp);
update_fields_sel_vx();
$(this).blur();
});
jQuery('.crm_panel').each(function(){
var panel=$(this);
verify_options(panel);
});
function verify_options(panel){
var name=$.trim(panel.find('.crm-desc-name').text());
if(name && crm_fields[name].options){
var row=panel.find('.entry_row2');
var type=panel.find('.vxc_field_type').val();
var input=row.find('.vxc_field_input');
var val=input.val();
var str='<select name="'+input.attr('name')+'" id="'+input.attr('id')+'" class="vxc_field_input vx_input_100">';
str+='<option value="">Select any option</option>';
jQuery.each(crm_fields[name].options,function(k,v){
if(v.hasOwnProperty('value')){
k=v.value;
if(v.hasOwnProperty('name')){
k=v.name;
}
if(v.hasOwnProperty('label')){
v=v.label;
}else{
v=v.value;
}
}
str+='<option value="'+k+'">'+v+'</option>';
});
str+='</select>';
input.replaceWith(str);
input=row.find('.vxc_field_input');
input.val(val);
row.addClass('vxcf_options_row');
if(type){ row.find('.vxc_field_option').hide(); }
}
}
//
$(document).on("click",".vx_add_or",function(e){
e.preventDefault();
var par=$(this).parent(".vx_btn_div");
var div=$("#vx_filter_temp");
var temp=div.find(".vx_filter_or").clone();
var par_id=rand();
temp.attr('data-id',par_id);
var id=rand();
temp.find(":input").each(function(){
var name=$(this).attr('name');
if(name)
$(this).attr('name','meta[filters]['+par_id+']['+id+']['+name+']');
});
temp.find(".vx_filter_label_and").remove();
temp.find(".vx_filter_field4").remove();
par.before(temp);
});
$(document).on("click",".vx_trash_or",function(e){
e.preventDefault();
var temp=$(this).parents(".vx_filter_or");
mark_del(temp);
});
$(document).on("click",".vx_trash_and",function(e){
e.preventDefault();
var temp=$(this).parents(".vx_filter_and");
mark_del(temp);
});
$(document).on("click",".vx_add_and",function(e){
e.preventDefault();
var par=$(this).parent(".vx_btn_div");
var div=$("#vx_filter_temp");
var temp=div.find(".vx_filter_and").clone();
var par_id=$(this).parents(".vx_filter_or").attr('data-id');
var id=rand();
temp.find(":input").each(function(){
var name=$(this).attr('name');
if(name)
$(this).attr('name','meta[filters]['+par_id+']['+id+']['+name+']');
})
par.before(temp);
});
$(document).on('click','.vxc_tips',function(e){
e.preventDefault();
});
function add_note_sel(){
jQuery('#crm_note_fields').select2({ placeholder: '<?php esc_html_e('Select Field','contact-form-hubspot-crm') ?>'});
}
function mark_del(obj){
obj.css({'opacity':'.5'});
obj.fadeOut(500,function(){
$(this).remove();
});
}
function rand(){
return Math.round(Math.random()*1000000000);
}
function update_fields_sel_vx(){
if(!jQuery('#vx_add_fields_select').length){
return;
}
var fields_boxes=[];
jQuery('.crm-desc-name').each(function(){
var val= jQuery.trim(jQuery(this).text());
if(val){
fields_boxes.push(val);
}
});
var str='';
if(crm_fields){
jQuery.each(crm_fields , function(k,v){
var disable='';
if(jQuery.inArray(k,fields_boxes) > -1){
disable='disabled="disabled"';
}
str+='<option value="'+k+'" '+disable+'>'+v.label+'</option>';
//}
})
}
jQuery('#vx_add_fields_select').html(str);
jQuery('#vx_add_fields_select').val('');
jQuery('#vx_add_fields_select').trigger('change');
}
function load_fields(refresh){
if(vx_ajax && vx_ajax.abort){
vx_ajax.abort();
}
var module=$("#vx_module").val();
var account=$("#vx_account").val();
var id=$("#vx_id").val();
///var primary=$("#crm_primary_field");
var ajax=$("#crm_ajax_div");
var fields=$("#crm_field_group");
var form_id=$("#vx_form_id").val();
///var fields_div=$("#fields_div");
//if(form_id == "" || module == "")
//return;
ajax.show();
fields.hide();
var button=$("#vx_refresh_fields");
button_state_vx('ajax',button);
vx_ajax=$.post(ajaxurl,{action:'get_field_map_<?php echo esc_attr($this->id) ?>',form_id:form_id,account:account,module:module,id:id,vx_crm_ajax:vx_crm_ajax,refresh:refresh},function(res){
fields.html(res);
// primary.html(re.fields);
fields.slideDown(); button_state_vx('ok',button);
start_tooltip();
vx_select();
ajax.hide();
jQuery('.crm_panel').each(function(){
var panel=$(this);
verify_options(panel);
});
})
}
function load_object(){
if(vx_ajax && vx_ajax.abort){
vx_ajax.abort();
}
var account=$("#vx_account").val();
var id=$("#vx_id").val();
///var primary=$("#crm_primary_field");
var ajax=$("#crm_ajax_div_object");
var fields=$("#crm_object_div");
var form_id=$("#vx_form_id").val();
// if(form_id == "" || account == "")
// return;
ajax.show();
fields.hide();
vx_ajax=$.post(ajaxurl,{action:'get_field_map_object_<?php echo esc_attr($this->id) ?>',form_id:form_id,account:account,id:id,vx_crm_ajax:vx_crm_ajax},function(res){
fields.html(res);
// primary.html(re.fields);
fields.slideDown();
start_tooltip();
vx_select();
ajax.hide();
})
}
vx_select();
function vx_select(){
$('#vx_add_fields_select').select2({ placeholder: '<?php esc_html_e('Select Field','contact-form-hubspot-crm') ?>'});
add_note_sel();
}
$(document).on("click","#load_objects",function(e){
e.preventDefault();
var id=$("#vx_id").val();
var ajax=$("#crm_ajax_div");
var fields=$("#vx_module");
var fields_div=$("#crm_field_group");
ajax.show();
fields_div.hide();
$.post(ajaxurl,{action:'get_objects_list_<?php echo esc_attr($this->id) ?>',id:id},function(res){
fields.html(res);
ajax.hide();
})
});
function button_state_vx(state,button){
var ok=button.find('.reg_ok');
var proc=button.find('.reg_proc');
if(state == "ajax"){
button.attr({'disabled':'disabled'});
ok.hide();
proc.show();
}else{
button.removeAttr('disabled');
ok.show();
proc.hide();
}
}
});
</script>

View File

@@ -0,0 +1,56 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?><div class="vx_div">
<div class="vx_head">
<div class="crm_head_div"> <?php esc_html_e('4. Select the Object to create when a form is submitted.', 'contact-form-hubspot-crm'); ?></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"><i class="fa crm_toggle_btn vx_action_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_row">
<div class="vx_col1">
<label for="vx_module" class="left_header"><?php esc_html_e("HubSpot Object", 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip("vx_sel_object") ?>
</label>
</div>
<div class="vx_col2">
<select id="vx_module" class="load_form crm_sel" name="object" autocomplete="off" style="max-width: 260px;">
<option value=""><?php esc_html_e("Select a HubSpot Object", 'contact-form-hubspot-crm'); ?></option>
<?php
foreach ($objects as $k=>$v){
$sel=$feed['object'] == $k ? 'selected="selected"' : "";
?>
<option value="<?php echo esc_attr($k) ?>" <?php echo $sel; ?>><?php echo esc_html($v) ?></option>
<?php
}
?>
</select>
<span style="margin-left: 10px;"></span>
<button class="button" id="vx_refresh_objects" title="<?php esc_html_e('Refresh Objects','contact-form-hubspot-crm'); ?>">
<span class="reg_ok"><i class="fa fa-refresh"></i> <?php esc_html_e('Refresh Objects','contact-form-hubspot-crm') ?></span>
<span class="reg_proc"><i class="fa fa-refresh fa-spin"></i> <?php esc_html_e('Refreshing...','contact-form-hubspot-crm') ?></span>
</button>
<button class="button" id="vx_refresh_fields" title="<?php esc_html_e('Refresh Fields','contact-form-hubspot-crm'); ?>">
<span class="reg_ok"><i class="fa fa-refresh"></i> <?php esc_html_e('Refresh Fields','contact-form-hubspot-crm') ?></span>
<span class="reg_proc"><i class="fa fa-refresh fa-spin"></i> <?php esc_html_e('Refreshing...','contact-form-hubspot-crm') ?></span>
</button>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div id="crm_ajax_div" style="display:none; text-align: center; line-height: 100px;"><i> <?php esc_html_e('Loading, Please Wait...','contact-form-hubspot-crm'); ?></i></div>
<div id="crm_err_div" class="alert_danger" style="display:none;"></div>
<div id="crm_field_group" style="<?php if($object == "" || $form_id == "") {echo 'display:none';} ?>">
<?php
if(!empty($object) && !empty($form_id)){
$this->get_field_mapping($feed,$info);
}
?>
</div>

View File

@@ -0,0 +1,235 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?> <style type="text/css">
.user-list tr {
cursor: move;
}
.user-list tr td a {
cursor: pointer;
}
.user-list tr:nth-child(even) {
background-color: #f5f5f5;
}
.vx_col{
width: 35px; padding-top: 12px !important; text-align: center; cursor: auto;
}
.vx_date{
width: 18%;
}
.ui-sortable-helper {
display: table;
background: #eee;
}
</style>
<div class="vx_wrap">
<h2 class="vx_img_head"><img alt="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" title="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" src="<?php echo $this->get_base_url()?>images/hubspot-crm-logo.png?ver=1" /> <?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm'); ?> <a class="page-title-action" href="<?php echo $new_feed_link?>">
<?php esc_html_e("Add New", 'contact-form-hubspot-crm') ?>
</a> </h2>
<div class="clear"></div>
<?php
if(!$valid_accounts){
?>
<div class="error below-h2" id="message" style="margin-top:20px;">
<p><?php echo sprintf( esc_html__("To get started, please configure your %s HubSpot Settings %s.", 'contact-form-hubspot-crm'), '<a href="'.esc_url($page_link).'">', "</a>") ?></p>
</div>
<?php
}
?>
<form id="feed_form" method="post">
<?php wp_nonce_field('vx_crm_ajax') ?>
<input type="hidden" id="action" name="action"/>
<input type="hidden" id="action_argument" name="action_argument"/>
<div class="tablenav">
<div class="alignleft actions" style="padding:8px 0 7px; ">
<label class="hidden" for="bulk_action">
<?php esc_html_e("Bulk action", 'contact-form-hubspot-crm') ?>
</label>
<select name="bulk_action" id="bulk_action" style="width: 200px">
<option value=''>
<?php esc_html_e("Bulk action", 'contact-form-hubspot-crm') ?>
</option>
<option value='delete'>
<?php esc_html_e("Delete", 'contact-form-hubspot-crm') ?>
</option>
</select>
<button type="submit" title="<?php esc_html_e("Apply Action", 'contact-form-hubspot-crm') ?>" class="button" id="vx_bulk_actions_submit">
<?php esc_html_e("Apply", 'contact-form-hubspot-crm') ?>
</button>
</div>
</div>
<table class="widefat fixed sort" cellspacing="0">
<thead>
<tr>
<td id="cb" class="column-cb check-column" style=""><input type="checkbox" /></td>
<th id="active" class="vx_col"></th>
<th><?php esc_html_e("Name", 'contact-form-hubspot-crm') ?></th>
<th><?php esc_html_e("HubSpot Object", 'contact-form-hubspot-crm') ?></th>
<th><?php esc_html_e("Primary Key", 'contact-form-hubspot-crm'); ?></th>
<th class="vx_date"><?php esc_html_e("Created", 'contact-form-hubspot-crm') ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td id="cb" class="column-cb check-column" style=""><input type="checkbox" /></td>
<th id="active" class="vx_col"></th>
<th><?php esc_html_e("Name", 'contact-form-hubspot-crm') ?></th>
<th><?php esc_html_e("HubSpot Object", 'contact-form-hubspot-crm') ?></th>
<th><?php esc_html_e("Primary Key", 'contact-form-hubspot-crm'); ?></th>
<th class="vx_date"><?php esc_html_e("Created", 'contact-form-hubspot-crm') ?></th>
</tr>
</tfoot>
<tbody class="list:user user-list">
<?php
if(is_array($feeds) && !empty($feeds)){
foreach($feeds as $feed){
$data=$this->post('data',$feed);
$meta=$this->post('meta',$feed);
$data=json_decode($data,true);
$fields=json_decode($meta,true);
$fields=$this->post('fields',$fields);
$primary_key=!empty($data['primary_key']) && isset($fields[$data['primary_key']]['label']) ? $fields[$data['primary_key']]['label'] : esc_html__('N/A','contact-form-hubspot-crm');
$edit_link=$this->get_feed_link($feed['id']);
if(isset($objects[$feed["object"]])){
$feed["object"]=$objects[$feed["object"]];
}
?>
<tr class='author-self status-inherit' data-id="<?php echo $feed['id'] ?>">
<th scope="row" class="check-column"><input type="checkbox" class="vx_check" name="feed[]" value="<?php echo $feed["id"] ?>"/></th>
<td class="vx_col"><img src="<?php echo $this->get_base_url() ?>images/active<?php echo intval($feed["is_active"]) ?>.png" alt="<?php echo $feed["is_active"] ? esc_html__("Active", 'contact-form-hubspot-crm') : esc_html__("Inactive", 'contact-form-hubspot-crm');?>" title="<?php echo $feed["is_active"] ? esc_html__("Active", 'contact-form-hubspot-crm') : esc_html__("Inactive", 'contact-form-hubspot-crm');?>" class="vx_toggle_status" /></td>
<td><a href="<?php echo $edit_link ?>" title="<?php echo esc_html( $feed["name"] ) ?>"><?php echo esc_attr($feed["name"]) ?></a>
<div class="row-actions"> <span class="edit">
<a title="<?php esc_attr_e("Edit Settings", 'contact-form-hubspot-crm') ?>" href="<?php echo $edit_link ?>">
<?php esc_html_e("Edit", 'contact-form-hubspot-crm') ?>
</a> |
</span>
<span class="edit">
<a title="<?php esc_html_e("Delete", 'contact-form-hubspot-crm') ?>" href="#" class="vx_del_feed">
<?php esc_html_e("Delete", 'contact-form-hubspot-crm')?>
</a>
</span>
</div></td>
<td><p><?php echo $feed["object"]; ?></p></td>
<td><p><?php echo $primary_key; ?></p></td>
<td><p><?php echo date('M-d-Y H:i:s', strtotime($feed['time'])+$offset); ?></p></td>
</tr>
<?php
}
}
else {
if($valid_accounts){
?>
<tr>
<td colspan="4" style="padding:20px;"><?php echo sprintf(esc_html__("You don't have any HubSpot feeds configured. Let's go %s create one %s!", 'contact-form-hubspot-crm'), '<a href="'.$new_feed_link.'">', "</a>"); ?></td>
</tr>
<?php
}
else{
?>
<tr>
<td colspan="4" style="padding:20px;"><?php echo sprintf(esc_html__("To get started, please configure your %s HubSpot Settings%s.", 'contact-form-hubspot-crm'), '<a href="'.esc_url($page_link).'">', "</a>"); ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</form>
</div>
<script type="text/javascript">
var vx_crm_nonce='<?php echo wp_create_nonce("vx_crm_ajax") ?>';
(function( $ ) {
$(document).ready( function($) {
$(".vx_del_feed").click(function(e){
e.preventDefault();
if(!confirm("<?php esc_html_e("Delete this feed? 'Cancel' to stop, 'OK' to delete.", 'contact-form-hubspot-crm') ?>")){
return;
}
var id=$(this).closest('tr').data('id');
jQuery("#action_argument").val(id);
jQuery("#action").val("delete");
jQuery("#feed_form")[0].submit();
});
$(".vx_toggle_status").click(function(e){
e.preventDefault();
var feed_id;
var img=this;
var is_active = img.src.indexOf("active1.png") >=0
var $img=$(this);
if(is_active){
img.src=img.src.replace("active1.png", "active0.png");
$img.attr('title','<?php esc_html_e("Inactive", 'contact-form-hubspot-crm') ?>').attr('alt', '<?php esc_html_e("Inactive", 'contact-form-hubspot-crm') ?>');
}
else{
img.src = img.src.replace("active0.png", "active1.png");
$img.attr('title','<?php esc_html_e("Active", 'contact-form-hubspot-crm') ?>').attr('alt', '<?php esc_html_e("Active", 'contact-form-hubspot-crm') ?>');
}
if(feed_id = $img.closest('tr').attr('data-id')) {
$.post(ajaxurl,{action:"update_feed_<?php echo esc_attr($this->id) ?>",vx_crm_ajax:vx_crm_nonce,feed_id:feed_id,is_active:is_active ? 0 : 1})
}
});
$("#vx_bulk_actions_submit").click(function(e){
if($("#bulk_action").val() == ""){
alert('<?php esc_html_e('Please Select Action','contact-form-hubspot-crm') ?>');
return false;
}
if($(".vx_check:checked").length == 0){
alert('<?php esc_html_e('Please Select Feed','contact-form-hubspot-crm') ?>');
return false;
}
if(!confirm('<?php esc_html_e("Are you sure to Delete selected feeds?",'contact-form-hubspot-crm'); ?>' )){
return false;
}
})
$('.sort tbody').sortable({
axis: 'y',
helper: "clone",
helper: function(e, tr)
{
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index)
{
// Set helper cell sizes to match the original sizes
$(this).width($originals.eq(index).width());
});
return $helper;
},
update: function(event, ui){
var data = {
'action': 'update_feed_sort_<?php echo esc_attr($this->id) ?>',
'sort': [],
'vx_crm_ajax': vx_crm_nonce,
};
$(this).children().each(function(index, element) {
var id = $(element).attr('data-id')
data.sort.push(id);
})
$.post( ajaxurl, data );
}
});
});
}(jQuery));
</script>
<?php
do_action('vx_plugin_upgrade_notice_plugin_'.$this->type);
?>

View File

@@ -0,0 +1,776 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
//echo json_encode($fields).'--------------';
?>
<div class="vx_div">
<div class="vx_head">
<div class="crm_head_div"> <?php esc_html_e('5. Map Form Fields to HubSpot Fields.', 'contact-form-hubspot-crm'); ?></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"><i class="fa crm_toggle_btn vx_action_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_col1">
<label>
<?php esc_html_e("Fields Mapping", 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip("vx_map_fields") ?>
</label>
</div>
<div class="vx_col2">
<div id="vx_fields_div">
<?php
$req_span=" <span class='vx_red vx_required'>(".__('Required','contact-form-hubspot-crm').")</span>";
$req_span2=" <span class='vx_red vx_required vx_req_parent'>(".__('Required','contact-form-hubspot-crm').")</span>";
foreach($map_fields as $k=>$v){
if(isset($v['name_c'])){
$v['name']=$v['name_c'];
$v['label']=__('Custom Field','contact-form-hubspot-crm');
}
if( in_array($v['name'] , array("OwnerId","AccountId","ContractId") )){
continue;
}
if($module == "Order" && in_array($v['name'] , array("Status" ))){
continue;
}
$sel_val=isset($map[$k]['field']) ? $map[$k]['field'] : "";
$val_type=isset($map[$k]['type']) && !empty($map[$k]['type']) ? $map[$k]['type'] : "field";
$display="none"; $btn_icon="fa-plus";
if(isset($map[$k][$val_type]) && !empty($map[$k][$val_type])){
$display="block";
$btn_icon="fa-minus";
}
$required=isset($v['req']) && $v['req'] == "true" ? true : false;
$req_html=$required ? $req_span : ""; $k=esc_attr($k);
?>
<div class="crm_panel crm_panel_100">
<div class="crm_panel_head2">
<div class="crm_head_div"><span class="crm_head_text crm_text_label"> <?php echo $v['label'];?></span> <?php echo wp_kses_post($req_html) ?></div>
<div class="crm_btn_div">
<?php
if(! $required){
?>
<i class="vx_remove_btn vx_remove_btn vx_action_btn fa fa-trash-o" title="<?php esc_html_e('Delete','contact-form-hubspot-crm'); ?>"></i>
<?php } ?>
<i class="fa crm_toggle_btn vx_action_btn vx_btn_inner <?php echo esc_attr($btn_icon) ?>" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"></i>
</div>
<div class="crm_clear"></div> </div>
<div class="more_options crm_panel_content" style="display: <?php echo esc_attr($display) ?>;">
<?php if(!isset($v['name_c'])){ ?>
<div class="crm-panel-description">
<span class="crm-desc-name-div"><?php echo esc_html__('Name:','contact-form-hubspot-crm')." ";?><span class="crm-desc-name"><?php echo $v['name']; ?></span> </span>
<?php if($this->post('type',$v) !=""){ ?>
<span class="crm-desc-type-div">, <?php echo esc_html__('Type:','contact-form-hubspot-crm')." ";?><span class="crm-desc-type"><?php echo $v['type'] ?></span> </span>
<?php
}
if($this->post('maxlength',$v) !=""){
?>
<span class="crm-desc-len-div">, <?php echo esc_html__('Max Length:','contact-form-hubspot-crm')." ";?><span class="crm-desc-len"><?php echo $v['maxlength']; ?></span> </span>
<?php
}
if($this->post('eg',$v) !=""){
?>
<span class="crm-eg-div">, <?php echo esc_html__('e.g:','contact-form-hubspot-crm')." ";?><span class="crm-eg"><?php echo $v['eg']; ?></span> </span>
<?php
}
?>
</div>
<?php
}
?>
<div class="vx_margin">
<?php
if(isset($v['name_c'])){
?>
<div class="entry_row">
<div class="entry_col1 vx_label"><?php esc_html_e('Field API Name','contact-form-hubspot-crm') ?></div>
<div class="entry_col2">
<input type="text" name="meta[map][<?php echo esc_attr($k) ?>][name_c]" value="<?php echo $v['name_c'] ?>" placeholder="<?php esc_html_e('Field API Name','contact-form-hubspot-crm') ?>" class="vx_input_100">
</div>
<div class="crm_clear"></div>
</div>
<?php
}
?>
<div class="entry_row">
<div class="entry_col1 vx_label"><label for="vx_type_<?php echo esc_attr($k) ?>"><?php esc_html_e('Field Type','contact-form-hubspot-crm') ?></label></div>
<div class="entry_col2">
<select name='meta[map][<?php echo esc_attr($k) ?>][type]' id="vx_type_<?php echo esc_attr($k) ?>" class='vxc_field_type vx_input_100'>
<?php
foreach($sel_fields as $f_key=>$f_val){
$select="";
if($this->post2($k,'type',$map) == $f_key)
$select='selected="selected"';
?>
<option value="<?php echo esc_attr($f_key) ?>" <?php echo $select ?>><?php echo esc_attr($f_val); ?></option>
<?php } ?>
</select>
</div>
<div class="crm_clear"></div>
</div>
<div class="entry_row entry_row2">
<div class="entry_col1 vx_label">
<label for="vx_field_<?php echo esc_attr($k) ?>" style="<?php if($this->post2($k,'type',$map) != ''){echo 'display:none';} ?>" class="vxc_fields vxc_field_"><?php esc_html_e('Select Field','contact-form-hubspot-crm') ?></label>
<label for="vx_value_<?php echo esc_attr($k) ?>" style="<?php if($this->post2($k,'type',$map) != 'value'){echo 'display:none';} ?>" class="vxc_fields vxc_field_value"> <?php esc_html_e('Custom Value','contact-form-hubspot-crm') ?></label>
</div>
<div class="entry_col2">
<div class="vxc_fields vxc_field_value" style="<?php if($this->post2($k,'type',$map) != 'value'){echo 'display:none';} ?>">
<textarea name='meta[map][<?php echo esc_attr($k)?>][value]' id="vx_value_<?php echo esc_attr($k) ?>" placeholder='<?php esc_html_e("Custom Value",'contact-form-hubspot-crm')?>' class='vx_input_100 vxc_field_input'><?php if(!empty($map[$k]['value'])){ echo htmlentities($map[$k]['value']); } ?></textarea>
<div class="howto"><?php echo sprintf(esc_html__('You can add a form field %s in custom value from following form fields','contact-form-hubspot-crm'),'<code>{field_id}</code>')?></div>
</div>
<select name="meta[map][<?php echo esc_attr($k) ?>][field]" id="vx_field_<?php echo esc_attr($k) ?>" class="vxc_field_option vx_input_100">
<?php echo $this->form_fields_options($form_id,$sel_val); ?>
</select>
</div>
<div class="crm_clear"></div>
</div>
</div></div>
<div class="clear"></div>
</div>
<?php
}
?>
<div id="vx_field_temp" style="display:none">
<div class="crm_panel crm_panel_100 vx_fields">
<div class="crm_panel_head2">
<div class="crm_head_div"><span class="crm_head_text crm_text_label"> <?php esc_html_e('Custom Field', 'contact-form-hubspot-crm');?></span> </div>
<div class="crm_btn_div">
<i class="vx_remove_btn vx_action_btn fa fa-trash-o" title="<?php esc_html_e('Delete','contact-form-hubspot-crm'); ?>"></i>
<i class="fa crm_toggle_btn vx_action_btn vx_btn_inner fa-minus" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"></i>
</div>
<div class="crm_clear"></div> </div>
<div class="more_options crm_panel_content" style="display: block;">
<?php
if($api_type != 'web'){
?>
<div class="crm-panel-description">
<span class="crm-desc-name-div"><?php echo esc_html__('Name:','contact-form-hubspot-crm')." ";?><span class="crm-desc-name"></span> </span>
<span class="crm-desc-type-div">, <?php echo esc_html__('Type:','contact-form-hubspot-crm')." ";?><span class="crm-desc-type"></span> </span>
<span class="crm-desc-len-div">, <?php echo esc_html__('Max Length:','contact-form-hubspot-crm')." ";?><span class="crm-desc-len"></span> </span>
<span class="crm-eg-div">, <?php echo esc_html__('e.g:','contact-form-hubspot-crm')." ";?><span class="crm-eg"></span> </span>
</div>
<?php
}
?>
<div class="vx_margin">
<?php
if($api_type == 'web'){
?>
<div class="entry_row">
<div class="entry_col1 vx_label"><?php esc_html_e('Field API Name','contact-form-hubspot-crm') ?></div>
<div class="entry_col2">
<input type="text" name="name_c" placeholder="<?php esc_html_e('Field API Name','contact-form-hubspot-crm') ?>" class="vx_input_100">
</div>
<div class="crm_clear"></div>
</div>
<?php
}
?>
<div class="entry_row">
<div class="entry_col1 vx_label"><label for="vx_type"><?php esc_html_e('Field Type','contact-form-hubspot-crm') ?></label></div>
<div class="entry_col2">
<select name='type' class='vxc_field_type vx_input_100'>
<?php
foreach($sel_fields as $f_key=>$f_val){
?>
<option value="<?php echo esc_attr($f_key) ?>"><?php echo esc_html($f_val)?></option>
<?php } ?>
</select>
</div>
<div class="crm_clear"></div>
</div>
<div class="entry_row entry_row2">
<div class="entry_col1 vx_label">
<label for="vx_field_" class="vxc_fields vxc_field_"><?php esc_html_e('Select Field','contact-form-hubspot-crm') ?></label>
<label for="vx_value_" style="display:none" class="vxc_fields vxc_field_value"> <?php esc_html_e('Custom Value','contact-form-hubspot-crm') ?></label>
</div>
<div class="entry_col2">
<div class="vxc_fields vxc_field_value" style="display:none">
<textarea name='value' placeholder='<?php esc_html_e("Custom Value",'contact-form-hubspot-crm')?>' class="vx_input_100 vxc_field_input"></textarea>
<div class="howto"><?php echo sprintf(esc_html__('You can add a form field %s in custom value from following form fields','contact-form-hubspot-crm'),'<code>{field_id}</code>')?></div>
</div>
<select name="field" id="vx_field_" class="vxc_field_option vx_input_100">
<?php echo $this->form_fields_options($form_id); ?>
</select>
</div>
<div class="crm_clear"></div>
</div>
</div></div>
<div class="clear"></div>
</div>
</div>
<!--end field box template--->
<?php
if($api_type =="web"){ ?>
<div class="vx_fields_footer">
<div class="vx_row">
<div class="vx_col1"> &nbsp;</div><div class="vx_col2">
<button type="button" class="button button-default" id="xv_add_custom_field"><i class=" fa fa-plus-circle" ></i> <?php esc_html_e('Add Custom Field','contact-form-hubspot-crm')?></button></div>
<div class="clear"></div></div>
</div>
<?php }else{ ?>
<div class="crm_panel crm_panel_100">
<div class="crm_panel_head2">
<div class="crm_head_div"><span class="crm_head_text "> <?php esc_html_e("Add New Field", 'contact-form-hubspot-crm');?></span> </div>
<div class="crm_btn_div"><i class="fa crm_toggle_btn vx_btn_inner fa-minus" style="display: none;" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm'); ?>"></i></div>
<div class="crm_clear"></div> </div>
<div class="more_options crm_panel_content" style="display: block;">
<div class="vx_margin">
<div style="display: table">
<div style="display: table-cell; width: 85%; padding-right: 14px;">
<select id="vx_add_fields_select" class="vx_input_100" autocomplete="off">
<option value=""></option>
<?php
$json_fields=array();
foreach($fields as $k=>$v){
$v['type']=ucfirst($v['type']);
$json_fields[$k]=$v;
$disable='';
if(isset($map_fields[$k])){
$disable='disabled="disabled"';
}
echo '<option value="'.esc_html($k).'" '.$disable.' >'.esc_html($v['label']).'</option>';
} ?>
</select>
</div><div style="display: table-cell;">
<button type="button" class="button button-default" style="vertical-align: middle;" id="xv_add_custom_field"><i class="fa fa-plus-circle" ></i> <?php esc_html_e('Add Field','contact-form-hubspot-crm')?></button>
</div></div>
</div></div>
<div class="clear"></div>
</div>
<!--add new field box template--->
<script type="text/javascript">
var crm_fields=<?php echo json_encode($json_fields); ?>;
</script>
<?php
}
?>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="vx_div">
<div class="vx_head">
<div class="crm_head_div"> <?php esc_html_e('6. When to Send Entry to HubSpot.', 'contact-form-hubspot-crm'); ?></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"><i class="fa crm_toggle_btn vx_action_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_row">
<div class="vx_col1">
<label for="crm_manual_export">
<?php esc_html_e('Disable Automatic Export', 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip("vx_manual_export") ?>
</label>
</div>
<div class="vx_col2">
<fieldset>
<legend class="screen-reader-text"><span>
<?php esc_html_e('Disable Automatic Export', 'contact-form-hubspot-crm'); ?>
</span></legend>
<label for="crm_manual_export">
<input name="meta[manual_export]" id="crm_manual_export" type="checkbox" value="1" <?php echo isset($meta['manual_export'] ) ? 'checked="checked"' : ''; ?>>
<?php esc_html_e( 'Manually send the entries to HubSpot.', 'contact-form-hubspot-crm'); ?> </label>
</fieldset>
</div>
<div style="clear: both;"></div>
</div>
<div class="vx_row">
<div class="vx_col1">
<label for="crm_optin">
<?php esc_html_e("Opt-In Condition", 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip("vx_optin_condition") ?>
</label>
</div>
<div class="vx_col2">
<div>
<input type="checkbox" style="margin-top: 0px;" id="crm_optin" class="crm_toggle_check" name="meta[optin_enabled]" value="1" <?php echo !empty($meta["optin_enabled"]) ? "checked='checked'" : ""?>/>
<label for="crm_optin">
<?php esc_html_e("Enable", 'contact-form-hubspot-crm'); ?>
</label>
</div>
<div style="clear: both;"></div>
<div id="crm_optin_div" style="margin-top: 16px; <?php echo empty($meta["optin_enabled"]) ? "display:none" : ""?>">
<div>
<?php
$sno=0;
foreach($filters as $filter_k=>$filter_v){ $filter_k=esc_attr($filter_k);
$sno++;
?>
<div class="vx_filter_or" data-id="<?php echo esc_attr($filter_k) ?>">
<?php if($sno>1){ ?>
<div class="vx_filter_label">
<?php esc_html_e('OR','contact-form-hubspot-crm') ?>
</div>
<?php } ?>
<div class="vx_filter_div">
<?php
if(is_array($filter_v)){
$sno_i=0;
foreach($filter_v as $s_k=>$s_v){ $s_k=esc_attr($s_k);
$sno_i++;
?>
<div class="vx_filter_and">
<?php if($sno_i>1){ ?>
<div class="vx_filter_label">
<?php esc_html_e('AND','contact-form-hubspot-crm') ?>
</div>
<?php } ?>
<div class="vx_filter_field vx_filter_field1">
<select id="crm_optin_field" name="meta[filters][<?php echo esc_attr($filter_k) ?>][<?php echo esc_attr($s_k) ?>][field]">
<?php
echo $this->form_fields_options($form_id,$this->post('field',$s_v));
?>
</select>
</div>
<div class="vx_filter_field vx_filter_field2">
<select name="meta[filters][<?php echo esc_attr($filter_k) ?>][<?php echo esc_attr($s_k) ?>][op]" >
<?php
foreach($vx_op as $k=>$v){
$sel="";
if($this->post('op',$s_v) == $k)
$sel='selected="selected"';
echo "<option value='".esc_attr($k)."' $sel >".esc_html($v)."</option>";
}
?>
</select>
</div>
<div class="vx_filter_field vx_filter_field3">
<input type="text" class="vxc_filter_text" placeholder="<?php esc_html_e('Value','contact-form-hubspot-crm') ?>" value="<?php echo $this->post('value',$s_v) ?>" name="meta[filters][<?php echo esc_attr($filter_k) ?>][<?php echo esc_attr($s_k) ?>][value]">
</div>
<?php if( $sno_i>1){ ?>
<div class="vx_filter_field vx_filter_field4"><i class="vx_icons-h vx_trash_and vxc_tips fa fa-trash-o" data-tip="Delete"></i></div>
<?php } ?>
<div style="clear: both;"></div>
</div>
<?php
} }
?>
<div class="vx_btn_div">
<button class="button button-default button-small vx_add_and" title="<?php esc_html_e('Add AND Filter','contact-form-hubspot-crm'); ?>"><i class="vx_icons-s vx_trash_and fa fa-hand-o-right"></i>
<?php esc_html_e('Add AND Filter','contact-form-hubspot-crm') ?>
</button>
<?php if($sno>1){ ?>
<a href="#" class="vx_trash_or">
<?php esc_html_e('Trash','contact-form-hubspot-crm') ?>
</a>
<?php } ?>
</div>
</div>
</div>
<?php
}
?>
<div class="vx_btn_div">
<button class="button button-default vx_add_or" title="<?php esc_html_e('Add OR Filter','contact-form-hubspot-crm'); ?>"><i class="vx_icons vx_trash_and fa fa-check"></i>
<?php esc_html_e('Add OR Filter','contact-form-hubspot-crm') ?>
</button>
</div>
</div>
<!--------- template------------>
<div style="display: none;" id="vx_filter_temp">
<div class="vx_filter_or">
<div class="vx_filter_label">
<?php esc_html_e('OR','contact-form-hubspot-crm') ?>
</div>
<div class="vx_filter_div">
<div class="vx_filter_and">
<div class="vx_filter_label vx_filter_label_and">
<?php esc_html_e('AND','contact-form-hubspot-crm') ?>
</div>
<div class="vx_filter_field vx_filter_field1">
<select id="crm_optin_field" name="field">
<?php
echo $this->form_fields_options($form_id);
?>
</select>
</div>
<div class="vx_filter_field vx_filter_field2">
<select name="op" >
<?php
foreach($vx_op as $k=>$v){
echo "<option value='".esc_attr($k)."' >".esc_html($v)."</option>";
}
?>
</select>
</div>
<div class="vx_filter_field vx_filter_field3">
<input type="text" class="vxc_filter_text" placeholder="<?php esc_html_e('Value','contact-form-hubspot-crm') ?>" name="value">
</div>
<div class="vx_filter_field vx_filter_field4"><i class="vx_icons vx_trash_and vxc_tips fa fa-trash-o"></i></div>
<div style="clear: both;"></div>
</div>
<div class="vx_btn_div">
<button class="button button-default button-small vx_add_and" title="<?php esc_html_e('Add AND Filter','contact-form-hubspot-crm'); ?>"><i class="vx_icons vx_trash_and fa fa-hand-o-right"></i>
<?php esc_html_e('Add AND Filter','contact-form-hubspot-crm') ?>
</button>
<a href="#" class="vx_trash_or">
<?php esc_html_e('Trash','contact-form-hubspot-crm') ?>
</a> </div>
</div>
</div>
</div>
<!--------- template end ------------>
</div>
</div>
<div style="clear: both;"></div>
</div>
<?php
if($module != 'Task'){
$settings=get_option($this->type.'_settings',array());
if(!empty($settings['notes'])){
?>
<div class="vx_row">
<div class="vx_col1">
<label for="vx_notes"><?php esc_html_e('Entry Notes ', 'contact-form-hubspot-crm'); $this->tooltip('vx_entry_notes');?></label>
</div>
<div class="vx_col2">
<input type="checkbox" style="margin-top: 0px;" id="vx_notes" class="crm_toggle_check" name="meta[entry_notes]" value="1" <?php echo !empty($meta['entry_notes']) ? 'checked="checked"' : ''?> autocomplete="off"/>
<label for="vx_notes"><?php esc_html_e('Add / delete notes to HubSpot when added / deleted in Contact Form Entries Plugin', 'contact-form-hubspot-crm'); ?></label>
</div>
<div class="clear"></div>
</div>
<?php
}
}
?>
</div>
</div>
<?php
$panel_count=6;
if(is_array($search_fields) && count($search_fields)>0){
?>
<div class="vx_div ">
<div class="vx_head ">
<div class="crm_head_div"> <?php echo sprintf(esc_html__('%s. Choose Primary Key.', 'contact-form-hubspot-crm' ),++$panel_count); ?></div>
<div class="crm_btn_div"><i class="fa crm_toggle_btn fa-minus" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_row">
<div class="vx_col1">
<label for="crm_primary_field"><?php esc_html_e('Select Primary Key','%dd%') ?></label>
</div><div class="vx_col2">
<select id="crm_primary_field" name="meta[primary_key]" class="vx_sel vx_input_100" autocomplete="off">
<?php echo $this->crm_select($search_fields,$this->post('primary_key',$meta)); ?>
</select>
<div class="description" style="float: none; width: 90%"><?php esc_html_e('If you want to update a pre-existing object, select what should be used as a unique identifier ("Primary Key"). For example, this may be an email address, lead ID, or address. When a new entry comes in with the same "Primary Key" you select, a new object will not be created, instead the pre-existing object will be updated.', '%dd%'); ?></div>
</div>
<div class="clear"></div>
</div>
<div class="vx_row">
<div class="vx_col1">
<label for="vx_update"><?php esc_html_e('Update Entry ', '%dd%');?></label>
</div>
<div class="vx_col2">
<input type="checkbox" style="margin-top: 0px;" id="vx_update" class="crm_toggle_check" name="meta[update]" value="1" <?php echo !empty($meta['update']) ? 'checked="checked"' : ''?> autocomplete="off"/>
<label for="vx_update"><?php esc_html_e('Do not update entry, if already exists', '%dd%'); ?></label>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<!-------------------------- lead owner -------------------->
<?php
}
if($module != 'Task'){
?>
<div class="vx_div">
<div class="vx_head">
<div class="crm_head_div"> <?php echo sprintf(esc_html__('%s. Add Note.', 'contact-form-hubspot-crm'),$panel_count+=1); ?></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"><i class="fa crm_toggle_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group">
<div class="vx_row">
<div class="vx_col1">
<label for="crm_note">
<?php esc_html_e("Add Note ", 'contact-form-hubspot-crm'); ?>
<?php $this->tooltip('vx_entry_note') ?>
</label>
</div>
<div class="vx_col2">
<input type="checkbox" style="margin-top: 0px;" id="crm_note" class="crm_toggle_check" name="meta[note_check]" value="1" <?php echo !empty($meta['note_check']) ? "checked='checked'" : ""?>/>
<label for="crm_note_div">
<?php esc_html_e("Enable", 'contact-form-hubspot-crm'); ?>
</label>
</div>
<div style="clear: both;"></div>
</div>
<div id="crm_note_div" style="margin-top: 16px; <?php echo empty($meta["note_check"]) ? "display:none" : ""?>">
<div class="vx_row">
<div class="vx_col1">
<label for="crm_note_fields">
<?php esc_html_e( 'Note Fields ', 'contact-form-hubspot-crm' ); $this->tooltip("vx_note_fields") ?>
</label>
</div>
<div class="vx_col2 entry_col2">
<textarea name="meta[note_val]" placeholder="<?php esc_html_e("{field-id} text",'contact-form-hubspot-crm')?>" class="vx_input_100 vxc_field_input" style="height: 60px"><?php
if(!empty($meta['note_fields']) && is_array($meta['note_fields'])){
$meta['note_val']='{'.implode("}\n{",$meta['note_fields'])."}";
}
echo $this->post('note_val',$meta); ?></textarea>
<div class="howto"><?php echo sprintf(esc_html__('You can add a form field %s in custom value from following form fields','contact-form-hubspot-crm'),'<code>{field_id}</code>')?></div>
<select name="field" class="vxc_field_option vx_input_100">
<?php echo $this->form_fields_options($form_id); ?>
</select>
</div>
<div style="clear: both;"></div>
</div>
<div class="vx_row">
<div class="vx_col1">
<label for="crm_disable_note">
<?php esc_html_e( 'Disable Note ', 'contact-form-hubspot-crm' ); $this->tooltip("vx_disable_note") ?>
</label>
</div>
<div class="vx_col2">
<input type="checkbox" style="margin-top: 0px;" id="crm_disable_note" class="crm_toggle_check" name="meta[disable_entry_note]" value="1" <?php echo !empty($meta['disable_entry_note']) ? "checked='checked'" : ""?>/>
<label for="crm_disable_note">
<?php esc_html_e('Do not Add Note if entry already exists in Hubspot', 'contact-form-hubspot-crm'); ?>
</label>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>
</div>
<?php
}
if( in_array($module, array('Task','Contact','Company'))){
$users=$this->post('users',$info_meta);
?>
<div class="vx_div vx_refresh_panel ">
<div class="vx_head ">
<div class="crm_head_div"> <?php echo sprintf(esc_html__('%s. Object Owner', 'contact-form-hubspot-crm' ),++$panel_count); ?></div>
<div class="crm_btn_div"><i class="fa crm_toggle_btn fa-minus" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group ">
<div class="vx_row">
<div class="vx_col1">
<label for="crm_owner"><?php esc_html_e("Assign Owner ", 'contact-form-hubspot-crm'); $this->tooltip('vx_owner_check');?></label>
</div>
<div class="vx_col2">
<input type="checkbox" style="margin-top: 0px;" id="crm_owner" class="crm_toggle_check <?php if(empty($users)){echo 'vx_refresh_btn';} ?>" name="meta[owner]" value="1" <?php echo !empty($meta["owner"]) ? "checked='checked'" : ""?> autocomplete="off"/>
<label for="owner"><?php esc_html_e("Enable", 'contact-form-hubspot-crm'); ?></label>
</div>
<div class="clear"></div>
</div>
<div id="crm_owner_div" style="<?php echo empty($meta["owner"]) ? "display:none" : ""?>">
<div class="vx_row">
<div class="vx_col1">
<label><?php esc_html_e('Users List ','contact-form-hubspot-crm'); $this->tooltip('vx_owners'); ?></label>
</div>
<div class="vx_col2">
<button class="button vx_refresh_data" data-id="refresh_users" type="button" autocomplete="off" style="vertical-align: baseline;">
<span class="reg_ok"><i class="fa fa-refresh"></i> <?php esc_html_e('Refresh Data','contact-form-hubspot-crm') ?></span>
<span class="reg_proc"><i class="fa fa-refresh fa-spin"></i> <?php esc_html_e('Refreshing...','contact-form-hubspot-crm') ?></span>
</button>
</div>
<div class="clear"></div>
</div>
<div class="vx_row">
<div class="vx_col1">
<label for="crm_sel_user"><?php esc_html_e('Select User ','contact-form-hubspot-crm'); $this->tooltip('vx_sel_owner'); ?></label>
</div>
<div class="vx_col2">
<select id="crm_sel_user" name="meta[user]" style="width: 100%;" autocomplete="off">
<?php echo $this->gen_select($users,$meta['user'],__('Select User','contact-form-hubspot-crm')); ?>
</select>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php
}
$file=vxcf_hubspot::$path.'pro/pro-mapping.php';
if(vxcf_hubspot::$is_pr && file_exists($file)){
include_once($file);
}
if(in_array($module,array('Ticket'))){
$pipe='pipes';
$pipes=$this->post($pipe,$info_meta);
?>
<div class="vx_div vx_refresh_panel ">
<div class="vx_head ">
<div class="crm_head_div"> <?php echo sprintf(esc_html__('%s. Select Pipeline', 'contact-form-hubspot-crm' ),++$panel_count); ?></div>
<div class="crm_btn_div"><i class="fa crm_toggle_btn fa-minus" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group ">
<div class="vx_row">
<div class="vx_col1">
<label><?php esc_html_e('Assign Pipeline ', 'contact-form-hubspot-crm');?></label>
</div>
<div class="vx_col2">
<input type="checkbox" style="margin-top: 0px;" id="crm_flow" class="crm_toggle_check <?php if( empty($pipes)){echo 'vx_refresh_btn';} ?>" name="meta[add_pipe]" value="1" <?php echo !empty($meta["add_pipe"]) ? "checked='checked'" : ""?> autocomplete="off"/>
<label for="crm_flow"><?php esc_html_e("Enable", 'contact-form-hubspot-crm'); ?></label>
</div>
<div class="clear"></div>
</div>
<div id="crm_flow_div" style="<?php echo empty($meta["add_pipe"]) ? "display:none" : ""?>">
<div class="vx_row">
<div class="vx_col1">
<label><?php esc_html_e('Pipelines ','contact-form-hubspot-crm'); ?></label>
</div>
<div class="vx_col2">
<button class="button vx_refresh_data" data-id="refresh_<?php echo $pipe; ?>" type="button" autocomplete="off" style="vertical-align: baseline;">
<span class="reg_ok"><i class="fa fa-refresh"></i> <?php esc_html_e('Refresh Data','contact-form-hubspot-crm') ?></span>
<span class="reg_proc"><i class="fa fa-refresh fa-spin"></i> <?php esc_html_e('Refreshing...','contact-form-hubspot-crm') ?></span>
</button>
</div>
<div class="clear"></div>
</div>
<div class="vx_row">
<div class="vx_col1">
<label for="crm_sel_flow"><?php esc_html_e('Select Pipeline ','contact-form-hubspot-crm'); ?></label>
</div> <div class="vx_col2">
<select id="crm_sel_pipe" name="meta[pipe]" style="width: 100%;" autocomplete="off">
<?php echo $this->gen_select($pipes,$meta['pipe'],__('Select Pipeline','contact-form-hubspot-crm')); ?>
</select>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php }
if(in_array($module,array('Deal'))){
$pipe='deal_pipes';
$pipes=$this->post($pipe,$info_meta);
?>
<div class="vx_div vx_refresh_panel ">
<div class="vx_head ">
<div class="crm_head_div"> <?php echo sprintf(esc_html__('%s. Select Pipeline', 'contact-form-hubspot-crm' ),++$panel_count); ?></div>
<div class="crm_btn_div"><i class="fa crm_toggle_btn fa-minus" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm') ?>"></i></div>
<div class="crm_clear"></div>
</div>
<div class="vx_group ">
<div class="vx_row">
<div class="vx_col1">
<label><?php esc_html_e('Assign Pipeline ', 'contact-form-hubspot-crm');?></label>
</div>
<div class="vx_col2">
<input type="checkbox" style="margin-top: 0px;" id="crm_flow1" class="crm_toggle_check <?php if( empty($pipes)){echo 'vx_refresh_btn';} ?>" name="meta[add_sales_pipe]" value="1" <?php echo !empty($meta["add_sales_pipe"]) ? "checked='checked'" : ""?> autocomplete="off"/>
<label for="crm_flow"><?php esc_html_e("Enable", 'contact-form-hubspot-crm'); ?></label>
</div>
<div class="clear"></div>
</div>
<div id="crm_flow1_div" style="<?php echo empty($meta["add_sales_pipe"]) ? "display:none" : ""?>">
<div class="vx_row">
<div class="vx_col1">
<label><?php esc_html_e('Pipelines ','contact-form-hubspot-crm'); ?></label>
</div>
<div class="vx_col2">
<button class="button vx_refresh_data" data-id="refresh_sales_pipes" type="button" autocomplete="off" style="vertical-align: baseline;">
<span class="reg_ok"><i class="fa fa-refresh"></i> <?php esc_html_e('Refresh Data','contact-form-hubspot-crm') ?></span>
<span class="reg_proc"><i class="fa fa-refresh fa-spin"></i> <?php esc_html_e('Refreshing...','contact-form-hubspot-crm') ?></span>
</button>
</div>
<div class="clear"></div>
</div>
<div class="vx_row">
<div class="vx_col1">
<label for="crm_sel_flow"><?php esc_html_e('Select Pipeline ','contact-form-hubspot-crm'); ?></label>
</div> <div class="vx_col2">
<select id="crm_sel_pipe" name="meta[sales_pipe]" style="width: 100%;" autocomplete="off">
<?php echo $this->gen_select($pipes,$meta['sales_pipe'],__('Select Pipeline','contact-form-hubspot-crm')); ?>
</select>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php }
?>
<div class="button-controls submit" style="padding-left: 5px;">
<input type="hidden" name="form_id" value="<?php echo esc_attr($form_id) ?>">
<button type="submit" title="<?php esc_html_e('Save Feed','contact-form-hubspot-crm'); ?>" name="<?php echo esc_attr($this->id) ?>_submit" class="button button-primary button-hero"> <i class="vx_icons vx vx-arrow-50"></i> <?php echo empty($fid) ? esc_html__("Save Feed", 'contact-form-hubspot-crm') : esc_html__("Update Feed", 'contact-form-hubspot-crm'); ?> </button>
</div>
<?php
do_action('vx_plugin_upgrade_notice_plugin_'.$this->type);
?>

View File

@@ -0,0 +1,140 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div class="vxa_entry">
<div>
<div class="crm_panel crm_panel_50">
<div class="crm_panel_head">
<div class="crm_head_div"><span class="crm_head_text"><?php esc_html_e('Data Sent','contact-form-hubspot-crm') ?></span></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm'); ?>"><i class="fa crm_toggle_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="crm_panel_content crm-block-content">
<?php
if(is_array($data) && count($data)>0){
foreach($data as $k=>$v){
$label=isset($v['label']) ? $v['label'] : $k;
$value=$v;
if(is_array($v) && isset($v['value'])){
$value=$v['value'];
}
if(is_array($value)){
$value=json_encode($value);
}
?>
<div class="entry_row">
<div class="entry_col1 vx_label"><span title="<?php echo esc_attr($k) ?>"><?php echo esc_html($label); ?></span></div>
<div class="entry_col2"><?php echo is_array($value) ? esc_html(json_encode($value)) : esc_html($value) ?></div>
<div class="crm_clear"></div>
</div>
<?php
}
}else{
?>
<div class="vx_error"><i class="fa fa-warning"></i> <?php esc_html_e('Nothing Posted to HubSpot','contact-form-hubspot-crm');?></div>
<?php
}
?>
</div></div>
<?php
if(is_array($response) && count($response)>0){
$error=false;
?>
<div class="crm_panel crm_panel_50">
<div class="crm_panel_head">
<div class="crm_head_div"><span class="crm_head_text"><?php esc_html_e('HubSpot Response','contact-form-hubspot-crm') ?></span></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm'); ?>"><i class="fa crm_toggle_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="crm_panel_content crm-block-content">
<?php
foreach($response as $k=>$v){
?>
<div class="entry_row">
<div class="entry_col1 vx_label"><?php echo esc_attr($k) ?></div>
<div class="entry_col2"><?php echo is_array($v) ? json_encode($v) : $v ?></div>
<div class="crm_clear"></div>
</div>
<?php
}
?>
</div></div>
<?php
}
if(is_array($extra) && count($extra)>0){
$detail_class=!$error ? 'crm_panel_100' : 'crm_panel_50';
$error=false;
?>
<div class="crm_panel <?php echo esc_attr($detail_class) ?>">
<div class="crm_panel_head">
<div class="crm_head_div"><span class="crm_head_text"><?php esc_html_e('More Detail','contact-form-hubspot-crm') ?></span></div>
<div class="crm_btn_div" title="<?php esc_html_e('Expand / Collapse','contact-form-hubspot-crm'); ?>"><i class="fa crm_toggle_btn fa-minus"></i></div>
<div class="crm_clear"></div>
</div>
<div class="crm_panel_content crm-block-content">
<?php
foreach($extra as $k=>$v){
?>
<div class="entry_row">
<div class="entry_col1 vx_label"><?php echo isset($labels[$k]) ? esc_attr($labels[$k]) : esc_attr($k) ?></div>
<div class="entry_col2"><?php
if($k == "filter"){
if(is_array($v)){
$or_count=0;
foreach($v as $or){
if(is_array($or)){
if($or_count>0){ echo "<div class='vx_or '>OR</div>";}
$or_count++;
$and_count=0;
foreach($or as $con){
$con['field']=$this->get_gf_field_label($form_id,$con['field']);
$icon="times"; $color="vx_red";
if($con['check'] == "true"){
$icon="check"; $color="vx_green";
}
$op=isset($vx_ops[$con['op']]) ? $vx_ops[$con['op']] : $con['op'];
if($and_count>0){ echo "<div class='vx_or'>AND</div>";}
echo "<i class='fa fa-".$icon." vx_left_2'></i> ".esc_html($con['field'])." ( <span class='vx_val'>".esc_html($con['input'])."</span> ) <code>".esc_html($op)."</code> <span class='vx_val'>".esc_html($con['field_val'])."</span>";
$and_count++;
}
}
}
}
}else{
echo is_array($v) ? esc_html(json_encode($v)) : esc_html($v);
} ?></div>
<div class="crm_clear"></div>
</div>
<?php
}
?>
</div></div>
<?php
}
if($error){
?>
<div class="vx_error"><i class="fa fa-warning"></i> <?php esc_html_e('Detail Not Found','contact-form-hubspot-crm');?></div>
<?php
} ?>
<div style="clear: both"></div>
</div>
<div class="vx_log_detail_footer">
<?php
if($log['feed_id']!=""){
$feed_link=$this->get_feed_link($log['feed_id'],$log['form_id']);
?>
<a href="<?php echo esc_url($feed_link) ?>" title="<?php esc_html_e('Edit Feed','contact-form-hubspot-crm') ?>" class="button"><i class="fa fa-edit"></i> <?php esc_html_e('Edit Feed','contact-form-hubspot-crm') ?></a>
<?php
}
?>
<a href="<?php echo esc_url($log_link) ?>" title="<?php esc_html_e('Open in New Window','contact-form-hubspot-crm') ?>" target="_blank" class="button"><i class="fa fa-external-link"></i> <?php esc_html_e('Open in New Window','contact-form-hubspot-crm') ?></a>
<a href="#" class="button vx_close_detail" title="<?php esc_html_e('Close','contact-form-hubspot-crm') ?>"><i class="fa fa-times"></i> <?php esc_html_e('Close','contact-form-hubspot-crm') ?></a>
</div>
</div>

View File

@@ -0,0 +1,644 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?><style type="text/css">
.vx_col{
width: 16px;
}
.widefat tr td.vx_icon_col{
padding-left: 0px;
}
.widefat tr td.vx_icon_col img{
margin-top: 2px;
}
.widefat tr th input{
margin-left: 0px;
}
.crm_status_img{
width:18px; display: block; margin: 1px auto;
}
.crm_actions{
padding: 12px 0px 10px 0px; clear: both;
}
.crm_input_inline{
float: left; height: 28px; margin-right:5px;
}
.vx_sort{
cursor: pointer;
}
.vx_sort .vx_hide_sort{
display: none;
}
table .vx_icons{
color: #888;
font-size: 18px;
cursor: pointer;
}
.vx_icons:hover{
color: #333;
}
.vx_sort_icon{
vertical-align: middle; margin-left: 5px;
}
.wrap form .vx_left_10{
margin-left: 8px;
}
.entry_detail{
border-top: 0px solid #ddd;
border-bottom: 0px solid #ddd;
}
@media screen and (max-width: 782px) {
.crm_input_inline{
float: left; height: 36px !important;
}
}
@media screen and (max-width: 1028px) {
table .crm_panel_50{
width: 98%;
}
}
/*********************crm panel******************/
.crm_panel_content{
border: 1px solid #ddd;
border-top: 0px;
display: none;
padding: 16px;
background: #fff;
}
.crm_panel * {
-webkit-box-sizing: border-box; /* Safari 3.0 - 5.0, Chrome 1 - 9, Android 2.1 - 3.x */
-moz-box-sizing: border-box; /* Firefox 1 - 28 */
box-sizing: border-box;
}
.crm_panel_100{
margin: 1%;
clear: both;
}
.crm_panel_50{
width: 48%;
margin: 1%;
min-width: 300px;
float: left;
}
.crm_panel_head{
background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(229, 229, 229, 1) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
border: 1px solid #ddd;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
.crm_panel_head2{
background: #f6f6f6;
border: 1px solid #ddd;
}
.crm_panel_head , .crm_head_text{
font-size: 14px; color:#666; font-weight: bold;
}
.crm_head_div{
float: left;
width: 80%; padding: 8px 20px;
}
.crm_panel_content{
border: 1px solid #ddd;
border-top: 0px;
display: block;
padding: 12px;
background: #fff;
overflow: auto;
}
.crm-block-content{
height: 200px;
overflow: auto;
}
.crm_btn_div{
float: right;
font-size: 18px;
width:20%; padding: 8px 20px;
text-align: right;
}
.crm_toggle_btn:hover{
color: #333;
}
.crm_toggle_btn{
color: #999; cursor: pointer;
}
.vx_input_100{
width: 100%;
}
.crm_clear{
clear: both;
}
.entry_row {
margin: 7px auto;
}
.entry_col1 {
float: left;
width: 25%;
padding: 0px 7px;
text-align: left;
}
.entry_col2 {
float: left;
width: 75%;
padding-left: 7px;
}
.vx_margin{
margin-top: 10px;
}
.vx_red{
color: #E31230;
}
.vx_label{
font-weight: bold;
}
.vx_blue{
color: #1874CD;
}
.vx_val{
text-decoration: underline;
}
.vx_or{
font-style: italic;
}.vx_op{
font-style: italic;
}
.vx_u{
text-decoration: underline;
}
.vx_left_20{
margin-left: 8px;
}
.vx_error{
background: #ca5952;
padding: 10px;
font-size: 14px;
margin: 1% 2%;
color: #fff;
}
.vx_yellow{
background-color: #F9ECBE;
}
.vx_log_detail_footer{
padding: 2px 10px;
text-align: right;
}
.vx_wrap .crm_actions a.button{
display:inline-block;
margin-top: 0px;
}
.tablenav .tablenav-pages a:focus,.tablenav .tablenav-pages a:hover{border-color:#5b9dd9;color:#fff;background:#00a0d2;box-shadow:none;outline:0}
.tablenav .tablenav-pages a,.tablenav-pages span.current{text-decoration:none;padding:3px 6px}
.tablenav .tablenav-pages a,.tablenav-pages-navspan{display:inline-block;min-width:17px;border:1px solid #ccc;padding:3px 5px 7px;background:#e5e5e5;font-size:16px;line-height:1;font-weight:400;text-align:center}
</style>
<div class="vx_wrap">
<div>
<h2 class="vx_img_head"><img alt="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" title="<?php esc_html_e("HubSpot Feeds", 'contact-form-hubspot-crm') ?>" src="<?php echo $this->get_base_url()?>images/hubspot-crm-logo.png?ver=1" /> <?php esc_html_e("HubSpot Log", 'contact-form-hubspot-crm'); ?> <select style="min-width: 120px; max-width: 200px; margin-left: 12px; font-weight: normal;" id="vx_sel_feed">
<option value=""><?php esc_html_e('All Feeds','contact-form-hubspot-crm') ?></option>
<?php
$feeds = $this->data->get_feeds();
foreach($feeds as $val){
$sel="";
if(isset($_REQUEST['feed_id']) && $_REQUEST['feed_id'] == $val['id'])
$sel="selected='selected'";
echo "<option value='".esc_attr($val['id'])."' $sel>".esc_html($val['name'])."</option>";
}
?>
</select></h2>
<div class="clear"></div>
</div>
<div>
<div style="float: right;">
<form id="vx_form" class="crm_form" method="get"><div>
<input type="hidden" name="page" value="<?php echo esc_attr($this->post('page')) ?>" />
<input type="hidden" name="id" value="<?php echo esc_attr($this->post('id')) ?>" />
<input type="hidden" name="tab" value="<?php echo esc_attr($this->post('tab')) ?>" />
<input type="text" placeholder="<?php esc_html_e('Search','contact-form-hubspot-crm') ?>" value="<?php echo esc_attr($this->post('search')) ?>" name="search" class="crm_input_inline">
<?php
if($this->post('entry_id') !=""){
?>
<input type="hidden" name="entry_id" value="<?php echo esc_attr($_REQUEST['entry_id']) ?>" />
<?php
}
?>
<input type="hidden" name="order" value="<?php echo esc_attr($this->post('order')) ?>" />
<input type="hidden" name="orderby" value="<?php echo esc_attr($this->post('orderby')) ?>" />
<input type="hidden" name="vx_tab_action_<?php echo esc_attr($this->id) ?>" id="vx_export_log" value="" autocomplete="off" />
<input type="hidden" id="vx_nonce_field" value="<?php echo wp_create_nonce('vx_nonce'); ?>">
<select name="object" class="crm_input_inline" style="max-width: 100px;">
<option value=""><?php esc_html_e('All Objects','contact-form-hubspot-crm') ?></option>
<?php
foreach($objects as $f_key=>$f_val){
$sel="";
if(isset($_REQUEST['object']) && $_REQUEST['object'] == $f_key)
$sel="selected='selected'";
echo "<option value='".esc_attr($f_key)."' $sel>".esc_attr($f_val)."</option>";
}
?>
</select>
<select name="status" class="crm_input_inline">
<option value=""><?php esc_html_e('All Status','contact-form-hubspot-crm') ?></option>
<?php
foreach($statuses as $f_key=>$f_val){
$sel="";
if(isset($_REQUEST['status']) && $_REQUEST['status'] == $f_key)
$sel="selected='selected'";
echo "<option value='".esc_attr($f_key)."' $sel>".esc_attr($f_val)."</option>";
}
?>
</select>
<select name="time" class="crm_time_select crm_input_inline" style="max-width: 100px;">
<option value=""><?php esc_html_e('All Times','contact-form-hubspot-crm') ?></option>
<?php
foreach($times as $f_key=>$f_val){
$sel="";
if(isset($_REQUEST['time']) && $_REQUEST['time'] == $f_key)
$sel="selected='selected'";
echo "<option value='".esc_attr($f_key)."' $sel>".esc_attr($f_val)."</option>";
}
?>
</select>
<span style="<?php if($this->post('time') != "custom"){echo "display:none";} ?>" class="crm_custom_range">
<input type="text" name="start_date" placeholder="<?php esc_html_e('From Date','contact-form-hubspot-crm') ?>" value="<?php if(isset($_REQUEST['start_date'])){echo esc_attr($_REQUEST['start_date']);}?>" class="vxc_date crm_input_inline" style="width: 100px">
<input type="text" class="vxc_date crm_input_inline" value="<?php if(isset($_REQUEST['end_date'])){echo esc_attr($_REQUEST['end_date']);}?>" placeholder="<?php esc_html_e('To Date','contact-form-hubspot-crm') ?>" name="end_date" style="width: 100px">
</span>
<button type="submit" title="<?php esc_html_e('Search','contact-form-hubspot-crm') ?>" name="search" class="button-secondary button crm_input_inline"><i class="fa fa-search"></i> <?php esc_html_e('Search','contact-form-hubspot-crm') ?></button>
</div> </form>
<div style="clear: both;"></div>
</div>
<form method="post">
<div class="crm_actions tablenav">
<div class="alignleft actions">
<select name="bulk_action" id="vx_bulk_action" class="crm_input_inline" style="min-width: 100px; max-width: 250px;">
<?php
foreach($bulk_actions as $k=>$v){
echo '<option value="'.esc_attr($k).'">'.esc_html($v).'</option>';
}
?>
</select>
<input type="hidden" name="vx_nonce" value="<?php echo wp_create_nonce('vx_nonce'); ?>">
<button type="submit" class="button-secondary button crm_input_inline" title="<?php esc_html_e('Apply','contact-form-hubspot-crm') ?>" id="vx_apply_bulk"><i class="fa fa-check"></i> <?php esc_html_e('Apply','contact-form-hubspot-crm') ?></button>
<?php
$log_link= admin_url("admin.php?page={$this->id}&tab=logs");
if($items>0){
?>
<button type="button" name="tab_action" title="<?php esc_html_e('Export as CSV','contact-form-hubspot-crm') ?>" id="vx_export" class="button-secondary button crm_input_inline vx_left_10"><i class="fa fa-download"></i> <?php esc_html_e('Export as CSV','contact-form-hubspot-crm') ?></button>
<?php
}
$_log_id=isset($_GET['log_id']) ? $this->post('log_id') : '';
if($_log_id !="" ){
if(isset($data['feeds'][0]['entry_id']) && $data['feeds'][0]['entry_id']!=""){
$entry_id=$data['feeds'][0]['entry_id'];
?>
<a href="<?php echo esc_url( $log_link.'&entry_id='.$entry_id);?>" title="<?php echo sprintf(esc_html__('View Entry# %s Logs','contact-form-hubspot-crm'),$entry_id); ?>" class="button vx_left_10"><i class="fa fa-hand-o-right"></i> <?php echo sprintf(esc_html__('View Entry# %s Logs','contact-form-hubspot-crm'),$entry_id); ?></a><?php
}}
if($this->post('entry_id') !="" || $_log_id !=""){
?><a href="<?php echo esc_url($log_link);?>" title="<?php esc_html_e('View All Logs','contact-form-hubspot-crm') ?>" class="button vx_left_10"><i class="fa fa-external-link"></i> <?php esc_html_e('View All Logs','contact-form-hubspot-crm') ?></a>
<?php
}
?>
</div>
<?php
if($items>0){
?>
<div class="tablenav-pages"> <span id="paging_header" class="displaying-num"><?php esc_html_e('Displaying','contact-form-hubspot-crm') ?> <span id="paging_range_min_header"><?php echo esc_html($data['min']); ?></span> - <span id="paging_range_max_header"><?php echo esc_html($data['max']) ?></span> of <span id="paging_total_header"><?php echo esc_html($data['items']) ?></span></span><?php echo wp_kses_post($data['links']) ?></div>
<?php
}
?>
</div>
<table class="widefat fixed sort" cellspacing="0">
<thead>
<tr>
<th scope="col" id="active" class="manage-column vx_col"><input type="checkbox" class="crm_head_check"> </th>
<th scope="col" class="manage-column vx_col"> </th>
<th scope="col" class="manage-column vx_sort" data-name="crm_id"><?php esc_html_e("HubSpot ID", 'contact-form-hubspot-crm') ?>
<i class="fa fa-caret-<?php echo esc_attr($crm_order) ?> vx_sort_icon <?php echo esc_attr($crm_class) ?>"></i>
</th>
<th scope="col" class="manage-column vx_sort" data-name="entry_id"><?php esc_html_e("Entry ID", 'contact-form-hubspot-crm') ?>
<i class="fa fa-caret-<?php echo esc_attr($entry_order) ?> vx_sort_icon <?php echo esc_attr($entry_class) ?>"></i>
</th>
<th scope="col"><?php esc_html_e('Feed ID', 'contact-form-hubspot-crm') ?> </th>
<th scope="col" class="manage-column" data-name="object"><?php esc_html_e("Description", 'contact-form-hubspot-crm') ?>
</th>
<th scope="col" class="manage-column vx_sort" data-name="time"><?php esc_html_e("Time", 'contact-form-hubspot-crm') ?>
<i class="fa fa-caret-<?php echo esc_attr($time_order) ?> vx_sort_icon <?php echo esc_attr($time_class) ?>"></i>
</th>
<th style="width: 40px"><?php esc_html_e('Detail','contact-form-hubspot-crm') ?></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" id="active" class="manage-column vx_col"><input type="checkbox" class="crm_head_check"> </th>
<th scope="col" class="manage-column vx_col"> </th>
<th scope="col" class="manage-column vx_sort" data-name="crm_id"><?php esc_html_e("HubSpot ID", 'contact-form-hubspot-crm') ?>
<i class="fa fa-caret-<?php echo esc_attr($crm_order) ?> vx_sort_icon <?php echo esc_attr($crm_class) ?>"></i>
</th>
<th scope="col" class="manage-column vx_sort" data-name="entry_id"><?php esc_html_e("Entry ID", 'contact-form-hubspot-crm') ?>
<i class="fa fa-caret-<?php echo esc_attr($entry_order) ?> vx_sort_icon <?php echo esc_attr($entry_class) ?>"></i>
</th>
<th scope="col"><?php esc_html_e('Feed ID', 'contact-form-hubspot-crm') ?> </th>
<th scope="col" class="manage-column" data-name="object"><?php esc_html_e("Description", 'contact-form-hubspot-crm') ?>
</th>
<th scope="col" class="manage-column vx_sort" data-name="time"><?php esc_html_e("Time", 'contact-form-hubspot-crm') ?>
<i class="fa fa-caret-<?php echo esc_attr($time_order) ?> vx_sort_icon <?php echo esc_attr($time_class) ?>"></i>
</th>
<th><?php esc_html_e('Detail','contact-form-hubspot-crm') ?></th>
</tr>
</tfoot>
<tbody class="list:user user-list">
<?php
if(is_array($data['feeds']) && !empty($data['feeds'])){
$entries_plugin=class_exists('vxcf_form') ? true : false ;
$analytics_addon=class_exists('vx_track_pages') ? true : false ;
$sno=0;
foreach($data['feeds'] as $feed){
$sno++;
$row=$this->verify_log($feed);
$e_id=(int)$row['entry_id'];
$p_id=(int)$row['parent_id'];
?>
<tr class='author-self status-inherit <?php if(in_array($row['id'],$log_ids)){echo 'vx_yellow ';} echo $sno%2 == 0 ? 'alternate' :'' ?>' id="tr_<?php echo esc_attr($row['id']) ?>" data-id="<?php echo esc_attr($row['id']); ?>" >
<td class="vx_check_col"><input type="checkbox" name="log_id[]" value="<?php echo esc_attr($row['id']); ?>" class="crm_input_check"></td>
<td class="vx_icon_col"><img src="<?php echo esc_url($base_url) ?>images/<?php echo esc_attr($row["status_img"]); ?>.png" alt="<?php echo $row["status"] ? esc_html__("Active", 'contact-form-hubspot-crm') : esc_html__("Inactive", 'contact-form-hubspot-crm');?>" title="<?php echo esc_html($row['title']);?>" class="crm_status_img" /></td>
<td class="column-name" style="width:40%"><?php echo wp_kses_post($row['a_link']) ?></td>
<td class="column-title">
<?php
$entry_link='';
if(!empty($e_id)){
if($p_id < 0){
if($analytics_addon){
$entry_link=add_query_arg(array('page'=>'vx_analytics','entrty_id'=>$e_id), admin_url('admin.php'));
}
$e_id='#'.$e_id;
}else if($entries_plugin){
if(in_array($row['form_id'],array('vx_calls','vx_sms'))){
$link_tab=substr($row['form_id'],3);
$link_tab=$link_tab == 'calls' ? 'Call' : 'SMS';
$e_id=ucfirst($link_tab).' #'.$e_id;
}else{
$link_tab='entries';
if($row['form_id'] == 'vx_contacts'){
$link_tab='contacts';
}
$entry_link=add_query_arg(array('page'=>'vxcf_leads','tab'=> $link_tab,'id'=>$e_id), admin_url('admin.php'));
}
}}
if(! empty($entry_link) ){
?>
<a href="<?php echo esc_url($entry_link) ?>" title="<?php echo esc_attr($row["entry_id"]); ?>" target="_blank" ><?php echo esc_html($e_id); ?></a>
<?php
}else{
echo esc_html($e_id);
}
?>
</td>
<td scope="col" class="manage-column"><?php
if(!empty($row['feed_id'])){
$feed_link=$this->get_feed_link($row['feed_id'],$row['form_id']);
?><a href="<?php echo esc_url($feed_link) ?>" title="<?php esc_html_e('Edit Feed','contact-form-hubspot-crm') ?>">#<?php echo $row['feed_id'] ?></a><?php } ?>
</td>
<td scope="col" class="manage-column"><?php echo esc_html($row['desc']); ?></td>
<td scope="col" class="manage-column"><?php echo date('M-d-Y H:i:s', strtotime($row['time'])+$offset);?></td>
<td><i class="vx_icons vx_detail fa fa-th-list" title="<?php esc_html_e('Expand Details','contact-form-hubspot-crm') ?>"></i></td>
</tr>
<tr style="display: none;"><td colspan="8" class="entry_detail"></td></tr>
<?php
}
}
else {
?>
<tr>
<td colspan="4" style="padding:20px;">
<?php esc_html_e("No Record(s) Found", 'contact-form-hubspot-crm'); ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
if($items>0){
?>
<div class="crm_actions tablenav">
<a id="vx_clear_logs" class="button" title="<?php esc_html_e('Clear HubSpot Log','contact-form-hubspot-crm') ?>" href="<?php echo esc_url(wp_nonce_url(admin_url('admin.php?page='.$this->post('page')."&view=log&vx_tab_action_".$this->id."=clear_logs"),'vx_nonce','vx_nonce')); ?>"><?php esc_html_e('Clear HubSpot Log','contact-form-hubspot-crm') ?></a>
<div class="tablenav-pages"> <span id="paging_header" class="displaying-num"><?php esc_html_e('Displaying','contact-form-hubspot-crm') ?> <span id="paging_range_min_header"><?php echo esc_html($data['min']); ?></span> - <span id="paging_range_max_header"><?php echo esc_html($data['max']) ?></span> of <span id="paging_total_header"><?php echo esc_html($data['items']) ?></span></span><?php echo wp_kses_post($data['links']) ?></div>
</div>
<?php
}
?>
</form>
</div>
</div>
<script type="text/javascript">
var vx_crm_ajax='<?php echo wp_create_nonce("vx_crm_ajax") ?>';
(function( $ ) {
$(document).ready( function($) {
$("#vx_sel_feed").change(function(){
var link='<?php echo $this->link_to_settings('logs'); ?>';
link+='&feed_id='+$(this).val();
window.location.href=link;
});
$(".vx_sort").click(function(){
var orby=$(this).attr('data-name');
if(!orby || orby =="")
return;
var form=$("#vx_form");
var order=form.find("input[name=order]");
var orderby=form.find("input[name=orderby]");
var or="asc";
if(orderby.val() == orby && order.val() == "asc"){
or="desc";
}
order.val(or);
orderby.val(orby);
form.submit();
});
$(".crm_head_check").click(function(e){
if($(this).is(":checked")){
$(".crm_input_check,.crm_head_check").attr('checked','checked');
}else{
$(".crm_input_check,.crm_head_check").removeAttr('checked');
}
});
$(".crm_input_check").click(function(e){
var head_checked=$(".crm_head_check").eq(0).is(':checked');
if(!head_checked && $(".crm_input_check:checked").length == $(".crm_input_check").length){
$(".crm_head_check").attr('checked','checked');
}else if(head_checked){
$(".crm_head_check").removeAttr('checked');
}
});
$("#vx_export").click(function(e){
e.preventDefault();
$("#vx_export_log").val('export_log');
$("#vx_nonce_field").attr('name','vx_nonce');
var form=$("#vx_form");
form.attr({method:'post'});
form.submit();
form.attr({method:'get'});
$("#vx_export_log").val('');
$("#vx_nonce_field").removeAttr('name');
// form[0].reset();
});
$("#vx_apply_bulk").click(function(e){
var sel=$("#vx_bulk_action");
if(sel.val() == ""){
alert('<?php esc_html_e('Please Select Action','contact-form-hubspot-crm') ?>');
return false;
}
if($(".crm_input_check:checked").length == 0){
alert('<?php esc_html_e('Please select at least one entry','contact-form-hubspot-crm') ?>');
return false;
}
var action=sel.val();
if( $.inArray(action,["send_to_crm_bulk_force","send_to_crm_bulk"]) !=-1 && $(".crm_input_check:checked").length>4){
if(!confirm('<?php esc_html_e('Exporting more than 4 entries may take too long.\\n Are you sure you want to continue?','contact-form-hubspot-crm') ?>')){
e.preventDefault();
}
}
})
$("#vx_clear_logs").click(function(e){
if(!confirm('<?php esc_html_e('HubSpot Logs will be deleted permanently. Do you want to continue?','contact-form-hubspot-crm') ?>')){
e.preventDefault();
}
})
$(".vx_sort").hover(function(){
$(this).find(".vx_hide_sort").show();
},function(){
$(this).find(".vx_hide_sort").hide();
})
$(".vxc_date").datepicker({ changeMonth: true,
changeYear: true,
showButtonPanel: true,
yearRange: "-100:+10",
dateFormat: 'dd-M-yy' });
$(document).on("change",".crm_time_select",function(){
var form=$(this).parents(".crm_form");
var input=form.find(".crm_custom_range");
if($(this).val() != "custom"){
form.find(".vxc_date").val("");
}
if($(this).val() == "custom"){
input.show();
}else{
input.hide();
}
});
$(".vx_log_link").click(function(e){
e.preventDefault();
if($(this).data('id')){
$('html, body').animate({
scrollTop: $("#tr_"+$(this).data('id')).offset().top-35
}, 500);
var tr=$("#tr_"+$(this).data('id'));
var next_tr=tr.next("tr");
if(!next_tr.find("td").is(":visible")){
tr.find(".vx_detail").click();
}
}
})
////////////
$(document).on("click",".vx_detail,.vx_close_detail",function(e){
e.preventDefault();
var next_tr=tr=$(this).parents("tr");
var is_main=false;
if(!$(this).hasClass("vx_close_detail")){
next_tr=tr.next(tr);
is_main=true;
}
var icon=$(this);
var td=next_tr.find("td");
if(td.is(":visible"))
{
next_tr.find('.vxa_entry').slideUp('fast',function(){
next_tr.hide();
})
if(is_main){
icon.attr('title','<?php esc_html_e('Expand Detail','contact-form-hubspot-crm'); ?>');
}
return;
}else{
next_tr.show('fast');
next_tr.find('.vxa_entry').slideDown('fast');
if(is_main){
icon.attr('title','<?php esc_html_e('Collapse Detail','contact-form-hubspot-crm'); ?>');
}
}
if(!td.find("div").length){
var id=$.trim(tr.attr("data-id"));
td.html("<div style='text-align:center'><i class='fa fa-spinner fa-spin' style='margin: 20px auto'></i></div>");
$.post(ajaxurl,{action:'log_detail_<?php echo esc_attr($this->id) ?>',id:id,vx_crm_ajax:vx_crm_ajax},function(res){
td.html(res);
});
}
});
//logs detail boxes
$(document).on("dblclick",".crm_panel_head",function(e){
e.preventDefault();
var elem=jQuery(this);
vx_toggle_log_panel(elem);
});
$(document).on("click",".crm_toggle_btn",function(e){
e.preventDefault();
var elem=jQuery(this);
vx_toggle_log_panel(elem);
});
});
}(jQuery));
function vx_toggle_log_panel(elem){
var panel=elem.parents(".crm_panel");
var div=panel.find(".crm_panel_content");
var btn=panel.find(".crm_toggle_btn");
div.slideToggle('fast',function(){
if(jQuery(this).is(":visible")){
btn.removeClass('fa-plus');
btn.addClass('fa-minus');
}else{
btn.addClass('fa-plus');
btn.removeClass('fa-minus');
}
});
}
</script>

View File

@@ -0,0 +1,130 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?><div class="crm_fields_table">
<div class="crm_field">
<div class="crm_field_cell1"><label for="vx_name"><?php esc_html_e("Account Name",'contact-form-hubspot-crm'); ?></label>
</div>
<div class="crm_field_cell2">
<input type="text" name="crm[name]" value="<?php echo !empty($name) ? esc_html($name) : 'Account #'.esc_html($id); ?>" id="vx_name" class="crm_text">
</div>
<div class="clear"></div>
</div>
<div class="vx_tabs" id="tab_vx_web" style="<?php if($this->post('api',$info) != "web"){echo 'display:none';} ?>">
<div class="crm_field">
<div class="crm_field_cell1"><label for="org_id"><?php esc_html_e('HubSpot API Key','contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2">
<div class="vx_tr" >
<div class="vx_td">
<input type="password" id="org_id" name="crm[api_key]" class="crm_text" placeholder="<?php esc_html_e('HubSpot API Key','contact-form-hubspot-crm'); ?>" value="<?php echo $this->post('api_key',$info); ?>">
</div><div class="vx_td2">
<a href="#" class="button vx_toggle_btn vx_toggle_key" title="<?php esc_html_e('Toggle Key','contact-form-hubspot-crm'); ?>"><?php esc_html_e('Show Key','contact-form-hubspot-crm') ?></a>
</div></div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="vx_tabs" id="tab_vx_api" style="<?php if($this->post('api',$info) == "web"){echo 'display:none';} ?>">
<div class="crm_field">
<div class="crm_field_cell1"><label><?php esc_html_e('HubSpot Access','contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2">
<?php if(isset($info['access_token']) && $info['access_token']!="") {
$code='HubSpot'; if(!empty($info['portal_id'])){ $code.=' portal #'.$info['portal_id']; }
?>
<div style="padding-bottom: 8px;" class="vx_green"><i class="fa fa-check"></i> <?php
echo sprintf(esc_html__("Authorized Connection to %s on %s",'contact-form-hubspot-crm'),'<code>'.esc_html($code).'</code>',date('F d, Y h:i:s A',$info['_time']));
?></div>
<?php
}else{ //"automation" permission is not available in free version , throws error for free accounts , "content" permission
?>
<a class="button button-default button-hero sf_login" data-id="<?php echo esc_html($client['client_id']) ?>" href="https://app.hubspot.com/oauth/authorize?scope=<?php echo urlencode('crm.objects.owners.read crm.objects.contacts.write crm.objects.companies.write crm.objects.companies.read crm.lists.read crm.schemas.contacts.read crm.objects.contacts.read crm.schemas.companies.read').'&optional_scope='.urlencode('forms tickets automation crm.schemas.deals.read crm.objects.deals.read crm.objects.deals.write crm.lists.read crm.lists.write content') ?>&state=<?php echo urlencode($link."&".$this->id."_tab_action=get_token&id=".$id."&vx_nonce=".$nonce);?>&client_id=<?php echo esc_html($client['client_id']) ?>&redirect_uri=<?php echo urlencode(esc_url($client['call_back'])) ?>" title="<?php esc_html_e("Login with HubSpot",'contact-form-hubspot-crm'); ?>" > <i class="fa fa-lock"></i> <?php esc_html_e("Login with HubSpot",'contact-form-hubspot-crm'); ?></a>
<?php
}
?></div>
<div class="clear"></div>
</div>
<?php if(isset($info['access_token']) && $info['access_token']!="") {
?>
<div class="crm_field">
<div class="crm_field_cell1"><label><?php esc_html_e("Revoke Access",'contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2"> <a class="button button-secondary" id="vx_revoke" href="<?php echo esc_url($link."&".$this->id."_tab_action=get_token&vx_nonce=".$nonce.'&id='.$id); ?>"><i class="fa fa-unlock"></i> <?php esc_html_e("Revoke Access",'contact-form-hubspot-crm'); ?></a>
</div>
<div class="clear"></div>
</div>
<?php
}
?>
<div class="crm_field">
<div class="crm_field_cell1"><label for="vx_custom_app_check"><?php esc_html_e("HubSpot App",'contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2"><div><input type="checkbox" name="crm[custom_app]" id="vx_custom_app_check" value="yes" <?php if($this->post('custom_app',$info) == "yes"){echo 'checked="checked"';} ?> style="margin-right: 5px;"><?php echo esc_html__('Use Own Private HubSpot Keys ','contact-form-hubspot-crm'); $this->tooltip('vx_custom_app'); ?></div>
</div>
<div class="clear"></div>
</div>
<div id="vx_custom_app_div" style="<?php if($this->post('custom_app',$info) != "yes"){echo 'display:none';} ?>">
<div class="crm_field">
<div class="crm_field_cell1"><label for="app_id"><?php esc_html_e('Client ID','contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2">
<div class="vx_tr">
<div class="vx_td">
<input type="password" id="app_id" name="crm[app_id]" class="crm_text" placeholder="<?php esc_html_e('Client ID','contact-form-hubspot-crm'); ?>" value="<?php echo $this->post('app_id',$info); ?>">
</div><div class="vx_td2">
<a href="#" class="button vx_toggle_btn vx_toggle_key" title="<?php esc_html_e('Toggle Consumer Key','contact-form-hubspot-crm'); ?>"><?php esc_html_e('Show Key','contact-form-hubspot-crm') ?></a>
</div></div>
</div>
<div class="clear"></div>
</div>
<div class="crm_field">
<div class="crm_field_cell1"><label for="app_secret"><?php esc_html_e('Client Secret','contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2">
<div class="vx_tr" >
<div class="vx_td">
<input type="password" id="app_secret" name="crm[app_secret]" class="crm_text" placeholder="<?php esc_html_e('Client Secret','contact-form-hubspot-crm'); ?>" value="<?php echo $this->post('app_secret',$info); ?>">
</div><div class="vx_td2">
<a href="#" class="button vx_toggle_btn vx_toggle_key" title="<?php esc_html_e('Toggle Consumer Secret','contact-form-hubspot-crm'); ?>"><?php esc_html_e('Show Key','contact-form-hubspot-crm') ?></a>
</div></div>
</div>
<div class="clear"></div>
</div>
<div class="crm_field">
<div class="crm_field_cell1"><label for="app_url"><?php esc_html_e("Redirect URL",'contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2"><input type="text" id="app_url" name="crm[app_url]" class="crm_text" placeholder="<?php esc_html_e("Redirect URL",'contact-form-hubspot-crm'); ?>" value="<?php echo $this->post('app_url',$info); ?>">
<div class="howto">
<div>1: <?php echo esc_url($link."&".$this->id."_tab_action=get_code");?></div>
<div>2: https://www.crmperks.com/sf_auth/</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="crm_field">
<div class="crm_field_cell1"><label><?php esc_html_e("Test Connection",'contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2"> <button type="submit" class="button button-secondary" name="vx_test_connection"><i class="fa fa-refresh"></i> <?php esc_html_e("Test Connection",'contact-form-hubspot-crm'); ?></button>
</div>
<div class="clear"></div>
</div>
<div class="crm_field">
<div class="crm_field_cell1"><label for="vx_error_email"><?php esc_html_e("Notify by Email on Errors",'contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2"><textarea name="crm[error_email]" id="vx_error_email" placeholder="<?php esc_html_e("Enter comma separated email addresses",'contact-form-hubspot-crm'); ?>" class="crm_text" style="height: 70px"><?php echo isset($info['error_email']) ? esc_html($info['error_email']) : ""; ?></textarea>
<span class="howto"><?php esc_html_e("Enter comma separated email addresses. An email will be sent to these email addresses if an order is not properly added to HubSpot. Leave blank to disable.",'contact-form-hubspot-crm'); ?></span>
</div>
<div class="clear"></div>
</div>
<div class="crm_field">
<div class="crm_field_cell1"><label for="vx_hub_analytics"><?php esc_html_e('HubSpot Analytics','contact-form-hubspot-crm'); ?></label></div>
<div class="crm_field_cell2">
<span class="howto"><?php echo sprintf(esc_html__('Add Hubspot Tracking Code in wordpress footer or install the %s HubSpot All-In-One Marketing %s','contact-form-hubspot-crm'),'<a href="https://wordpress.org/plugins/leadin/">','</a>'); ?></span>
</div>
<div class="clear"></div>
</div>
<button type="submit" value="save" class="button-primary" title="<?php esc_html_e('Save Changes','contact-form-hubspot-crm'); ?>" name="save"><?php esc_html_e('Save Changes','contact-form-hubspot-crm'); ?></button>
</div>

View File

@@ -0,0 +1,85 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
wp_enqueue_script('vx-sorter');
?><style type="text/css">
.vx_red{
color: #E31230;
}
.vx_green{
color:rgb(0, 132, 0);
}
.crm_fields_table input , .crm_fields_table select{
margin: 0px;
}
.vx_accounts_table .vx_pointer{
cursor: pointer;
}
.vx_accounts_table .fa-caret-up , .vx_accounts_table .fa-caret-down{
display: none;
}
.vx_accounts_table th.headerSortUp .fa-caret-down{
display: inline;
}
.vx_accounts_table th.headerSortDown .fa-caret-up{
display: inline;
}
</style>
<table class="widefat fixed sort striped vx_accounts_table" style="margin: 20px 0 50px 0">
<thead>
<tr> <th class="manage-column column-cb vx_pointer" style="width: 30px" ><?php esc_html_e("#",'contact-form-hubspot-crm'); ?> <i class="fa fa-caret-up"></i><i class="fa fa-caret-down"></i></th>
<th class="manage-column vx_pointer"> <?php esc_html_e("Account",'contact-form-hubspot-crm'); ?> <i class="fa fa-caret-up"></i><i class="fa fa-caret-down"></i></th>
<th class="manage-column"> <?php esc_html_e("Status",'contact-form-hubspot-crm'); ?> </th>
<th class="manage-column vx_pointer"> <?php esc_html_e("Created",'contact-form-hubspot-crm'); ?> <i class="fa fa-caret-up"></i><i class="fa fa-caret-down"></i></th>
<th class="manage-column vx_pointer"> <?php esc_html_e("Last Connection",'contact-form-hubspot-crm'); ?> <i class="fa fa-caret-up"></i><i class="fa fa-caret-down"></i></th>
<th class="manage-column"> <?php esc_html_e("Action",'contact-form-hubspot-crm'); ?> </th> </tr>
</thead>
<tbody>
<?php
$nonce=wp_create_nonce("vx_nonce");
if(is_array($accounts) && count($accounts) > 0){
$sno=0;
foreach($accounts as $id=>$v){
$sno++; $id=$v['id'];
$icon= $v['status'] == "1" ? 'fa-check vx_green' : 'fa-times vx_red';
$icon_title= $v['status'] == "1" ? esc_html__('Connected','contact-form-hubspot-crm') : esc_html__('Disconnected','contact-form-hubspot-crm');
?>
<tr> <td><?php echo esc_attr($id) ?></td> <td> <?php echo esc_html($v['name']) ?></td>
<td> <i class="fa <?php echo esc_attr($icon) ?>" title="<?php echo esc_attr($icon_title) ?>"></i> </td> <td> <?php echo date('M-d-Y H:i:s', strtotime($v['time'])+$offset); ?> </td>
<td> <?php echo date('M-d-Y H:i:s', strtotime($v['updated'])+$offset); ?> </td>
<td><span class="row-actions visible"> <a href="<?php echo esc_url($page_link."&id=".$id); ?>"><?php
if($v['status'] == "1"){
_e('View','contact-form-hubspot-crm');
}else{
_e('Edit','contact-form-hubspot-crm');
}
?></a> | <span class="delete"><a href="<?php echo esc_url($page_link.'&'.$this->id.'_tab_action=del_account&id='.$id.'&vx_nonce='.$nonce) ?>" class="vx_del_account" > <?php esc_html_e("Delete",'contact-form-hubspot-crm'); ?> </a></span></span> </td> </tr>
<?php
} }else{
?>
<tr><td colspan="6"><p><?php echo sprintf(esc_html__("No HubSpot Account Found. %sAdd New Account%s",'contact-form-hubspot-crm'),'<a href="'.esc_url($new_account).'">','</a>'); ?></p></td></tr>
<?php
}
?>
</tbody>
<tfoot>
<tr> <th class="manage-column column-cb" style="width: 30px" ><?php esc_html_e("#",'contact-form-hubspot-crm'); ?></th>
<th class="manage-column"> <?php esc_html_e("Account",'contact-form-hubspot-crm'); ?> </th>
<th class="manage-column"> <?php esc_html_e("Status",'contact-form-hubspot-crm'); ?> </th>
<th class="manage-column"> <?php esc_html_e("Created",'contact-form-hubspot-crm'); ?> </th>
<th class="manage-column"> <?php esc_html_e("Last Connection",'contact-form-hubspot-crm'); ?> </th>
<th class="manage-column"> <?php esc_html_e("Action",'contact-form-hubspot-crm'); ?> </th> </tr>
</tfoot>
</table>
<script>
jQuery(document).ready(function($){
$('.vx_accounts_table').tablesorter( {headers: { 2:{sorter: false}, 5:{sorter: false}}} );
$(".vx_del_account").click(function(e){
if(!confirm('<?php esc_html_e('Are you sure to delete Account ?','contact-form-hubspot-crm') ?>')){
e.preventDefault();
}
})
})
</script>

View File

@@ -0,0 +1,103 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?> <style type="text/css">
.crm_fields_table{
width: 100%; margin-top: 30px;
}.crm_fields_table .crm_field_cell1 label{
font-weight: bold; font-size: 14px;
}
.crm_fields_table .clear{
clear: both;
}
.crm_fields_table .crm_field{
margin: 20px 0px;
}
.crm_fields_table .crm_text{
width: 100%;
}
.crm_fields_table .crm_field_cell1{
width: 20%; min-width: 100px; float: left; display: inline-block;
line-height: 26px;
}
.crm_fields_table .crm_field_cell2{
width: 80%; float: left; display: inline-block;
}
.vxc_alert{
padding: 10px 20px;
}
.vx_icons{
color: #888;
}
.vx_green{
color:rgb(0, 132, 0);
}
#tiptip_content{
max-width: 200px;
}
.vx_tr{
display: table; width: 100%;
}
.vx_td{
display: table-cell; width: 90%;
}
.vx_td2{
display: table-cell;
}
.crm_field .vx_td2 .vx_toggle_btn{
margin: 0 0 0 10px; vertical-align: baseline; width: 80px;
}
</style>
<div class="vx_wrap">
<form id="mainform" method="post">
<?php wp_nonce_field("vx_nonce") ?>
<h2>
<?php esc_html_e("Settings", 'contact-form-hubspot-crm') ?>
</h2>
<table class="form-table">
<tr>
<th scope="row"><label for="vx_plugin_data"><?php esc_html_e("Plugin Data", 'contact-form-hubspot-crm'); ?></label>
</th>
<td>
<label for="vx_plugin_data"><input type="checkbox" name="meta[plugin_data]" value="yes" <?php if($this->post('plugin_data',$meta) == "yes"){echo 'checked="checked"';} ?> id="vx_plugin_data"><?php esc_html_e('On deleting this plugin remove all of its data','contact-form-hubspot-crm'); ?></label>
</td>
</tr>
<?php
if(class_exists('vxcf_form')){
?>
<tr>
<th><label for="update_entry"><?php esc_html_e("Update Entry",'contact-form-hubspot-crm'); ?></label></th>
<td><label for="update_entry"><input type="checkbox" id="update_entry" name="meta[update]" value="yes" <?php if($this->post('update',$meta) == "yes"){echo 'checked="checked"';} ?> ><?php esc_html_e("Update entry data in HubSpot when updated in Contact Form Entries Plugin",'contact-form-hubspot-crm'); ?></label></td>
</tr>
<tr>
<th><label for="delet_entry"><?php esc_html_e("Delete Entry",'contact-form-hubspot-crm'); ?></label></th>
<td><label for="delet_entry"><input type="checkbox" id="delet_entry" name="meta[delete]" value="yes" <?php if($this->post('delete',$meta) == "yes"){echo 'checked="checked"';} ?> ><?php esc_html_e("Delete entry data from HubSpot when deleted from Contact Form Entries Plugin",'contact-form-hubspot-crm'); ?></label></td>
</tr>
<tr>
<th><label for="restore_entry"><?php esc_html_e("Restore Entry",'contact-form-hubspot-crm'); ?></label></th>
<td><label for="restore_entry"><input type="checkbox" id="restore_entry" name="meta[restore]" value="yes" <?php if($this->post('restore',$meta) == "yes"){echo 'checked="checked"';} ?> ><?php esc_html_e("Restore entry in HubSpot when restored in Contact Form Entries Plugin",'contact-form-hubspot-crm'); ?></label></td>
</tr>
<tr>
<th><label for="notes_meta"><?php esc_html_e("Entry Notes",'contact-form-hubspot-crm'); ?></label></th>
<td><label for="notes_meta"><input type="checkbox" id="notes_meta" name="meta[notes]" value="yes" <?php if($this->post('notes',$meta) == "yes"){echo 'checked="checked"';} ?> ><?php esc_html_e("Add / delete notes to HubSpot when added / deleted in Contact Form Entries Plugin",'contact-form-hubspot-crm'); ?></label></td>
</tr>
<?php
}
?>
</table>
<p class="submit"><input type="submit" name="save" class="button-primary" title="<?php esc_html_e('Save Settings','contact-form-hubspot-crm'); ?>" value="<?php esc_html_e("Save Settings", 'contact-form-hubspot-crm') ?>" /></p>
</form>
<?php
//var_dump(self::$tooltips);
do_action('add_section_'.$this->id);
?>
</div>