';
// header
echo "
" . __( 'Apptivo Contact Forms', 'awp_contactform' ) . "
";
checkCaptchaOption();
echo '
';
//if updatemessage is not empty display the div
if(trim($updatemessage)!=""){
?>
_plugin_activated){
$disabledForm = 'disabled="disabled"';
$disabledOption = TRUE;
echo "Contact Forms is currently
disabled. Please enable this in
Apptivo General Settings.";
}
//get the count of total contact forms created
$contactformscount=0;
if(!empty($contact_forms)){
$contactformscount=count($contactformscount);
}else{
$contactformscount=0;
}
if($contactformscount < 10){
?>
getNewsletterCategory();
$themetemplates = get_awpTemplates(TEMPLATEPATH.'/contactforms','Plugin');
$plugintemplates=$this->get_plugin_templates();
arsort($plugintemplates);
?>
" . __( 'Contact Form Configuration', 'awp_contactform' ) . "";
?>
get_settings($selectedcontactform);
if(count($contactformdetails)>0){
$selectedcontactform=$contactformdetails[name];
$fields=$contactformdetails[fields];
$formproperties=$contactformdetails[properties];
}
?>
leadAssignee)){
foreach ($configDatas->leadAssignee as $assigne_key => $assigne_value){
if($assigne_value->assigneeObjectId == APPTIVO_EMPLOYEE_OBJECT_ID){
$assignee_employee_list[$assigne_value->assigneeName] = $assigne_value->assigneeObjectRefId;
}
else if($assigne_value->assigneeObjectId == APPTIVO_TEAM_OBJECT_ID){
$assignee_team_list[$assigne_value->assigneeName] = $assigne_value->assigneeObjectRefId;
}
}
$contact_assignee_default_name = $configDatas->leadAssignee[0]->assigneeName;
}
else{
$contact_assignee_default_name = '';
}
if(!isset($assignee_employee_list)){
$assignee_employee_list["No Employee"] = '';
}
if(!isset($assignee_team_list)){
$assignee_team_list["No Team"] = '';
}
}
if(isset($formproperties['contact_assignee_name'])){
$contact_assignee_name = $formproperties['contact_assignee_name'];
}
else{
$contact_assignee_name = $case_assignee_default_name;
}
?>
loadscripts();
//$this->loadstyles();
add_action('wp_footer', abwpExternalScripts);
}
return $posts;
}
/**
* Load the CSS files
*/
function loadstyles() {
}
/**
* Load the JS files
*/
function loadscripts() {
// add_action('wp_footer', abwpExternalScripts);
}
function getAllCountryList(){
$awp_services_obj=new AWPAPIServices();
$countrylist = $awp_services_obj->getAllCountries();
return $countrylist;
}
function getNewsletterCategory(){
$awp_services_obj=new AWPAPIServices();
$category = $awp_services_obj->getTargetListcategory();
return $category;
}
}
/*
* Save Contact Status, Contact Type and Contact Priority
*
*/
function contactOptions($save)
{
if(_isCurl())
{
$lead_status=array();
$lead_type=array();
$lead_source=array();
$lead_rank=array();
//$contactConfigData = getAllContactConfigData();
$contactConfigData = getContactConfigData();
if($contactConfigData == ''){
echo '';
}
if(isset($contactConfigData->leadStatuses)){
foreach ($contactConfigData->leadStatuses as $leadStatus){
if($leadStatus->disabled !='Y'){
array_push($lead_status, $leadStatus);
}
}
}
if(isset($contactConfigData->leadTypes)){
foreach ($contactConfigData->leadTypes as $leadType){
if($leadType->disabled !='Y'){
array_push($lead_type, $leadType);
}
}
}
if(isset($contactConfigData->leadSources)){
foreach ($contactConfigData->leadSources as $leadSource){
if($leadSource->disabled !='Y'){
array_push($lead_source, $leadSource);
}
}
}
if(isset($contactConfigData->leadRanks)){
foreach ($contactConfigData->leadRanks as $leadRank){
if($leadRank->disabled !='Y'){
array_push($lead_rank, $leadRank);
}
}
}
//$lead_assignee = $contactConfigData->assigneesList;
$assignees = getAllEmployeesAndTeams();
$empAssignees = $assignees->employeeData;
$teamAssignees = $assignees->teamData;
foreach($empAssignees as $emp){
$assigneeObj = new stdClass();
$assigneeObj->assigneeName = $emp->fullName;
$assigneeObj->assigneeObjectId = APPTIVO_EMPLOYEE_OBJECT_ID;
$assigneeObj->assigneeObjectRefId = $emp->employeeId;
$lead_assignee[] = $assigneeObj;
}
foreach($teamAssignees as $team){
$assigneeObj = new stdClass();
$assigneeObj->assigneeName = $team->name;
$assigneeObj->assigneeObjectId = APPTIVO_TEAM_OBJECT_ID;
$assigneeObj->assigneeObjectRefId = $team->teamId;
$lead_assignee[] = $assigneeObj;
}
$contact_config = array("leadStatus"=>$lead_status,"leadType"=>$lead_type,"leadSource"=>$lead_source,'leadAssignee'=>$lead_assignee,'leadRank'=>$lead_rank);
$contact_configDatas = json_encode($contact_config);
$_SESSION['contact_config'] = $contact_configDatas;
}
if($save=='save'){
check_option('awp_contact_configdata',$contact_configDatas);
}
return $contact_configDatas;
}
function getContactFirstConfigData($leadType,$leadSource,$leadStatus,$checkleadRank,$contactForm)
{
$firstConfig = get_option("awp_contact_configdata");
$firstConfig = json_decode($firstConfig);
$getConfig=get_option('awp_contactforms');
for($i=0;$i