@@ -51,29 +51,29 @@ |
||
| 51 | 51 | |
| 52 | 52 | function smarty_function_sugar_getlink($params, &$smarty) { |
| 53 | 53 | |
| 54 | - // error checking for required parameters |
|
| 55 | - if(!isset($params['url'])) |
|
| 56 | - $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'url'); |
|
| 57 | - if(!isset($params['title'])) |
|
| 58 | - $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'title'); |
|
| 54 | + // error checking for required parameters |
|
| 55 | + if(!isset($params['url'])) |
|
| 56 | + $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'url'); |
|
| 57 | + if(!isset($params['title'])) |
|
| 58 | + $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'title'); |
|
| 59 | 59 | |
| 60 | - // set defaults |
|
| 61 | - if(!isset($params['attr'])) |
|
| 62 | - $params['attr'] = ''; |
|
| 63 | - if(!isset($params['img_name'])) |
|
| 64 | - $params['img_name'] = ''; |
|
| 65 | - if(!isset($params['img_attr'])) |
|
| 66 | - $params['img_attr'] = ''; |
|
| 67 | - if(!isset($params['img_width'])) |
|
| 68 | - $params['img_width'] = null; |
|
| 69 | - if(!isset($params['img_height'])) |
|
| 70 | - $params['height'] = null; |
|
| 71 | - if(!isset($params['img_placement'])) |
|
| 72 | - $params['img_placement'] = 'imageonly'; |
|
| 73 | - if(!isset($params['img_alt'])) |
|
| 74 | - $params['img_alt'] = ''; |
|
| 60 | + // set defaults |
|
| 61 | + if(!isset($params['attr'])) |
|
| 62 | + $params['attr'] = ''; |
|
| 63 | + if(!isset($params['img_name'])) |
|
| 64 | + $params['img_name'] = ''; |
|
| 65 | + if(!isset($params['img_attr'])) |
|
| 66 | + $params['img_attr'] = ''; |
|
| 67 | + if(!isset($params['img_width'])) |
|
| 68 | + $params['img_width'] = null; |
|
| 69 | + if(!isset($params['img_height'])) |
|
| 70 | + $params['height'] = null; |
|
| 71 | + if(!isset($params['img_placement'])) |
|
| 72 | + $params['img_placement'] = 'imageonly'; |
|
| 73 | + if(!isset($params['img_alt'])) |
|
| 74 | + $params['img_alt'] = ''; |
|
| 75 | 75 | |
| 76 | - return SugarThemeRegistry::current()->getLink($params['url'], $params['title'], $params['attr'], $params['img_name'], |
|
| 77 | - $params['img_attr'], $params['img_width'], $params['img_height'], $params['img_alt'], $params['img_placement']); |
|
| 76 | + return SugarThemeRegistry::current()->getLink($params['url'], $params['title'], $params['attr'], $params['img_name'], |
|
| 77 | + $params['img_attr'], $params['img_width'], $params['img_height'], $params['img_alt'], $params['img_placement']); |
|
| 78 | 78 | } |
| 79 | 79 | ?> |
@@ -102,11 +102,11 @@ |
||
| 102 | 102 | $field = $params['field']; |
| 103 | 103 | $type = $bean->field_name_map[$field]['type']; |
| 104 | 104 | if($type == 'text') { |
| 105 | - echo strlen($bean->$field) > 50 ? substr($bean->$field, 0, 47) . '...' : $bean->field; |
|
| 105 | + echo strlen($bean->$field) > 50 ? substr($bean->$field, 0, 47) . '...' : $bean->field; |
|
| 106 | 106 | } else if($type == 'link') { |
| 107 | - echo "<a href='{$bean->$field}' target='_blank'>{$bean->$field}</a>"; |
|
| 107 | + echo "<a href='{$bean->$field}' target='_blank'>{$bean->$field}</a>"; |
|
| 108 | 108 | } else { |
| 109 | - echo $bean->$field; |
|
| 109 | + echo $bean->$field; |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -43,9 +43,9 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | function smarty_function_sugar_getjspath($params, &$smarty) |
| 45 | 45 | { |
| 46 | - if(!isset($params['file'])) { |
|
| 47 | - $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file'); |
|
| 48 | - } |
|
| 49 | - return getJSPath($params['file']); |
|
| 46 | + if(!isset($params['file'])) { |
|
| 47 | + $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file'); |
|
| 48 | + } |
|
| 49 | + return getJSPath($params['file']); |
|
| 50 | 50 | } |
| 51 | 51 | ?> |
| 52 | 52 | \ No newline at end of file |
@@ -64,19 +64,19 @@ |
||
| 64 | 64 | function smarty_function_sugar_currency_format($params, &$smarty) { |
| 65 | 65 | |
| 66 | 66 | // Bug #47406 : Currency field doesn't accept 0.00 as default value |
| 67 | - if(!isset($params['var']) || $params['var'] === '') { |
|
| 67 | + if(!isset($params['var']) || $params['var'] === '') { |
|
| 68 | 68 | return ''; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | global $locale; |
| 72 | 72 | if(empty($params['currency_id'])){ |
| 73 | - $params['currency_id'] = $locale->getPrecedentPreference('currency'); |
|
| 74 | - if(!isset($params['convert'])) { |
|
| 75 | - $params['convert'] = true; |
|
| 76 | - } |
|
| 77 | - if(!isset($params['currency_symbol'])) { |
|
| 78 | - $params['currency_symbol'] = $locale->getPrecedentPreference('default_currency_symbol'); |
|
| 79 | - } |
|
| 73 | + $params['currency_id'] = $locale->getPrecedentPreference('currency'); |
|
| 74 | + if(!isset($params['convert'])) { |
|
| 75 | + $params['convert'] = true; |
|
| 76 | + } |
|
| 77 | + if(!isset($params['currency_symbol'])) { |
|
| 78 | + $params['currency_symbol'] = $locale->getPrecedentPreference('default_currency_symbol'); |
|
| 79 | + } |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $_contents = currency_format_number($params['var'], $params); |
@@ -65,29 +65,29 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | function smarty_function_multienum_to_array($params, &$smarty) |
| 67 | 67 | { |
| 68 | - $ret = ""; |
|
| 69 | - if(empty($params['string'])) { |
|
| 68 | + $ret = ""; |
|
| 69 | + if(empty($params['string'])) { |
|
| 70 | 70 | if (empty($params['default'])) |
| 71 | 71 | $ret = array(); |
| 72 | 72 | else if(is_array($params['default'])) |
| 73 | 73 | $ret = $params['default']; |
| 74 | 74 | else |
| 75 | - $ret = unencodeMultienum($params['default']); |
|
| 75 | + $ret = unencodeMultienum($params['default']); |
|
| 76 | 76 | } else { |
| 77 | - if (is_array($params['string'])) |
|
| 78 | - $ret = $params['string']; |
|
| 79 | - else |
|
| 80 | - $ret = unencodeMultienum($params['string']); |
|
| 77 | + if (is_array($params['string'])) |
|
| 78 | + $ret = $params['string']; |
|
| 79 | + else |
|
| 80 | + $ret = unencodeMultienum($params['string']); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| 84 | - if (!empty($params['assign'])) |
|
| 85 | - { |
|
| 86 | - $smarty->assign($params['assign'], $ret); |
|
| 87 | - return ""; |
|
| 88 | - } |
|
| 84 | + if (!empty($params['assign'])) |
|
| 85 | + { |
|
| 86 | + $smarty->assign($params['assign'], $ret); |
|
| 87 | + return ""; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - return ($ret); |
|
| 90 | + return ($ret); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | ?> |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | } elseif (preg_match('/^\d{14}$/', $string)) { |
| 24 | 24 | // it is mysql timestamp format of YYYYMMDDHHMMSS? |
| 25 | 25 | $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), |
| 26 | - substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); |
|
| 26 | + substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); |
|
| 27 | 27 | |
| 28 | 28 | } elseif (is_numeric($string)) { |
| 29 | 29 | // it is a numeric string, we handle it as timestamp |
@@ -44,9 +44,9 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | function smarty_modifier_in_array($needle = null, $haystack = null) |
| 46 | 46 | { |
| 47 | - //Smarty barfs if Array is empty |
|
| 47 | + //Smarty barfs if Array is empty |
|
| 48 | 48 | if($haystack == null || empty($haystack)) { |
| 49 | - return false; |
|
| 49 | + return false; |
|
| 50 | 50 | } |
| 51 | 51 | return in_array($needle, $haystack); |
| 52 | 52 | } |
@@ -39,24 +39,24 @@ |
||
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * smarty_function_sugar_email_btn |
|
| 44 | - * This is the constructor for the Smarty plugin. |
|
| 45 | - * This function exists so that the proper email button based on user prefs is loaded into the quotes module. |
|
| 46 | - * |
|
| 47 | - * @param $params The runtime Smarty key/value arguments |
|
| 48 | - * @param $smarty The reference to the Smarty object used in this invocation |
|
| 49 | - */ |
|
| 42 | + /** |
|
| 43 | + * smarty_function_sugar_email_btn |
|
| 44 | + * This is the constructor for the Smarty plugin. |
|
| 45 | + * This function exists so that the proper email button based on user prefs is loaded into the quotes module. |
|
| 46 | + * |
|
| 47 | + * @param $params The runtime Smarty key/value arguments |
|
| 48 | + * @param $smarty The reference to the Smarty object used in this invocation |
|
| 49 | + */ |
|
| 50 | 50 | function smarty_function_sugar_email_btn($params, &$smarty) |
| 51 | 51 | { |
| 52 | - global $app_strings, $current_user; |
|
| 53 | - $pdfButtons = ''; |
|
| 54 | - $client = $current_user->getPreference('email_link_type'); |
|
| 55 | - if ($client != 'sugar') { |
|
| 56 | - $pdfButtons = '<input title="'. $app_strings["LBL_EMAIL_COMPOSE"] . '" class="button" type="submit" name="button" value="'. $app_strings["LBL_EMAIL_COMPOSE"] . '" onclick="location.href=\'mailto:\';return false;"> '; |
|
| 57 | - } else { |
|
| 58 | - $pdfButtons = '<input id="email_as_pdf_button" title="'. $app_strings["LBL_EMAIL_PDF_BUTTON_TITLE"] . '" class="button" type="submit" name="button" value="'. $app_strings["LBL_EMAIL_PDF_BUTTON_LABEL"] . '" onclick="this.form.email_action.value=\'EmailLayout\';"> '; |
|
| 59 | - } |
|
| 60 | - return $pdfButtons; |
|
| 52 | + global $app_strings, $current_user; |
|
| 53 | + $pdfButtons = ''; |
|
| 54 | + $client = $current_user->getPreference('email_link_type'); |
|
| 55 | + if ($client != 'sugar') { |
|
| 56 | + $pdfButtons = '<input title="'. $app_strings["LBL_EMAIL_COMPOSE"] . '" class="button" type="submit" name="button" value="'. $app_strings["LBL_EMAIL_COMPOSE"] . '" onclick="location.href=\'mailto:\';return false;"> '; |
|
| 57 | + } else { |
|
| 58 | + $pdfButtons = '<input id="email_as_pdf_button" title="'. $app_strings["LBL_EMAIL_PDF_BUTTON_TITLE"] . '" class="button" type="submit" name="button" value="'. $app_strings["LBL_EMAIL_PDF_BUTTON_LABEL"] . '" onclick="this.form.email_action.value=\'EmailLayout\';"> '; |
|
| 59 | + } |
|
| 60 | + return $pdfButtons; |
|
| 61 | 61 | } |
| 62 | 62 | ?> |
@@ -42,9 +42,9 @@ |
||
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | function smarty_modifier_lookup($value='', $from=array()){ |
| 45 | - $value = trim($value); |
|
| 46 | - if (array_key_exists($value, $from)) { |
|
| 47 | - return $from[$value]; |
|
| 48 | - } |
|
| 49 | - return ''; |
|
| 45 | + $value = trim($value); |
|
| 46 | + if (array_key_exists($value, $from)) { |
|
| 47 | + return $from[$value]; |
|
| 48 | + } |
|
| 49 | + return ''; |
|
| 50 | 50 | } |