[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 /********************************************************************************* 3 ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 * 10 ********************************************************************************/ 11 require_once ('include/database/PearDatabase.php'); 12 require_once ('config.php'); 13 require_once ('include/utils/utils.php'); 14 global $current_user; 15 global $adb; 16 $db = new PearDatabase(); 17 if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')) 18 { 19 header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0'); 20 } 21 else 22 { 23 header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); 24 } 25 26 header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); 27 header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 28 header('Content-Type: text/xml'); 29 30 echo ("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"); 31 echo (" <rss version=\"2.0\">\n"); 32 echo (" <channel>\n"); 33 echo (" <title>vtigerCRM Tickets</title>\n"); 34 echo (" <link>".$site_URL."/index.php?module=Home&action=home_rss</link>\n"); 35 echo (" <description>test</description>\n"); 36 echo (" <managingEditor></managingEditor>\n"); 37 echo (" <webMaster>".$current_user->user_name."</webMaster>\n"); 38 echo (" <lastBuildDate>" . gmdate('D, d M Y H:i:s', time()) . " GMT</lastBuildDate>\n"); 39 echo (" <generator>vtigerCRM</generator>\n"); 40 41 //retrieving notifications****************************** 42 //<<<<<<<<<<<<<<<< start of owner notify>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 43 $query = "select vtiger_crmentity.setype,vtiger_crmentity.crmid,vtiger_crmentity.smcreatorid,vtiger_crmentity.modifiedtime from vtiger_crmentity inner join vtiger_ownernotify on vtiger_crmentity.crmid=vtiger_ownernotify.crmid"; 44 45 $result = $adb->query($query); 46 for($i=0;$i<$adb->num_rows($result);$i++) 47 { 48 $mod_notify[$i] = $adb->fetch_array($result); 49 if($mod_notify[$i]['setype']=='Accounts') 50 { 51 $tempquery='select vtiger_accountname from vtiger_account where vtiger_accountid='.$mod_notify[$i]['crmid']; 52 $tempresult=$adb->query($tempquery); 53 $account_name=$adb->fetch_array($tempresult); 54 $notify_values[$i]=$account_name['accountname']; 55 }else if($mod_notify[$i]['setype']=='Potentials') 56 { 57 $tempquery='select vtiger_potentialname from vtiger_potential where vtiger_potentialid='.$mod_notify[$i]['crmid']; 58 $tempresult=$adb->query($tempquery); 59 $potential_name=$adb->fetch_array($tempresult); 60 $notify_values[$i]=$potential_name['potentialname']; 61 }else if($mod_notify[$i]['setype']=='Contacts') 62 { 63 $tempquery='select lastname from vtiger_contactdetails where contactid='.$mod_notify[$i]['crmid']; 64 $tempresult=$adb->query($tempquery); 65 $contact_name=$adb->fetch_array($tempresult); 66 $notify_values[$i]=$contact_name['lastname']; 67 68 }else if($mod_notify[$i]['setype']=='Leads') 69 { 70 $tempquery='select lastname from vtiger_leaddetails where leadid='.$mod_notify[$i]['crmid']; 71 $tempresult=$adb->query($tempquery); 72 $lead_name=$adb->fetch_array($tempresult); 73 $notify_values[$i]=$lead_name['lastname']; 74 }else if($mod_notify[$i]['setype']=='SalesOrder') 75 { 76 $tempquery='select subject from vtiger_salesorder where vtiger_salesorderid='.$mod_notify[$i]['crmid']; 77 $tempresult=$adb->query($tempquery); 78 $sales_subject=$adb->fetch_array($tempresult); 79 $notify_values[$i]=$sales_subject['subject']; 80 81 }else if($mod_notify[$i]['setype']=='Orders') 82 { 83 $tempquery='select subject from vtiger_purchaseorder where vtiger_purchaseorderid='.$mod_notify[$i]['crmid']; 84 $tempresult=$adb->query($tempquery); 85 $purchase_subject=$adb->fetch_array($tempresult); 86 $notify_values[$i]=$purchase_subject['subject']; 87 88 }else if($mod_notify[$i]['setype']=='Products') 89 { 90 $tempquery='select productname from vtiger_products where productid='.$mod_notify[$i]['crmid']; 91 $tempresult=$adb->query($tempquery); 92 $product_name=$adb->fetch_array($tempresult); 93 $notify_values[$i]=$product_name['productname']; 94 }else if($mod_notify[$i]['setype']=='Emails') 95 { 96 $tempquery='select subject from vtiger_activity where vtiger_activityid='.$mod_notify[$i]['crmid']; 97 $tempresult=$adb->query($tempquery); 98 $email_subject=$adb->fetch_array($tempresult); 99 $notify_values[$i]=$email_subject['subject']; 100 101 }else if($mod_notify[$i]['setype']=='HelpDesk') 102 { 103 $tempquery='select title from vtiger_troubletickets where ticketid='.$mod_notify[$i]['crmid']; 104 $tempresult=$adb->query($tempquery); 105 $HelpDesk_title=$adb->fetch_array($tempresult); 106 $notify_values[$i]=$HelpDesk_title['title']; 107 }else if($mod_notify[$i]['setype']=='Calendar') 108 { 109 $tempquery='select subject from vtiger_activity where vtiger_activityid='.$mod_notify[$i]['crmid']; 110 $tempresult=$adb->query($tempquery); 111 $Activity_subject=$adb->fetch_array($tempresult); 112 $notify_values[$i]=$Activity_subject['subject']; 113 }else if($mod_notify[$i]['setype']=='Quotes') 114 { 115 $tempquery='select subject from vtiger_quotes where quoteid='.$mod_notify[$i]['crmid']; 116 $tempresult=$adb->query($tempquery); 117 $quote_subject=$adb->fetch_array($tempresult); 118 $notify_values[$i]=$quote_subject['subject']; 119 }else if($mod_notify[$i]['setype']=='Invoice') 120 { 121 $tempquery='select subject from vtiger_invoice where vtiger_invoiceid='.$mod_notify[$i]['crmid']; 122 $tempresult=$adb->query($tempquery); 123 $invoice_subject=$adb->fetch_array($tempresult); 124 $notify_values[$i]=$invoice_subject['subject']; 125 } 126 127 128 129 130 //<<<<<<<<<<<<<<<< end of owner notify>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 131 // Variable reassignment and reformatting for author 132 $author_id = $db->query_result($result,$i,'smcreatorid'); 133 $entry_author = getUserName($author_id); 134 $entry_author = htmlspecialchars ($entry_author); 135 136 $entry_link = $site_URL."/index.php?modules=".$mod_notify[$i]['setype']."&action=DetailView&record=".$mod_notify[$i]['crmid']; 137 $entry_link = htmlspecialchars($entry_link); 138 $entry_time = $db->query_result($result,$i,'modifiedtime'); 139 140 echo (" <item>\n"); 141 echo (" <title>".$mod_notify[$i]['setype']."</title>\n"); 142 echo (" <link>".$entry_link."</link>\n"); 143 echo (" <description>".$notify_values[$i]."</description>\n"); 144 echo (" <author>".$entry_author."</author>\n"); 145 echo (" <pubDate>".$entry_time."</pubDate>\n"); 146 echo (" </item>\n"); 147 } 148 echo (" </channel>\n"); 149 echo (" </rss>\n"); 150 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |