Esempio n. 1
0
 /**
  * Get country prefix based on campaign id.
  *
  * @param int $campaign_id
  *
  * @return string
  */
 public function getCountry($campaign_id)
 {
     $country = '';
     if ($campaign_id > 0) {
         $speakcivi = new CRM_Speakcivi_Page_Speakcivi();
         $speakcivi->setDefaults();
         $speakcivi->customFields = $speakcivi->getCustomFields($campaign_id);
         $language = $speakcivi->getLanguage();
         if ($language != '') {
             $tab = explode('_', $language);
             if (strlen($tab[0]) == 2) {
                 $country = '/' . $tab[0];
             }
         }
     }
     return $country;
 }