]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/Smarty/plugins/function.sugar_phone.php
Release 6.5.0
[Github/sugarcrm.git] / include / Smarty / plugins / function.sugar_phone.php
1 <?php
2
3 /*
4
5 Modification information for LGPL compliance
6
7 r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
8
9 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
10
11 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
12
13 r51719 - 2009-10-22 10:18:00 -0700 (Thu, 22 Oct 2009) - mitani - Converted to Build 3  tags and updated the build system 
14
15 r51634 - 2009-10-19 13:32:22 -0700 (Mon, 19 Oct 2009) - mitani - Windex is the branch for Sugar Sales 1.0 development
16
17 r50752 - 2009-09-10 15:18:28 -0700 (Thu, 10 Sep 2009) - dwong - Merged branches/tokyo from revision 50372 to 50729 to branches/kobe2
18 Discard lzhang r50568 changes in Email.php and corresponding en_us.lang.php
19
20 r50375 - 2009-08-24 18:07:43 -0700 (Mon, 24 Aug 2009) - dwong - branch kobe2 from tokyo r50372
21
22 r42807 - 2008-12-29 11:16:59 -0800 (Mon, 29 Dec 2008) - dwong - Branch from trunk/sugarcrm r42806 to branches/tokyo/sugarcrm
23
24 r36563 - 2008-06-11 10:36:05 -0700 (Wed, 11 Jun 2008) - jmertic - Bug 22877: Make a new wireless detail view and have the smarty sugar_phone plugin check for being in a mobile session; if true then format the phone number as a link in the form of "tel:1234567890" per RFC 3966.
25 Added:
26 - include/SugarFields/Fields/Phone/WirelessDetailView.tpl
27 Touched:
28 - include/Smarty/plugins/function.sugar_phone.php
29 - include/SugarWireless/css/wireless.css
30
31 r29406 - 2007-11-08 16:36:28 -0800 (Thu, 08 Nov 2007) - bsoufflet - Bug 17690 : [RC] No license and/or entry point check in the files
32
33 r28844 - 2007-10-24 22:52:24 -0700 (Wed, 24 Oct 2007) - clee - Fix for 16807
34 It appears that the formats may be giving some trouble.  It is best to consolidate the formatting to a known skype format.  Adding function in include/utils.php to format the phone number to a known skype format that will work for sure.
35 Modified:
36 include/utils.php
37 include/Smarty/plugins/function.sugar_phone.php
38 Code review by Ajay
39
40 r28841 - 2007-10-24 20:11:24 -0700 (Wed, 24 Oct 2007) - ajay - 16807: added support for skypeout in detail view..
41
42
43 */
44
45
46 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
47 /*********************************************************************************
48  * SugarCRM Community Edition is a customer relationship management program developed by
49  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
50  * 
51  * This program is free software; you can redistribute it and/or modify it under
52  * the terms of the GNU Affero General Public License version 3 as published by the
53  * Free Software Foundation with the addition of the following permission added
54  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
55  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
56  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
57  * 
58  * This program is distributed in the hope that it will be useful, but WITHOUT
59  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
60  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
61  * details.
62  * 
63  * You should have received a copy of the GNU Affero General Public License along with
64  * this program; if not, see http://www.gnu.org/licenses or write to the Free
65  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
66  * 02110-1301 USA.
67  * 
68  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
69  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
70  * 
71  * The interactive user interfaces in modified source and object code versions
72  * of this program must display Appropriate Legal Notices, as required under
73  * Section 5 of the GNU Affero General Public License version 3.
74  * 
75  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
76  * these Appropriate Legal Notices must retain the display of the "Powered by
77  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
78  * technical reasons, the Appropriate Legal Notices must display the words
79  * "Powered by SugarCRM".
80  ********************************************************************************/
81
82 /**
83  * Smarty plugin
84  * @package Smarty
85  * @subpackage plugins
86  */
87
88
89 /**
90  * Smarty {sugar_translate} function plugin
91  *
92  * Type:     function<br>
93  * Name:     sugar_translate<br>
94  * Purpose:  translates a label into the users current language
95  * 
96  * @author Majed Itani {majed at sugarcrm.com
97  * @param array
98  * @param Smarty
99  */
100 function smarty_function_sugar_phone($params, &$smarty)
101 {
102         if (!isset($params['value'])){
103                 $smarty->trigger_error("sugar_phone: missing 'value' parameter");
104                 return '';
105         }
106         
107         global $system_config;
108     if(isset($system_config->settings['system_skypeout_on']) && $system_config->settings['system_skypeout_on'] == 1
109         && isset($params['value']) && skype_formatted($params['value'])  ) {
110                 $GLOBALS['log']->debug($params['value']);
111                         return '<a href="callto://'.format_skype($params['value']).'">'.$params['value'].'</a>';
112     } else {
113         return $params['value'];
114     }
115 }
116 ?>