* SPDX-License-Identifier: AGPL-3.0-only ************************************/ require_once('include/utils/utils.php'); global $current_user; global $adb,$table_prefix; if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')){ header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0'); }else{ header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); } header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Content-Type: text/xml'); echo ("\n"); echo (" \n"); echo (" \n"); echo (" vtenext Tickets\n"); echo (" ".$site_URL."/index.php?module=Home&action=home_rss\n"); echo (" test\n"); echo (" \n"); echo (" ".$current_user->user_name."\n"); echo (" " . gmdate('D, d M Y H:i:s', time()) . " GMT\n"); echo (" vtenext\n"); //retrieving notifications****************************** //<<<<<<<<<<<<<<<< start of owner notify>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $query = "select ".$table_prefix."_crmentity.setype,".$table_prefix."_crmentity.crmid,".$table_prefix."_crmentity.smcreatorid,".$table_prefix."_crmentity.modifiedtime from ".$table_prefix."_crmentity inner join ".$table_prefix."_ownernotify on ".$table_prefix."_crmentity.crmid=".$table_prefix."_ownernotify.crmid"; $result = $adb->pquery($query, array()); for($i=0;$i<$adb->num_rows($result);$i++){ $mod_notify[$i] = $adb->fetch_array($result); if($mod_notify[$i]['setype']=='Accounts'){ $tempquery='select '.$table_prefix.'_accountname from '.$table_prefix.'_account where '.$table_prefix.'_accountid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $account_name=$adb->fetch_array($tempresult); $notify_values[$i]=$account_name['accountname']; }else if($mod_notify[$i]['setype']=='Potentials'){ $tempquery='select '.$table_prefix.'_potentialname from '.$table_prefix.'_potential where '.$table_prefix.'_potentialid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $potential_name=$adb->fetch_array($tempresult); $notify_values[$i]=$potential_name['potentialname']; }else if($mod_notify[$i]['setype']=='Contacts'){ $tempquery='select lastname from '.$table_prefix.'_contactdetails where contactid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $contact_name=$adb->fetch_array($tempresult); $notify_values[$i]=$contact_name['lastname']; }else if($mod_notify[$i]['setype']=='Leads'){ $tempquery='select lastname from '.$table_prefix.'_leaddetails where leadid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $lead_name=$adb->fetch_array($tempresult); $notify_values[$i]=$lead_name['lastname']; }else if($mod_notify[$i]['setype']=='SalesOrder'){ $tempquery='select subject from '.$table_prefix.'_salesorder where '.$table_prefix.'_salesorderid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $sales_subject=$adb->fetch_array($tempresult); $notify_values[$i]=$sales_subject['subject']; }else if($mod_notify[$i]['setype']=='Orders'){ $tempquery='select subject from '.$table_prefix.'_purchaseorder where '.$table_prefix.'_purchaseorderid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $purchase_subject=$adb->fetch_array($tempresult); $notify_values[$i]=$purchase_subject['subject']; }else if($mod_notify[$i]['setype']=='Products'){ $tempquery='select productname from '.$table_prefix.'_products where productid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $product_name=$adb->fetch_array($tempresult); $notify_values[$i]=$product_name['productname']; }else if($mod_notify[$i]['setype']=='Emails'){ $tempquery='select subject from '.$table_prefix.'_activity where '.$table_prefix.'_activityid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $email_subject=$adb->fetch_array($tempresult); $notify_values[$i]=$email_subject['subject']; }else if($mod_notify[$i]['setype']=='HelpDesk'){ $tempquery='select title from '.$table_prefix.'_troubletickets where ticketid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $HelpDesk_title=$adb->fetch_array($tempresult); $notify_values[$i]=$HelpDesk_title['title']; }else if($mod_notify[$i]['setype']=='Calendar'){ $tempquery='select subject from '.$table_prefix.'_activity where '.$table_prefix.'_activityid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $Activity_subject=$adb->fetch_array($tempresult); $notify_values[$i]=$Activity_subject['subject']; }else if($mod_notify[$i]['setype']=='Quotes'){ $tempquery='select subject from '.$table_prefix.'_quotes where quoteid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $quote_subject=$adb->fetch_array($tempresult); $notify_values[$i]=$quote_subject['subject']; }else if($mod_notify[$i]['setype']=='Invoice'){ $tempquery='select subject from '.$table_prefix.'_invoice where '.$table_prefix.'_invoiceid=?'; $tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid'])); $invoice_subject=$adb->fetch_array($tempresult); $notify_values[$i]=$invoice_subject['subject']; } //<<<<<<<<<<<<<<<< end of owner notify>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // Variable reassignment and reformatting for author $author_id = $adb->query_result($result,$i,'smcreatorid'); $entry_author = getUserName($author_id); $entry_author = htmlspecialchars ($entry_author); $entry_link = $site_URL."/index.php?modules=".$mod_notify[$i]['setype']."&action=DetailView&record=".$mod_notify[$i]['crmid']; $entry_link = htmlspecialchars($entry_link); $entry_time = $adb->query_result($result,$i,'modifiedtime'); echo (" \n"); echo (" ".$mod_notify[$i]['setype']."\n"); echo (" ".$entry_link."\n"); echo (" ".$notify_values[$i]."\n"); echo (" ".$entry_author."\n"); echo (" ".$entry_time."\n"); echo (" \n"); } echo (" \n"); echo (" \n");